Jump to content

Block wishlist dosnt show image


Recommended Posts

Sure.

 

It seems I cannot attach this file here.

How should I share it with you?

 

Actually I did not put that background there, it seems it was there before.

Yours is different?

Do you know why when the customer is typing in this box it does not show any result to choose from it?

Link to comment
Share on other sites

Your welcome.

My problem is that when a customer is in his/her account and adding a product to his/her wishlist via search box, while he/she is typing no suggestion pops up like the main search functionality in the site.

 

How can I have that functionality?

Link to comment
Share on other sites

  • 1 month later...

I have PS v1.5.4.1 (fairly fresh install)

And "Yes" by default the "background:url(../img/bg_input.png) repeat-x 0 0 #fff" within the fillable "name" field for the wishlist is for some reason overlooked in the code QA and should be changed to: "background: #fff;" without the quotes of course.

 

However, this whole mod is a wash it seems and looking for help to fix this... I see other examples of just 1 product added to the wishlist and the image doesn't show... but, add more than 1 product and the product repeats for all instances rather than showing x number of products and descriptions. (see SS) Any recommendations ???

 

**NOTE: Just to be clear "NO" I did not add the same item 3 times - I added 3 different products.

 

wishlist-1.5.4.1.jpg

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

***********UPDATE**************

 

Since this last post I deleted the wishlist shown above as "My Wishlist" with the green background and the wishlist module has since stopped working. No matter what I do I cannot save products to a new wishlist. I am using Firefox 22.0 and I have refreshed the page / cleared the cache.... created new customer accounts and ???? no love. The option to "Add to My Wishlist" link is present on the product page and when clicked I see the product image float down to the wishlist block, the block moves up and down like it has accepted the product... but nothing happens. The product does not show within the wishlist block nor does it show under "my account" "my wishlist" ---------- Anyone else having this issue ???? I need this to work... any help would be greatly appreciated.

I am working with:

PS v1.5.4.1

Wishlist v0.2

Theme: default PS theme w/ modified css

Link to comment
Share on other sites

  • 2 months later...

same problem here, care to share the solution with us?

Hi Smijn1,

 

I've almost fixed my whishlist module, apart from the "Send the whishlist" button, which is still having a strange behaviour.

 

Would you please recap for me about your issue?

 

As you can see I'm a newbie but I would be very happy to help & share a valid solution :D

 

Thanks & Ciao!

Valeria

Link to comment
Share on other sites

@MyValeria:

 

I am having the same issue as @Smijn1 which is that the thumbnail does not show when you visit the Wishlist in your account.

 

Did you solve that issue?

 

Thanks,

 

Brian

Hi Brian et all,

 

I've replaced the entire Whishlist module with the one received from Benjamin (one of my favourite Gurus  :)).

You might want to have a look at this post for clarification:

http://www.prestashop.com/forums/topic/190616-send-wishlist-bugs-15017/

 

Zipped file is here attached. It's now running on my store foodforlove.it, PS version 1.5.4.1.

 

There's still one issue to be solved (see thumbnail):

post-558663-0-21401000-1379358100_thumb.jpg
 
When the "Send this whishlist" button is clicked, it first turns in a very long button line. You have to click it a second time to see the list of email input fields.
 
Hope this helps guys!

blockwishlist.zip

Link to comment
Share on other sites

Hi Valeria,

 

My issue is indeed like surferboy that the image thumbnails are not displayed. My guess is that it only displays the image for the first product added or maybe just the images for products without attributes..

 

Also the wishlist URL is generated starting with: http://https://www.

 

So for now I have disabled the module because I don't want to use it like this, but I will take a look at the module you suggested.

 

Thanks!

Link to comment
Share on other sites

Hi Valeria,

 

My issue is indeed like surferboy that the image thumbnails are not displayed. My guess is that it only displays the image for the first product added or maybe just the images for products without attributes..

 

Also the wishlist URL is generated starting with: http://https://www.

 

So for now I have disabled the module because I don't want to use it like this, but I will take a look at the module you suggested.

 

Thanks!

 

Hi Smijn1,

 

I haven't experienced what you're describing.

It all worked well after having replaced the module, as I said before.

 

If you're still having problems with the new module, I suggest that you try and send a post in this thread:

http://www.prestasho...ist-bugs-15017/

I guess Benjamin will be much much more helpful than me :D

 

Good luck!

Valeria

Link to comment
Share on other sites

  • 3 weeks later...

hi all.

 

I had to use clockwishlist for a customer and experienced the same troubles regarding images.

 

Main trouble comes when u use attributes for a product and don't have a défault image for each combination.

 

In the module's code you can see that right here around line 65 :

					if ($products[$i]['id_product_attribute'] != 0)
					{
						$combination_imgs = $obj->getCombinationImages($context->language->id);
						if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
							$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];
					}

Trouble is that there is no rule if no default image's found for this combination.

 

