Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Qty Discount - Display lowest price & "Start At" text

Qty Discount - Display lowest price & "Start At" text

Locked

Started by kappaluppa on 6 Jan 2007, 11:00 PM · Views: 23,083

Results 21 to 35 of 35
This thread is locked. New replies are disabled.
20 May 2008, 5:16 PM
#21
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Qty Discount - Display lowest price & "Start At" text

Here is a thought...

How much money would we have to raise, donate for you to release this as a free mod? Is this even an option for you?

PM me if you feel this is not right for posting in the forum.

Live and learn... the Zen way.

21 May 2008, 4:11 AM
#22
ronwong avatar

ronwong

Zen Follower

Join Date:
Jan 2006
Posts:
223
Plugin Contributions:
0

Re: Qty Discount - Display lowest price & "Start At" text

This is what I did, instead of replace the price, I put the code within the discount table region, thus encompassing with the conditional code:

 
 
<!--bof Quantity Discounts table -->
<?php
  if ($products_discount_type != 0) { ?>
<p>Bulk purchase price from
<h2>
<?php
  //echo $one_time . ($flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
echo ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . $currencies->display_price(zen_get_products_discount_price_qty((int)$_GET['products_id'], 999999), zen_get_tax_rate($products_tax_class_id));
?></h2>
<?php
/**
* display the products quantity discount
*/
require($template->get_template_dir('/tpl_modules_products_quantity_discounts.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_products_quantity_discounts.php'); ?>
<?php
  }
?>
<!--eof Quantity Discounts table -->
21 May 2008, 8:53 AM
#23
darrels avatar

darrels

New Zenner

Join Date:
Jan 2008
Posts:
26
Plugin Contributions:
0

Re: Qty Discount - Display lowest price & "Start At" text

Thanks mydanilo,
I am going to try this but on what line in the tpl_product_info_display.php do i add the following code ?

$cheapest = zen_get_products_discount_price_qty((int)$_GET['products_id'],20000);
$cheapest = number_format($cheapest, 2);
echo 'As low as: $' . $cheapest . '<br>';

Thanks

21 May 2008, 1:19 PM
#24
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Qty Discount - Display lowest price & "Start At" text

Line 193 or just search for this code:

 echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);

and replace or put just below if you want both prices:

$cheapest = zen_get_products_discount_price_qty((int)$_GET['products_id'],20000);
$cheapest = number_format($cheapest, 2);
echo 'As low as: $' . $cheapest . '<br>';  

Live and learn... the Zen way.

23 May 2008, 1:53 PM
#25
ronwong avatar

ronwong

Zen Follower

Join Date:
Jan 2006
Posts:
223
Plugin Contributions:
0

Re: Qty Discount - Display lowest price & "Start At" text

Hi mydanilo,
For the product_listing, I took your code, so the results is it will show as low as if there is a discount table, and the normal or special price if no discount table. Functionally great.
But it lost some important stuff:

  • Normal price strike out and red special price
  • Sold out logo
  • call for price logo

now everything is black. It must be fixable?

29 Jun 2008, 9:09 AM
#26
mariellen avatar

mariellen

New Zenner

Join Date:
Jun 2008
Posts:
3
Plugin Contributions:
0

Re: Qty Discount - Display lowest price & "Start At" text

Hey

I wanted to display the whole product quantity discount box on my category listing pages but after reading the messages in this thread copied what was in here and made the following change to the products listing template.

Its a hack of what mydanilo posted, and it suits my purpose for the time being. I think the only change is I made the style be driven by the css, require definition of a new var TEXT_PRODUCT_LISTING_LOW_PRICE in the languages files for whatever text you want before the price range, and I display the range.

