Post by CEMinistries » Fri Jul 24, 2015 10:27 pm

After upgrading to 1.5.6.4 the "Add to Cart" button is not working correctly.

It does not work on the home page, on any browser or computer.

On a Mac with the Safari browser, it doesn't work at all.

There aren't any errors in the log related to this issue.

www.arpbookstore.com

Thanks for the help.

New member

Posts

Joined
Wed Apr 16, 2014 11:17 pm

Post by deepvision » Fri Jul 24, 2015 11:02 pm

Because there is a javascript error, result of a wrong copy&paste:

Code: Select all

<script type="text/javascript"><!--
		$(document).ready(function() {
			<script type="text/javascript">
  (function() {
    var po = document.createElement("script"); po.type = "text/javascript"; po.async = true;
    po.src = "https://apis.google.com/js/plusone.js?publisherid=110186862990706569766";
    var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s);
  })();
</script>		});
//--></script>
It can be changed to something like this

Code: Select all

<script type="text/javascript">
  (function() {
    var po = document.createElement("script"); po.type = "text/javascript"; po.async = true;
    po.src = "https://apis.google.com/js/plusone.js?publisherid=110186862990706569766";
    var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

ImageImageImage


User avatar
Active Member

Posts

Joined
Tue May 19, 2015 1:03 am

Post by CEMinistries » Fri Jul 24, 2015 11:39 pm

Do you know what file that script is located in? Hopefully not every .tpl file that has "add to cart"?

New member

Posts

Joined
Wed Apr 16, 2014 11:17 pm

Post by CEMinistries » Sat Jul 25, 2015 12:21 am

In the header.tpl file, where that script should be located, all I find is this:

Code: Select all

<?php foreach( $helper->getScriptFiles() as $script )  { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>

<?php foreach ($scripts as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>

<?php if( isset($themeConfig['custom_javascript'])  && !empty($themeConfig['custom_javascript']) ){ ?>
	<script type="text/javascript"><!--
		$(document).ready(function() {
			<?php echo html_entity_decode(trim( $themeConfig['custom_javascript']) ); ?>
		});
//--></script>
<?php }	?>
So, I'm not sure where the script is coming from. Any help locating would be great. I've looked in the theme's javascript folder, but it isn't in those files.

New member

Posts

Joined
Wed Apr 16, 2014 11:17 pm

Post by deepvision » Sat Jul 25, 2015 12:26 am

from here:

Code: Select all

$themeConfig['custom_javascript']
It is somewhere in the theme settings.
Try to change it like this

Code: Select all

(function() {
    var po = document.createElement("script"); po.type = "text/javascript"; po.async = true;
    po.src = "https://apis.google.com/js/plusone.js?publisherid=110186862990706569766";
    var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s);
  })();

ImageImageImage


User avatar
Active Member

Posts

Joined
Tue May 19, 2015 1:03 am

Post by CEMinistries » Sat Jul 25, 2015 12:40 am

Changing that made the following error:

Parse error: syntax error, unexpected 'var' (T_VAR) in /home2/bturner/public_html/vqmod/vqcache/vq2-catalog_view_theme_pav_bikestore_template_common_header.tpl on line 112

New member

Posts

Joined
Wed Apr 16, 2014 11:17 pm

Post by IP_CAM » Sat Jul 25, 2015 1:38 am

next time, you should mention first, that it's a PAV Theme, you use... 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 deepvision » Sat Jul 25, 2015 2:32 am

I meant paste the new code in the theme settings instead of the code you already have there.
I didn't mean to edit .tpl file

ImageImageImage


User avatar
Active Member

Posts

Joined
Tue May 19, 2015 1:03 am

Post by CEMinistries » Wed Jul 29, 2015 10:52 pm

Ah. Gotcha. I found the code and changed it to the above code, but the homepage "Add to Cart" is still not working. I don't have the ability to check the safari browser at the current moment, so I don't know if that is working or not.

Any other ideas?

New member

Posts

Joined
Wed Apr 16, 2014 11:17 pm

Post by deepvision » Fri Jul 31, 2015 3:58 am

There is the same javascript error on your site. The code has not changed.
What exactly did you paste into the theme field for the custom javascript code?

Or maybe it is because of the server cache. Maybe it will help to empty vqcache folder.

ImageImageImage


User avatar
Active Member

Posts

Joined
Tue May 19, 2015 1:03 am

Post by victorj » Sun Aug 02, 2015 6:28 am

its more simple than you think.

if you go to your homepage its not working, click any link and, go back and it will work.
the difference is that when you click a link your shop redirects you very nicely to a protected ssl connection.

so your config files point to htps, so http does not work (had the same problem)

solution use htaccess to redirect all incomming traffic to https.

i solved it this way:

in .htaccess find:

Code: Select all

Options +FollowSymlinks
paste after that

Code: Select all

RewriteEngine On 

RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://arpbookstore.com/$1 [R=301,L]
if youre running cpanel hosting, now all http traffic wil be redirected to https, see nice padlock and it will work

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland

Post by hassanalishah » Mon Aug 22, 2016 8:12 pm

how about if you dont want to use https and yo want to continue using http only?

I have the same issue and now i notice that some functionalities like js and other wont work. So you cant add products to the card and any thing else running on js wont work as well.

In my case, i want to use only http and will force ssl on checkout and account only.

Please help!

New member

Posts

Joined
Wed Sep 17, 2014 1:45 pm
Who is online

Users browsing this forum: Amazon [Bot] and 38 guests