You can fix it easily if you replace this code by the following (you''l see what changes right in the "else" condition added.

					if ($products[$i]['id_product_attribute'] != 0)
					{
						$combination_imgs = $obj->getCombinationImages($context->language->id);
						if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
							$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];
						else {
							$cover=Product::getCover($obj->id);
							$products[$i]['cover']= $obj->id.'-'.$cover['id_image'];
						}
					}

Finally, if no default image is defined for the combination, then the additional code will look for the product's cover instead.

 

The very same change has to be done on view.php, around line 71.

You''l find the very same code , juste replace it the same way.

 

Regards,

Eric

  • Like 1
Link to comment
Share on other sites

Hi Eric,

 

Great post, thanks. However I can only seem to find the piece of code that needs to be replaced in view.php.

 

In which other file should I replace it?

 

 

Well i'll paste a bit more code then . Just open view.php in /modules/blockwishlist

 

In 1.5.6 , the right place to act on is on line  60 and following

 

Actual code is : 

			if ($products[$i]['id_product_attribute'] != 0)
			{
				$combination_imgs = $obj->getCombinationImages($context->language->id);
				if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
					$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];			
			}

It has to be replaced by : 

			if ($products[$i]['id_product_attribute'] != 0)
			{
				$combination_imgs = $obj->getCombinationImages($context->language->id);
				if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
					$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];
				else {
							$cover=Product::getCover($obj->id);
							$products[$i]['cover']= $obj->id.'-'.$cover['id_image'];
				}				
			}

Notice that you also have to replace the very same block in managewishlist, around lin 66.

Here you'll find the very same code than in view.php : 

					if ($products[$i]['id_product_attribute'] != 0)
					{
						$combination_imgs = $obj->getCombinationImages($context->language->id);
						if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
							$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];
					}

wich has to be replace as well , by : 

			if ($products[$i]['id_product_attribute'] != 0)
			{
				$combination_imgs = $obj->getCombinationImages($context->language->id);
				if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
					$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];
				else {
							$cover=Product::getCover($obj->id);
							$products[$i]['cover']= $obj->id.'-'.$cover['id_image'];
				}				
			}

Except tha fact that those lines appear in two different files, you'l see that the code is identical and the patch then the very same.

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

  • 2 months later...

hi Broceliande.

I am using Presta 1.5.3.1 and have read your tip above to fix the missing thumbs in the wishlist. i found the code you indicated in the managewishlist.php and it fixed the problem with the thumbs not appearing on the wishlist page when i add items to a wishlist BUT my view.php file does not contain the code you indicated so i cannot edit it as you mention, hence when someone goes to view a wishlist the thumbs are missing.

 

here is my complete view.php code below...
 

<?php
/*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2012 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/

/* SSL Management */
$useSSL = true;

require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../header.php');
require_once(dirname(__FILE__).'/WishList.php');

$context = Context::getContext();
$token = Tools::getValue('token');

// Instance of module class for translations
$module = new BlockWishList();

if (empty($token) === false)
{
	$wishlist = WishList::getByToken($token);
	if (empty($result) === true || $result === false)
		$errors[] = $module->l('Invalid wishlist token', 'view');
	WishList::refreshWishList($wishlist['id_wishlist']);
	$products = WishList::getProductByIdCustomer((int)($wishlist['id_wishlist']), (int)($wishlist['id_customer']), $context->language->id, null, true);
	for ($i = 0; $i < sizeof($products); ++$i)
	{
		$obj = new Product($products[$i]['id_product'], false, $context->language->id);
		if (!Validate::isLoadedObject($obj))
			continue;
		else
		{
			if ($products[$i]['id_product_attribute'] != 0 && isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
			{
				$combination_imgs = $obj->getCombinationImages($context->language->id);
				$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];
				
			}
			else
			{
				$images = $obj->getImages($context->language->id);
				foreach ($images AS $k => $image)
				{
					if ($image['cover'])
					{
						$products[$i]['cover'] = $obj->id.'-'.$image['id_image'];
						break;
					}
				}
				if (!isset($products[$i]['cover']))
					$products[$i]['cover'] = $context->language->iso_code.'-default';
			}
		}
		
	}
	WishList::incCounter((int)($wishlist['id_wishlist']));
	$ajax = Configuration::get('PS_BLOCK_CART_AJAX');
	$context->smarty->assign(array (
		'current_wishlist' => $wishlist,
		'token' => $token,
		'ajax' => ((isset($ajax) AND (int)($ajax) == 1) ? '1' : '0'),
		'wishlists' => WishList::getByIdCustomer((int)($wishlist['id_customer'])),
		'products' => $products));
}

if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/blockwishlist/view.tpl'))
	$context->smarty->display(_PS_THEME_DIR_.'modules/blockwishlist/view.tpl');
elseif (Tools::file_exists_cache(dirname(__FILE__).'/view.tpl'))
	$context->smarty->display(dirname(__FILE__).'/view.tpl');
else
	echo $module->l('No template found', 'view');

require(dirname(__FILE__).'/../../footer.php');

as you can see, it does not contain the code you said to look for...

