prestamax Posted January 23, 2017 Share Posted January 23, 2017 (edited) Hi, does anybody know if there is an overview about smarty changes in prestashop1.7.X ? I noticed that some prestashop 1.6.X modules will create parse errors in prestashop 1.7.x since smarty tags won't be recognised. I am wondering if there is a list somewhere with replacement options? This would be very helpful in order to make some 1.6.x modules work in prestashop 1.7.X Edited January 23, 2017 by prestamax (see edit history) Link to comment Share on other sites More sharing options...
eleazar Posted January 24, 2017 Share Posted January 24, 2017 Didn't you know that Smarty is deprecated in the long run? If you want Smarty and override methods for the future, you should better stick to 1.6 or forks like Thirty Bees. Link to comment Share on other sites More sharing options...
Knowband Plugins Posted January 25, 2017 Share Posted January 25, 2017 As per our knowledge, there are no major changes in smarty logic of PrestaShop 1.7.x, all the tags used in PrestaShop 1.6 work without any issue in 1.7 as well. All the major changes in PrestaShop 1.7 as compared to PrestaShop 1.6 are mentioned at following link: http://build.prestashop.com/news/module-development-changes-in-17/ Link to comment Share on other sites More sharing options...
eleazar Posted January 26, 2017 Share Posted January 26, 2017 @Knowband Plugins You should better read carefully, what Xavier wrote. And prepare for the future, because PrestaShop 1.7 is the first step to a new software platform (currently sort of hybrid between old and new), not the final result! Link to comment Share on other sites More sharing options...
prestamax Posted January 26, 2017 Author Share Posted January 26, 2017 (edited) In Prestashop 1.6 I could include product tags in product.tpl using the tutorial from vekia. The following code won't work in Prestashop 1.7 so something must have changed regarding tags (there isn't even a tag cloud module in PS 1.7) This is my code {if isset($product->tags) && $product->tags} <ul class="producttags"> {assign var='id_lang' value=Language::getIdByIso($lang_iso)} {assign var='productTags' value=$product->tags} {foreach from=$productTags[$id_lang] item=productTag name=productTags} <li> <a href="{$base_dir}index.php?controller=search&tag={$productTag|escape:'url'}"><strong>{$productTag}</strong></a></li>{if !$smarty.foreach.productTags.last} {/if} {/foreach} </ul> {/if} It won't work in Prestashop 1.7 .... nothing happens. If I remove the if-condition I am getting an error message : Undefined index: lang_iso If I remove the line with the language .. again nothing will happen .. @eleazar I have read that smarty should be replaced. But as long as there is no replacement I will have to use it. @Knowband Plugins thanks for the link. I will go ahead and read it. It seems that there are major changes especially for product.tpl. I will see if I can find a hint. P.S.: I have found another post in this forum that may explain the problems https://www.prestashop.com/forums/topic/571833-prestashop-17-smarty-global-variables/ Yes, this has changed in PrestaShop v1.7. There are many Smarty variables that are no longer available. The new convention is that objects should not be passed into templates, only the values you need to use, so you should create {$lang_iso} and {$id_shop} variables in your module. Thanks again .. Edited January 26, 2017 by prestamax (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