Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    Jun 2009
    Posts
    69
    Plugin Contributions
    0

    Default Re: negative price of attributes add onto base price, not subtract

    Thanks for the title help.

    Quote Originally Posted by stevesh View Post
    I'll admit I might not understand exactly what you need to do with attributes, so when you get things set up, you might post a URL to the site so we can see the situation.
    I'm sorry, this due to my poor explanation of what I'm trying to accomplish.

    1. The product I sell also includes supplier provided cashback offers.
    2. These change frequently and differ in amount by the customer's location.
    3. I provide them as an instant cash discount at point of sale and then the supplier reimburses me afterwards.
    4. I do this via a dropdown box where visitors choose their location and hence the cashback amount that they are entitled to.
    5. The product is intensly price sensitive so i need to show the best possible price that I do offer.

    Here's an example.
    Product price = $70

    Rebate Location A = - $30
    Rebate Location B = - $28
    Rebate Location C = - $25

    Final Checkout Price (A) = $40
    Final Checkout Price (B) = $42
    Final Checkout Price (C) = $45

    Zen Cart Base Price Currently Showing: $100
    Correct Zen Cart Base Price Needed (A): $40


    Please let me know if any more information would help solve this dillema,

    Thanks

  2. #12
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: negative price of attributes add onto base price, not subtract

    How about this:

    Price the product by attributes.

    Set the attributes to the discounted price:

    A) $40
    B) $42
    C) $45

    (with neither plus or minus in the attribute setup)

    Remove the price from the title.

    Remove the price from Admin - Configuration - Product Listing

    Add #productPrices {display:none;} to the stylesheet to turn off the Starting At: price on the product info page.

    Otherwise, you're looking at rewriting code or fiddling with some kind of Javascript, I think.

  3. #13
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: negative price of attributes add onto base price, not subtract

    Ok I see the problem, which is only on the title price and yes it is a bug because as you said it doesn't matter if its a minus or plus the cart will always ADD the amount to the "starting price".

    Option:
    -Base price on the product page $70 (priced by attributes)
    -When adding the attributes DON'T insert the minus on the box for it, instead add it to the quantity: [ ] [-30.00]

    It will show on frontend as positive but it will do the addition/substraction correctly.

    See it here:
    http://www.ideascg.com/sandbox/index...roducts_id=181

    You can name the attribute as "discount" to make sense to the shoppers.

    Hope that helps....
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

  4. #14
    Join Date
    Jun 2009
    Posts
    69
    Plugin Contributions
    0

    Default Re: negative price of attributes add onto base price, not subtract

    Quote Originally Posted by stevesh View Post
    How about this:

    Price the product by attributes.

    Set the attributes to the discounted price:

    A) $40
    B) $42
    C) $45
    thanks for the option, that's what we had earlier and customers kept calling up to see if that was the after cashback offer or not.

    one good option to be completely transparent with our pricing is was to use the dynamic pricing update mod. unfortunately that showed this pricing hack and would confuse buyers even more.

    i am still keen to look into fixing this for 1.39, i see no reason why this problem should continue.


    Quote Originally Posted by ideasgirl View Post
    Ok I see the problem, which is only on the title price and yes it is a bug because as you said it doesn't matter if its a minus or plus the cart will always ADD the amount to the "starting price".
    it's not limited to the title. it's incorrect on EVERY page of the website. on the specials, page, the featured prooducts page, on the homepage, etc. fixing this bug to take into consideration of the price_prefix field would also fix the bug across the site as well, hence my facination in trying to understand where all these calculations take place.



    Quote Originally Posted by ideasgirl View Post
    Option:
    -Base price on the product page $70 (priced by attributes)
    -When adding the attributes DON'T insert the minus on the box for it, instead add it to the quantity: [ ] [-30.00]

    It will show on frontend as positive but it will do the addition/substraction correctly.
    sounds like a promising workaround. i couldn't see any reference to it inthe link you provided.


    DrByte, a point in the right direction please?

  5. #15
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: negative price of attributes add onto base price, not subtract

    i couldn't see any reference to it inthe link you provided.
    What do you mean?
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

  6. #16
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: negative price of attributes add onto base price, not subtract

    Strictly speaking, Priced by Attribute really wasn't meant for a Product Price and Attribute Prices. It was initially designed that they would be mutually exclusive, not combined; which is likely the reason for the inconsistencies you're saying you're experiencing when combining them.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #17
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: negative price of attributes add onto base price, not subtract

    Here's something you can TRY. I've *NOT* tested this thoroughly, but at a cursory level it appears to allow you to set a product price AND flag the product as priced-by-attributes AND have it auto-calculate the lowest "starting at" price when negative prices are used for attributes.

    /includes/functions/functions_prices.php
    somewhere around maybe line 115 you'll have a "zen_get_products_base_price" function definition, which starts with these lines:
    Code:
      function zen_get_products_base_price($products_id) {
        global $db;
          $product_check = $db->Execute("select products_price, products_priced_by_attribute from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
    
    // is there a products_price to add to attributes
          $products_price = $product_check->fields['products_price'];
    
          // do not select display only attributes and attributes_price_base_included is true
          $product_att_query = $db->Execute("select options_id, price_prefix, options_values_price, attributes_display_only, attributes_price_base_included from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and attributes_display_only != '1' and attributes_price_base_included='1'". " order by options_id, price_prefix, options_values_price");
    
          $the_options_id= 'x';
          $the_base_price= 0;
    // add attributes price to price
          if ($product_check->fields['products_priced_by_attribute'] == '1' and $product_att_query->RecordCount() >= 1) {
            while (!$product_att_query->EOF) {
              if ( $the_options_id != $product_att_query->fields['options_id']) {
                $the_options_id = $product_att_query->fields['options_id'];
                $the_base_price += $product_att_query->fields['options_values_price'];
              }
              $product_att_query->MoveNext();
            }
    .......
    Try changing the 2 lines highlighted above with their respective replacements shown below:
    2 changes in this line:
    Code:
          $product_att_query = $db->Execute("select options_id, price_prefix, options_values_price, attributes_display_only, attributes_price_base_included, round(concat(price_prefix, options_values_price), 5) as value from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and attributes_display_only != '1' and attributes_price_base_included='1'". " order by options_id, value");
    and 1 change in this line:
    Code:
                $the_base_price += (($product_att_query->fields['price_prefix'] == '-') ? -1 : 1) * $product_att_query->fields['options_values_price'];
    Last edited by DrByte; 13 Apr 2010 at 12:47 PM. Reason: Updated for backwards compatibility with MySQL 4
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #18
    Join Date
    Jun 2009
    Posts
    69
    Plugin Contributions
    0

    Default Re: negative price of attributes add onto base price, not subtract

    Quote Originally Posted by ideasgirl View Post
    What do you mean?
    nevermind that comment i made, i didn't understand how that sandbox example really worked in the backend, i do appreciate your help though!

    Quote Originally Posted by DrByte
    Here's something you can TRY. I've *NOT* tested this thoroughly,
    Thanks DrByte! I will try this later on in the day and do as much testing on it as i can. I'm so excited,

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v154 SaleMaker only discounts base price, not attributes?
    By FueledByMatt in forum Setting Up Specials and SaleMaker
    Replies: 13
    Last Post: 17 Jan 2019, 11:00 PM
  2. Add attributes for product no base price
    By hara in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 6 Jan 2012, 05:36 PM
  3. Attributes to replace the price.. but not add on to default price..
    By jackson5759 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 18 Apr 2011, 06:43 AM
  4. Add base price to attribute price so that attribute shows total amount
    By dcitsolutions in forum Setting Up Categories, Products, Attributes
    Replies: 10
    Last Post: 18 Nov 2010, 08:56 AM

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