Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Search Page Results - Add to cart not working
Author « Topic »  

xyz1
Advanced Member

United Kingdom
166 Posts

Posted - 10/23/2022 :  09:54:53  
Currently running PHP version 7.5.4 with the GA4 tag details being called from "incectstyle.php" on the various website pages.

Noticed that when using the website search function and then from the search results page using the Quick Buy button, which then displays the Quick Buy pop up window, then the Add to Cart button does not work.

I can see when using Firefox to inspect the page for errors that on the search page once the search button is executed then there is an "Uncaught ReferenceError: gtag is not defined" error against any products that are returned from the search results. The GA4 tag details and Add to Cart buttons are working without problem from the other website pages.

Any ideas what needs changing to get the add to cart function working from the search page results?

Many thanks.

Neil

Edited by - xyz1 on 10/24/2022 01:33:14

Vince
Administrator

42815 Posts

Posted - 10/23/2022 :  14:09:18  
Hi Neil
I've tried on my test site and everything seems to be ok on the search page and the gtag function is defined. I can't see why it would not be on yours so could you send the site FTP login to my email at vince AT ecommercetemplates DOT com and I'll see what is up.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

xyz1
Advanced Member

United Kingdom
166 Posts

Posted - 10/24/2022 :  01:33:40  
Hi Vince,

Many thanks.

FTP details sent.

Neil

Vince
Administrator

42815 Posts

Posted - 10/24/2022 :  03:59:38  
Hi Neil
I see what the problem is and I've fixed it on your site. But this happened because the incectstyle.php page had been included before the other include files on the search page and I'm going to have a think now if there should maybe be some kind of warning if this is the case.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

xyz1
Advanced Member

United Kingdom
166 Posts

Posted - 10/25/2022 :  01:23:13  
Hi Vince,

Many thanks for sorting this out.

I was checking the rest of the site and realised that the same issue was also occurring on the cart.php checkout page where we have "bestsellers chosen by other customers" at the bottom of the page - the Add to Cart button was not working on the list of bestseller products either.

So on the cart.php page I moved the incectstyle.php statement so that it came after the other include files and that has fixed the problem.

We're using a template file in Expression Web for the various website pages so we'll have to make the changes in the template file to ensure that we don't overwrite the changes again going forward.

We didn't have the same issue on the categories.php, products.php and proddetail.php pages since these pages are not updated from the main Expression Web template file and are edited manually and it just so happens that on these pages the incectstyle.php statement has been placed correctly after the other includes files.

Thanks again for your help.

Neil

Vince
Administrator

42815 Posts

Posted - 10/26/2022 :  05:57:49  
Hi Neil
quote:
Thanks again for your help.
My pleasure and I'm glad it's working now.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000