Add to cart button not working

ThemeBurn SupportForumsOpenCart ThemesShoppica 2 OpenCart ThemeAdd to cart button not working

This topic has been marked as not resolved.

Hi,

The add to cart button on my site does not work sometimes. I click on it but it doesnt go to the product page.
I have to clear my browser’s cache for it to work again. After a few refreshes to the site, it stops working.

I’m running OC Version 2.3.0.2 and BurnEngine v1.2.6.
My site url is http://www.matawear.com

On the General Cache i have the following settings:
Javascript _ ON
CSS _ ON
Configuration _ OFF
Menu _ ON

Looking forward for your help as i’ll be launching my site soon.

 evilfx
December 16, 2017 at 8:03 pm #62877

…also, could you please inform me how i can get bigger “buy now” buttons on the slider?
I am using “btn btn-lg” already

 evilfx
December 17, 2017 at 2:13 am #62879

Hi,

We’ve inspected your website and we’ve never had any problems with adding products to the cart. Should we follow any specific steps?

About button size in the slider – unfortunately there are no different button sizes due to the slider auto resize function. You can use some custom CSS to manually enlarge big buttons:

.mSCaption .btn-lg.btn-lg {
    line-height: 1.75em !important;
}

Add these styles from the Theme CP > Theme Settings > Custom > Custom Stylesheet text field.

BR,
ThemeBurn team

January 4, 2018 at 4:08 pm #63013

-edit-
jump to the reply below

  • This reply was modified 2301 days ago by  evilfx.
 evilfx
January 4, 2018 at 11:03 pm #63042

Hi, i think i just discovered what triggers this.
If i login to my admin panel, the add to cart button stops working. if i clear my browser’s cache it will start working again.

could you please try it as well?

Credentials:

  • This reply was modified 2301 days ago by  evilfx.
 evilfx
January 4, 2018 at 11:20 pm #63045

Also, if you could check the error log, i’m getting alot of these events:

2018-01-04 21:17:39 – PHP Notice: Undefined variable: page in /home/battlefi/public_html/matawear.com/vqmod/vqcache/vq2-catalog_view_theme_BurnEngine_template_product_special.tpl on line 145

This seems to be related as line 145 of this file is Add to Cart button related:

<a class="<?php echo $cart_button_classes; ?>" href="javascript:;" onclick="ga('send', 'event', '<?php echo $page; ?>', 'Add to Cart', '<?php echo $product['name']; ?>'); cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');">

  • This reply was modified 2301 days ago by  evilfx.
  • This reply was modified 2301 days ago by  evilfx.
 evilfx
January 4, 2018 at 11:27 pm #63046

Hi,

Where did this code come from:

ga('send', 'event', '<?php echo $page; ?>', 'Add to Cart', '<?php echo $product['name']; ?>'); 

The <?php echo $page; ?> variable is not defined and thus breaks the click event that is used to redirect the user to the product page.

BR,
ThemeBurn team

January 4, 2018 at 11:44 pm #63052

I wouldn’t know. I never touched that file. Could it be that some other file wrote that in that file?
Should i remove that code and upload the file again?

  • This reply was modified 2301 days ago by  evilfx.
 evilfx
January 5, 2018 at 12:19 am #63053

Hi,

On a second look this most likely comes from a vqmodification. We could take a look but will need ftp access.

BR,
ThemeBurn team

January 5, 2018 at 9:02 am #63055

I appreciate it, thank you. Here are the FTP credentials:

 evilfx
January 5, 2018 at 12:13 pm #63057

Hi,

We’ve examined your case and found the following:

- The problem is caused by a vqmod called google_analytics_expert.xml
- There was an incompatibility between BurnEngine and the vqmod which we’ve fixed – there are no more undefined errors in your Add to cart button actions
- There is still a problem when you click on the add to cart button – call to non defined ga JS function – probably this is due to non activated Google Analytics code – the same problem exists with the default theme too

Most likely, the problem will disappear when you active Google Analytics

BR,
ThemeBurn team

January 5, 2018 at 4:18 pm #63059

Hi,

Thanks for checking this. The Google Analytics extension is active and set up.
Could you check this again please?

Thanks

 evilfx
January 5, 2018 at 4:24 pm #63060

Hi,

The GA extension is active, but there is no GA code in the site source. We’ve switched to the default theme for a while and the GA code is missing there as well.

BR,
ThemeBurn team

January 5, 2018 at 4:36 pm #63062

Hi, the GA has been working fine, i get events on Google Analytics admin.
I think this was because the “Track Admin Visits” on the GA Expert module was disabled. I chose “Track” and the code is showing to admin’s now and the Add to Cart is working now, apparently.
Could you check if i’m right?

edit: they seem to have a new version (can’t download it right now). should i install it?

Thanks

  • This reply was modified 2300 days ago by  evilfx.
 evilfx
January 5, 2018 at 4:52 pm #63063

Hi,

We see now there are no errors when adding a product in the cart (or redirecting to the product page). The GA code is inserted in the source as well, so we assume everything is OK.

Not sure if you need to install the latest version – we have no experience with the plugin you are using.

BR,
ThemeBurn team

January 7, 2018 at 5:40 pm #63071
Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.