VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: ironlion37 on March 15, 2013, 23:32:39 PM

Title: [Solved] VM 2.0.20b Upgrade Breaks Add to Cart Button
Post by: ironlion37 on March 15, 2013, 23:32:39 PM
Just upgraded to 2.0.20a and all  the add to cart buttons stopped working:

http://www.jesseheath-artist.com/paintings/capture/capture-medium-detail




Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: Minh BlackRed on March 16, 2013, 10:49:35 AM
But I can see the button. Seem that you has just found the problem?
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: pdreus on March 16, 2013, 13:21:29 PM
aT MY SITE WWW.FISHOME.NL THE BUTTON CALLS THE MESSAGE "ACCEPT DELEVERY RULES" BUT THAT BUTTON NO LONGER IS VISIBLE AFTER UPGRADE. WHAT CAN THAT BE?
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: jcmanc on March 17, 2013, 09:23:25 AM
After the upgrade to 2.0.20a I have the same issue.

When users hit the "Checkout" button the following message appears:

"Please accept the terms of service to confirm"

yet there is no checkbox or label.

In the backend admin I have these set to appear yet they don't, meaning the user cannot continue to checkout
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: bfrylinck on March 17, 2013, 10:09:32 AM
I had the same problem.  I installed the JQuery Easy plugin and that solved it.
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: ironlion37 on March 17, 2013, 23:03:01 PM
Can I please get some help with this? The add to cart buttons are not working in virtuemart!!!! Another words, You press the add to cart button and nothing happens. This just started happening with the new upgrade:

http://www.jesseheath-artist.com/paintings/wait/wait-poster-detail

Thank you.
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: jenkinhill on March 17, 2013, 23:44:05 PM
@ironlion37  the site threw up this error for me:
Fatal error: require_once() [function.require]: Failed opening required '/home/content/31/10255631/html/jesse/libraries/rokcommon/RokCommon/ClassLoader.php' (include_path='.:/usr/local/php5_3/lib/php') in /home/content/31/10255631/html/jesse/libraries/rokcommon/include.php on line 36

Something to do with RT's rokcommon library.

Can you try your VM just using the Beez 20 template
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: perfcomp on March 20, 2013, 00:31:27 AM
Joomla core 2.5.9. Upgraded VM today to 2.0.20b and it broke my add to cart button as described by other posters.  Switched to Beez20, no joy.  Installed jQuery Easy, no joy.  Switched jQuery settings ad infinitum, every possible variation of google jquery and Virtuemart jQuery no joy.

ideas?
live site store: https://www.airgunstocks.com/shop/composite-stocks.html

thank you,
Michael
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: jenkinhill on March 20, 2013, 09:47:24 AM
@perfcomp I just looked - you are not loading jQuery so unable to test.
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: perfcomp on March 20, 2013, 15:11:42 PM
If my site is not loading jQuery, how do I go about making it do so?  It used to.... Here's the admin logins if you'd be willing to take a look for me:
admin
12345

thank you for your help!
Michael
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: jenkinhill on March 20, 2013, 17:15:58 PM
VM configuration/templates under "Activate Css Styles & Javascripts" Select all scripts should work.
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: perfcomp on March 20, 2013, 17:56:03 PM
That is how it's been set:


Using the VirtueMart CSS   yes
Using the VirtueMart jQuery no   
Using the product Scripts   yes
Using the Script ajax Countries / Regions   yes
Use external google jQuery library   yes
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: jenkinhill on March 20, 2013, 19:36:39 PM
Turn on Using the VirtueMart jQuery  - your site is not loading jQ from Google possibly as you are using https so this is the best way to go.
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: perfcomp on March 20, 2013, 20:01:22 PM
Thank you.  That didn't work either, but by turning off both Google jQuery and VMjQuery, and turning on the jQuery Easy, that seems to work.
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: perfcomp on March 20, 2013, 20:13:13 PM
Well it worked once.  I went back to work configuring my products, tried again, and no work.  The button was working, but the price didn't show in the cart (and the cart acted as if no product had been added).  then a few minutes ago as I reported, it worked correctly.  Now the button does nothing. 
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: ironlion37 on March 20, 2013, 22:24:10 PM
Quote from: jenkinhill on March 17, 2013, 23:44:05 PM
@ironlion37  the site threw up this error for me:
Fatal error: require_once() [function.require]: Failed opening required '/home/content/31/10255631/html/jesse/libraries/rokcommon/RokCommon/ClassLoader.php' (include_path='.:/usr/local/php5_3/lib/php') in /home/content/31/10255631/html/jesse/libraries/rokcommon/include.php on line 36

