Can Anyone tell me how to get my product qty discounts to appear on the product list page under the price I have been messing all day trying to find where to put
{include file=“views/products/components/products_qty_discounts.tpl”}
But never see it, do I need to enclose it with something
Thanks
JOhn
Open the “categories.php” file located in the “controllers/customer”
UNDER THIS
$selected_layout = fn_get_products_layout($_REQUEST);
ADD THIS
for ($i = 0; $i < sizeof($products); ++$i) {
$product_id = $products[$i][‘product_id’];
$products[$i][‘prices’] = db_get_array(“SELECT price, lower_limit, usergroup_id FROM ?:product_prices WHERE product_id = ?i ORDER BY usergroup_id, lower_limit”, $product_id);
}
THE CREATE NEW FOLDER
skins/[your skin]/customer/addons/my_changes/hooks/products.
in there create a file called “product_multicolumns_list.post.tpl”
with this content
{foreach from=$product.prices item=“price”}
{if in_array($price.usergroup_id, $auth.usergroup_ids) && $product.base_price != $price.price}
{assign var=“var” value=1}
{/if}
{/foreach}
{if $product.prices|@sizeof > 1 && $var == 1}
{$lang.text_qty_discounts}:
{foreach from=$product.prices item=“price”}
{if in_array($price.usergroup_id, $auth.usergroup_ids)}
{/if}
{/foreach}
{foreach from=$product.prices item=“price”}
{if in_array($price.usergroup_id, $auth.usergroup_ids)}
{/if}
{/foreach}
{$lang.quantity} | {$price.lower_limit}+ |
---|---|
{$lang.price} | {include file=“common_templates/price.tpl” value=$price.price} |
{/if}
Version 2.1.2 works for me Thanks CS
JOhn
Thank you John for the question and the answer
John you are a star. I have been trying to figure this for a while.
I notice in your answer that part of the code had gone ‘Smiles’ so here it is for the ‘ADD THIS’ element of your answer:
```php
for ($i = 0; $i < sizeof($products); ++$i) {
$product_id = $products[$i][‘product_id’];
$products[$i][‘prices’] = db_get_array(“SELECT price, lower_limit, usergroup_id FROM ?:product_prices WHERE product_id = ?i ORDER BY usergroup_id, lower_limit”, $product_id);
}
```
Sorry if I shouldn’t be doing this here but thought I would let anyone who also needs to do this that I found a way of doing it without editing any templates (I am a newbie and so didn’t want to start mucking about with templates straight away!)
I simply copied and pasted the table from the Product Details page into the Short Description (using the HTML Editor) field whilst editing the product and it solved it perfectly.
An example of what I mean can be seen here
It works great!
I finally have found it!!! lol
but any ideas how to remove the lowest quantity from the box?
the discount box appears with 1+ and I want to remove that please.
any ideas?
I have tried this on 3.0.3 but it doesn't seem to work? Is there a way to make this work in 3.0.3 or am I just doing this wrong?
Thanks,
Kyle
Don't work on 3.0.3, confirmed.
I have only one question: Somebody have a solution?
I am testing Cs-Cart and this an important information for me.
Correction: Hm. Working, but only absolute discount type.
I modify a bit the code in the “categories.php” file located in the “controllers/customer”.
UNDER THIS:
$selected_layout = fn_get_products_layout($_REQUEST);
ADD:
<br />
for ($i = 0; $i < sizeof($products); ++$i) {<br />
<br />
$product_id = $products[$i]['product_id'];<br />
<br />
$products[$i]['prices'] = db_get_array("SELECT price, lower_limit, usergroup_id, percentage_discount,<br />
IF(percentage_discount = 0, price, price - (price * percentage_discount)/100) as price FROM ?:product_prices WHERE product_id = ?i ORDER BY usergroup_id, lower_limit",$product_id);<br />
```<br />
<br />
I dont created any new file in "addons/mychange".<br />
But I added 2 rows to the "skins/basic/customer/blocks/products_list_templates/products_multicolumns.tpl:<br />
<br />
show_qty=true<br />
show_product_amount=$show_product_amount<br />
<br />
Under Cs-Cart Pro 3.0.4 Pro - work for me.<br />
<br />
I don't testing different user groups, discounts, etc...<br />
<br />
I'm not a programmer and Cs-Cart new for me.<br />
If possible, I would like to see an easy, professional, elegant solution.. <img src="upload://rA9Qa8gnUPZzRZRdI8kt3dpjkrs.png" class="bbc_emoticon" alt=":)"><br />
<br />
Ero