[WordPress] 外掛分享: Advanced Shipping Rules For WooCommerce

首頁外掛目錄 › Advanced Shipping Rules For WooCommerce
WordPress 外掛 Advanced Shipping Rules For WooCommerce 的封面圖片
10+
安裝啟用
尚無評分
10 天前
最後更新
問題解決
WordPress 5.6+ PHP 7.4+ v1.0.1 上架:2025-03-03

內容簡介

總結:Conditional Shipping for WooCommerce 讓您根據購物車條件定義自訂的運送規則。無論您需要根據購物車總額、商品重量或數量設定運送費率,此外掛程式都能輕鬆實現。

問題與答案:
1. Conditional Shipping for WooCommerce 可以根據什麼條件來定義自訂的運送規則?
- 可以根據購物車條件。
2. 這個外掛的主要功能有哪些?
- 以購物車總額設定運送費用、定義基於重量的運送規則、應用基於產品數量的條件。
3. 是否需要寫程式碼來使用這個外掛?
- 不需要!這個外掛是簡單且使用者友善的。
4. Conditional Shipping for WooCommerce 釋出時的授權是什麼?
- 這個外掛是根據 GPL-2.0+ 授權釋出的。

```html
<ul>
<li>Conditional Shipping for WooCommerce 讓您根據購物車條件定義自訂的運送規則。無論您需要根據購物車總額、商品重量或數量設定運送費率,此外掛程式都能輕鬆實現。</li>
<li>重點特點:</li>
<ul>
<li>✅ 以購物車總額設定運送費用</li>
<li>✅ 定義基於重量的運送規則</li>
<li>✅ 應用基於產品數量的條件</li>
<li>✅ 不需要程式編碼!簡單易用</li>
</ul>
<li>授權:此外掛程式是根據 GPL-2.0+ 授權釋出的。</li>
</ul>
```

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Advanced Shipping Rules For WooCommerce」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Stop losing money on shipping costs — take full control of your WooCommerce shipping fees.
Advanced Shipping Rules For WooCommerce lets you create smart, conditional shipping rules that automatically apply extra fees based on what’s actually in the cart: total weight, number of items, or subtotal. Define as many conditions as you need, combine them with AND/OR logic, and let the plugin handle the rest at checkout — no developer required.
Whether you run a small shop or a high-volume store, getting shipping costs right is critical for both profitability and customer satisfaction. This plugin gives you the precision tooling you need.
Who is this for?

Store owners shipping heavy or bulky goods who need to recover real carrier surcharges for overweight shipments.
Shops with variable order sizes that want to add a handling fee when orders fall below a minimum quantity or total.
Multi-zone stores that need location-specific fee logic on top of WooCommerce’s native shipping zones.

How it works
The plugin adds a new shipping method — Advanced Shipping Rules — directly inside WooCommerce’s native shipping zones. You configure groups of conditions for each zone. When a customer’s cart matches a group, the defined extra fee is applied. Multiple groups use OR logic; conditions inside a group use AND logic. The highest matching fee wins, so you stay in control even when several rules could apply.
Key benefits

Accurate cost recovery: charge the real extra cost for heavy, bulky, or high-value orders instead of absorbing losses.
Fewer abandoned carts: transparent, rules-based fees at checkout are more trustworthy than flat-rate surprises.
Zero code: every rule is configured from the WooCommerce admin — no PHP, no hooks, no child theme edits.
Non-destructive: works alongside flat rate, free shipping, and any other method in the same zone.
Multiple instances: add the method more than once in a zone for layered fee structures.
Performance-friendly: no front-end scripts or styles are loaded; all logic runs only during cart/checkout calculation.

Available condition types
Condition
Operators
Cart total (subtotal)
equal to, less than, greater than
Total cart weight
equal to, less than, greater than
Number of products
equal to, less than, greater than
Extensible by developers
Three WordPress filters let you add custom condition types, evaluation handlers, and adjust the final shipping cost without modifying plugin files:

asrfwoo_condition_types — register new condition type definitions (description, operators, input type, step)
asrfwoo_condition_handlers — register the evaluation logic for each condition type
asrfwoo_shipping_cost — filter the final computed cost before it is passed to WooCommerce

Example: add a custom condition type based on the number of unique product categories in the cart.
add_filter( 'asrfwoo_condition_types', function( $types ) {
$types['category_count'] = array(
'description' => 'Number of Categories',
'operators' => array(
'greater_than' => 'Greater than',
'less_than' => 'Less than',
'equal' => 'Equal to',
),
'placeholder' => 'Enter category count',
'input_type' => 'number',
'step' => '1',
);
return $types;
} );

add_filter( 'asrfwoo_condition_handlers', function( $handlers ) {
$handlers['category_count'] = function( $operator, $value, $cost, &$group_cost, &$is_condition_met, $cart_weight, $cart_items, $cart_total ) {
$categories = array();
foreach ( WC()->cart->get_cart() as $item ) {
$terms = get_the_terms( $item['product_id'], 'product_cat' );
if ( $terms ) {
foreach ( $terms as $term ) {
$categories[ $term->term_id ] = true;
}
}
}
$count = count( $categories );
if ( ( $operator === 'greater_than' && $count > (int) $value ) ||
( $operator === 'less_than' && $count < (int) $value ) || ( $operator === 'equal' && $count === (int) $value ) ) { $group_cost += $cost; $is_condition_met = true; } }; return $handlers; } ); HPOS compatible: fully tested with WooCommerce High-Performance Order Storage. How to Use Open the method settings after adding it to a shipping zone. Click Add Group to create a rule group. Inside the group, click Add Condition and choose a condition type (weight, item count, or cart total), an operator, a threshold value, and an extra fee amount. Add more conditions to the same group (all must match — AND logic) or add a second group (either group can match — OR logic). Click Save changes. The fees will be applied automatically at checkout when the cart meets the defined conditions. Example setups Charge €5 extra when total cart weight exceeds 20 kg. Charge €3 extra when the order contains fewer than 3 items. Charge €10 extra when cart total is below €50 AND weight exceeds 10 kg. License This plugin is released under the GPL-2.0+ license.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon