Just installed this module few days ago. It works great ! Thank you for this contribution!
There are a few kinks that needed to be worked out. Finally resolved them and here are my solutions in case someone finds this useful.
1. Problem #1:
if not logged in, adding an item to wishlist sends you to shopping cart after logging in. There was a solution to ask people to login first, but i did not like that. I found this code to work perfectly well instead:
2. wishlist default template has 'SSL' hard coded which may result in switching to SSL when it's not needed.PHP Code:
<!--bof Wishlist button -->
<?php
if (UN_MODULE_WISHLISTS_ENABLED) {
echo '<a href="' . zen_href_link(UN_FILENAME_WISHLIST, 'products_id=' . (int)$_GET['products_id'] . '&action=wishlist_add_product', 'NONSSL') . '">' . zen_image_button(UN_BUTTON_IMAGE_WISHLIST_ADD, UN_BUTTON_WISHLIST_ADD_ALT, 'name="wishlist" value="yes"') . '</a>';
}
?>
<!--eof Wishlist button -->
Solution is to find and replace every instance of 'SSL' by $request_type in tpl_wishlist_default.php file .
3. two calls to zen_href_link function in wishlist default template have a bug in them, which results in "Security Warning" in certain situations.
in file tpl_wishlist_default.php need to replace the following lines:
byPHP Code:
<?php echo zen_draw_form('wishlist', zen_href_link(UN_FILENAME_WISHLIST, zen_get_all_get_params(array('action'), 'SSL') . 'action=un_update_wishlist')); ?>
PHP Code:
<?php echo zen_draw_form('wishlist', zen_href_link(UN_FILENAME_WISHLIST, zen_get_all_get_params(array('action')) . 'action=un_update_wishlist', $request_type)); ?>
and
byPHP Code:
echo zen_draw_form('cart_quantity', zen_href_link(UN_FILENAME_WISHLIST, zen_get_all_get_params(array('action'), 'SSL') . 'action=add_product'));
PHP Code:
echo zen_draw_form('cart_quantity', zen_href_link(UN_FILENAME_WISHLIST, zen_get_all_get_params(array('action')) . 'action=add_product', $request_type));
I basically an using the example provided in the download for tpl_product_info_display.php and I get the following error when I click on the add to wishlist to add a product to the wishlist.
1054 Unknown column 'attributes' in 'field list'
in:
[INSERT INTO un_products_to_wishlists ( `products_id`, `un_wishlists_id`, `created`, `modified`, `quantity`, `priority`, `comment`, `attributes` ) VALUES ( '6449', '2', NOW(), NOW(), '1', '2', '', 'a:3:{i:1;s:1:"1";i:2;s:1:"2";i:3;s:1:"3";}' )]
Please advise, thanks.
I seem to have the heading on the wishlist page as "Product: Default" not "Wishlist: Default" -
any reason why this is not recognising the page and using its heading correctly?
Does anybody know how I could use the wishlist on the product info page? I would need to have the button just like the "multiple products to cart button" (including attributes). Hope someone can help
Cheers
I recently was asked to install Wishlist into Zencart v1.5, and tried some of the solutions in this thread to add item to wishlist from product page using a text link instead of input submit with image. Examples posted did not work for me... so,
Here is my solution using javascript:
PHP Code:
<?php if (UN_MODULE_WISHLISTS_ENABLED) { ?>
<script type="text/javascript">
<!--
function addWishlist(){ var hWish = document.createElement("input"); hWish.setAttribute("type","hidden"); hWish.setAttribute("name","wishlist"); hWish.setAttribute("value","yes"); var cartForm = document.getElementsByName("cart_quantity").item(0); cartForm.appendChild(hWish); cartForm.submit(); }
//-->
</script>
<a href="javascript:addWishlist()"><?php echo UN_BUTTON_WISHLIST_ADD_ALT; ?></a>
<?php } ?>
I was having the same problem many are having. Add to cart button adding product to cart and wishlist button adding product to cart and all the combinations in between described in this thread. I followed all the possibilities and nothing worked until I made a silly change and now it finally works.
Hope this helps anyone with the same problem.
tpl_product_info_display.php
PHP Code:
<?php echo ('<a href="' . zen_href_link(UN_FILENAME_WISHLIST, zen_get_all_get_params(array('action', 'products_id')) . 'products_id='.(int)$_GET['products_id'].'&action=un_add_wishlist') . '">' . zen_image_button(UN_BUTTON_IMAGE_WISHLIST_ADD, UN_BUTTON_WISHLIST_ADD_ALT) . '</a>'); ?>
M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com
I have it working on 1.5.1 test site but when you press wish list nothing shows up ..
Will it be make 1.5 compatible
cheers
Really want (need) to install this with a new v1.5.1 build but it doesn't appear to be compatible/working with Zen-Cart v1.5.1. My list of add-ons to install is vast and I don't want to risk installing this without some certainty that it will work.
So, if someone has or gets this working with v1.5.1, please post (to let me know) and I will proceed.
Cheers
GAM
ps. Or if anyone knows of an alternative that provides similar functionality and works with 1.5.1, please advise. So far I'm only aware of 'save for later', which is what I will be going with in the meantime (not quite the functionality that I sought though).
Last edited by GAM; 20 May 2013 at 11:04 PM.
Just wanted to post a suggestion here.. Instead of waiting for someone to confirm if this works with v1.5.1, you can (should) setup a test/dev store to do your work.. If you backup EVERYTHING (DB & files) in your test/dev site before you proceed with your installation, and all hell breaks loose, then you can EASILY roll your test/dev store back to the state it was before installing this module..
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Bookmarks