Something to do with RT's rokcommon library.

Can you try your VM just using the Beez 20 template

Hi, thank you. I've enabled the Beez template and disabled the rokcommon plugin, cleared site and browser caches and the add to cart button is still not working:

http://www.jesseheath-artist.com/paintings/capture/capture-large-detail

Again, this problem just started with the 2.0.20a upgrade.

Also, as a side note, is there any way in this forum to be notified via email that a post has been replied to?
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: jenkinhill on March 20, 2013, 22:44:29 PM
@perfcomp it worked then stopped? That is the worst sort of thing to work out. Try using Beez20 to strip out possible template issues
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: perfcomp on March 21, 2013, 06:49:57 AM
I messed around with the settings again, doing nothing really different, but it's working again with VMjQuery library selected.  Thanks for your help. 
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: jenkinhill on March 21, 2013, 10:24:23 AM
Quote from: ironlion37 on March 20, 2013, 22:24:10 PM
Also, as a side note, is there any way in this forum to be notified via email that a post has been replied to?

Profile/Modify profile/notifications
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: ironlion37 on March 21, 2013, 22:31:26 PM
Thanks for the tip Kelvin. Back to the main issue (I was the one that started this thread).


QuoteHi, thank you. I've enabled the Beez template and disabled the rokcommon plugin, cleared site and browser caches and the add to cart button is still not working:

http://www.jesseheath-artist.com/paintings/capture/capture-large-detail

Again, this problem just started with the 2.0.20a upgrade.

[Update]
With Beez template enabled, Add to cart is working in Chrome and IE, but not Firefox.
Switched back to RT template, same thing; Add to cart is working in Chrome and IE, but not Firefox. In fact Add to cart takes user to checkout page (odd behavior). I tried restarting firefox with addons disabled. No change.
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: PRO on March 22, 2013, 02:05:32 AM
Try the  modal pop up add to cart. Turn it on in configuration
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: madamsplash on March 24, 2013, 11:48:36 AM
Hello - I've had the same issue - but I find if I disable Shop Licious - Virtuemart works fine  (it just looks blerdy awful) ...

hotdiva.com.au  (with Shoplicious)  tigerragfashions.com (disabled)  I've notified Shoplicious and will post if they have an answer.

Ugrade also reverted some of the standard shop images - but can't understand how an upgrade would kill off the html over-ride ...

I've known RS Firewall to reverse upgrades if not deactivated - does nasty things to js ...  but don't think that has happened this time.

Can you tell me what I need to tweak to make it work again ...
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button Solved
Post by: madamsplash on March 24, 2013, 14:35:01 PM
Must have been a bug in the upload -

I carefully disconnected all the firewalls and reloaded upgrade 18 then 20b again  (just doing 20b didn't cut it)   - and voila it all works again.

I turned off a few things - e.g. Joomla Plugin - but I don't think this really matters ..

I believe I did not properly disengage the RS Firewall when I did the 18 upgrade ... so there you have it

::)
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: madamsplash on March 24, 2013, 14:47:11 PM
Nope Scratch that - only reloading  Upgrade18 works - 20b did not take after all ... back to the original problem - no check possible for terms and conditions
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: PRO on March 26, 2013, 01:21:30 AM
madamsplash
why not just try disbling

views/productdetails/tmpl/default_addtocart.php

.20 added a new feature

quantity steps.

There is a chance that is all it is
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: PRO on March 26, 2013, 01:39:07 AM
here is the new code for the addtocartform

after this


defined('_JEXEC') or die('Restricted access');

add this

if (isset($this->product->step_order_level))
   $step=$this->product->step_order_level;
