Magento: Shopping cart price rule gets applied, but discount not subtracted from subtotal

22,330

Solution 1

I actually JUST figured out what was going wrong, or at least, I figured out a solution, though not sure exactly why this was affecting the shopping cart price rules. You're right that I wasn't even able to get a simple price rule to work - it simply wasn't working no matter how I changed the rule. Anyway, while working on another issue, I realized that I was missing the Subtotal/Grand Total box on the front-end of the shopping cart (I installed a clean copy of version 1.4.1.1 on my localhost, which is when I noticed it was missing from my live site). When I re-enabled the Subtotal/Grand Total box, the rules started working again. (I suppose now that Magento has a place on the front-end to show the discount, it actually applies it, whereas before it would just do nothing.)

So, to re-enable the subtotal/grand total box, in the back end, I went to System > Configuration > Advanced > Enable the Mage_Tax module. Again, not sure why it was disabled in the first place, and I'm not sure if this affects anything else on the site, but it's been up for awhile now and I haven't noticed anything awry. Here's a screen capture of it working: http://i.stack.imgur.com/kjl6S.png

Solution 2

Had this same exact problem on CE 1.9 running PHP7, applying the Inchoo "PHP 7 compatibility extension for Magento 1" solved the issue!

https://github.com/Inchoo/Inchoo_PHP7

Solution 3

I think the problem comes from using SKUs with your custom options combined with restricting your price rule to the product SKU. Magento combines them using a hyphen - place a test order to see if this is the problem.

The SKU in a test order I made comes out something like this; [ORIGINAL_PRODUCT_SKU]-[CUSTOM_OPTION_SKU]

At least, that's the result I'm getting from version 1.5.0.1

The quickest solution I could find was to match the rule on the product url key rather than SKU. It isn't the most intuitive solution, but since you wouldn't change the URL on the product (I hope), it will work where SKU's with custom options fail.

In version 1.4, the URL key should be available to choose instead of SKU already. So you can just select url key instead of sku and insert your product's correct url key in your shopping cart price rule. Just replace "SKU is ..." with "URL key is ..." inserting the correct url key for your product.

In version 1.5 I had to enable "Use for Promo Rule Conditions" on the url_key attribute like this;

  1. Log in to Magento admin area
  2. Navigate to Catalog > Attributes > Manage Attributes
  3. Locate the Atrtibute Code "url_key" and click to edit it
  4. Change "Use for Promo Rule Conditions" to Yes
  5. Save the changes
  6. you may need to reindex the Product Flat Data index at this point

Then I could use it in my price rule.

Share:
22,330
Admin
Author by

Admin

Updated on July 31, 2022

Comments

  • Admin
    Admin over 1 year

    I have created a shopping cart price rule in my Magento store (version 1.4.1.1), and it seems to get applied without issue on the frontend, but the discount isn't actually reflected in the subtotal or final total. The original item price is $45.00, and the discount should be $35.00, making the final price $10.00. Here are some screenshots of the setup. (Sorry, because I'm a new user it won't let me post images directly in this posting.)

    http://imgur.com/a/hdYDb

    1. Main rule page
    2. Actions page
    3. Cart showing that promotional code was applied
    4. Reviewing order (last step before submitting order)

    This particular item has some custom options set, which set the pricing for four individual options. The price for the product is $0.00, and then each option has it's own price (I didn't set this part up, so I'm not sure if I'm missing something from here too). Here's a screenshot of the product custom options page: http://imgur.com/uO9HG

    Any thoughts? I'm fairly new to Magento, so it's possible I'm just missing something obvious. Thanks in advance for any help or guidance!