News:

Support the VirtueMart project and become a member

Main Menu

(yet another) products don't add to cart

Started by guzabi, February 21, 2012, 19:41:26 PM

Previous topic - Next topic

guzabi

Hi there,

I've got another JQuery-related problem where products can't be added to cart.
I'm using Joomla! 2.5.1, Virtuemart 2.0.1N (dev) and it clonflicts with JQuery in Yootheme's Widgetkit 1.0.1.

I can't disable JQuery in widgetkit (it depends on it to work). I tried to:
- disable google_jquery in cfg file
- disable "use VM JQuery" in config (backend)
- disable product scripts and country/region scripts in config (backend)

And it still doesn't work. My console does not show anything at page load, but upon clicking the "Add to cart" button, I'm redirected to my website's home page with the cart displayed (and empty). At this point the console says "ReferenceError: Can't find variable: jQuery - in facebox.js : 337".

Can anybody help please?
Thanks...

luxuryvps

Are you using google's jquery in joomla settings?

Liam
Liam Studham - Graphical Designer / Server Engineer
http://www.luxuryvps.com
VPS & Dedicated Servers - Discounts available for all VM Forum users (PM me)

guzabi

In *Joomla* settings? Errr... can't figure out what you're talking about.
In Virtuemart, I unchecked the box, though. I can't find any reference to jQuery in Joomla.

I solved the problem the wrong way :
I manually changed the HTML template file.
It's in /components/com_virtuemart/viws/productdetails/tmpl/default_addtocart.php, line 104 :
remove the <noscript> tags around the <input type="hidden" name="task" value="add" /> statement. It works. But I don't like it that way :-(

I'm actually using version 2.0.2 (development) now.
Any idea how I can do better?

maxispin

For me, the cart is not updating if I disable from back end "configuration/Templates/Activate Css Styles & Javascripts: Using the product Scripts"
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

guzabi

Yeah, same for me. If I disable product scripts, clicking on the "add to cart" button just goes to "index.php" because the TASK field is not posted (hence my initiative of removing the <noscript> tag manually.

I had to hack into the same page to make the + and - buttons work for changing quantity, too...
Really, I don't like this. Not only will it be broken after an udpate, but also it's raw, untested coding and really not clean.

If someone from the development team is reading this : could you please that this is a known issue?
Or tell me where I should report this? Thanks...

superbee

OK, I have to agree with softforge....

I'm really frustrated, yes, this is not a problem with either yootheme, or virtuemart....
HOWEVER
the problem exists....

I'm not a designer, or a coder, I'm a customizer like so many else, so I have a limited availability of using an element inspector to try and figure out what is going on with the template vs. virtuemart. What I do know is that I have a few skills when it comes to building sites for my clients, and I have supported both components for years, and I need a solution that works with both, and someone is going to have to give.

I'm posting this in both forums... Please, somebody help, yootheme is a major player... virtuemart is a standard for joomla e-commerce. If they can't play nice, then I either have to find a different e-commerce solution or I have to find another template provider that works with the available e-commerce solutions. I would love it if zoo had it's own shopping cart, but, it doesn't. I spend over $2,000 a year for my template providers, but yootheme is definitely my go to provider... Is there some sort of animosity between YOO and Virtuemart?

Milbo

Quote from: guzabi on February 21, 2012, 19:41:26 PM
- disable google_jquery in cfg file

This is quite useless, because the config is cached in the db.
Quote from: guzabi on February 25, 2012, 13:29:33 PM
remove the <noscript> tags around the <input type="hidden" name="task" value="add" /> statement. It works. But I don't like it that way :-(
...
Any idea how I can do better?
Yes, use a template override, so you do not lose your changes. But I do not really understand why it should work that way. When js is working the task shouldnt be set. I think in your case you should disable

- Virtuemart jQuery
- Use external google jquery library

because it is loaded in your template already.

But enable the
- product scripts
- country/state scripts
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

guzabi

Hi Milbo,

As I explained earlier, if I enable product scripts it does not work.
Reading your post, I gave it another go this morning.

- Restored the default_addtocart.php page
- Joomla config : nothing to mention
- VM config / store : Use jQuery from Google :  UNCHECKED
- VM Config / template Use VM CSS CHECKED, use VM jQuery UNCHECKED, use product scripts CHECKED, use country Ajax script CHECKED

Then empty cache, reload product page... then :

- Quantity buttons don't work
- Add to cart buttons doesn't work
- Click add to cart links to index.php without task and displays empty cart

As I said previously : Joomla 2.5.1, Virtuemart 2.0.2 on a Yootheme template (Big Easy, latest update) with Widgetkit 1.0.1.
I'm nos using a template override, but this is really annoying... :-S

guzabi

Don't know at all if it's related but when I save the config, I see this message (on top of the expected "configuration saved"):
Table updated: Tablename joom_virtuemart_vendors_fr_fr dropped: 0 altered: 2 added: 0