A lot of assumptions are made in the code and it probably doesn't deal with all scenarios but its a quick solution till I need something better, thought it might help other people who want something quick and yes its a total rip off of mydanilo's code but with tweaks :D

		// ORIGINAL PRICING INFORMATION
		// $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
		// $lc_align = 'right';
		// $lc_text =  $lc_price;

		// PRICING TAKING INTO CONSIDERATION DISCOUNTS
		$discount_price_real = zen_get_products_discount_price_qty((int)$listing->fields['products_id'],20000);
		$discount_price = '$'.number_format($discount_price_real, 2);
		$actual_price_real = zen_get_products_actual_price((int)$listing->fields['products_id']);
		$actual_price = '$'.number_format($actual_price_real, 2);

		if ($discount_price_real < $actual_price_real)
		{
			$lc_text='<span class="low_price">' . TEXT_PRODUCT_LISTING_LOW_PRICE . $discount_price . ' - ' . $actual_price . "</span>";
		} else {
			$lc_text = zen_get_products_display_price($listing->fields['products_id']);
		}

I guess you could always keep the original pricing stuff as well as the range, by appending the original lc_text value after the span for the range. If thats what displays all the call for price stuff... I dont know how messy that will make the information, might be too confusing. Unless your Low Price text clarifies what the range is.....

:)

16 Jul 2008, 6:53 PM
#27
rmullaney77 avatar

rmullaney77

New Zenner

Join Date:
Mar 2007
Location:
Lakeland, FL, US
Posts:
44
Plugin Contributions:
1

Re: Qty Discount - Display lowest price & "Start At" text

I have finished rewriting the mod after losing the original code. The new code will be easier to follow and implement. No core files are modified, but 1 language file, 8 templates, 2 sideboxes and 3 modules are included in the package in their respective YOUR_TEMPLATE folders. :smartalec:

I recently uploaded an 'EZ-Pages Meta Tags' mod to the downloads area that allows you to add meta tags (title, keywords, description) using the ez-pages editor, but the "powers that be" have not activated it. :censored: Once I see it listed as available to download, I MIGHT consider uploading this package.

If you don't want to wait to see if it will become a free download, PM me for a price and we'll get you taken care of. A non-disclosure agreement will be required at the time of purchase to protect our interests. The new mod can be viewed in action on one of our testing sites upon PM request. :hug:

PS: I do not normally charge for mods, but this one will get downloaded by others in our industry who also use ZC. This means I would have written free code to help those whom we compete against for customers :yuck:

17 Sep 2008, 3:34 AM
#28
josefine avatar

josefine

New Zenner

Join Date:
Aug 2008
Posts:
16
Plugin Contributions:
0

Re: Qty Discount - Display lowest price & "Start At" text

I sent you a private message, I hope you're still reading the forum .

10 Oct 2008, 10:51 PM
#29
jaydee98273 avatar

jaydee98273

New Zenner

Join Date:
May 2008
Posts:
28
Plugin Contributions:
0

Re: Qty Discount - Display lowest price & "Start At" text

The mod that ebspromo is trying to sell sounds like it might be nice, but I personally don't really see the need for it. If you're somewhat familiar with PHP, the code posted freely in this thread (thank you!) should do the trick.

As for there being hard coded styles and text...it is pretty easy to fix that too. Just replace the <span style="..."> tag with <span class="whatever">, and add a new definition to a language file and you're set. So long as you're utilizing the override system and have the files you're editing copied into a YOUR_TEMPLATE folder it should update just fine. It seems much simpler to update a couple files that are already there than to add a bunch of extra ones.

Thanks to mydanilo and others for sharing their knowledge.

24 Jan 2009, 6:07 PM
#30
charinlasvegas avatar

charinlasvegas

Zen Follower

Join Date:
Jan 2009
Location:
Vegas Baby!
Posts:
311
Plugin Contributions:
0

Re: Qty Discount - Display lowest price & "Start At" text

I'm trying to get this code to work, however, it shows the "as low as" price even if there is no discount on the product.

Any ideas on what the correct code would be to display the regular price if no discount and the cheapest price is there is a discount?

Following post #24, I put the code below to show both prices:

"tpl_product_info_display.php":

Line 193 or just search for this code:

echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);

and replace or put just below if you want both prices:

