News:

Support the VirtueMart project and become a member

Main Menu

Cart caching problem

Started by Gipa, February 23, 2013, 17:49:22 PM

Previous topic - Next topic

Gipa

Hi

I use Joomla 2.5.9 and Virtuemart 2.0.18a.
Joomla template is Beez2.

I have a problem with caching of the cart, both in module (VM2s built in cart module) and on the cart page.

If I add something to cart or remove it, it DOES happen. But the cart keeps showing the old "version" without the changes, so I think it is a caching problem.
Of course this is a serious problem for me, as customers will think that nothing has happened...

I went to Global Configuration -> System and turned off caching. I also turned off the System Cache plugin. I haven't been able to find any other places to turn it off.

Any suggestions?


:)     Rie

jjk

Might be a javascript conflict. Please use Firebug (see here: http://forum.virtuemart.net/index.php?topic=102850.0) to find out if your site loads more than one jquery version. You might have i.e. 'Use external google jQuery library' and 'Using the VirtueMart jQuery' enabled in VM configuration and possibly your template loads another jquery version, too.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Gipa

#2
Hi JJK

Thanks so much for your answer and sorry for my late reply. I have been trying to find other solutions, but that doesn't seem to be the way to go either...     ;)

I'm not sure how to use Firebug to debug (I just use it to look at html and css), but if I look at the source code for the page, it seems that jquery is just loaded once.
Maybe you could have a look and see if you can find the error? I'm going insane, so I really hope you can push me in the right direction.

http://butik-unika.dk/promaling.dk


:)    Rie

Gipa

#3
Also I can't login to backend with FF. I just get sent back to the login-page. Works fine in IE...

jjk

As far as I can see you are loading two jquery libraries. The VirtueMart jquery and the Google jquery. I would recommend to disable the Google jquery in VM Configuration > Templates tab > Activate Css Styles & Javascripts - Use external google jQuery library.

Also it looks like the Style switcher in the Beez template is causing a problem. In the cart view Firebug says
TypeError: container is null
.../promaling.dk/templates/beez_20/javascript/md_stylechanger.js
Line 66


But that might be related to the loading of the two different jquery libraries.
Did you hide the 'Add to cart' button text on purpose or is that another problem?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Gipa

Weee! It seems that if I disable the Google jQuery and the cart pop-up, then the problem goes away!    :)
Thank you SO much!

In stead of sending users to the cart page and breaking their shopping flow, I would like to have a "fly-to-cart" effect like in Prestashop (so when you press "Add to cart", you stay on the page and the product briefly seems to fly into the cart). It doesn't have to be really fancy, just something to illustrate that the item is added to the cart. Any idea how I can do that?

The buttons is a css-problem. I copied the vmsite-ltr.css to my Beez-template, but apparently I will need to copy some more css files in order to keep the green background.     ;)

jjk

How to override the file vmsite-ltr.css

This isn't much different from overriding other VirtueMart files. You just have to copy the file into your Joomla template's css folder, i.e.:
yourdomain\templates\yourtemplate\css\vmsite-ltr.css
However, after doing this, the image paths for some VirtueMart images and icons, like for example the background.png for the 'Add to Cart' button are not valid for the new location of vmsite-ltr.css in your template folder. The most simple trick to solve this small problem, is to copy the folder vmgeneral from
yourdomain\components\com_virtuemart\assets\images
into your template's image folder, i.e.:
yourdomain\templates\yourtemplate\images.

After doing this, you should have a working override file, which doesn't become overridden upon each update of VirtueMart 2.




There is a commerical plugin for the "Fly into Cart" effect being advertised here: http://forum.virtuemart.net/index.php?topic=99804.0
And I think this one is free: http://www.joomlack.fr/en/joomla-extensions/vm-addtocart-ck
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Gipa

Hi jjk

Perfect! Thank you so much!!      8)

Do you also know how I can copy /components/com_virtuemart/views/productdetails/view.html.php so it isn't overwritten the next time I update VM2? Where can I place it?


:)     Rie

jjk

If you want to do some changes in the product details view, it's likely that the changes have to be applied to the file
yourdomain\components\com_virtuemart\views\productdetails\tmpl\default.php
The override may be placed in
yourdomain\templates\yourtemplate\html\com_virtuemart\productdetails\default.php
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Gipa

Thanks. I know about the default.php, but one change has to be done in the view.html.php - and since that is placed a level below the tmpl folder, I can't just copy it to the same location as the files in the tmpl folder. I tried - it doesn't work.      ;)