Quantity Discounts

Locked

Started by zenlova on 21 May 2006, 1:14 AM · Views: 36,198

Results 61 to 73 of 73
This thread is locked. New replies are disabled.
2 Jun 2010, 2:25 AM
#61
aoren avatar

aoren

New Zenner

Join Date:
Sep 2008
Posts:
37
Plugin Contributions:
0

Quantity Discounts

I'd like to have the regular price in the product listings with the As Low As price underneath it.

What do I need to change in this code in the includes\modules\product_listing.php file? (this is from post #27 by ZenLova)

case 'PRODUCT_LIST_PRICE':

// $lc_price = zen_get_products_discount_price_qty((int)$_GET['products_id'],20000);
$lc_price = zen_get_products_discount_price_qty((int)$listing->fields['products_id'],20000);
$lc_price = number_format($lc_price, 2);
$lc_text='<b><font color="red">As low as: $' . $lc_price . '</font></b><br>';

This is the original:

case 'PRODUCT_LIST_PRICE':
$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
$lc_align = 'right';
$lc_text = $lc_price;

9 Aug 2010, 6:27 AM
#62
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Re: Quantity Discounts

Genevieve:

I'm running Zen Cart v1.3.8a/v1.3.8 and I've instituted the following code (which I got from page 3 of this thread) in my product_listing.php file to display the lowest price available with quantity discounts:

case 'PRODUCT_LIST_PRICE':
// $lc_price = zen_get_products_discount_price_qty((int)$_GET['products_id'],20000);
$lc_price = zen_get_products_discount_price_qty((int)$listing->fields['products_id'],20000);
$lc_price = number_format($lc_price, 2);
$lc_text='As low as: $' . $lc_price . '<br>';

> 
> It works great on my category index pages main product listing area, but when I implement it in my new_products.php and featured_products.php module files, it displays the "As low as" price as $0.00 on every page that module is used on except the sub-category listing page. In other words it works here: <http://babybeecards.com/index.php?main_page=index&cPath=1_3>
> but not here: <http://babybeecards.com/index.php?main_page=index&cPath=1>
> 
> On my new_products.php mod file the code looks like this:
> ```
while (!$new_products->EOF) {
    $products_price = zen_get_products_discount_price_qty((int)$new_products->fields['products_id'],20000);
    $products_price = number_format($lc_price, 2);
    $lc_text='As low as: $' . $products_price . '<br>';
    if (!isset($productsInCategory[$new_products->fields['products_id']])) $productsInCategory[$new_products->fields['products_id']] = zen_get_generated_category_path_rev($new_products->fields['master_categories_id']);

    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $lc_text);

Can anyone help me out?

You need to edit your tpl_modules_products_new_listing.php file with this code:

if ((PRODUCT_NEW_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($products_new->fields['products_id']) == 'Y') and zen_check_show_prices() == true) {

  $products_price = zen_get_products_discount_price_qty((int)$products_new->fields['products_id'],20000);
$products_price = number_format($products_price, 2);
$lc_text='As low as $' . $products_price . '<br>';
    
    $display_products_price = $lc_text . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_LIST_PRICE, 3, 1)) . (zen_get_show_product_switch($products_new->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($products_new->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');
  } else {
    $display_products_price = '';
  }

Danielle

9 Aug 2010, 6:28 AM
#63
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Re: Quantity Discounts

Does anyone know how to make the "As low as" text conditional on the product info display page? I want that text to only show if there are quantity discounts. If there are no quantity discounts, I want the price displayed without the extra text. I got this working on the product listing page, but not the product info display page.

Thanks!

Danielle

16 Aug 2010, 6:10 PM
#64
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Re: Quantity Discounts

Danielle:

Does anyone know how to make the "As low as" text conditional on the product info display page? I want that text to only show if there are quantity discounts. If there are no quantity discounts, I want the price displayed without the extra text. I got this working on the product listing page, but not the product info display page.

Thanks!

Got it working. Use this code in tpl_products_info_display.php:

<!--bof Product Price block --> <h2 id="productPrices" class="productGeneral"> <?php // base price if ($show_onetime_charges_description == 'true') { $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />'; } else { $one_time = ''; } $cheapest = zen_get_products_discount_price_qty((int)$_GET['products_id'],20000); $cheapest = '$' . number_format($cheapest, 2); $price = zen_get_products_actual_price((int)$_GET['products_id']); $price = '$' . number_format($price, 2);

if ( $cheapest != $price && ( !stristr($price,"productSpecialPrice") ) && ( !stristr($price,"call_for_prices") ) ) {
echo 'As low as ' . $cheapest . '';
}
else {
echo $price;
}

?></h2>
<!--eof Product Price block -->

Danielle

17 Aug 2010, 10:43 AM
#65
marketimpact avatar

marketimpact

Zen Follower

Join Date:
Aug 2009
Location:
England
Posts:
93
Plugin Contributions:
0

Re: Quantity Discounts

hi all

i have just installed quanity discounts and I have noticed that i can specify what sub category or category for the module to work in. Someone please help? I have read through the thread and i am more confused then ever!

:cool:

Alex
http://the-ishop.com
Great Prices, Great Products

20 Aug 2010, 12:46 AM
#66
grantsja avatar

grantsja

New Zenner

Join Date:
Jul 2010
Posts:
9
Plugin Contributions:
0

Re: Quantity Discounts

marketimpact:

hi all

i have just installed quanity discounts and I have noticed that i can specify what sub category or category for the module to work in. Someone please help? I have read through the thread and i am more confused then ever!

:cool:

I am a newbie but it appears that you installed and are using the add-on rather than using the Product Price Manager (admin, catalog, product price manager). Do you need the add-on or will the built in functionality suffice?

20 Aug 2010, 12:53 AM
#67
grantsja avatar

grantsja

New Zenner

Join Date:
Jul 2010
Posts:
9
Plugin Contributions:
0

Re: Quantity Discounts

As a newbie, I have really found this thread helpful in displaying the "as low as" options. I also wanted to do this for the featured products. I am displaying featured products on my main page as well as a few on my right side-bar.

Using the code in this thread, I made the following changes to a section of /includes/modules/featured_products.php

FROM

while (!$featured_products->EOF) {
$products_price = zen_get_products_display_price($featured_products->fields['products_id']);
if (!isset($productsInCategory[$featured_products->fields['products_id']]))

TO

while (!$featured_products->EOF) {
$products_price = zen_get_products_discount_price_qty($featured_products->fields['products_id'],20000);
$products_price = number_format($products_price, 2);
if (!isset($productsInCategory[$featured_products->fields['products_id']]))

This now shows the lowest price in the featured box in the center of the main page. However, the featured sidebox still shows the highest figure. I cannot figure out what file should be edited. Can someone point me in the right direction?

Thanks a lot!
b

20 Aug 2010, 3:42 PM
#68
grantsja avatar

grantsja

New Zenner

Join Date:
Jul 2010
Posts:
9
Plugin Contributions:
0

Re: Quantity Discounts

Ok found it! In the event someone else has the same issue here goes....

Used the Developer's toolkit to find the file (see https://www.zen-cart.com/tutorials/index.php?article=39 & https://www.zen-cart.com/tutorials/index.php?article=38)

Edited

includes/templates/template_default/sideboxes/tpl_featured.php

and changed

$featured_box_price = zen_get_products_display_price($random_featured_product->fields['products_id']);

To

$featured_box_price = zen_get_products_discount_price_qty($random_featured_product->fields['products_id'], 20000);
$featured_box_price = number_format($featured_box_price, 2);

I love this forum!
b

28 Sep 2010, 2:12 PM
#69
tcjay avatar

tcjay

Zen Follower

Join Date:
Jul 2010
Location:
Boston
Posts:
139
Plugin Contributions:
0

Re: Quantity Discounts

Where do I go to administor the Quantity Discounts? I added the files in the download and do not see any added files to administration. I am confused. :unsure:

I saw a reference to the sales maker but when I go to admin/catalog/salesmaker/

Help! Tom

I am using v1.3.9d

28 Sep 2010, 3:06 PM
#70
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Quantity Discounts

Zen Cart has built in the Discount Quantities in the Catalog ... Products Price Manager ...

This can also be reached when browsing a Category of Products by hitting the green $ for the individual Products ...

The Discount Quantities are designed to be applied to individual Products ... similar to a Special ...

NOTE: SaleMaker is used to apply to a Category of Products or Categories based on the master_categories_id of the Product matching the categories_id of the Category on Sale ...

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!]
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!

1 Oct 2010, 10:54 AM
#71
tcjay avatar

tcjay

Zen Follower

Join Date:
Jul 2010
Location:
Boston
Posts:
139
Plugin Contributions:
0

Re: Quantity Discounts

I would like to to have a sale. Buy the first one at full price and the second wone is half price how would I go about doing this? :cool:

1 Oct 2010, 1:08 PM
#72
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Quantity Discounts

What happens if I buy a 3rd to 4th one of the 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!]
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!

2 Oct 2010, 7:34 PM
#73
tcjay avatar

tcjay

Zen Follower

Join Date:
Jul 2010
Location:
Boston
Posts:
139
Plugin Contributions:
0

Re: Quantity Discounts

I think I found the solution with better together contribution. :)