• Resolved LimeTreeFruits

    (@limetreefruits)


    Hi there, I am setting up shipping costs based on items in the cart and per this doc here it says to use a formula for each shipping class:

    shipping cost * [qty]

    In my case that’d be:

    • 1-3 items = $7.50 so formula >> 7.50*[3]
    • 4-8 items = $12.50 so formula >> 7.50*[3]

    However when I type that in, it comes back with this message:

    any help really appreciated!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Sai (woo-hc)

    (@saivutukuru)

    Hi @limetreefruits,

    The error happens because WooCommerce’s shipping cost field doesn’t allow literal numbers inside brackets. The placeholder [qty] is the only bracketed value you can use.

    To calculate shipping based on quantity, the correct format is:

    7.50 * [qty] 

    You should not use:

    7.50 * [3] 

    That will always trigger: “illegal character ‘[‘ ”.

    If you need different rates for 1–3 items vs 4–8 items, you’ll need:

    • Two separate shipping classes, or
    • A shipping plugin that supports conditional rules.
    Thread Starter LimeTreeFruits

    (@limetreefruits)

    TY

    Thread Starter LimeTreeFruits

    (@limetreefruits)

    Thank you

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    You are welcome, I’m so glad we were able to get that sorted for you! If you’re happy with the support you received today, would you consider leaving us a quick review? It really helps us out: https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/#new-post

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Shipping variables’ is closed to new replies.