Author Topic: Put product images in the cart module.  (Read 4818 times)

ARTIFIEDWEB

  • Beginner
  • *
  • Posts: 8
  • Premium Web Services
    • ARTIFIEDWEB
  • VirtueMart Version: 3.0.18
Put product images in the cart module.
« on: November 30, 2016, 13:32:01 pm »
I have made an addition to the cart module to display the images of the products.

Go to components/com_virtuemart/helpers/cart.php
Line 1769
Add:
Code: [Select]
$data->products[$i]['image'] = $product->images[0];
So that the final Result is:
Code: [Select]
$data->products[$i]['image'] = $product->images[0];
$data->products[$i]['product_sku'] = $product->product_sku;

Then go to modules/mod_virtuemart_cart/tmpl/default.php
Line 31
Add:
Code: [Select]
<span class="image"><img src="<?php echo $product['image']->getFileUrlThumb(); ?>" alt="" /></span></br>
So that the final Result is:
Code: [Select]
<span class="image"><img src="<?php echo $product['image']->getFileUrlThumb(); ?>" alt="" /></span></br>
<span class="quantity"><?php echo  $product['quantity'?></span>&nbsp;x&nbsp;<span class="product_name"><?php echo  $product['product_name'?></span>


Websites that STAND OUT!
Contact me if you want an amazing upgrade

ARTIFIEDWEB

  • Beginner
  • *
  • Posts: 8
  • Premium Web Services
    • ARTIFIEDWEB
  • VirtueMart Version: 3.0.18
Re: Put product images in the cart module.
« Reply #1 on: November 30, 2016, 13:42:08 pm »
Could I suggest that you update the helper file in virtuemart core to always include that line, so that we don't have to re-insert the code on each virtuemart update?
Websites that STAND OUT!
Contact me if you want an amazing upgrade

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4336
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Put product images in the cart module.
« Reply #2 on: December 01, 2016, 10:44:17 am »
I think it not work on add to cart a new product.

ARTIFIEDWEB

  • Beginner
  • *
  • Posts: 8
  • Premium Web Services
    • ARTIFIEDWEB
  • VirtueMart Version: 3.0.18
Re: Put product images in the cart module.
« Reply #3 on: December 01, 2016, 10:47:49 am »
It was tested on a clean virtuemart install.
Make sure that in the "Virtuemart Shopping Cart" module both of the following options are set to yes:
Show Product Price?
Show Product list in cart?
Websites that STAND OUT!
Contact me if you want an amazing upgrade

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10040
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Put product images in the cart module.
« Reply #4 on: December 15, 2016, 14:31:37 pm »
Please use this version

http://dev.virtuemart.net/attachments/download/1037/com_virtuemart.3.0.18.6_extract_first.zip

it loads now the products. It needs your layout changes.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ARTIFIEDWEB

  • Beginner
  • *
  • Posts: 8
  • Premium Web Services
    • ARTIFIEDWEB
  • VirtueMart Version: 3.0.18
Re: Put product images in the cart module.
« Reply #5 on: December 15, 2016, 14:42:19 pm »
Thank you VERY MUCH!
I will continue posting some changes that I include in my core overrides on every website in case you want to also import them in the main version!
Websites that STAND OUT!
Contact me if you want an amazing upgrade

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10040
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Put product images in the cart module.
« Reply #6 on: December 15, 2016, 14:43:08 pm »
I think you know, you have to thank Spyros for it, he committed the "mounting point" in vm core
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ARTIFIEDWEB

  • Beginner
  • *
  • Posts: 8
  • Premium Web Services
    • ARTIFIEDWEB
  • VirtueMart Version: 3.0.18
Re: Put product images in the cart module.
« Reply #7 on: December 15, 2016, 14:44:55 pm »
I do know!
I have already thanked him ;)
Websites that STAND OUT!
Contact me if you want an amazing upgrade

Huubs

  • Jr. Member
  • **
  • Posts: 215
Re: Put product images in the cart module.
« Reply #8 on: November 26, 2018, 15:24:49 pm »
Is this still correct? Do I need to switch the function prepareAjaxData($withProductImages=false) to function prepareAjaxData($withProductImages=true)?

Or can I use prodct images in my cart module without altering the core?