News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Can't remove child product variants from the cart

Started by TeeJay.net, May 23, 2014, 00:34:31 AM

Previous topic - Next topic

TeeJay.net

Hello VM friends,
I've been creating a great ecommerce solution with VM2 since this problem were still up to date. It has already been corrected, as I can see in this topic confirmed by Milbo, and I also tried a clean installation on localhost where it worked just fine (though not on the same hosting and with a little bit different PHP version).

However, despite the fact that I've been updating regularly both Joomla 2.5 and VM2 (with AIO as well) to be up to date, this has never started to work on my VM site.
Any product that has children created using either Stockable Variants plugin or just bare Cart Variants (custom fields) can't be removed from the shopping cart. You click onto the trash bin icon, page refreshes, you receive a message that "The product has been successfully removed from your cart" or something like that - that's cool, but false. The product stays in your cart like you've never tried to remove it. It applies only for Stockable Variants and Cart Variants of product, products without variants work just fine.

I'm running Joomla 2.5.20, PHP 5.3.28 OR 5.5.11 (mostly 5.5, but tried both) and VM 2.6.4.

I didn't come to report a bug - as I said, in a clean installation, it works (tried stockable variant product) - verified myself.
I just would like to know how did you manage to solve it? Updates did not solve it in my case, so there has to be something more.
I've spend whole day today trying to figure this out and I haven't found a way... this is what I tried:

  • Disable SEF component (JoomSEF) and Joomla SEF
  • Switch template to Beez5
  • Remove all template overrides to use default current VM templates
  • Using older version of stockable variants plugin
  • Removing as much scripts as possible (though no errors shown)
  • Disabling all my components, plugins and modules except those which are a part of VM

Nothing has helped. I'm getting kinda desperate, I don't see a way to solve this, but I just can't go with a fresh clean VM installation...

Do you have any more ideas what could I try? Do you know where is the code responsible for removing all cart items? I'd love to check whether it got updated with all those updates.

Milbo is a nice guy according to his manners on JoomlaDay and his plans with VM are great. I wanna enjoy the great future with a nicely working open source ecommerce, too, I just need to solve this really insurmountable problem first.

Thank you for any help, advices or just proposals.

Matt_Ginn

I've had the same problem. The only way I've found round it was to take out the 'remove from cart' button and add a note telling customers to set the quantity to 0 and then click the 'update' button. Not ideal but it works!

TeeJay.net

Thank you for your reply. I know that it can be achieved this way, but you know that this is far away from being user-friendly. People are lazy to click twice, they better call you with "What should I do I can't remove products I don't want to buy from the cart...".
I know that it can be corrected somehow, so I would love to make this work as it is supposed to.

Maybe it's something in the DB or something connected with the multivendor mode I experimented with, I don't really know...

TeeJay.net

I've spent more than 10 hours of researching and I've found out that the problem is something with hosting settings.

Everything works nice on localhost (PHP 5.5.9), but not on online hosting (PHP 5.5.11).

Can you guess or do you have any ideas where to dig, where to look for the problem causing this?
Thank you

TeeJay.net

#4
Never mind anymore, I figured a custom solution myself.

In the cart, the update button is actually an <input type="submit"...> of a form. The delete button is a <a href="..."..."> that has nothing to do with the form.

What came into my mind that I could modify the delete button into an update count form that will update the count of the product to zero. So I did and it works :)
Basically, it's a copied update form, just the quantity is set to zero in every case and it's input is not type="text", but type="hidden". Then I changed some strings and classes and styles, but that's not important for this job to be done.

I'm just still wondering why VM has two separate function for the update and remove. You can remove a product with updating its count to 0, so isn't it a waste to create and extra function for that? I don't know...

GJC Web Design

nice idea - very clever..  :)

the delete form/button has been there since this was phpshop about a 100 years ago - so maybe no one ever looked at it....
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

we keep backward compatibility. You may take a look on vm2.9.6
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

TeeJay.net