Support » Plugin: WooCommerce » flat-rate shipping formula options

  • Resolved cacarr


    I need to apply an extra charge per item when there’s more than one item. Currently I have price + (1 * [qty]) — but this applies an extra dollar for each item, even if there’s only one. Is something like this supported?:

    price + (1 * [qty>1])

Viewing 5 replies - 1 through 5 (of 5 total)
  • ([qty] * 1) – 1

    This multiplies the qty * 1 then removes 1 so if only one is in the cart it isn’t charged for it.

    > is not a supported operator, see class-wc-eval-math.php. Only +-*/^ and no functions.

    Forgot to add this.

    Provides you more examples.

    Thread Starter cacarr


    Thanks, I’ll give that a go.

    Could use a hand with something similar:

    For one of my shipping classes, I charge $4 per item. I’m using the formula: ([qty] * 4). This works fine as long as I have the “Cost” field in the upper area of the dialog for my Flat rate Shipping Method set to nothing (no entry).

    What I actually want is to set my main flat rate Cost to 12, and then set the flat rate rule for the particular shipping class to: ([qty] * 4) – 12, which is pretty much what the OP was looking for. Doesn’t work. I get shown a flat rate of $12, unless my quantity is 4 or greater. Where am I going wrong?

    Related: The Flat Rate WC documentation seems to say that if I enter N/A under the shipping class costs, the Flat Rate option won’t show up for products in that shipping class. This only works if I don’t have an entry for Cost (in the upper part of the Shipping Method dialog.) As soon as I put 12 up there, even the shipping classes that I have set as N/A will offer the Flat Rate of $12.00 at checkout. Help?

    (Shipping debug is enabled.)


    • This reply was modified 3 years, 9 months ago by cherbal.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘flat-rate shipping formula options’ is closed to new replies.