• Hi, When i add a product using –

    
        $woocommerce->cart->add_to_cart($x, $quanitity);
    

    It doesnt calculate/get the tiered price i set for a product. Plugin doesnt work when use such function to add products?

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WP Developer

    (@bycrik)

    Hi,

    You can use
    \TierPricingTable\PriceManager::getPriceByRules( $quantity, $product_id )
    to get the right price.

    • This reply was modified 5 years, 4 months ago by WP Developer.
    • This reply was modified 5 years, 4 months ago by WP Developer.
    Thread Starter zahedkamal87

    (@zahedkamal87)

    Hi, I’m not talking about getting the price. What i wanted to know is that, plugin doesnt apply tiered price if i add products by ‘add_to_cart()’ function?

    Plugin Author WP Developer

    (@bycrik)

    Hi,

    Should apply. The calculation is doing on “woocommerce_before_calculate_totals”,
    so in theory, manually adding a product to the cart should also work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Applying tiered price applying programatcially’ is closed to new replies.