Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Add product thumbnail in PRODUCTS IN YOUR ORDER block in check out page Rate Topic   - - - - -

 
  • ravt
  • Junior Member
  • Members
  • Join Date: 11-Aug 10
  • 195 posts

Posted 19 September 2013 - 05:44 AM #1

hi,

I am trying to add a thumbnail just next to product name in product in your order block in checkout page,

I tried adding this

{include file="common_templates/image.tpl" image_width='50' obj_id=$product.product_id image=$product.main_pair.icon object_type="product"}

in
/skins/basic/customer/blocks/checkout/products_in_cart.tpl

file

But nothing happened.. Can experts help me out in this.

Thanks

Attached Files


After all its simple

 
  • ravt
  • Junior Member
  • Members
  • Join Date: 11-Aug 10
  • 195 posts

Posted 19 September 2013 - 01:00 PM #2

Issue Solved guys.


I figured out the way.
After all its simple

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 19 September 2013 - 01:17 PM #3

It would be beneficial to post the solution here too. After all, this is a Community and you can only get out of it what you put back in.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • ravt
  • Junior Member
  • Members
  • Join Date: 11-Aug 10
  • 195 posts

Posted 20 September 2013 - 04:07 AM #4

The solution is on my first post itself. Just image.tpl call in that file location given above.


Done some silly mistake. (forgot to upload file back to server)

:neutral:
After all its simple

 
  • Scott_C
  • Senior Member
  • Members
  • Join Date: 23-Jun 11
  • 452 posts

Posted 19 February 2014 - 11:38 AM #5

Hi Guys, does anyone have a suggestion for V4? I have;

design/themes/basic/templates/addons/my_changes/overrides/blocks/checkout/products_in_cart.tpl

and based on the above code, I included the file; image.tpl which in my case (custom template) I found in;

design/themes/basic/templates/addons/my_changes/overrides/common/image.tpl

I successfully included the file (no smarty errors) with this path; {include file="common/image.tpl" image_width='40' obj_id=$product.product_id image=$product.main_pair.icon object_type="product"}

But I get a "no image" icon showing instead. Obviously the path to the images themselves is wrong somehow, anyone have an idea?

Thanks in advance,

Scott.

 
  • Scott_C
  • Senior Member
  • Members
  • Join Date: 23-Jun 11
  • 452 posts

Posted 20 February 2014 - 01:42 PM #6

Anyone? Vali? Stellar?

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1275 posts

Posted 25 February 2014 - 03:26 PM #7

Hi Scott,

For v4.x (4.1.2)
Please add into the file design/themes/basic/templates/addons/my_changes/hooks/block_checkout/cart_products.override.tpl
{if !$cart.products.$key.extra.parent}
<li>
  <a href="{"products.view?product_id=`$product.product_id`"|fn_url}" class="product-name">{include file="common/image.tpl" image_width="40" image_height="40" images=$product.main_pair no_ids=true link_class="float-left"}{$product.product nofilter}</a>{if !$product.exclude_from_calculate}{include file="buttons/button.tpl" but_href="checkout.delete?cart_id=`$key`&redirect_mode=`$runtime.mode`" but_meta="delete" but_target_id="cart_status*" but_role="delete" but_name="delete_cart_item"}{/if}
  <span class="product-price">{$product.amount}&nbsp;x&nbsp;{include file="common/price.tpl" value=$product.display_price}</span>
  {include file="common/options_info.tpl" product_options=$product.product_options no_block=true}
  {hook name="block_checkout:product_extra"}{/hook}
</li>
{/if}

I use hook feature instead of override of changing the core file ;)

The difference:

#before
<a href="{"products.view?product_id=`$product.product_id`"|fn_url}" class="product-name">{$product.product nofilter}</a>
#after
<a href="{"products.view?product_id=`$product.product_id`"|fn_url}" class="product-name">{include file="common/image.tpl" image_width="40" image_height="40" images=$product.main_pair no_ids=true link_class="float-left"}{$product.product nofilter}</a>

Clear cache after adding the file of code.

You can also find a demo on hungryweb.net/demo

I hope that helps,

---
Valentin
part of hungryweb.net

 
  • Scott_C
  • Senior Member
  • Members
  • Join Date: 23-Jun 11
  • 452 posts

Posted 27 February 2014 - 03:16 AM #8

Hi Valentin, thank you so much mate. I'm currently running 4.0.3 - do you think this code will work on that version, or should i update first?

Thanks again,

Scott.

 
  • Scott_C
  • Senior Member
  • Members
  • Join Date: 23-Jun 11
  • 452 posts

Posted 27 February 2014 - 05:14 AM #9

Confirmed it works in 4.0.3! :-)

 
  • Takestock
  • Senior Member
  • Members
  • Join Date: 08-Nov 13
  • 505 posts

Posted 27 February 2014 - 06:44 AM #10

Confirmed it works in 4.0.3! :-)

Great Mod, works perfect in 4.1.2

Alan