robyciu97 Posted November 5, 2017 Share Posted November 5, 2017 (edited) Hi guys, sorry for my english but i will try to do my best... I need to show in the product's miniature how many combinations are available and how many not. I'm new and very noob with .ptl (never seen before). I thought so to use a simple increment x++ in a foreach that count the product-variables. Thank you for all =) Edited November 7, 2017 by robyciu97 (see edit history) Link to comment Share on other sites More sharing options...
robyciu97 Posted November 5, 2017 Author Share Posted November 5, 2017 (edited) I have solved without php... now how can i visualize "result" in product.tpl? Edited November 7, 2017 by robyciu97 (see edit history) Link to comment Share on other sites More sharing options...
karimelomdah Posted November 5, 2017 Share Posted November 5, 2017 very good Link to comment Share on other sites More sharing options...
robyciu97 Posted November 5, 2017 Author Share Posted November 5, 2017 33 minuti fa, karimelomdah dice: very good Thank you but now how can i visualize "result" in product.tpl? Link to comment Share on other sites More sharing options...
karimelomdah Posted November 5, 2017 Share Posted November 5, 2017 7 minutes ago, robyciu97 said: Thank you but now how can i visualize "result" in product.tpl? Edit product.tpl is incorrect. The product is also present in other tpl and once made shopping the discount would be lost. PrestaShop does not have a similar management. I can recommend to create two categories : 6X and 12X, and add in these values to be served SELECT `id_product` FROM `ps_product_tag` WHERE `id_tag`="/*here enter the id of the tag*/" and for each of the id creates: INSERT INTO `ps_category_product`(`id_category`, `id_product`) VALUES (/* id new category */,/*id product*/) Enter area there is a page for your purpose. Go to "price rules" and "Catalog Price Rules". Press "Add new catalog price rule". From this panel you can decide discounts er category. In principal area select general option and in " Add a new condition group" select the category involved. The tpl file via tag you can change it so this: {foreach from=Tag::getProductTags($product->id) key=k item=v} {foreach from=$v item=value} {if $value==6X} {convertPrice price=$productPrice/6|floatval} {else} {convertPrice price=$productPrice} {/if} {/foreach} {/foreach} Link to comment Share on other sites More sharing options...
robyciu97 Posted November 5, 2017 Author Share Posted November 5, 2017 (edited) Thank you but maybe I was not clear. The issue is this: Edited November 7, 2017 by robyciu97 aggiunzione (see edit history) Link to comment Share on other sites More sharing options...
robyciu97 Posted November 7, 2017 Author Share Posted November 7, 2017 (edited) Someone know how to use php in ptl on prestashop 1.7?!?!? PLEASE Edited November 7, 2017 by robyciu97 (see edit history) 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