godsone Posted March 23, 2010 Share Posted March 23, 2010 My add to wishlist button isn't working. The website's address is http://www.dnl.ro/proiecte7/ad/Need help!! Link to comment Share on other sites More sharing options...
rocky Posted March 23, 2010 Share Posted March 23, 2010 Did you remove the wishlist block from the right column and leave it in the others hooks? Unfortunately, the wishlist block has the script code in the wishlist block, so a Javascript error will occur when you remove it. To fix it, you'll need to add the following code in your header.tpl: <script type="text/javascript" src="{$content_dir}modules/blockwishlist/js/ajax-wishlist.js"></script> Link to comment Share on other sites More sharing options...
godsone Posted March 23, 2010 Author Share Posted March 23, 2010 I've added the script but it still isn't working... what can i try next? Link to comment Share on other sites More sharing options...
godsone Posted March 23, 2010 Author Share Posted March 23, 2010 I've added the block to the right column and it's working fine, so i'm gonna let it there.Thanks for your help! Link to comment Share on other sites More sharing options...
rocky Posted March 23, 2010 Share Posted March 23, 2010 I just tested the wishlist in IE8 and it is working fine. What browser are you using? There is no box animation in the wishlist module like there is in the cart block, so it seems like nothing is happening, but if you are logged in, you will see that the item is added to the wishlist block in the right column. Without that block, you can't tell that the product has been added to the wishlist unless you actually view your wishlist. If you want a more obvious indication that the product has been added to the cart, you can to change modules/blockwishlist/blockwishlist-extra.tpl to: <a href="[removed];" class="button" onclick="[removed]WishlistCart('wishlist_block_list', 'add', '{$id_product|intval}', $('#idCombination').val(), document.getElementById('quantity_wanted').value); alert('Product successfully added to wishlist');">{l s='Add to my wishlist' mod='blockwishlist'} Change the first [removed] to javascript and the second [removed] with javascript followed by a :This will pop up a box that says "Product successfully added to wishlist" after the "Add to wishlist" button is clicked. 1 Link to comment Share on other sites More sharing options...
rocky Posted March 23, 2010 Share Posted March 23, 2010 I missed your last post. You can remove the code I asked you to put in the header.tpl now that you have the wishlist in the right column. You're importing the script twice at the moment. Link to comment Share on other sites More sharing options...
bexvlad Posted March 29, 2010 Share Posted March 29, 2010 I have a similar problem, no matter which side I place the box. The Wishlist box does not update and the My wishlists button brings up an internal server message. Any Ideas, please? Link to comment Share on other sites More sharing options...
rocky Posted March 29, 2010 Share Posted March 29, 2010 Internal Server Error messages are usually caused by incorrect permissions. Try setting the permissions of the modules and modules/wishlist folders to 755. On some servers, you may need to set the permissions to 777, though it is not recommended. Link to comment Share on other sites More sharing options...
bexvlad Posted March 29, 2010 Share Posted March 29, 2010 Thanks for the quick reponse! Tried that without an improvement. I believe the installation instruction are to set the /modules and subfolders to 0777, which is what i did from the start. Link to comment Share on other sites More sharing options...
rocky Posted March 29, 2010 Share Posted March 29, 2010 If recursively setting the module folder to chmod 755 doesn't work, I'm not sure what will. Something is preventing the wishlist code from executing. Link to comment Share on other sites More sharing options...
bexvlad Posted March 29, 2010 Share Posted March 29, 2010 Thanks again. I solved it by deleting and re-uploading the entire /modules folder and setting the permissions again. Link to comment Share on other sites More sharing options...
adammontague Posted May 27, 2011 Share Posted May 27, 2011 If you want a more obvious indication that the product has been added to the cart, you can to change modules/blockwishlist/blockwishlist-extra.tpl to: Just used your code - it was a great help, thank you. Link to comment Share on other sites More sharing options...
nkomel Posted October 22, 2011 Share Posted October 22, 2011 I must say it seems I am doing something very wrong since I enabled the wishlist module in Prestashop 1.4.4. and the Add to wishlist button does not work (eventhough a wish list is created and I am logged in, nothing happens when I click on it). When I refresh the page the wish list is still empty. I do have the wishlist module in the right column, I did the code tweeks you suggest in the previous replies but still nothing. I am using IE and Chrome. I have translated the module to Slovene. Can somebody help with any ideas? Thank you. N Link to comment Share on other sites More sharing options...
aalexandros Posted January 14, 2012 Share Posted January 14, 2012 I just tested the wishlist in IE8 and it is working fine. What browser are you using? There is no box animation in the wishlist module like there is in the cart block, so it seems like nothing is happening, but if you are logged in, you will see that the item is added to the wishlist block in the right column. Without that block, you can't tell that the product has been added to the wishlist unless you actually view your wishlist. If you want a more obvious indication that the product has been added to the cart, you can to change modules/blockwishlist/blockwishlist-extra.tpl to: <a href="[removed];" class="button" onclick="[removed]WishlistCart('wishlist_block_list', 'add', '{$id_product|intval}', $('#idCombination').val(), document.getElementById('quantity_wanted').value); alert('Product successfully added to wishlist');">{l s='Add to my wishlist' mod='blockwishlist'} Change the first [removed] to javascript and the second [removed] with javascript followed by a : This will pop up a box that says "Product successfully added to wishlist" after the "Add to wishlist" button is clicked. Hi, I re-installed my blockwishlist, since there was not default wishlist and when I created a wishlist I could not add any product to it. So, now that i re-installed is the same result. Note that on mouseover in the (very) bottom-left of the page, the address is: Go to # on this page So, I do change as you say that line but it then redirects me to error page. Any help or suggestions? Thanks Link to comment Share on other sites More sharing options...
tintunnaing Posted September 5, 2012 Share Posted September 5, 2012 Hi all Friends, prestashop 1.4.7 solved wishlist module reference http://forge.prestas...owse/PSCFI-4387 please replace on cart.php ///////////////////////////////////////////////////////////////////////////////////////////////////// require_once(dirname(__FILE__).'/../../config/config.inc.php'); require_once(dirname(__FILE__).'/../../init.php'); require_once(dirname(__FILE__).'/WishList.php'); require_once(dirname(__FILE__).'/blockwishlist.php'); $errors = array(); $action = Tools::getValue('action'); $add = (!strcmp($action, 'add') ? 1 : 0); $delete = (!strcmp($action, 'delete') ? 1 : 0); $id_wishlist = (int)(Tools::getValue('id_wishlist')); $id_product = (int)(Tools::getValue('id_product')); $quantity = (int)(Tools::getValue('quantity')); $id_product_attribute = (int)(Tools::getValue('id_product_attribute')); if (Configuration::get('PS_TOKEN_ENABLE') == 1 AND strcmp(Tools::getToken(false), Tools::getValue('token')) AND $cookie->isLogged() === true) $errors[] = Tools::displayError('Invalid token'); if ($cookie->isLogged()) { if ($id_wishlist AND WishList::exists($id_wishlist, $cookie->id_customer) === true) $cookie->id_wishlist = (int)($id_wishlist); if (empty($cookie->id_wishlist) === true OR $cookie->id_wishlist == false) $smarty->assign('error', true); if (($add OR $delete) AND empty($id_product) === false) { $wishlists = Wishlist::getByIdCustomer($cookie->id_customer); if (!empty($wishlists)) { $id_wishlist = (int)$wishlists[0]['id_wishlist']; $cookie->id_wishlist = (int)$id_wishlist; } else { $wishlist = new WishList(); $modWishlist = new BlockWishList(); $wishlist->name = $modWishlist->default_wishlist_name; $wishlist->id_customer = (int)($cookie->id_customer); list($us, $s) = explode(' ', microtime()); srand($s * $us); $wishlist->token = strtoupper(substr(sha1(uniqid(rand(), true)._COOKIE_KEY_.$cookie->id_customer), 0, 16)); $wishlist->add(); $cookie->id_wishlist = (int)($wishlist->id); } if ($add AND $quantity) WishList::addProduct($cookie->id_wishlist, $cookie->id_customer, $id_product, $id_product_attribute, $quantity); else if ($delete) WishList::removeProduct($cookie->id_wishlist, $cookie->id_customer, $id_product, $id_product_attribute); } $smarty->assign('products', WishList::getProductByIdCustomer($cookie->id_wishlist, $cookie->id_customer, $cookie->id_lang, null, true)); if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/blockwishlist/blockwishlist-ajax.tpl')) $smarty->display(_PS_THEME_DIR_.'modules/blockwishlist/blockwishlist-ajax.tpl'); elseif (Tools::file_exists_cache(dirname(__FILE__).'/blockwishlist-ajax.tpl')) $smarty->display(dirname(__FILE__).'/blockwishlist-ajax.tpl'); else echo Tools::displayError('No template found'); } else $errors[] = Tools::displayError('You must be logged in to manage your wishlist.'); if (sizeof($errors)) { $smarty->assign('errors', $errors); $smarty->display(_PS_THEME_DIR_.'errors.tpl'); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now