News:

Support the VirtueMart project and become a member

Main Menu

State dropdown or add to cart

Started by zprint, December 29, 2017, 08:00:12 AM

Previous topic - Next topic

zprint

I'm having a problem with a site using a JoomlaShine V2 template and VirtueMart.

I'm only shipping in the US. In the user details form, once US is selected, the state dropdown does not populate with states.
If I turn off "javascript compression" in the JoomlaShine template, the states populate fine, but the "add to cart" function no longer works.

There is an option to exclude individual files from the javascript compression, but I have not yet found a file that to exclude that fixes this problem.


GJC Web Design

This question should be directed to the people that sold you the template
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

zprint

This question has been directed to the people who sold me the template.

I was, however, hoping to gain some insights from people who work every day with VirtueMart.

Can anyone possibly tell me which file(s) is responsible for populating the US state drop down list in the registration area?

Any help is much appreciated.

jenkinhill

That would normally be a version of chosen.js but the function of that script depends on the relevant jQuery being loaded before. It is almost always best not to use js compression, or to exclude all VM js files from being compressed.
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

zprint

Thank you for your response, Kelvyn.

What I'm finding is with js un-compressed, the states populate, but the "add to cart" function ceases to work.

Kind of between a rock and a hard place: customers can either add a product to their cart, or they can successfully add their state to their profile, but no both!

jenkinhill

Then you have another issue, probably also with with your template.
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

1st check that everything is working with the std templates..  protostar

if so then check for JS errors on your template in the browser tools -  is the templater not providing any support for this problem?
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

zprint

Kelvyn-

Yes- it is a problem with the template, but in order to keep everything in the template operable, I have to sacrifice the "state" drop down in the Virturemart registration.

I've found that disabling the js compression fixes the US state drop down list, but breaks both "add to cart" and another Joomlashine component, "Image Show".

If I alter the VM "add to cart" function to skip the pop-up window, I can successfully turn off the js compression, and still be able to add products to the cart.

But!!! The the Joomlashine image show component breaks.

I understand well that I should be getting help from Joomlashine for this, but I'm at a place in time that this site needs to go live, and their tech help is off probably until Tuesday.

The only thing that breaks with js compressed by the Joomlashine template is the VirtueMart US state drop down in the cart/registration area.

I apologize that my knowledge of jquery and js is lacking, but that's where I'm at.

It appears in the Joomlashine template that I can exclude files from js compression, so I'm hoping that maybe that might be a solution.
Try as I might, however, I cannot find the VirtueMart file that might fix this problem if I exclude from the template's js compression.

I've been doing this for some time now, but my code knowledge has some big holes in it. Any help is much appreciated.

Chris

jenkinhill

Probably best to exclude all VM js files from compression. If you check the page source code with compression turned off then you can see h=what VM js files are being loaded. Alternatively look in the components/com_virtuemart/assets/js direcctory on the server to see the full list of scripts VM may use.

You should also check the settings in VM Configuration/Templates/Activate Css Styles & Javascripts  - I usually select all options except the last one (external jQuery).
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

exclude the VM JS files

basically all in components\com_virtuemart\assets\js\

vmsite.js  handles the states

vmprices.js the add to cart etc
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

zprint

Thank you for the information and suggestions, guys.

After trying a bunch of things, I tried disabling jquery easy, where I had previously excluded a line of code regarding the state dropdown.

Excluding it had previously made it work; after a few updates, apparently it broke it.

After disabling the plug in all worked as intended.

Studio 42

Try to not use plugin that modify the javascripts, this most time break your site(a day).