if ($products[$i]['id_product_attribute'] != 0)
			{
				$combination_imgs = $obj->getCombinationImages($context->language->id);
				if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
					$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];			
			}

can you tell me which lines of code to change here to make the view.php show the thumbs?

here is a link to my view wishlist page that is missing the thumbs --> http://www.fixgear.info/modules/blockwishlist/view.php?token=B78E0369054A5A82 

thanks!

jez...

Link to comment
Share on other sites

hi again.

 

well, it seems i downloaded the file posted by a user above and uploaded it and the code replacement works :)

BUT, for some reason the products without attributes are not showing thumbs :(

Can you all see the thumb of the 5th product here -_> http://www.fixgear.info/modules/blockwishlist/view.php?token=1A073E82361BC8F5 

it's the "THE SKELETON" BLUE - FIXGEAR CYCLING/RUNNING/TRAINING BANDANA.

" and not the Skeleton Blue cycling kit. 

Any ideas as to why the thumb for products without attributes does not show? i imagine it's because there are no combinations and hence no combination images but the code edit above should refer to the cover image right?

Here is my current "view.php" code...

 

<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2013 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/

/* SSL Management */
$useSSL = true;

require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../header.php');
require_once(dirname(__FILE__).'/WishList.php');

error_reporting(0);

$context = Context::getContext();
$token = Tools::getValue('token');

// Instance of module class for translations
$module = new BlockWishList();

if (empty($token) === false)
{
	$wishlist = WishList::getByToken($token);
	if (empty($result) === true || $result === false)
		$errors[] = $module->l('Invalid wishlist token', 'view');
	WishList::refreshWishList($wishlist['id_wishlist']);
	$products = WishList::getProductByIdCustomer((int)($wishlist['id_wishlist']), (int)($wishlist['id_customer']), $context->language->id, null, true);
	
	for ($i = 0; $i < sizeof($products); ++$i)
	{
		$obj = new Product((int)($products[$i]['id_product']), false, $context->language->id);
		if (!Validate::isLoadedObject($obj))
			continue;
		else
		{
			$quantity = Product::getQuantity((int)$products[$i]['id_product'], $products[$i]['id_product_attribute']);
			$products[$i]['attribute_quantity'] = $quantity;
			$products[$i]['product_quantity'] = $quantity;
			if ($products[$i]['id_product_attribute'] != 0)
					{
						$combination_imgs = $obj->getCombinationImages($context->language->id);
						if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
							$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];
						else {
							$cover=Product::getCover($obj->id);
							$products[$i]['cover']= $obj->id.'-'.$cover['id_image'];
						}
					}
			if (!isset($products[$i]['cover']))
				$products[$i]['cover'] = $context->language->iso_code.'-default';
		}
		$products[$i]['bought'] = false;
		for ($j = 0, $k = 0; $j < sizeof($bought); ++$j)
		{
			if ($bought[$j]['id_product'] == $products[$i]['id_product'] AND
				$bought[$j]['id_product_attribute'] == $products[$i]['id_product_attribute'])
				$products[$i]['bought'][$k++] = $bought[$j];
		}
	}
	
	WishList::incCounter((int)($wishlist['id_wishlist']));
	$ajax = Configuration::get('PS_BLOCK_CART_AJAX');
	$context->smarty->assign(array (
		'current_wishlist' => $wishlist,
		'token' => $token,
		'ajax' => ((isset($ajax) AND (int)($ajax) == 1) ? '1' : '0'),
		'wishlists' => WishList::getByIdCustomer((int)($wishlist['id_customer'])),
		'products' => $products));
}

if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/blockwishlist/view.tpl'))
	$context->smarty->display(_PS_THEME_DIR_.'modules/blockwishlist/view.tpl');
elseif (Tools::file_exists_cache(dirname(__FILE__).'/view.tpl'))
	$context->smarty->display(dirname(__FILE__).'/view.tpl');
else
	echo $module->l('No template found', 'view');

require(dirname(__FILE__).'/../../footer.php');

TNX,

jez...

Link to comment
Share on other sites

hi MyValeria and all. 

since the Send button it indeed not working right unless clicked twice, i thought i'd share my simple but not ideal work around. 

see http://www.fixgear.info/probs/wishlist/SENDwishLIST.png

hahahahahaa! it's the basic things that are often the most effective.

NOW, another issue i have found is that (at least in chrome), when you enter the first e-mail in the e-mail field, it enters the same e-mail in all 10 fields, YIKES! this does not happen in safari though.

any ideas,

jez..

Link to comment
Share on other sites

  • 9 months later...

Hello,

 

Create new wishlist. In product cart select this list and try to add.

But when I open this new wishlist - it is empty.

The product in default wishlist... Why? Can you help me?

 

I look at Cart.php, must work this:

WishList::addProduct($context->cookie->id_wishlist, $context->customer->id, $id_product, $id_product_attribute, $quantity); 

But I don't see error... Error with id_wishlist... must be...

Link to comment
Share on other sites

  • 2 months later...
×
×
  • Create New...