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.
Printable View
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.
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:
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 -->
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
Line 193 or just search for this code:
and replace or put just below if you want both prices:PHP 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']);
PHP Code:
$cheapest = zen_get_products_discount_price_qty((int)$_GET['products_id'],20000);
$cheapest = number_format($cheapest, 2);
echo 'As low as: $' . $cheapest . '<br>';
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?
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.....
:)
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:
I sent you a private message, I hope you're still reading the forum .
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.
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>';
?>