How to apply dynamic extra fees using shortcode parameters in WooCommerce?

The WooCommerce Extra Fees plugin allows you to apply dynamic extra fees based on cart contents using shortcode parameters. This feature helps you create flexible fees based on quantity, cost, weight, and specific conditions.

1. What are dynamic charges in WooCommerce?

Dynamic charges let you calculate fees based on real-time cart values. Instead of a fixed fee, you can use shortcode parameters to adjust the fee dynamically.

Available Shortcode Parameters:

[qty] – Total number of items in the cart.
[cost] – Total cost of items in the cart.
[weight] – Total weight of the items in the cart.
[fee min_fee=20] – Set a minimum fee to apply (e.g., minimum $20 charge).
[fee max_fee=20] – Set a maximum fee to limit the charge (e.g., maximum $20 charge).

2. Why use dynamic extra fees in WooCommerce?

Dynamic Extra Fees allow you to charge fees based on cart products, weight, or total cost. You can set the minimum and maximum fee limits to control charges for your business needs. You can also apply fees for special services or handling costs based on product quantity, cost, or weight.

3. Steps to apply dynamic extra fees

Step 1: Access the Extra Fees Settings by going to Dotstore > WooCommerce Extra Fees > Add Fee in your WordPress dashboard. Click Add New Fee to create a dynamic fee.

Step 2: Configure Dynamic Fee Settings, including descriptive fee title and choose fixed fee for calculation-based fee type. Add the dynamic formula using shortcodes (e.g., 10 * [qty]).

Dynamic Fee using shortcode

Step 3: Set conditions by applying dynamic fees based on specific products or limiting the fee to certain categories. There is also an option to set specific fees for different customer types or set country or region-based fees.

Step 4: Save and activate the Dynamic Fee to ensure the status toggle is set to Enabled.

4. Examples of dynamic extra fee calculations

Example 1: Flat extra fee of $10

Amount: 10.00

Outcome: Always charge a flat $10 fee, regardless of cart contents.

Example 2: Charge $10 per quantity in the WooCommerce cart page

Amount: 10.00 * [qty]

Outcome: If a customer buys 3 items, the fee will be:

10.00 * 3 = $30.00

Example 3: Minimum extra fee of $50

Amount: [fee min_fee=50]

Outcome: If the calculated cart subtotal fee is less than $50, the plugin applies a minimum charge of $50.

For example, if the cart total amount is $14, then it will charge the fees to $50, and if the cart total is $145, then it will charge the $145

Example 4: Maximum extra fee of $50

Formula: [fee max_fee=50]

Outcome: If the calculated fee exceeds $50, the plugin caps the fee at $50

Example 5: Weight-based extra fee of $0.10 per kg

Amount: [weight] * 0.10

Outcome: If the total cart weight is 3 kg, the fee will be 20 * 0.10 = $2

Example 6: Cost-based extra fee (5% of Total Cart Value)

Amount: [cost] * 0.05

Outcome: If the total cart value is $198, the fee will be 198 * 0.05 = $9.80

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.