bpviswa Posted April 8, 2013 Share Posted April 8, 2013 Hi, I'm using Prestashop 1.5.4 and I'm unable to delete products in block cart. Here's what I did: 1. Removed block cart from hook displayTop 2. Added block cart to hook displayRightColumn 3. Disabled ajax cart from module cart block Looking forward to your help. Thanks. Link to comment Share on other sites More sharing options...
NemoPS Posted April 8, 2013 Share Posted April 8, 2013 What do you get when you click the delete button? i assume you get redirected, as ajax is disabled Link to comment Share on other sites More sharing options...
bpviswa Posted April 8, 2013 Author Share Posted April 8, 2013 The page refreshes without deleting the product Link to comment Share on other sites More sharing options...
NemoPS Posted April 8, 2013 Share Posted April 8, 2013 (edited) Are you used any third party module, url rewriting, or have you changed any core file? Also, can you please post the url you get here? You can leave away the site's name of course, but the query string is important ...and, are you using a custom theme? Edited April 8, 2013 by Nemo1 (see edit history) Link to comment Share on other sites More sharing options...
bpviswa Posted April 8, 2013 Author Share Posted April 8, 2013 Thanks Nemo. The configuration is a default one with no modifications what so ever. So if you install version 1.5.4 with default settings/data/theme and do the following: 1. Unhook block cart from hook displayTop 2. Added block cart to hook displayRightColumn 3. Disabled ajax cart from module cart block I'm unable to delete products from block cart using the 'x' or delete icon. I've decided to switch to AJAX cart, so I'm not too worried about a solution to this problem any more but resolving this bug might be of interest to Prestashop developers and other users. Link to comment Share on other sites More sharing options...
NemoPS Posted April 8, 2013 Share Posted April 8, 2013 Okay, it's weird though, since without ajax the thing should be managed by the query string, and positioning shouldn't matter Link to comment Share on other sites More sharing options...
Teapot Creative Posted September 27, 2013 Share Posted September 27, 2013 Hi Anyone know if there is a fix for this as it is still and issue..? Nick Link to comment Share on other sites More sharing options...
Spherix Posted October 14, 2013 Share Posted October 14, 2013 I'm still encountering this issue. Link to comment Share on other sites More sharing options...
vekia Posted October 14, 2013 Share Posted October 14, 2013 I'm still encountering this issue. hello it's your first post here. you've got THE SAME issue? Link to comment Share on other sites More sharing options...
Spherix Posted October 14, 2013 Share Posted October 14, 2013 It's my first post in _this_ topic; but yes, I'm encountering the exact same issue. Ajax cart disabled, one page checkout, clicking [x] on the cart doesn't remove the product. It doesn't work as long as the cart is a 'block' next to other pages. If you view your cart as whole, you can remove products, otherwise, you can't. Link to comment Share on other sites More sharing options...
vekia Posted October 14, 2013 Share Posted October 14, 2013 can you share url to your website? I will inspect code of your shop i fixed several similar issues in last week (related to quantity change and also product "remove" buttons in cart) Link to comment Share on other sites More sharing options...
Spherix Posted October 14, 2013 Share Posted October 14, 2013 That'd be great; I'll PM you the link as it's still in development and not meant for the public. Link to comment Share on other sites More sharing options...
vekia Posted October 14, 2013 Share Posted October 14, 2013 this is how your delete url looks like: XXXXXXXXX.org/index.php?controller=cart&delete%26id_product%3D12%26ipa%3D0%26id_address_delivery%3D0%26token%3D751116a81b0224e2f435945ae07db56b= and this is how it should looks like: XXXXXXXXX.org/index.php?controller=cart&delete=1&id_product=12&ipa=0&id_address_delivery=0&token=751116a81b0224e2f435945ae07db56b you see the difference? it looks like you've got some troubles with encoding in block cart module template file. If i were you for the first i will check template file encoding type (it must be utf-8 without BOM) Link to comment Share on other sites More sharing options...
Spherix Posted October 18, 2013 Share Posted October 18, 2013 (edited) Hey, thanks for the response. It does indeed look as if the encoding messes up. I've opened up the template file from the theme I'm using and searched for the particular link; <span class="remove_link">{if !isset($customizedDatas.$productId.$productAttributeId) && ($product.total > 0)}<a rel="nofollow" class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete&id_product={$product.id_product}&ipa={$product.id_product_attribute}&id_address_delivery={$product.id_address_delivery}&token={$static_token}", true)}" title="{l s='remove this product from my cart' mod='blockcart'}" > </a>{/if}</span> I tried adding :'UTF-8' after the {$static_token}" part; but that makes my whole shop render a white page. I'm not quite sure where to edit anything else regarding encoding; I can't find any other encoding aside from UTF-8 here and there. I did notice that all the links to delete an item from my cart use a ajax_cart css style; I've got the ajax cart disabled (on purpose), could this be interfering? Edit: I noticed that the link that does work (when actually viewing cart contents @ index.php?controller=order-opc , and it seems to be 100% the same link; aside from the encoding? Since this is probably using the same code, where the heck would it screw up the encoding? Edited October 18, 2013 by Spherix (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 18, 2013 Share Posted October 18, 2013 can you use: insetead of & just use & in: {$link->getPageLink('cart', true, NULL, "delete&id_product={$product.id_product}&ipa={$product.id_product_attribute}&id_address_delivery={$product.id_address_delivery}&token={$static_token}", true)} Link to comment Share on other sites More sharing options...
Spherix Posted October 18, 2013 Share Posted October 18, 2013 Changed all the &'s to &'s, the url still formats as index.php?controller=cart&delete%26id_product%3D12%26ipa%3D0%26id_address_delivery%3D0%26token%3D751116a81b0224e2f435945ae07db56b=From the sidemenu, whilst the cart detail page makes the urlindex.php?controller=cart&delete=1&id_product=12&ipa=0&id_address_delivery=0&token=751116a81b0224e2f435945ae07db56b Something if definately screwing up the formatting, but I'm clueless where to look next, as it's using the same code, isn't it? Link to comment Share on other sites More sharing options...
Spherix Posted October 18, 2013 Share Posted October 18, 2013 (edited) Update: I checked the cart pages; it turns out the code for the cart viewing page is different than the one from the module cart-block. I've taken the code from shopping-cart.tpl for the delete link and put it in the module page (blockcart.tpl) and that seems to do the trick. The URL itself is very different though. Old url (blockcart.tpl): <a rel="nofollow" class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete&id_product={$product.id_product}&ipa={$product.id_product_attribute}&id_address_delivery={$product.id_address_delivery}&token={$static_token}", true)}" title="{l s='remove this product from my cart' mod='blockcart'}" > </a> New url (from shopping-cart.tpl): <a rel="nofollow" class="cart_quantity_delete" id="{$product.id_product}_{$product.id_product_attribute}_{$id_customization}_{$product.id_address_delivery|intval}" href="{$link->getPageLink('cart', true, NULL, "delete&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization}&id_address_delivery={$product.id_address_delivery}&token={$token_cart}")}">{l s='Delete'}</a> By the way... You can't seem to delete free products from a cart; adressed here: http://forge.prestashop.com/browse/PSCFV-10647 as well. Edited October 18, 2013 by Spherix (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 18, 2013 Share Posted October 18, 2013 so you used new url mentioned above and now it works? Link to comment Share on other sites More sharing options...
Spherix Posted October 22, 2013 Share Posted October 22, 2013 Yeah, correct. Link to comment Share on other sites More sharing options...
webrise Posted April 17, 2014 Share Posted April 17, 2014 (edited) It's my first post in _this_ topic; but yes, I'm encountering the exact same issue. Ajax cart disabled, one page checkout, clicking [x] on the cart doesn't remove the product. It doesn't work as long as the cart is a 'block' next to other pages. If you view your cart as whole, you can remove products, otherwise, you can't. I have the exact same problem... the issue is on the blockcart only and the ajax should be disabled. I tried to use only & instead of &, I replaced the code from the actual cart page, I reseted the module, I unhooked and re-hooked it from header, nothing works... I think that I have issues with encoding as well but any of the suggested solutions didn't worked out. The version is 1.5.6.2 and the blockcart is edited from a previous dev, which is not responding and we don't know exactly what and how he did... Any help will be highly appreciated as it's quite urgent! PS: We use the default theme but heavily edited. PS2: I forgot to mention that when we click on the "delete", currently "X" in our blockcart, we are redirected to the homepage. Also, I don't know if has anything to do with this but we use multiple languages and friendly URLs Edited April 17, 2014 by webrise (see edit history) Link to comment Share on other sites More sharing options...
Petter B Posted April 23, 2014 Share Posted April 23, 2014 I have the same problem in PS 1.6.0.6 Switched to ajax cart= no problems. Link to comment Share on other sites More sharing options...
vekia Posted April 23, 2014 Share Posted April 23, 2014 yes it will work because there is no ajax query. page needs refresh then with ajax cart everything works in background and it's a bit more "friendly" for customers. Link to comment Share on other sites More sharing options...
R.Shredder Posted October 23, 2018 Share Posted October 23, 2018 (edited) I'm having the same issue on PS 1.7.3 I replaced the JS folder (theme/xxx/assets/js) with the classic theme one, and it fixes the cart summary issue but it broke my slider, add to cart JS buttons, and other stuff, of course. I compared the 2 versions of theme.js (my theme and the originial PS) as i suspect the ajax update is failing somewhere in it but i really can't find the problem. If anyone has a little bit of time, that would help a ton, since i'm not good at all in JS !! custom-theme.js theme-original.js by the way, disabling ajax cart didn't do the trick for me. Edited October 23, 2018 by R.Shredder (see edit history) Link to comment Share on other sites More sharing options...
ericksonrqc99 Posted August 23, 2020 Share Posted August 23, 2020 (edited) On 4/8/2013 at 2:54 AM, bpviswa said: Hi, I'm using Prestashop 1.5.4 and I'm unable to delete products in block cart. Here's what I did: 1. Removed block cart from hook displayTop 2. Added block cart to hook displayRightColumn 3. Disabled ajax cart from module cart block Looking forward to your help. Thanks. first notice the error displayed when you click on remove a product from the shopping cart if the error is 406 as in the following image solve the problem in the following way otherwise look for solutions with the error shown in the console 1.- enter your Cpanel 2.- select mod security 3.- Disable domain status Edited August 23, 2020 by ericksonrqc99 (see edit history) Link to comment Share on other sites More sharing options...
Jean Posted December 30, 2021 Share Posted December 30, 2021 Hi is there already a fix for. , ? I have the same. problem ca not DELETE. products. in Cart / basket? Thanks for help , Jean 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