Jump to content

[Solved] Display small image in Short description in Product List page


Recommended Posts

smartdatasoft,

Thank you for fast reply.

I want to show my image "Free Shipping" bellow the product title or above the price for certain products in my store. I don't want to show "Free Shipping" for entire store's products, please see the screen shots.

Thanks.

free-shipping-gift.jpg

Edited by bruce-rez (see edit history)
Link to comment
Share on other sites

If you want to show bellow product name than you can put that image here in product-list.tpl line no 39

 

  <div class="center_block">
   <a href="{$product.link|escape:'htmlall':'UTF-8'}" class="product_img_link" title="{$product.name|escape:'htmlall':'UTF-8'}">
 <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} />
 {if isset($product.new) && $product.new == 1}<span class="new">{l s='New'}</span>{/if}
   </a>
   <h3><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'|truncate:35:'...'}</a></h3>

[u]<img src=".........imageurl"/>[/u]

   <p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" >{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}</a></p>
  </div>

 

if you want to show that image to the right side line no 47

<div class="right_block">
   {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="on_sale">{l s='On sale!'}</span>
   {elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="discount">{l s='Reduced price!'}</span>{/if}
   {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
   <div class="content_price">

 

and hope your problem will solved.

let me inform if you need any help.

Link to comment
Share on other sites

smartdatasoft,

Thank you for the explanation.

My question is if I change the code as yours in product-list.tpl, the "Free Shipping" image will be imbedded to all products?

What I would like to do is that I want to show this image for only some of my products that are set to "Free Shipping" and I do not want to show this image in the products that are not applied for 'Free Shipping". I hope this makes sense for you.

Thanks.

Edited by bruce-rez (see edit history)
Link to comment
Share on other sites

yes that will show all product, so you have to display that with some condition, is that image show in all of your product details page, or some product,

 

if all product details show that than you have to find how you manage free shipping from back office, than need to write smarty tag for that.

Link to comment
Share on other sites

smartdatasoft,

As I mentioned in my previous reply I want to show this "Free Shipping" image in only some of my products and in Product List and Product detail pages.

 

if all product details show that than you have to find how you manage free shipping from back office

 

I know we can show "Free Shipping" in Short description section in Back Office by using the text editor and HTML. This does not resolve the problem, the "Free Shipping" image wont be shown in Product List page.

 

than need to write smarty tag for that.

 

How we can write smarty tag?

 

Thank you

Link to comment
Share on other sites

smartdatasoft,

Sorry I didn't understand your explanation.

Let's do it easier and real. I have already my category (Tablecloth category) set with with Free Shipping in Back Office of my store.

Example; When customers place an order in one the product in Tablecloth category the shipping is free, they don't pay shipping.

 

The free shipping does not apply to other products in my store except the Tablecloth products.That means if customers place an order for example Chiffon product, they pay for shipping.

You can go to the above link and test it.

Thank you for your help and your time.

Edited by bruce-rez (see edit history)
Link to comment
Share on other sites

you can achive this by product-list.tpl

 

as your shop have your http://site.com/16-tablecloth-products which means that this is on category 16. so you can put by this.

 

 

{if $product.id_category_default == 16}

<img src="shiping image.">

{/if}

 

than it will solve your solution . inform me if that work

Edited by smartdatasoft (see edit history)
Link to comment
Share on other sites

hello, if you want to put that in the left site put in side this block

<div class="center_block">
<a href="{$product.link|escape:'htmlall':'UTF-8'}" class="product_img_link" title="{$product.name|escape:'htmlall':'UTF-8'}">
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} />
{if isset($product.new) && $product.new == 1}<span class="new">{l s='New'}</span>{/if}
</a>
<h3><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'|truncate:35:'...'}</a></h3>
<p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" >{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}</a></p>
</div>

[color=#343943][font=Arial, Helvetica, sans-serif][size=3]{if $product.id_category_default == 16}[/size][/font][/color]
[color=#343943][font=Arial, Helvetica, sans-serif][size=3]<img src="shiping image."/>[/size][/font][/color]
[color=#343943][font=Arial, Helvetica, sans-serif][size=3]{/if}[/size][/font][/color]

and in this way it will work

Link to comment
Share on other sites

hello, bruce-rez this must not happen, if you put this inside category for each loop that it must be show all other product. did you other product on tablecloth is assign different category.

 

as here we give condition to match default category assign. if a product is assign multiple category that may be the problem. if you have not problem you can send me your site ftp by personal message i will take a look and fix your issue.

  • Like 1
Link to comment
Share on other sites

smartdatasoft,

It worked.

You were right the tablecloth products were assigned to Home and Tablecloth categories at the same time.

So I changed and assigned them only to their relative category.

I am going to click on "Like This" for you and I thank you very much for support and help.

Best regard

Edited by bruce-rez (see edit history)
Link to comment
Share on other sites

  • 2 years later...
×
×
  • Create New...