News:

Support the VirtueMart project and become a member

Main Menu

Can't add to cart child variants in category view

Started by Ferran, November 18, 2020, 08:41:01 AM

Previous topic - Next topic

Ferran


Good morning, I'm trying to make it possible to select a child variant from the category view and add it to the cart without redirecting to the product page. At first I thought it was a problem with my template but with VMBeez3, which is the one used in demo.virtuemart, it still doesn't work. Any ideas?

I would also need it to work on any template.

Demo link : https://www.fitorequip.cat/prova-llista.html

I'm using Virtuemart 3.8.6 and Joomla 3.9.22

Thanks in advance!

Ferran

UPDATE : Now it don't redirect, but no changes in product and no add to cart button....

Jörgen

Strange update, You do not tell us what You have done...

Turn off cache and cache plugins perhaps, check for JS errors in console ?

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

jenkinhill

I seem to remember that you cannot select a child variant from the category page as in order to add the variant to the cart it has first to be loaded to replace the parent - that cannot be done. The child is therefore loaded in its product details page.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

GJC Web Design

correct Jenks, it is a separate product so the dropdown is as u say simply loading the "different" product -- then it can be added.
I have been asked for this functionality a few times  ( load to cart on selecting the variant )  but I think it would only confuse users...
You can add to cart via a link so it may be possible to change the links called by the select but still don't think its a good idea from a functional point of view
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

pinochico

Yes, this is wrong idea - put child product from parent product to cart on category list.
If you really need then you must find solution self, not from me, sorry bro
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Ferran

Sorry, I was out for a few hours after fixing it. What I was looking for was to avoid that when selecting a variant from the category view, I was redirected to the product page, I wanted ajax to load the variant in the category view itself and with the possibility of being added to the cart without changing the URL. As is done at http://demo.virtuemart.net/.

Finally I discovered that it was a problem with the template that shows the products, product_slim and product_horizon, I don't know why but it works with one and not with the other.

GJC Web Design

do u mean this setting?

vmadmin-config->template->Use ajax for category content
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

Ferran

Quote from: GJC Web Design on November 19, 2020, 11:02:57 AM
do u mean this setting?

vmadmin-config->template->Use ajax for category content

I know this setting, i activated then at first attempt, but with product_slim template it doesn't work for me... With product_horizon yes.