VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Tonimito on March 15, 2016, 12:02:18 PM

Title: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Tonimito on March 15, 2016, 12:02:18 PM
Hello,

When upgrading from VirtueMart 3.0.12 to 3.0.14, the POPUP of Facebox of AddToCart not work. Any solution?

Thank you!
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: jenkinhill on March 15, 2016, 12:34:18 PM
Facebox works OK for me with VM3.0.14 using VM default templates on Protostar. The prefered fancybox also works OK.  Are you using a commercial template or overrides?
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Tonimito on March 15, 2016, 13:02:32 PM
Yes, use the Blank template for http://www.t3-framework.org

I also do an override of cart/padded.php

So far it has worked.

Thank you!
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: milstan on March 16, 2016, 18:20:29 PM
I have the same issue. In my case, this problem is only in NGINX server with URL rewrite enabled. The same VM with same template works fine on Apache server with rewrite enabled.

Regards
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: milstan on March 16, 2016, 18:26:56 PM
This is output from console on NGINX server:

Failed to load resource: the server responded with a status of 404 (Not Found):
http://www.mysite.com/vmfolder/index.php/vmcategory/undefinedindex.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=jsonundefined&Itemid=256
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Milbo on March 16, 2016, 20:17:44 PM
Our demo.virtuemart.net runs also on a nginx with rewrite and so far I know it works (just tested) but we use the fancybox. There is any special reason to use the old facebox?
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Ghost on March 16, 2016, 21:06:51 PM
Undefined usually means no variable has been passed in JS. Can be a JS conflict or template issue. See this in vmprices.js:

url: Virtuemart.vmSiteurl + "index.php?&option=com_virtuemart&view=productdetails&task=recalculate&format=json&nosef=1" + Virtuemart.vmLang,

Probably on your site Virtuemart.vmSiteurl and Virtuemart.vmLang are missing (or you have JS issues) and thus undefined is being added to URL instead.
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Ghost on March 17, 2016, 12:50:13 PM
Also can someone test this:

1. Enable Facebox.
2. Go to product page.
3. Click on ask a question or recommend to a friend.
4. Close the popup.
5. Click on add to cart button on the same page.

I see this error in console: TypeError: jQuery.facebox is not a function
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: milstan on March 17, 2016, 13:16:38 PM
I found a solution, at least for problem on my installation. Whenever I have an issue with VM, I am disabling all overrides and use default Joomla template (Protostar). So, in my case, template was not an issue.

I have two identical VirtueMart installations (all Joomla files and entire db are identical), one on Apache and another of NGINX server.

1. Problem occurs AFTER upgrade to VM 3.0.14.
2. Problem occurs on NGINX server only. On Apache, everything works fine after upgrade.

In VirtueMart configuration "Using the VirtueMart jQuery" was disabled. When I enable it, the problem is gone.

Thanks
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: mcevoli on March 19, 2016, 18:17:22 PM
Hello!

I have the same problem with add to cart button (I have a theme based on T3 framework).
The add to cart button is not working and is redirecting to cart page (without adding anything).
But other modals (I have a quick view plugin) are working.

The strange thing is if I open quick view modal, then I close IT, the add to cart modal button WORKS!

Any idea?
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: AH on March 19, 2016, 18:35:08 PM
mcevoli - check that you do not have any javascript errors
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Tonimito on March 29, 2016, 18:24:55 PM
Hello!
I found the error is in: components/com_virtuemart/assets/js/vmprices.js

There is a change in version 3.0.14 a new variable in Javascript "virtuemart":

3.0.12 VM = window.vmSiteurl
3.0.14 VM = virtuemart.vmSiteurl

I changed file vmprices.js from 3.0.12 and it works, I have compared and only this change on this variable.

Any idea what happens to not recognize the virtuemart.vmSiteurl variable?

Regards!
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Jimmie on April 05, 2016, 08:39:06 AM
Similar problem since update to 3.0.14
When visiting my website with a "fresh" browser (Google, Edge) for the first time in the morning and adding a product in the basket results in a cart page without products. Adding the product a second time is the solution... third, fourth.. no problem. Only the first visit to the site! Anyone?
Joomla 3.5.0
VM 3.0.14
Kind regards, John
gezondehuidwinkel.nl
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Doomas on April 20, 2016, 10:39:41 AM
I have the same problem.

Joomla 3.5.1
Virtuemart: 3.0.16

I found the problem is the "Show cart" link in the "Add to Cart" Pop-up. My customers site runs on https, but the "Show cart" link in the Pop-up points to http://.... . I don't know excatly what happens, but I think the first time you click on the link( non SSL) Joomla creates a new session and therefore it shows you an empty car.

However the Problem is the wrong link. And it should point to https instead of http.

For now I solved the problem with an override of cart/padded.php. Where I hard coded the correct "show cart" link.
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Thomas Kuschel on April 20, 2016, 11:37:32 AM
@Doomas, Tonimito: I started a new topic, maybe this could help with the http:// fail: please test this code at http://forum.virtuemart.net/index.php?topic=133941.0
Thomas
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Doomas on April 20, 2016, 12:11:33 PM
Quote
I found the problem is the "Show cart" link in the "Add to Cart" Pop-up. My customers site runs on https, but the "Show cart" link in the Pop-up points to http://....

Never mind....I found the Problem.
"Enable SSL for sensitive areas (recommended)" in the VM configuration was not enabled.

BUT, in my view it's a very strange behaviour. If your whole site is running over SSL( Forced by the Joomla configuration). The above VM config option should not be allowed to override it back to http, if it is not enabled.

@Thomas Kuschel
Thanks! I did not test your code yet, but it lead my to the correct solution of my problem.
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Thomas Kuschel on April 20, 2016, 12:40:31 PM
The problem is that code at components/com_virtuemart/helpers/vmview.php, possibly it appears more than once in VM:
$scheme = 'http';
if(VmConfig::get('useSSL',false)){
$scheme .='s';
}

A solution: http://forum.virtuemart.net/index.php?topic=133941.0   - With JRoute, it does not change back to http if you're on https. It's better using Joomla core functions then the obove code which implies to have set useSSL=1.
Title: Re: Update VirtueMart 3.0.12 to 3.0.14 - add to cart POPUP Facebox not work
Post by: Milbo on April 20, 2016, 20:37:53 PM
Thank you for pointing that out. I agree a common function would be better.