Author Topic: State dropdown or add to cart  (Read 700 times)

zprint

  • Beginner
  • *
  • Posts: 9
  • A beginner
  • VirtueMart Version: VirtueMart 3.2.4 Joomla 3.8.1
State dropdown or add to cart
« on: December 29, 2017, 08:00:12 am »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7780
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: State dropdown or add to cart
« Reply #1 on: December 29, 2017, 10:42:36 am »
This question should be directed to the people that sold you the template
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

zprint

  • Beginner
  • *
  • Posts: 9
  • A beginner
  • VirtueMart Version: VirtueMart 3.2.4 Joomla 3.8.1
Re: State dropdown or add to cart
« Reply #2 on: December 29, 2017, 18:28:54 pm »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26908
  • Always on vacation
    • Jenkin Hill Internet
Re: State dropdown or add to cart
« Reply #3 on: December 29, 2017, 20:00:05 pm »
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

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 VM.3.2.15.9866 on Joomla 3.8.10 PHP 7.0.30

Testing VM.3.2.15.9898 on J3.8.10

zprint

  • Beginner
  • *
  • Posts: 9
  • A beginner
  • VirtueMart Version: VirtueMart 3.2.4 Joomla 3.8.1
Re: State dropdown or add to cart
« Reply #4 on: December 30, 2017, 03:06:29 am »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26908
  • Always on vacation
    • Jenkin Hill Internet
Re: State dropdown or add to cart
« Reply #5 on: December 30, 2017, 11:27:10 am »
Then you have another issue, probably also with with your template.
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 VM.3.2.15.9866 on Joomla 3.8.10 PHP 7.0.30

Testing VM.3.2.15.9898 on J3.8.10

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7780
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: State dropdown or add to cart
« Reply #6 on: December 30, 2017, 11:41:23 am »
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 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

zprint

  • Beginner
  • *
  • Posts: 9
  • A beginner
  • VirtueMart Version: VirtueMart 3.2.4 Joomla 3.8.1
Re: State dropdown or add to cart
« Reply #7 on: December 31, 2017, 08:01:27 am »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26908
  • Always on vacation
    • Jenkin Hill Internet
Re: State dropdown or add to cart
« Reply #8 on: December 31, 2017, 12:16:10 pm »
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

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 VM.3.2.15.9866 on Joomla 3.8.10 PHP 7.0.30

Testing VM.3.2.15.9898 on J3.8.10

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7780
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: State dropdown or add to cart
« Reply #9 on: December 31, 2017, 12:16:49 pm »
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 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

zprint

  • Beginner
  • *
  • Posts: 9
  • A beginner
  • VirtueMart Version: VirtueMart 3.2.4 Joomla 3.8.1
Re: State dropdown or add to cart
« Reply #10 on: January 05, 2018, 08:02:13 am »
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: State dropdown or add to cart
« Reply #11 on: January 06, 2018, 02:23:00 am »
Try to not use plugin that modify the javascripts, this most time break your site(a day).