Rod Posted April 3, 2011 Share Posted April 3, 2011 How to add and show some content at the end of the product full description if there is no price listed and show in normal if there is price. Link to comment Share on other sites More sharing options...
shokinro Posted April 3, 2011 Share Posted April 3, 2011 If you can make your title much more specific and detail, you will get more and quick answers.I think there should be always price information there, but the price depends on a lot of other information like discounts. if there is no price listed I am not sure you "full description", I assume it is the short description area, not the long description area.You your reference, you can add contents to short description area by adding it to this block, in file /themes/YourSiteTheme/product.tpl {if $product->description_short} {$product->description_short} {/if} {if $product->description} {l s='Track list'} {/if} {if $packItems|@count > 0} {l s='Pack content'} {foreach from=$packItems item=packItem} {$packItem.pack_quantity} x getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)}">{$packItem.name|escape:'htmlall':'UTF-8'} {$packItem.description_short} {/foreach} {/if} Link to comment Share on other sites More sharing options...
Rod Posted April 3, 2011 Author Share Posted April 3, 2011 Thanks for your quick response.The full description is the long description. In my shop I have disable the short description fuction, only long description.My meaning is that when there is no price for this product, I want to add "Please contact us for quotation." at the end of the product long description. If there is price for this product, then this sentence do not need to show. I am not fimiliar with PHP code, but I think it will be add some {if}{else}{/if} something like this. Link to comment Share on other sites More sharing options...
shokinro Posted April 3, 2011 Share Posted April 3, 2011 I assume your " If there is price for this product" means price is 0.Please make changes as following in product.tpl fileLook for following code {if $product->description} <!-- full description --> {$product->description} {/if} Replace with following code {if $product->description} <!-- full description --> {$product->description} {if $product->getPrice(true, $smarty.const.NULL) == 0} Please contact us for quotation. {/if} {/if} Link to comment Share on other sites More sharing options...
Rod Posted April 3, 2011 Author Share Posted April 3, 2011 Hi shokinro, thanks for your answer, I try your method, but it not works. Link to comment Share on other sites More sharing options...
shokinro Posted April 3, 2011 Share Posted April 3, 2011 It just tested my code, if works fine.When you access this producthttp://expresscheckout.dyndns.org:8080/shop1323/product.php?id_product=8You will see "please contact us..." at the bottom of long description, because its price is 0See attached screen shot.But when you access other products like one, it will not show up, because there is a price.http://expresscheckout.dyndns.org:8080/shop1323/product.php?id_product=9 Link to comment Share on other sites More sharing options...
Rod Posted April 3, 2011 Author Share Posted April 3, 2011 I use prestashop 1.2.4 and it really not work. Please see attachment.Both have the sentence "Please contact us for quotation. " Link to comment Share on other sites More sharing options...
shokinro Posted April 3, 2011 Share Posted April 3, 2011 The sample you are given are using attribute combination. My script is based on base price, I am sure the base price is 0.Because the user can change attribute dynamically, so you might need use the dynamic price as condition. It will require more code. Hope you can figure it out yourself. I will take a look when I got time. Link to comment Share on other sites More sharing options...
shokinro Posted April 3, 2011 Share Posted April 3, 2011 I have updated the 2nd script so it will work with attribute combination in the previous post.please try that again. Link to comment Share on other sites More sharing options...
Rod Posted April 3, 2011 Author Share Posted April 3, 2011 shokinro, thanks for your script and it works now. Link to comment Share on other sites More sharing options...
shokinro Posted April 3, 2011 Share Posted April 3, 2011 glad to know it worked for you.please kindly add SOLVED at the beginning of the subject of your first post to mark it as solved. Link to comment Share on other sites More sharing options...
Recommended Posts