else
   $step=1;
if($step==0)
   $step=1;
$alert=JText::sprintf ('COM_VIRTUEMART_WRONG_AMOUNT_ADDED', $step);

BEFORE this

?>


then


after this
   <div class="addtocart-bar">


add this

<script type="text/javascript">
      function check(obj) {
      // use the modulus operator '%' to see if there is a remainder
      remainder=obj.value % <?php echo $step?>;
      quantity=obj.value;
      if (remainder  != 0) {
         alert('<?php echo $alert?>!');
         obj.value = quantity-remainder;
         return false;
         }
      return true;
      }
</script>


Then

this is the new quantity box code

<span class="quantity-box">
      <input type="text" class="quantity-input js-recalculate" name="quantity[]" onblur="check(this);" value="<?php if (isset($this->product->step_order_level) && (int)$this->product->step_order_level > 0) {
         echo $this->product->step_order_level;
      } else if(!empty($this->product->min_order_level)){
         echo $this->product->min_order_level;
      }else {
         echo '1';
      } ?>"/>
       </span>
            <span class="quantity-controls js-recalculate">
      <input type="button" class="quantity-controls quantity-plus"/>
      <input type="button" class="quantity-controls quantity-minus"/>
       </span>
            <?php // Display the quantity box END ?>
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button due to TOS
Post by: MrBim on March 26, 2013, 21:24:33 PM
And another one bites the dust. Same story here, clicking the button to proceed to checkout gives the message that we should accept the TOS first.

I seem to have found a method to get it to work, but it doesn't feel very stable...
- Installed JQuery Easy and enabled the plugin in Joomla Back End (at the choice "enable JQuery" I choose "JQuery", did not change anything else).
- Disabled the Google JQuery at VM Configuration --> Templates --> CSS and Java scripts (left the VM Query enabled)
- Changed whole site to Beez20 template
- Purchased product and was able to proceed to checkout
- Changed whole site back to home made template and was also able to proceed to check out.

The whole JQuery Easy thing did not work before the template switching, but did have effect after the template switching.
- Disabling the JQuery Easy plugin after the template switching sets me back at the start of the story: unable to proceed to checkout because of TOS.

We use Artisteer for our how brew templates.

Can anyone re-produce this method?
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: PRO on March 26, 2013, 22:36:55 PM
Quote from: MrBim on March 26, 2013, 21:24:33 PM
And another one bites the dust. Same story here, clicking the button to proceed to checkout gives the message that we should accept the TOS first.

I seem to have found a method to get it to work, but it doesn't feel very stable...
- Installed JQuery Easy and enabled the plugin in Joomla Back End (at the choice "enable JQuery" I choose "JQuery", did not change anything else).
- Disabled the Google JQuery at VM Configuration --> Templates --> CSS and Java scripts (left the VM Query enabled)
- Changed whole site to Beez20 template
- Purchased product and was able to proceed to checkout
- Changed whole site back to home made template and was also able to proceed to check out.

The whole JQuery Easy thing did not work before the template switching, but did have effect after the template switching.
- Disabling the JQuery Easy plugin after the template switching sets me back at the start of the story: unable to proceed to checkout because of TOS.

We use Artisteer for our how brew templates.

Can anyone re-produce this method?

you can bypass it


views/user/edit_address.php
after this
<input type="hidden" name="address_type" value="<?php echo $this->address_type; ?>" />
add this


<?php if (JRequest::getVar('addrtype')=='BT')   { echo '<input type="hidden" name="agreed" value="1" />';}?>
Title: Re: VM 2.0.20a Upgrade Breaks Add to Cart Button
Post by: ironlion37 on April 01, 2013, 20:15:38 PM
Quote from: PRO on March 22, 2013, 02:05:32 AM
Try the  modal pop up add to cart. Turn it on in configuration

It's on. Still can't add to cart in Firefox! This is template independent - happening regardless of template. Really need some help to get this fixed. To state again: just started happening with 2.0.2b upgrade.
Title: Re: VM 2.0.20b Upgrade Breaks Add to Cart Button
Post by: AH on April 02, 2013, 00:38:29 AM
Assuming that all of you having this problem, updated in a test server and tested before committing to live.

