Author Topic: Can't add to cart child variants in category view  (Read 423 times)

Ferran

  • Beginner
  • *
  • Posts: 15
  • A beginner
Can't add to cart child variants in category view
« on: November 18, 2020, 08:41:01 am »

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

  • Beginner
  • *
  • Posts: 15
  • A beginner
Re: Can't add to cart child variants in category view
« Reply #1 on: November 18, 2020, 11:36:46 am »
UPDATE : Now it don't redirect, but no changes in product and no add to cart button....

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3136
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Can't add to cart child variants in category view
« Reply #2 on: November 18, 2020, 13:01:26 pm »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27950
  • Always on vacation
    • Jenkin Hill Internet
Re: Can't add to cart child variants in category view
« Reply #3 on: November 18, 2020, 15:35:02 pm »
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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart 3.8.7 10374 on Joomla 3.9.23 PHP 7.4.12

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9901
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Can't add to cart child variants in category view
« Reply #4 on: November 18, 2020, 17:45:14 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 812
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Can't add to cart child variants in category view
« Reply #5 on: November 18, 2020, 18:47:12 pm »
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 from products, orders and database table
Virtuemart Email Manager - customs email templates

Ferran

  • Beginner
  • *
  • Posts: 15
  • A beginner
Re: Can't add to cart child variants in category view
« Reply #6 on: November 19, 2020, 09:58:58 am »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9901
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Can't add to cart child variants in category view
« Reply #7 on: November 19, 2020, 11:02:57 am »
do u mean this setting?

vmadmin-config->template->Use ajax for category content
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Ferran

  • Beginner
  • *
  • Posts: 15
  • A beginner
Re: Can't add to cart child variants in category view
« Reply #8 on: November 19, 2020, 18:18:51 pm »
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.