Add to cart button not working on product pages. (3rd Try for Help)

ThemeBurn SupportForumsOpenCart ThemesPavilion OpenCart ThemeAdd to cart button not working on product pages. (3rd Try for Help)

This topic has been marked as not resolved.

This is the third time I have posted this issue, the first two times I did not get a final response and those posts are now waiting for a response from support for over 14 and 23 days respectively.

I need an answer on this yesterday, I like this theme but it is completely unusable if the add to cart button does not work.

OC 2.1.0.1
Pav 1.2.9
Add to cart button does not work on product pages or product slider; I do not think this is a compatibility issue since after re-installing I can add to cart from all other places except add to cart button… and I noticed that this was an issue supposedly fixed in 1.2.9 (maybe not completely fixed?)

On the 3 item hover… Here you can see javascript being called and add to cart funtionality employed.
http://screencast.com/t/3A3BVJu5

Here you will see no such thing on the product page
http://screencast.com/t/AcCzLcDlfl

  • This reply was modified 2984 days ago by  bigmoon.
  • This reply was modified 2984 days ago by  bigmoon.
  • This reply was modified 2984 days ago by  bigmoon.
  • This reply was modified 2984 days ago by  bigmoon.
March 2, 2016 at 7:08 pm #45252

Hi,

The cause for the not working “add to cart” is the “Beautiful Add to Cart PopUp Notification”. We’ve tried to make it compatible, but for the moment this is not possible.

Since this modification alter all themes templates, we recommend to modify it a bit, so it changes only the default theme, e.g. change this route:

catalog/view/theme/*/template/.....

to:

catalog/view/theme/default/template/

We are sorry for the late reply, but converting 3rd party is not part of the free support we offer. Although we always try to help everybody, there are issues that have greater priority.

BR,
ThemeBurn team

March 3, 2016 at 8:59 pm #45285

This is not a 3rd party compatibility issue, AS STATED BEFORE, I got rid of the compatibility issue by re-installing pavilion, this corrected both the footer.tpl and product.tpl that had been altered by the other mod.

Just to be sure I manually did it again… no change.

It is not a 3rd party compatibility issue!

https://surplusjoe.com

(yes, I know there is no cert for it YET but) .htaccess needs to redirect anyway for other store. it is safe to proceed … lol

  • This reply was modified 2982 days ago by  bigmoon.
  • This reply was modified 2982 days ago by  bigmoon. Reason: adding website info
March 4, 2016 at 1:45 am #45290

Hi,

There is a JS syntax error on the product page, that is introduced by template modification (it doesn’t matter whether this modification is made manually or by an extension).

Unfortunately, you will need to roll back the changes, you have made. The modification relies on some Bootstrap scripts that for the moment are not properly supported by the theme. That is why you cannot use it for the moment.

BR,
ThemeBurn team

March 4, 2016 at 11:06 am #45293

When you say roll back the changes what do you mean? That’s exactly what I did, the mod you said was causing errors is not active on pavilion… Can you please be more specific, I have cleared the error logs and then made attempts and no errors show in logs.

I have re-installed pavilion twice and made no changes afterwords… same issue… at least give me a direction to look. What is the JS error? You are being very vague, I’m happy to dig into this myself but you say there is js error i need to know what it is cause error logs do not show anything.

All other add to cart buttons are working properly, only the product page is having issues… the product.tpl in your theme has NOT been modified.

what to do? I’m really committed to using your theme.

—-

You said error was due to template modifications, which template? cause there have been no mods to the pavilion template.

—–

Only error I see is unexpected token, no reference to a mod of any kind >> http://screencast.com/t/BV1LrMMtqNDm

  • This reply was modified 2982 days ago by  bigmoon. Reason: adding NO MOD info
  • This reply was modified 2982 days ago by  bigmoon.
March 4, 2016 at 12:20 pm #45295

Hi,

There is an error on your productpage. You can check with your browser, for example Developer Tools – Google Chrome.

Uncaught SyntaxError: Unexpected token } on black-1-3-gallon-can.html:1606

  timer = setInterval(function() {
      if ($('#form-upload input[name=\'file\']').val() != '') {
        clearInterval(timer);

        $.ajax({
            url: 'index.php?route=tool/upload',
            type: 'post',
            dataType: 'json',
            data: new FormData($('#form-upload')[0]),
            cache: false,
            contentType: false,
            processData: false,
            beforeSend: function() {
                $(node).after('<i class="fa fa-circle-o-notch fa-spin"></i>');
                $(node).attr('disabled', true);
            },
            success: function(json) {
                $('.text-danger').remove();
                $(node).next('.fa-spin').remove();
                $(node).attr('disabled', false);

                if (json['error']) {
                    $(node).parent().find('input').after('<div class="text-danger">' + json['error'] + '</div>');
                }
                if (json['success']) {
                    alert(json['success']);
                    $(node).parent().find('input').attr('value', json['code']);
                }
            },
            error: function(xhr, ajaxOptions, thrownError) {
                alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
            }
        });
      }
    }, 500);
});

Last line is incorrect.

  • This reply was modified 2982 days ago by  ultimatia.
March 4, 2016 at 12:45 pm #45298

Hi,

As we said in our previous post, there is a JS error in the product page (catalog/view/theme/pavilion/template/product/product.tpl). This error is caused by a template modification. We cannot say what is the cause of this change, as we can take a look only at the page source. What we can say is that there is some code from the “Beautiful Add to Cart PopUp Notification” vqmod that is not placed correctly and break the add to cart function.

As for the JS function, all add to cart buttons on the site use a single function and only the button on the product page has a dedicated one, which at the moment is broken.

Since you say, you haven’t modified the product.tpl manually, it seems that the vqmod/ocmod still changes the template. You can check the vqcache/occache folders for be assured:

vqmod/vqcache/
system/storage/modification/

If you still have any questions, we will try to assist you.

BR,
ThemeBurn team

March 4, 2016 at 12:55 pm #45300

Yup I see that error in google dev console, but since the page is dynamic (and I’m not a real coder) I can’t for the life of me figure out where the unexpected token is actually coming from… and I cant find any info online about how to do so…

I do appreciate the help, and I’m sure others already do (or will be having) the same issue.

It seems if we could just figure out what file is actually causing the unexpected token we might solve the problem.

—–
btw: how can you say this?
“What we can say is that there is some code from the “Beautiful Add to Cart PopUp Notification” vqmod that is not placed correctly and break the add to cart function.”
If you can’t pinpoint it how can you say its having an effect?
If you can pinpoint it please tell me how.
—-

If you want I can give you access to the backend.

  • This reply was modified 2982 days ago by  bigmoon.
March 4, 2016 at 2:27 pm #45301

OK I found the file with the last line error, it is one of your files.

/system/storage/modification/catalog/view/theme/pavilion/template/product/product.tpl

The last line looks irrelevant but if I take it out I get a node error.

I can see that it does not come as part of the deliverable so do you create this when the theme style is generated the first time? what to do next?

March 4, 2016 at 9:27 pm #45303

OK Fixed it, crazy.. all I had to do was delete the file and it is fixed.

deleted > /system/storage/modification/catalog/view/theme/pavilion/template/product/product.tpl

close issues, tx.

March 4, 2016 at 9:56 pm #45304

Hi,

Glad to hear that the problem is solved. Sorry to mention this a bit late, but if you are using ocmod modifications (instead vqmod), you need to remove the modification from Admin > Extensions > Modifications first, refresh and then again upload the modified file.

The refresh cleans all previously stored modifications (those you’ve removed manually).

BR,
ThemeBurn team

March 7, 2016 at 6:25 pm #45342
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.