Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2006
    Posts
    125
    Plugin Contributions
    0

    Default Category index listing - products with qty discounts

    I'm using v1.3.0 (with the Column Grid Layout add-on).

    Most of our products are going to have qty discounts. Currently, in the list of items in each category, it shows the base price for each item and an "add to cart" field (as long as the item doesn't have any attributes). When an item has qty discounts, this isn't very good - we want the customers to know immediately that they can get this item for lower prices if they order by bulk.

    So, I'm looking to do the following changes to the category view:

    1) Instead of showing the base price of an item that has qty discounts - show the words "As low as" and then the lowest price that is available for this item (we enter all our qty discounts as "Actual Price" discounts, and the lowest one is always the last, i.e. for the highest quantity)

    2) For every item that has qty discounts - show a "more info" link instead of an "add to cart" field, just like the one that appears for items that have attributes. In other words, show this link whenever an items has attributes AND/OR qty discounts.

    #1 would be more important. Any PHP wizards who can help?

    Thanks in advance!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,883
    Plugin Contributions
    6

    Default Re: Category index listing - products with qty discounts

    Doing a search on lowest discount price came up with this thread ...

    http://www.zen-cart.com/forum/showthread.php?t=45789
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Jun 2006
    Posts
    125
    Plugin Contributions
    0

    Default Re: Category index listing - products with qty discounts

    Thanks Linda!! Sorry for not thinking about doing a search myself.
    However, I have a further question.

    In the thread linked above, I saw a modification for includes/modules/product_listing.php, to do the "As low as:" thing. Worked great. However, it did this to all products, not just the ones with qty discounts.
    So, I tried to modify the code a little - so that if the product doesn't have discount, the "As low as:" text won't show.

    Thing is, it doesn't work - I ALWAYS get the "As low as" text no matter what....
    Could you please take a look at the code below and tell me what went wrong??
    (I know this is not very optimized... just want to know the principle)

    Thanks!

    PHP Code:
             case 'PRODUCT_LIST_PRICE':    //MODIFIED BY ME
          
    $lc_baseprice zen_get_products_display_price($listing->fields['products_id']);
          
    $lc_baseprice number_format($lc_baseprice2);
            
    $lc_discprice zen_get_products_discount_price_qty((int)$listing->fields['products_id'],20000);
            
    $lc_discprice number_format($lc_discprice2);
            if (
    $lc_baseprice != $lc_discprice) {
                
    $lc_price $lc_discprice;
                
    $lc_text='As low as: <b>$' $lc_price '</b><br/>';
            } else {
              
    $lc_price $lc_baseprice;
            
    $lc_text='<b>$' $lc_price '</b><br/>';
            } 

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,883
    Plugin Contributions
    6

    Default Re: Category index listing - products with qty discounts

    0 doesn't = $10.00 either ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  5. #5
    Join Date
    Jun 2006
    Posts
    125
    Plugin Contributions
    0

    Default Re: Category index listing - products with qty discounts

    Sorry, but I don't quite understand

    Are you saying I did something that causes $lc_baseprice to be always 0?

    I'd appreciate it if you could point out my error, since I know as much about php as I know about taiwanese oyster diving (i.e. not much)

    Thanks in advance.

  6. #6
    Join Date
    Jun 2006
    Posts
    125
    Plugin Contributions
    0

    Default Re: Category index listing - products with qty discounts

    Nevermind!! Figured out the problem. Data types mismatch.

    If anyone's interested, here's a corrected function. If there are qty discounts, it displays the base price + "as low as" + the lowest price... if there aren't any - just the base price:

    ("nicePrice" is a custom class I've added to the stylesheet - feel free to experiment)

    PHP Code:
    case 'PRODUCT_LIST_PRICE':    //MODIFIED BY ME
    $lc_baseprice zen_get_products_display_price($listing->fields['products_id']);
    $lc_discprice zen_get_products_discount_price_qty((int)$listing->fields['products_id'],20000);
    $lc_discprice "\$" number_format($lc_discprice2);
    if (
    $lc_baseprice != $lc_discprice) {
        
    $lc_price $lc_discprice;
        
    $lc_text $lc_baseprice ', as low as <span class="nicePrice">' $lc_price '</span><br/>';
    } else {
        
    $lc_price $lc_baseprice;
        
    $lc_text='<span class="nicePrice">' $lc_price '</span><br/>';


 

 

Similar Threads

  1. Replies: 5
    Last Post: 10 Aug 2006, 02:30 PM
  2. Eliminating Category from New Products ... How?
    By raskayu in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 20 May 2006, 07:46 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
  •