Wishlist wont show images

  • Posts: 1119
  • Thank you received: 114
8 years 10 months ago #223277

Hi,

I am not sure is it my template but with other template I think it was working fine.
The problem is that if product has variants/characteristics wishlist wont show image. I need to load images to all product variants for it to work.
It is extra steps when creating product....
How to have wishlist to load default image if that variant has no image?

Thanks

Last edit: 8 years 10 months ago by kyratn.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 10 months ago #223294

Hi,

To be sure, you can set the Protostar template as website template for few minutes and test. This way you will directly see if the issue come from your template or not.

Do you have view overrides on the views "product / cart" (for the cart module) or "cart / showcart" (for the cart display page) ?
If it is, you can do a backup of these views and remove them to see if the images are correctly displayed.

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

  • Posts: 1119
  • Thank you received: 114
8 years 10 months ago #223376

Hi,

So I enabled protostar template and image didn't show up. Tried to add image to variant and it worked. It is not template related....Question is same....How to load default image?
Could it be something with hikashop?

To be more clear I am talking about cart display page. Everything is fine with modules.

Last edit: 8 years 10 months ago by kyratn.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 10 months ago #223444

Hi,

Indeed, we have this issue.
Please edit the file "components/com_hikashop/views/cart/view.html.php" function "showcart()" and replace the lines:

			// Load the images data
			$query = 'SELECT * FROM '.hikashop_table('file').' WHERE file_ref_id IN ('.implode(',',$cids).') AND file_type IN (\'product\',\'file\') ORDER BY file_ref_id ASC, file_ordering ASC, file_id ASC';
			$database->setQuery($query);
			$product_files = $database->loadObjectList();
			if(!empty($product_files)){
				foreach($rows as $k => $row) {
					$productClass->addFiles($rows[$k],$product_files);
					if(in_array($row->product_id,array_keys($product_files))){
						$row->images[] = $product_files[$row->product_id];
					}elseif(in_array($row->product_parent_id,array_keys($product_files))){
						$row->images[] = $product_files[$row->product_parent_id];
					}
				}
			}
By:
			// Get the images
			$full = $class->loadFullCart(true,true,true);
			foreach($rows as $k => $row){
				if(isset($full->products[$k]->images))
					$rows[$k]->images = $full->products[$k]->images;
			}

Last edit: 8 years 10 months ago by Xavier.
The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
8 years 10 months ago #223470

Thank you Xavier. It is working now.

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

Time to create page: 0.072 seconds
Powered by Kunena Forum