$cheapest = zen_get_products_discount_price_qty((int)$_GET['products_id'],20000);
$cheapest = number_format($cheapest, 2);
echo 'As low as: $' . $cheapest . '<br>';

So I've got this:

<?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 = ''; } echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']); $cheapest = zen_get_products_discount_price_qty((int)$_GET['products_id'],20000); $cheapest = number_format($cheapest, 2); echo 'As low as: $' . $cheapest . '<br>'; ?>

Completed: BellaFavori.com
In Progress: WeddingDivasLV.com
Coming Soon: ???

27 Jan 2009, 10:22 PM
#31
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Re: Qty Discount - Display lowest price & "Start At" text

I think this is where the ebspromo's mod would do better. The little code changes we suggested only goes so far. Sorry. Could not come up with a better one myself. :blush: It works for the shop I used it for.

Live and learn... the Zen way.

24 Apr 2009, 5:16 PM
#32
jymontoya avatar

jymontoya

New Zenner

Join Date:
Apr 2009
Posts:
54
Plugin Contributions:
0

Re: Qty Discount - Display lowest price & "Start At" text

mydanilo:

Here is what I did so far:

edit
includes\modules\YOUR_TEMPLATE\product_listing.php
find:

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

> 
> and replace with:
> 
> ```php
//bof As low as price//
		case 'PRODUCT_LIST_PRICE':
		
			$lc_price = zen_get_products_discount_price_qty((int)$listing->fields['products_id'],20000);
			$lc_price = '$'.number_format($lc_price, 2);
			$lc_align = 'right';
			if ( zen_get_products_discount_price_qty((int)$listing->fields['products_id'],20000) != zen_get_products_actual_price((int)$listing->fields['products_id'])){
                                //Change the next line to your own text/formatting requirements
				$lc_text='<span style="color: gray; font-weight: normal;">Price as low as:<br />' . $lc_price . '';
				}else{
				$lc_text =  $lc_price.'<br />';
				}
//eof As low as prise//

I was having trouble with the Starting At: text not appearing on the product listing pages where attributes were defined for the product.

I modified your code to:

//bof Starting At: price//
case 'PRODUCT_LIST_PRICE':

$lc_price = zen_get_products_actual_price((int)$listing->fields['products_id'],20000);
$lc_price = '$'.number_format($lc_price, 2);
$lc_align = 'right';
if (zen_has_product_attributes($listing->fields['products_id']) != zen_get_products_actual_price((int)$listing->fields['products_id'])){
$lc_text = $lc_price.'<br />';
}else{
//Change the next line to your own text/formatting requirements
$lc_text='Starting At:  ' . $lc_price . '<br />';
}
//eof Starting At: price//

And now it works! :clap: Thanks for the start! I know next to nothing about php.

More Details: http://www.zen-cart.com/forum/showthread.php?t=119023

16 Sep 2009, 1:48 PM
#33
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: Qty Discount - Display lowest price & "Start At" text

when I use Attributes Qty Price Discount I have to set the base Price to 0 so that when I use Attributes Qty Price Discount that it works so the prices come from the *Attributes Qty Price Discount; *and the base price **is not added. **But then it does not show as a starting price! Any ideas (if you understand?)

http://www.galaxybeads.com.au/index.php?main_page=product_info&cPath=68_71&products_id=461

22 Sep 2009, 8:31 PM
#34
manage_it avatar

manage_it

Inactive

Join Date:
May 2006
Posts:
80
Plugin Contributions:
0

Re: Qty Discount - Display lowest price & "Start At" text

Is there a way to include the tax?

$cheapest = zen_get_products_discount_price_qty((int)$_GET['products_id'],20000);
$cheapest = number_format($cheapest, 2);
echo 'De goedkoopste prijs: $' . $cheapest . '<br>';

2 Aug 2010, 3:50 AM
#35
tpiccirillo avatar

tpiccirillo

New Zenner

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

Re: Qty Discount - Display lowest price & "Start At" text

Is there any way to display "Call for Price" image instead of Price:$0.00 if it has been set for Call for Price?