nicola10 Posted September 28, 2020 Share Posted September 28, 2020 Hello everybody I'm trying to make a modify to product-list.tpl to show different label based on different quantity discount, using PS 1.7.6 I set two different catalague rules: the first rule applies a discount from 1 unit and the second rule applies a discount form 2 unit For the first rule (minimal quantity = 1 unit) I'm trying to show the label "Special Offers" for each product on product list under this rule For the second rule (minimal quantity > 1 unit) I'm trying to show the label "Discoun based on quantity" for each product on product list under this rule {if $product.discount_type === 'percentage'} <span>{if (isset($product.quantity_discounts) && count($product.quantity_discounts) != 1)}{l s='Special Offers' d='Shop.Theme.Catalog'}{/if}</span> <!-- This works --> {elseif $product.discount_type === 'amount'} <span>{if (isset($product.quantity_discounts) && count($product.quantity_discounts) != 1)}{l s='Special Offers' d='Shop.Theme.Catalog'}{/if}</span> <!-- This works --> {elseif $product.discount_type === 'percentage'} <span>{if (isset($product.quantity_discounts) && ($quantity_discount.quantity) > 1)}{l s='Discoun based on quantity' d='Shop.Theme.Catalog'}{/if}</span> <!-- This doesn't works --> {elseif $product.discount_type === 'amount'} <span>{if (isset($product.quantity_discounts) && ($quantity_discount.quantity) > 1)}{l s='Discoun based on quantity' d='Shop.Theme.Catalog'}{/if}</span> <!-- This doesn't works --> {/if} No error display on the page Link to comment Share on other sites More sharing options...
Guest Posted September 30, 2020 Share Posted September 30, 2020 I recently gave an example of how to do this. If you have Prestashop 1.7.6 and higher, you can use a hook and write a minimodule. Sample here: Link to comment Share on other sites More sharing options...
Guest Posted September 30, 2020 Share Posted September 30, 2020 Programming such a module for these two conditions is a job of half an hour. 😉 😎 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now