Skip to main content

Joomla extensions tutorials

Addtocart doesn't work after moving the demo website on the other server?

It is very common problem after moving the demo website on the target server.
While creating your website, most of you are working on the project using the test server or subdomain. After introducing the whole content,usually you make backup of the site that is already finished in order to install the website on the live server.
Then it occur that Add-To-Cart button doesn't work properly - it redirects your current website to the URL you used for testing instead of adding the product to the cart.


What's the problem?

VirtueMart saved the previous demo URL in the configuration file, so you have to enter the correct URL address in this file.

How can you fix that?

Navigate to:  root/administrator/components/com_virtuemart/ and then edit virtuemart.cfg.php file.
Then go to 33 line, where the code starts with the following comment:
// these path and url definitions here are based on the Joomla! Configuration

Now you have to enter your website URL or replace these 2 lines of the code with:

define( 'URL', $mosConfig_live_site.'/' );
define( 'SECUREURL', $mosConfig_live_site.'/' );


Done!