Post by AllenFreeman » Sat Jul 07, 2018 1:45 am

About two hours ago, the site owner at https://adasignfactory.com called to tell me the Add to Cart buttons don't function in his OpenCart 3.0.2.0 store. When the Add to Cart buttons are clicked on a product page, nothing happens.

I tested this myself in three different browsers, and he is correct. It's not an options issue, as one product has no options and that can't be added to the cart either.

No changes have been made to the site in about a week, and many orders have been received since that change (the addition of the Cleantalk anti-spam extension, who I'm contacting too).

Others have called the site owner complaining of the same buttons issue. But even more bizarre, an order came in from a customer in CA just a few minutes ago -- even though none of us testing this can still add anything to the cart.

Any ideas what this might be? Thank you!

New member

Posts

Joined
Tue Feb 20, 2018 10:18 pm

Post by straightlight » Sat Jul 07, 2018 2:00 am

Uncaught TypeError: Cannot set property 'value' of null
at WHEELCHAIR-ACCESSIBLE-NY-CT:323
When using the developers tools on any product page. Switch back to the default theme and see if the same issue can be reproduced when using the add-to-cart button.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by AllenFreeman » Sat Jul 07, 2018 2:08 am

Thank you for the reply straightlight. This store is using the default theme, with no other themes installed.

If I'm seeing correctly, this is the issue you highlight?

var date = new Date(); document.getElementById("ct_checkjs").value = date.getFullYear();

SCRIPT5007: Unable to set property 'value' of undefined or null reference

New member

Posts

Joined
Tue Feb 20, 2018 10:18 pm

Post by straightlight » Sat Jul 07, 2018 2:25 am

If so, then the default theme has been modified and should not have been but rather use a custom theme in order to troubleshoot any issues a custom theme may encounter vs. the default theme. As for the described error, I would start by fixing this error message.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by AllenFreeman » Sat Jul 07, 2018 2:33 am

I don't believe I edited the theme other than to use css.

Of course there are some extensions enabled, but none related to the theme as best as I remember.

I don't know how to correct the issue causing the error message.

But most odd of all, why might this issue suddenly appear today, after a significant amount of time?

New member

Posts

Joined
Tue Feb 20, 2018 10:18 pm

Post by straightlight » Sat Jul 07, 2018 2:37 am

Some of the installed extensions may rely on the use of APIs. I would suggest to disable the extensions one-by-one after setting your store on maintenance mode until rectifying the issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by IP_CAM » Sat Jul 07, 2018 5:13 am

https://adasignfactory.com/
https://adasignfactory.com/ocart2/
Are you sure, that this DUAL way of linking a Shop,
done probably by use of .htaccess, cannot have
negative consequences on script-related functions ?
Just a guess ... 8)
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by AllenFreeman » Sat Jul 07, 2018 5:39 am

Thx for the reply Ernie. I don't discount your idea on the dual setup of my urls.

I've emailed the Advanced Product Options extension developer (https://www.opencart.com/index.php?rout ... n_id=33162) as I think it is his coding that might call the erroring javascript.

Here is the start of my current ROOT htaccess (I see another different htaccess in ocart2) if you have any suggestions (there are a bunch of redirects for an old site below that, plus some pagespeed fixes):

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php71” package as the default “PHP” programming language.
<IfModule mime_module>
AddType application/x-httpd-php .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?adasignfactory.com$
RewriteCond %{REQUEST_URI} !^/ocart2/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /ocart2/$1
RewriteCond %{HTTP_HOST} ^(www.)?adasignfactory.com$
RewriteRule ^(/)?$ ocart2/index.php [L]
</IfModule>

New member

Posts

Joined
Tue Feb 20, 2018 10:18 pm

Post by IP_CAM » Sat Jul 07, 2018 7:55 am

Well, I am very unsure, what effect this has on OC ???

Code: Select all

RewriteCond %{HTTP_HOST} ^(www.)?adasignfactory.com$
RewriteCond %{REQUEST_URI} !^/ocart2/
I would temporarely remove everything, exept for:

Code: Select all

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php71” package as the default “PHP” programming language.
<IfModule mime_module>
AddType application/x-httpd-php .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
out of the ROOT .htaccess File, and make sure, that the
RewriteBase Line in the ocart2/ Directory .htaccess looks like this:
RewriteBase /ocart2/
and then, try again. And if still does not work, remove the ROOT
.htaccess File, to so switch back to PHP 5.6x, then, try it out again.
And if a similar PHP7 Configuration also exists in the ocart2
directory .htaccess file already, you might remove the ROOT .htaccess, without
reworking it first. And if it still does not function, remove the PHP7 Content
from the ocart2 .htaccess also, and try again, just to make sure! ;)
Ernie
Just keep Copies, for just in Case ! :D
...

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by AllenFreeman » Sat Jul 07, 2018 9:05 am

Thank you Ernie. The htaccess file in the opencart folder does have the rewrite base you reference:

RewriteBase /ocart2/
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://%{HTTP_HOST}? [R=301,L]

I'll try out some of the things you suggest while waiting for a reply from the Advanced Products Options extension guy...

New member

Posts

Joined
Tue Feb 20, 2018 10:18 pm

Post by AllenFreeman » Sat Jul 07, 2018 7:10 pm

Just to resolve this thread, the issue was the anti-spam extension CleanTalk conflicting with the Advanced Product Options extension.

Cleantalk admitted that they are struggling with Opencart and other extensions.

I appreciate the advice offered and will further review the htaccess suggestions from Ernie!

New member

Posts

Joined
Tue Feb 20, 2018 10:18 pm

Post by AllenFreeman » Wed Jul 11, 2018 7:37 pm

Final update, Cleantalk has updated their extension and has resolved the described problem. Their 1.5x version works correctly to block spam registrations while leaving the Add to Cart buttons and the rest of the page functionality intact.

New member

Posts

Joined
Tue Feb 20, 2018 10:18 pm
Who is online

Users browsing this forum: nonnedelectari and 410 guests