Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    6,979
    Plugin Contributions
    63

    bug Re: SaleMaker only discounts base price, not attributes?

    This issue is still present in Zen Cart 1.5.5b. Here's a scenario:

    A product, priced by attributes with a base price set to 0.00, includes two radio-button type attributes (Color: Red, Color: Black). Each of those attributes' prices are set as 50.00 (no price prefix) and the Discounted and Base Price flags are set.

    Ensure that there are no "specials" associated with the product.

    Set a SaleMaker sale for 50%, selecting Ignore Specials Price - Apply to Product Price and Replace Special from the drop-down selection that will apply to the product.

    View the product on the storefront: Its price shows the salemaker price ($50.00 (struck-out), $25.00) ... but each of the attributes' prices still show the non-salemaker price of $50.00; the price when the product is placed in the cart is correct at $25.00.

    The source of the issue is in the zen_get_discount_calc function, present in /includes/functions/functions_prices.php (both admin and storefront versions). Under the above scenario, the "discount_type_id" being returned is 5, taking the code down this fragment:
    Code:
          case ($discount_type_id == 5):
            // No Sale and No Special
    //        $sale_maker_discount = 1;
            if (!$attributes_id) {
              $sale_maker_discount = $sale_maker_discount;
            } else {
              // compute attribute amount
              if ($attributes_amount != 0) {
                if ($special_price_discount != 0) {
                  $calc = ($attributes_amount * $special_price_discount);
                } else {
                  $calc = $attributes_amount;
                }
    
                $sale_maker_discount = $calc;
              } else {
                $sale_maker_discount = $sale_maker_discount;
              }
            }
    //echo 'How much 3 - ' . $qty . ' : ' . $product_id . ' : ' . $qty . ' x ' .  $attributes_amount . ' vs ' . $check_discount_qty_price . ' - ' . $sale_maker_discount . '<br />';
            break;
    ... and executing the highlighted portion of that code-block, essentially not applying the SaleMaker discount to the attribute's price. Part of the issue is that the $special_price_discount value (calculated earlier in that function) is set to (int)1.

    There's a lot going on in that function and I don't (yet) have a proposed solution, but I do believe that this should be moved to the "Bug Reports".

  2. #12
    Join Date
    Aug 2008
    Posts
    105
    Plugin Contributions
    0

    Default Re: SaleMaker only discounts base price, not attributes?

    I just ran into this problem using Salemaker.
    I have attributes that deduct an add on (deduct the pattern etc) that should always be deducted using the discount amount of the inventory item. Yes I have the "Apply Discounts Used by Product Special/Sale:" toggled to Yes just for this attribute.
    I recently used Salemaker to put a category of kits On Sale and it won't deduct the attribute properly.

    Is there a fix for this yet? I browsed thru the forum and didn't see it. Pardon me if there is and post a link please.
    If there isn't, I know I will have to do my flash sales on kits using a different method.

    Still love the Zencart and appreciate everyone's hard work!
    Thank you,
    Mona
    www.QuiltsInMontana.com

  3. #13
    Join Date
    Jul 2012
    Posts
    11,628
    Plugin Contributions
    13

    Default Re: SaleMaker only discounts base price, not attributes?

    I believe that the code modification shown in this post and presented as a pull request to the ZC development team fix this issue. In total there were basically three functions that seemed to be problematic, although one thing I'm trying to identify is if the solution provided which moves processing further into the zen_get_attributes_price_final functions_prices function to then call the zen_get_discount_calc function from within in there (and some modifications to that function as well) is the direction desired to go or instead to perform (reperform?) calculations in the attributes.php file to properly calculate/display the value(s) that would otherwise be expected.

    With the proposed solution I was able to obtain the desired/expected results in the testing that was performed, though still wondering if the testing was extensive enough. Tried a lot of variables and changes to them, between price-by-attributes with a base price on the product, no base price on the product and just attribute price(s), sales, and specials...

    While I indicates in that thread that the solution likely would support what was requested here, in closing browsers I realized I probably should cross post this for others to test it out and see. While the changes were made in ZC 1.5.5, it seems that the issue has existed for some time.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v154 "Qty Discounts Off Price" on Product page only displays one row of discounts
    By Zean in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 23 Feb 2016, 06:52 AM
  2. v153 Salemaker still not applying to Quantity Discounts
    By vickilapp in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 30 Nov 2014, 05:09 PM
  3. v151 Using Attribute pricing only and not including base price of an item
    By stxmona in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 20 Aug 2014, 07:36 PM
  4. Replies: 17
    Last Post: 21 Mar 2010, 05:57 PM
  5. attributes plus base price, Quantity discounts
    By JasonRocket in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 20 Nov 2008, 05:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR