Jump to content

[solved] Viewed Products - thumbnails do not display


Recommended Posts

Hi There, I'm a prestashop newbie and would appreciate anyone's help. I have installed Egg Themes Pizza Deli theme but can not get the 'viewed products' on the left of the product page to display the thumbnails? I have tried various solutions advised in other posts such as removing _default form medium_default and regenerating thumbs etc but to no avail. The website is www.verucasalts.co.uk

 

any help greatly appreciated.

Link to comment
Share on other sites

the solution for your issue is probably here:

http://www.prestashop.com/forums/topic/243696-solved-viewed-products-show-question-mark-ps-1541/page__p__1218306__hl__viewed%20products__fromsearch__1?do=findComment&comment=1218306

 

 

Make sure to confirm a working backup and try this in your blockviewed.php

 

"Changing line 108 from this:

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product)'.

To this:

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.

Fixes the image issue."

  • Like 1
Link to comment
Share on other sites

"Changing line 108 from this: LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product)'. To this: LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product AND i.cover = 1)'. Fixes the image issue."

Unfortunately, it is not so easy. I did it, and blockviewed dissapiered.

However, when I substituted blockviewed 1.5.4.1 with 1.5.4.0, blockviewed came back and works as it should.

Link to comment
Share on other sites

the solution for your issue is probably here:

http://www.prestasho..._1#entry1218306

 

 

Make sure to confirm a working backup and try this in your blockviewed.php

 

"Changing line 108 from this:

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product)'.

To this:

LEFT JOIN '.DB_PREFIX.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.

Fixes the image issue."

Unfortunately, it is not so easy. Not only one line of code. I did it, and blockviewed dissapiered.

However, when I substituted blockviewed 1.5.4.1 with 1.5.4.0, blockviewed came back and works as it should.

Link to comment
Share on other sites

hello

 

i said in other threads that you have got parse error in the code probably.

if it is possible - please show us your code

 

Hello,

 

The problem with leonidnk's code may be as mine was:

 

My old code:

LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product)'.

 

New code as per vekia sugested first:

LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.

 

So I had to keep the consistency with the "_"'.

 

I hope this helpes.

Edited by flowDsign (see edit history)
Link to comment
Share on other sites

I'm having the same issue now. The viewed products block used to work fine but suddenly it started to not update anymore and now none of the thumbnails are showing anymore. I got it hooked on right column blocks, tried to de-install and re-install it, tried the customer visitor thingy as described in other threads and also tried to edit the code like said above, but none of it is working :(

 

Does anyone have other suggestions?

Link to comment
Share on other sites

i can confirm the solution is working fine.

cheers.

 

BTW, i am a magento guy and a newbie to presta.. is it common to modify core files like that ? Just afraid next update it'll get overwritten and it;s kinda hard to keep track of all these small changes.

Link to comment
Share on other sites

  • 1 month later...

For any one reading this post having an issue with the blockviewed I have updated the blockviewed.php as with my latest test upgrade I also had the issue of the viewed block not showing after changing line 108 only.

I found that there were other changes necessary for the block to work as expected.

 

Here is the updated code, as you can see line 108 in changes as well as adding an AND at the bottom and removing GROUP, the code has been re-arranged.

 

$productIds = implode(',', $productsViewed);
  $productsImages = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
  SELECT image_shop.id_image, p.id_product, il.legend, product_shop.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite
  FROM '._DB_PREFIX_.'product p
  LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').')
  LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.
Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
  LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = i.id_image)
  '.Shop::addSqlAssociation('product', 'p').'
  LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').')
  WHERE p.id_product IN ('.$productIds.')
  AND (i.id_image IS NULL OR image_shop.id_shop='.(int)$this->context->shop->id.')
  AND pl.id_lang = '.(int)($params['cookie']->id_lang).'
  AND cl.id_lang = '.(int)($params['cookie']->id_lang)
  );

 

Here is the updated blockviewed.php file.

 

blockviewed.php

 

 

ps: also reported to Forge:

http://forge.prestashop.com/browse/PSCFV-10018

Edited by tdr170 (see edit history)
  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...