product thumbnail image dont show

  • Posts: 138
  • Thank you received: 4
7 years 10 months ago #272737

hi,
when compare product in listing product, dont show image thumbanil product (compare product)
screenshots attach.



I override Listing.php file in themplate.
releated php code for compare in listing.php :
  jQuery('#hikashop_compare_zone').append('<div id="compare_item"><img id="img_' + product_id + '" class="thumbnail_image" src="<?php $config = hikashop_config(); $image = reset($this->element->images); echo HIKASHOP_IMAGES.$image->file_path;?>"></div>');

please help me.
thanks


Joomla Developer | am.ebrahimzadeh[at]gmail.com
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
7 years 10 months ago #272756

Hello,

I want to be sure to understand precisely your point, so that there is no misunderstanding.

You had created an override, that don't works, and you request some help in order to achieved it ?
If only the answer is yes, unfortunately this forum aim is help to use and configure HikaShop, and only guide you to achieved some override.
For the last point, you have to explain what do you want achieved and write your code yourself, thanks to our help and advices.
But you can't asked to us to provide code, and understand your error without your goal...

Sorry for this return, and awaiting elements to go forward.

Regards

Last edit: 7 years 10 months ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 138
  • Thank you received: 4
7 years 10 months ago #272897

thanks #Philip;
yes I override Listing.php but It does not matter what I did override or not !!!!
only I just need one help!
if I want show product image (compare list) in ""listing.php"" , what php code to load and displaye product image?
I add source image code :

src="<?php $config = hikashop_config(); $image = reset($this->element->images); echo HIKASHOP_IMAGES.$image->file_path;?>"

but dont show image .
so thanks


Joomla Developer | am.ebrahimzadeh[at]gmail.com

Please Log in or Create an account to join the conversation.

  • Posts: 83799
  • Thank you received: 13571
  • MODERATOR
7 years 10 months ago #272966

Hi,

Wht you're trying to do is not possible the way you're trying to do it.
First, the variable $this->element->images doesn't exist in that view file.
The products are stored in $this->rows, it's an array of products.
You can do that though:

foreach( $this->rows as $row){
 echo '<img src="'.HIKASHOP_IMAGES.$row->file_path.'"/>';
}
However, that will just display a list of all the images of the products in the listing.
You'll need to have some more clever javascript to have all these images hidden by default and have they display based on an id you would add to them to be able to find them based on the compare function id for the product.

Please Log in or Create an account to join the conversation.

Time to create page: 0.246 seconds
Powered by Kunena Forum