Jump to content

[SOLVED] How to add content at the end of long description when there is no price for product????


Recommended Posts

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

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

I assume your " If there is price for this product" means price is 0.

Please make changes as following in product.tpl file


Look 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

It just tested my code, if works fine.

When you access this product
http://expresscheckout.dyndns.org:8080/shop1323/product.php?id_product=8

You will see "please contact us..." at the bottom of long description, because its price is 0
See 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

42039_xTVtgFbLLqOO4IPjc8TZ_t

Link to comment
Share on other sites

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

×
×
  • Create New...