kepler Posted September 8, 2017 Share Posted September 8, 2017 Hi I have an addon module which appears automatically to the user in the product area as an option. But I have 2 products: BASIC and PREMIUM This addon is to be used in PREMIUM only. So I was wondering if I could use this code in sidebar in the foreach loop {foreach $item->getChildren() as $childItem} {if $product|strstr:'BASIC'} {if $childItem->getName() eq "PREMIUM"} <a href="http://{$domain}" class="btn btn-default" target="_blank">BASIC</a> {continue} {/if} {/if} It's my belief that if the product is BASIC then when the addon apears in the loop, it will write the correct "button" (BASIC) instead of the PREMIUM addon. The "visit homepage" in the product details would disapear. Any expert advise would be very welcomed and apreciated.. Kind regards Kepler 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 9, 2017 Share Posted September 9, 2017 I doubt it would work in the way you think. i'd have to see the sidebar to know, but I suspect the far better way to do this would be to use a sidebar action hook. 0 Quote Link to comment Share on other sites More sharing options...
kepler Posted September 9, 2017 Author Share Posted September 9, 2017 I doubt it would work in the way you think. i'd have to see the sidebar to know, but I suspect the far better way to do this would be to use a sidebar action hook. Hi Actually it works ! Tested yesterday night. The only change I made was in the clas (instead of group button I used list because of the layout). There are amazing possibilities in the script language in the tpl files. Kind regards Kepler 0 Quote Link to comment Share on other sites More sharing options...
ClanPartner Posted September 11, 2017 Share Posted September 11, 2017 it's basicly smarty... http://www.smarty.org 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.