Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 46
  1. #11
    Join Date
    Apr 2007
    Posts
    139
    Plugin Contributions
    0

    Default Re: Qty Discounts on Product Listing

    Sorry Ajeh. Pls ignore last reply. The editing timing is out. 7 minute up.

    Thanks for the reply. I got the problem solve. I use Product Price Manager. My table looks like this below:-


    50-99 $4.00[/SIZE]
    100-149 $3.80

    150-199 $3.60

    200-249 $3.40

    250-299 $3.20

    300+ $3.00


    But I want it to look like this below:-
    50-99 $4.50
    100-149 $4.80
    150-199 $3.80
    200-249 $3.60
    250-299 $3.40
    300+ $3.20

    How to correct them?

  2. #12
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Qty Discounts on Product Listing

    How about an URL to this product?
    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.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #13
    Join Date
    Apr 2007
    Posts
    139
    Plugin Contributions
    0

    Default Re: Qty Discounts on Product Listing

    Hi Linda/Ajeh,

    I got it fix. I just change the 2nd discount to 51.Since the MIN is 50, i might as well keep this price in the list. At least its not 50 = $4.50 and not 50-99 = $4.99

    Please view attachment.
    Last edited by CJJUNE; 8 May 2007 at 02:15 PM.

  4. #14
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Qty Discounts on Product Listing

    Thanks for the update ... I was not seeing just how you wanted the prices to work until now ...

    This will help others in setting up Quantity Price Discounts with minimums, units and maximums ...
    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.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #15
    Join Date
    Jun 2005
    Posts
    8
    Plugin Contributions
    0

    Default Re: Qty Discounts on Product Listing

    Quote Originally Posted by Ajeh View Post
    Or, another way to look at this is ...

    In the module for product_listing.php ...

    You will see a section of code commented out ...

    This is where you can add a new row of data to the listing ...

    This is a partial list of what you need to do this ...

    What this will do is produce the quantity discounts above the Product Listing as the tpl_ used is from the tpl_product_info_display.php and you need to translate that ...

    Just above the MoveNext ... change this code:
    PHP Code:
        }
        
    $listing->MoveNext(); 

    To read this code:
    PHP Code:
        $products_discount_type zen_products_lookup($listing->fields['products_id'], $what_field 'products_discount_type');
        if (
    $products_discount_type != 0) {
          
    $rows++;
          
    $products_id_current = (int)$listing->fields['products_id'];
          
    $quantityDiscounts = array();
          
    $products_discount_type_from zen_products_lookup($listing->fields['products_id'], $what_field 'products_discount_type_from');
          require(
    DIR_WS_MODULES zen_get_module_directory(FILENAME_PRODUCTS_QUANTITY_DISCOUNTS));
          require(
    $template->get_template_dir('/tpl_modules_products_quantity_discounts.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_products_quantity_discounts.php');
        }
        
    $listing->MoveNext(); 
    Again you have to redo the info in tpl_modules_products_quantity_discounts.php to work with the listing properly, but this should get you all the data ... now you come up with the nice display method and post it here ...

    How hard can that be?
    Hello,

    Thanks to Ajeh for the great piece of code to get the quantity discount boxes to show in the product listing index page. I really want to do this on my site and have added Ajeh's code, here's a link: http://www.dimensionize.com/catalogu...&cPath=8_10_19

    I've been desperately struggling to work out the second 'translating' stage of this so that each discount table appears at the side of each corresponding product, ideally instead of the normal price field. I've tried fiddling with the product_listing module file, the product_quantity_discount template file and the index_product_listing template file but nothing I'm doing seems to make any difference. Can anyone point me in the right direction?

    Many thanks

    Rainbow

    P.S. I'm using version 1.3.7, sorry for the slow site, I need to change to a zen recommended host.

  6. #16
    Join Date
    Jun 2005
    Posts
    8
    Plugin Contributions
    0

    Default Re: Qty Discounts on Product Listing

    Hi again, I think I've made some progress with this although still haven't managed to get the quantity discount boxes under each product :-(

    What I think I have managed to do is to find the right files to edit and have learnt where to add the code to place text/objects under the product photos on the product listing page - it's a start! If you have a moment to take a look at my site: http://www.dimensionize.com/catalogu...&cPath=8_10_19 you'll see that I've put in some comments in a table where I would like the quanity discount boxes to appear - as many things as I've tried though, I just don't seem to be able to work out what I should be 'calling' to get the real quantity discounts to appear there instead of my comments.

    What I've done to get to this stage is:

    First add Ajeh's code to the product_listing module file.

    Then from the same product_listing module file duplicated the line case 'PRODUCT_LIST_MODEL':
    $lc_align = '';
    $lc_text = '';
    break;
    changing the words 'PRODUCT_LIST_MODEL' to 'PRODUCT_LIST_QUANTITY_DISCOUNT'

    In modules/pages/index/main_template_vars I added the line around line no 141 in my version: 'PRODUCT_LIST_QUANTITY_DISCOUNT' => PRODUCT_LIST_QUANTITY_DISCOUNT,

    And finally, copied the line for product_list_model in the database in the configuration table changing it to product_list_quantity_discount and switching it on for the product listing page.

    Please if anyone knows what I need to 'call' in that product_listing file to get those boxes in the right place please let me know. Also, please feel free to tell me if the steps that I've done above are wrong.

    Thanks again

    Lindsey (Rainbow)

  7. #17
    Join Date
    Jun 2005
    Posts
    8
    Plugin Contributions
    0

    Default Re: Qty Discounts on Product Listing

    Hi there, I have a solution for this now so I'm posting it here, hopefully it will help someone else. I'm a real novice at programming so I've probably not used the best and neatest code for this but it works for me.

    I'm posting the full solution here so please excuse any repetition from my posts above:

    1) In includes/modules/pages/index/main_template_vars.php, near line 141- add the line: 'PRODUCT_LIST_QUANTITY_DISCOUNT' => PRODUCT_LIST_QUANTITY_DISCOUNT

    2) Copy the line for product_list_model in your database in the configuration table changing it to product_list_quantity_discount, then in your admin, you can turn this on and give it a sort order (under menu: configuration/product listing

    3) Open file includes/modules/your_template/product_listing.php (NB, I'm using the add on for column layout so my line numbers may be different from yours):

    a) Around line 42: you will have something like -

    case 'PRODUCT_LIST_MODEL':
    $lc_text = TABLE_HEADING_MODEL;
    $lc_align = '';
    $zc_col_count_description++;
    break;

    Just under the 'break;' add:

    case 'PRODUCT_LIST_QUANTITY_DISCOUNT':
    $lc_text = TABLE_HEADING_QUANTITY_DISCOUNT;
    $lc_align = '';
    $zc_col_count_description++;
    break;

    b) Around line 135, you will see, something like:

    case 'PRODUCT_LIST_MODEL':
    $lc_align = '';
    $lc_text = $listing->fields['products_model'];
    break;

    Just underneath the 'break;' add the following:

    case 'PRODUCT_LIST_QUANTITY_DISCOUNT':

    // The following lines are taken for Ajeh's code in this forum thread
    $products_discount_type = zen_products_lookup($listing->fields['products_id'], $what_field = 'products_discount_type');
    $columns ++;
    $products_id_current = (int)$listing->fields['products_id'];
    $quantityDiscounts = array();
    $products_discount_type_from = zen_products_lookup($listing->fields['products_id'], $what_field = 'products_discount_type_from');
    require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCTS_QUANTITY_DISCOUNTS));

    // The following lines are my long & heavy but seemingly functional code, I've adapted it from tpl_modules_products_quantity_discounts as I couldn't get the foreach statement to work here

    $discount_level_1 = $quantityDiscounts[0];
    $discount_level_2 = $quantityDiscounts[1];
    $discount_level_3 = $quantityDiscounts[2];// This goes up to 5 discount levels, add more if you have more than 5 levels
    $discount_level_4 = $quantityDiscounts[3];// or remove some if you have less than 5 levels
    $discount_level_5 = $quantityDiscounts[4];

    if ($products_discount_type != 0) {

    // I've adapted the following table style from my custom tpl_modules_product_quantity_discounts, I've made it more vertical to make it fit better, if you want the original horizontal layout you can find the code in tpl_modules_product_quantity_discounts

    //NB the TEXT_HEADER below is for ACTUAL PRICE DISCOUNTS it could be replaced with the alternatives: TEXT_HEADER_DISCOUNT_PRICES_AMOUNT_OFF or TEXT_HEADER_DISCOUNT_PRICES_PERCENTAGE.

    $lc_text = '<table style="margin-top: 0.3em; margin-left: 1em; margin-right: 1em; margin-bottom: -1.5em; border:1px solid #94d9f8" cellspacing="0" cellpadding="3">
    <tr style="background: #ECF8FD; font-weight: bold">
    <td colspan="2" align="center">'.TEXT_HEADER_DISCOUNT_PRICES_ACTUAL_PRICE.'</font></td> </tr>

    <tr><td align="left">' . $show_qty . '</td><td>' . $currencies->display_price($show_price, zen_get_tax_rate($products_tax_class_id)) . '</td></tr>

    <tr><td align="left">' . $discount_level_1['show_qty'] . '</td><td>' . $currencies->display_price($discount_level_1['discounted_price'], zen_get_tax_rate($products_tax_class_id)) . '</td></tr>

    <tr><td align="left">'. $discount_level_2['show_qty'] . '</td><td>' . $currencies->display_price($discount_level_2['discounted_price'], zen_get_tax_rate($products_tax_class_id)) .'</td></tr>

    <tr><td align="left">'. $discount_level_3['show_qty'] . '</td><td>' . $currencies->display_price($discount_level_3['discounted_price'], zen_get_tax_rate($products_tax_class_id)) .'</td></tr>

    <tr><td align="left">'. $discount_level_4['show_qty'] . '</td><td>' . $currencies->display_price($discount_level_4['discounted_price'], zen_get_tax_rate($products_tax_class_id)) .'</td></tr>

    <tr><td align="left">'. $discount_level_5['show_qty'] . '</td><td>' . $currencies->display_price($discount_level_5['discounted_price'], zen_get_tax_rate($products_tax_class_id)) .'</td></tr></table>' ;
    } else {
    $lc_text ='';
    }
    break;

    c) Please take a moment to quickly read my commented notes in the above code, as it tells you where to make adaptions as this code is based on the colours of my template and uses the table heading for Actual Price Discounts and works with 5 discount levels, you may need to change some of this to suit your needs. NB, this code works fine for the other quantity discounts e.g percentage off, you just need to change the name of the table heading (see my commented notes for this above).

    4) In includes\languages\english\your_template\index.php, around line 33, add something like:

    define('TABLE_HEADING_QUANTITY_DISCOUNT', 'Quantity Discounts');

    That's it, you should now have the quantity discount box on your product listing page. Best of luck.

    Lindsey (Rainbow) :-)

  8. #18
    Join Date
    Jun 2007
    Posts
    87
    Plugin Contributions
    0

    Default Re: Qty Discounts on Product Listing

    Should the code that Ajeh provided work on the index.php?main_page=products_all, I'd like to know before I start working on the tpl page... I'm very new to PHP and can't waist time right now.

    Also, does this add the Quantity discount table to the product listing... the same table that appears by the "Add to Cart" button?

    Thanks :-)
    Last edited by flipjargendy; 13 Sep 2007 at 06:48 PM.

  9. #19
    Join Date
    Jun 2007
    Posts
    87
    Plugin Contributions
    0

    Default Re: Qty Discounts on Product Listing

    Rainbow, I'm not sure what you've done in the database to get this working... I don't quite understand it the way you've explained it.

    2) Copy the line for product_list_model in your database in the configuration table changing it to product_list_quantity_discount, then in your admin, you can turn this on and give it a sort order (under menu: configuration/product listing
    How I understand this:
    Copy the product_list_model value from the database. Then change it to product_list_quantity_discount?? Not quite sure.

    I'm trying to figure this out for a client... I'm new to PHP and Zen Cart. I'd appreciate the help very much.

  10. #20
    Join Date
    Jun 2005
    Posts
    8
    Plugin Contributions
    0

    Default Re: Qty Discounts on Product Listing

    Hi flipjargendy

    Sounds like you nearly have it, if you log on to your sql database with PHP MyAdmin. In the configuration table, you will find an entry for product_list_module that looks a bit like this:

    212 Display Product Model PRODUCT_LIST_MODEL 0 Do you want to display the Product Model? 8 3 2007-09-06 18:01:46 2007-05-10 12:34:37 NULL NULL

    Click the pencil icon to edit this line and it will appear in more detail like the below:

    configuration_id: 212
    configuration_title: Display Product Model
    configuration_key: PRODUCT_LIST_MODEL
    configuration_value: 0
    configuration_description: Do you want to display the Product Model?
    configuration_group_id: 8
    sort_order: 3
    last_modified: 2007-09-06 18:01:46
    date_added: 2007-05-10 12:34:37
    use_function: NULL
    set_function: NULL

    Make the following changes and be sure to select 'INSERT AS A NEW ROW' rather than 'SAVE' when you have finished or you will overwrite the values for product_list_model, in the worse case if that happens, you can also put them back again.

    Change the configuration_id to a high value e.g. 2000 to be sure that it doesn't clash with another number already used.

    Change the configuration_title to: Display Quantity Discount

    Change the configuration_key to: PRODUCT_LIST_QUANTITY_DISCOUNT

    Now you click the aforementioned 'INSERT AS A NEW ROW' option and then click 'GO'.

    You can now go into your zencart admin website. Under the menu heading Configuration, and then under 'product listing', you will now see the option of Quantity Discounts - change the value from 0 to your required sort number for the quantity discounts.

    Please let me know if you get stuck, or if you get stuck on any of the next steps. I noticed in your earlier post you mentioned 'all products', these steps are for the product listing page and would be a bit different for the products all page.

    Lindsey (Rainbow)

 

 
Page 2 of 5 FirstFirst 1234 ... LastLast

Similar Threads

  1. Qty Discounts on Product Listing
    By idc1 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 8 Aug 2018, 11:21 PM
  2. 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
  3. Mod to display qty. discounts in category listing?
    By DCDC in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 25 May 2010, 06:53 PM
  4. Display "Qty Discounts Off Price" table Product Listing intead of Detail
    By digulu in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 30 Dec 2009, 01:34 AM
  5. Category index listing - products with qty discounts
    By bodyjewelrystores in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 13 Sep 2006, 06:31 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