Page 1 of 1

1.5.6.4 "Add To Cart" Not Working . . .

Posted: Fri Jul 24, 2015 10:27 pm
by CEMinistries
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.

Re: 1.5.6.4 "Add To Cart" Not Working . . .

Posted: Fri Jul 24, 2015 11:02 pm
by deepvision
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>

Re: 1.5.6.4 "Add To Cart" Not Working . . .

Posted: Fri Jul 24, 2015 11:39 pm
by CEMinistries
Do you know what file that script is located in? Hopefully not every .tpl file that has "add to cart"?

Re: 1.5.6.4 "Add To Cart" Not Working . . .

Posted: Sat Jul 25, 2015 12:21 am
by CEMinistries
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.

Re: 1.5.6.4 "Add To Cart" Not Working . . .

Posted: Sat Jul 25, 2015 12:26 am
by deepvision
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);
  })();

Re: 1.5.6.4 "Add To Cart" Not Working . . .

Posted: Sat Jul 25, 2015 12:40 am
by CEMinistries
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

Re: 1.5.6.4 "Add To Cart" Not Working . . .

Posted: Sat Jul 25, 2015 1:38 am
by IP_CAM
next time, you should mention first, that it's a PAV Theme, you use... 8)
Ernie

Re: 1.5.6.4 "Add To Cart" Not Working . . .

Posted: Sat Jul 25, 2015 2:32 am
by deepvision
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

Re: 1.5.6.4 "Add To Cart" Not Working . . .

Posted: Wed Jul 29, 2015 10:52 pm
by CEMinistries
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?

Re: 1.5.6.4 "Add To Cart" Not Working . . .

Posted: Fri Jul 31, 2015 3:58 am
by deepvision
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.

Re: 1.5.6.4 "Add To Cart" Not Working . . .

Posted: Sun Aug 02, 2015 6:28 am
by victorj
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

Re: 1.5.6.4 "Add To Cart" Not Working . . .

Posted: Mon Aug 22, 2016 8:12 pm
by hassanalishah
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!