Of course, unless you knew what changed in the release, it would be difficult to test,
Title: Re: VM 2.0.20b Upgrade Breaks Add to Cart Button
Post by: jenkinhill on April 02, 2013, 11:37:34 AM
Ironlion add to cart does not work in IE10 either, where the new advanced debugger throws up these errors:

HTML1524: Invalid DOCTYPE. The shortest valid doctype is "<!DOCTYPE html>".
capture-medium-detail, line 1 character 1
HTML1423: Malformed start tag. Attributes should be separated by whitespace.
capture-medium-detail, line 347 character 67
HTML1409: Invalid attribute name character. Attribute names should not contain ("),('),(<), or (=).
capture-medium-detail, line 347 character 74
HTML1409: Invalid attribute name character. Attribute names should not contain ("),('),(<), or (=).
capture-medium-detail, line 347 character 75
SEC7118: XMLHttpRequest for http://jesseheath-artist.com/index.php?option=com_virtuemart&nosef=1&view=productdetails&task=recalculate&virtuemart_product_id=14&format=json&quantity%3D1%26quantity%255B%255D%3D2%26option%3Dcom_virtuemart%26virtuemart_product_id%255B%255D%3D14 required Cross Origin Resource Sharing (CORS).
capture-medium-detail
SEC7120: Origin http://www.jesseheath-artist.com not found in Access-Control-Allow-Origin header.
capture-medium-detail
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.

capture-medium-detail
SEC7118: XMLHttpRequest for http://jesseheath-artist.com/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&quantity%3D1%26quantity%255B%255D%3D2%26option%3Dcom_virtuemart%26view%3Dcart%26virtuemart_product_id%255B%255D%3D14&_=1364894222862 required Cross Origin Resource Sharing (CORS).
capture-medium-detail
SEC7120: Origin http://www.jesseheath-artist.com not found in Access-Control-Allow-Origin header.
capture-medium-detail
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
capture-medium-detail

So the host is blocking Cross Origin Resource Sharing (CORS) and preventing add to cart from working in IE10, and this will also affect Firefox. I see you are on Godaddy so I'd suspect you are also using CloudFlare - have a look at http://forum.virtuemart.net/index.php?topic=114127.msg384886#msg384886

Basically the "fix" is either to not use the plugin, or to ensure www. urls and turn off the server cache.

Title: Re: VM 2.0.20b Upgrade Breaks Add to Cart Button
Post by: ironlion37 on April 11, 2013, 01:45:50 AM
Quote from: jenkinhill on April 02, 2013, 11:37:34 AM
Ironlion add to cart does not work in IE10 either, where the new advanced debugger throws up these errors:

HTML1524: Invalid DOCTYPE. The shortest valid doctype is "<!DOCTYPE html>".
capture-medium-detail, line 1 character 1
HTML1423: Malformed start tag. Attributes should be separated by whitespace.
capture-medium-detail, line 347 character 67
HTML1409: Invalid attribute name character. Attribute names should not contain ("),('),(<), or (=).
capture-medium-detail, line 347 character 74
HTML1409: Invalid attribute name character. Attribute names should not contain ("),('),(<), or (=).
capture-medium-detail, line 347 character 75
SEC7118: XMLHttpRequest for http://jesseheath-artist.com/index.php?option=com_virtuemart&nosef=1&view=productdetails&task=recalculate&virtuemart_product_id=14&format=json&quantity%3D1%26quantity%255B%255D%3D2%26option%3Dcom_virtuemart%26virtuemart_product_id%255B%255D%3D14 required Cross Origin Resource Sharing (CORS).
capture-medium-detail
SEC7120: Origin http://www.jesseheath-artist.com not found in Access-Control-Allow-Origin header.
capture-medium-detail
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.

capture-medium-detail
SEC7118: XMLHttpRequest for http://jesseheath-artist.com/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&quantity%3D1%26quantity%255B%255D%3D2%26option%3Dcom_virtuemart%26view%3Dcart%26virtuemart_product_id%255B%255D%3D14&_=1364894222862 required Cross Origin Resource Sharing (CORS).
capture-medium-detail
SEC7120: Origin http://www.jesseheath-artist.com not found in Access-Control-Allow-Origin header.
capture-medium-detail
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
capture-medium-detail

So the host is blocking Cross Origin Resource Sharing (CORS) and preventing add to cart from working in IE10, and this will also affect Firefox. I see you are on Godaddy so I'd suspect you are also using CloudFlare - have a look at http://forum.virtuemart.net/index.php?topic=114127.msg384886#msg384886

Basically the "fix" is either to not use the plugin, or to ensure www. urls and turn off the server cache.

Thank you Jenkhill. I talked with GoDaddy and they assured me they are not blocking CORS. I'm not using CloudFlare and server caching is turned off.

Just in case they had me install this xml file in the root (crossdomain.xml):
<?xml version="1.0" encoding="utf-8"?>

<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-access-from domain="*"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>

and using this jquery .ajax() function worked.

$.ajax({
url: 'http://www.jesseheath-artist.com',
type: 'GET',
async: false,
data: {},
crossDomain: true,
//dataType: 'jsonp',
success: function(data) {
alert(data);
},
error: function(xhr, testStatus, error) {
alert('Error n' + error + 'n Status: ' + testStatus + 'n xhr:' + xhr);
}
});


Any more thoughts?

And perhaps a better question: is it possible to roll back to 2.0.18?
Title: Re: VM 2.0.20b Upgrade Breaks Add to Cart Button
Post by: ironlion37 on April 12, 2013, 19:43:14 PM
Jenkhill,

I have set up a fresh install of Virtuemart 2.0.18a. It is hosted on GoDaddy also:

http://www.thecrystalcache.com/newsite/index.php/test-category/test-product-detail

You'll note that on this installation, you can add the test product to the cart in Firefox (and I assume IE 10). This confirms that the break in 2.0.20b is indeed limited to the Virtuemart software. As I stated in the beginning on the www.Jesseheath-artist.com site, the problem only appeared after upgrading virtuemart to 2.0.20b.

Since I have the two versions up for testing, how can I help diagnose this problem so it can be fixed for the next release?

Thank you.




Title: Re: VM 2.0.20b Upgrade Breaks Add to Cart Button
Post by: Joseph Kwan on April 12, 2013, 20:51:27 PM
Look like there is a mix of domains on the page: some domain has www and some does not. This will cause javascript to post the add to cart data to a wrong session.
Make sure the domains set everywhere are the same, either with or without www. I've tested the site with http://jesseheath-artist.com without problem while accessing the site http://www.jesseheath-artist.com will not add product to cart.


Title: Re: VM 2.0.20b Upgrade Breaks Add to Cart Button
Post by: ironlion37 on April 12, 2013, 22:20:56 PM
Quote from: Joseph Kwan on April 12, 2013, 20:51:27 PM
Look like there is a mix of domains on the page: some domain has www and some does not. This will cause javascript to post the add to cart data to a wrong session.
Make sure the domains set everywhere are the same, either with or without www. I've tested the site with http://jesseheath-artist.com without problem while accessing the site http://www.jesseheath-artist.com will not add product to cart.

THANK YOU JOSEPH!

Made sure "URL" field under Shop >Vendor Information and public $live_site = in configuration.php both contained www and that fixed the problem.
Title: Re: [Solved] VM 2.0.20b Upgrade Breaks Add to Cart Button
Post by: tmdonovan on June 03, 2013, 22:32:19 PM
I have the same problem - when using domain.com instead of www.domain.com, add to cart popup doesn't display in some browsers.  It works fine for www.domain.com.

I checked the URL in Shop/Vendor Information and it is http://www.domain.com.  $live_site joomla variable is also http://www.domain.com.  Why does this not work?  BTW, I am on VM 2.0.21b.

Thanks for your help.
Title: Re: [Solved] VM 2.0.20b Upgrade Breaks Add to Cart Button
Post by: Joseph Kwan on June 03, 2013, 22:37:28 PM
Search through the page source to see if there are mixed domains. Or post a samples site url for checking.