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

ARTIFIEDWEB

  • Beginner
  • *
  • Posts: 9
  • 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: 9
  • 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: 4728
  • 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: 9
  • 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: 10663
  • VM4.0.232 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 4 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.
Should I 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: 9
  • 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: 10663
  • VM4.0.232 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 4 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
Should I 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: 9
  • 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

Kuubs

  • Jr. Member
  • **
  • Posts: 446
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?