In Drupal 7 Commerce, I am running into an issue with this workflow:

  1. Add item to cart
  2. Apply qualifying coupon. Correct discount is taken off item
  3. Add new item to cart with qualifying discount.
  4. Old discount in order shown UNTIL you reload the page 2 times.

Basically I am adding a coupon to the cart at the /checkout/% page

It seems like the block or view is being cached.

What is the best means to uncache the block?

I have tried using:

cache_clear_all('shopping_cart_summary_new', 'cache_views_data', TRUE); 

as well as:

$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
  • What have you tried? Clearing cache from Drupal, drush cc all? Restarting memcached? Any other caches? Can you list all your relevant modules? What do you use for discounts?
    – kenorb
    Oct 21, 2015 at 15:44
  • How are you adding the coupon is it in the cart page, or on another block?
    – nvahalik
    Oct 21, 2015 at 17:42
  • @nvahalik I am adding a coupon to the cart on the /checkout/ORDERID page
    – Matt
    Oct 22, 2015 at 14:16
  • @kenorb I have tried using cache_clear_all('shopping_cart_summary_new', 'cache_views_data', TRUE); as well as $order_wrapper = entity_metadata_wrapper('commerce_order', $order); commerce_coupon_commerce_cart_order_refresh($order_wrapper);
    – Matt
    Oct 22, 2015 at 14:18
  • Try clearing your all your cache_% tables manually and see if that helps.
    – kenorb
    Oct 22, 2015 at 14:49


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.