Post by IsItFast » Sat Nov 10, 2018 6:53 am

So this site is old and I am running 1.5.5.1 version through Mijoshop (plug in that connects OC to Joomla). Was playing around with the product.tpl template today and the add to cart button stopped working. Links to reviews also stopped working. So I put the file back to normal but still no luck. Tried clearing caches everywhere I could find them. Been working on this for hours and can't find a solution. I can add the product to cart from categories page (only have one product that I allow that to happen since the products have to be customized). So I would assume it has to do with the product.tpl file since that is the only thing I messed with. But not sure why putting it back to normal hasn't fixed it. Example product with problem: https://tablesaver.com/order-table-pads ... -table-pad

I really feel like this is a cache problem since I have put the original code back in place but not sure. Any input would be appreciated.

Newbie

Posts

Joined
Fri Feb 01, 2013 10:49 am

Post by ADD Creative » Sat Nov 10, 2018 8:56 am

Only had a quick look. Looks like some modification is removing the \ escape from the template file you attached before the output is generated. An example would be line 465 of your attached file which contains

Code: Select all

encodeURIComponent($('input[name=\'name\']').val())
is becoming

Code: Select all

encodeURIComponent($('input[name='name']').val())
Which causes a JavaScript error. You could try, as a test, replacing any

Code: Select all

\'
in JavaScript strings in the template with

Code: Select all

"
, but this won't solve the root cause of the problem.

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by IsItFast » Sat Nov 10, 2018 1:43 pm

Not sure how to take that suggestion as that code is even in the original unmodified OpenCart file. The only way I was able to get this to work was to through the "restore" process until I found the original file that worked. As I said before the code that is in there is the same that I have been using this entire time so not sure why saving the file is different than restoring it. Something odd definitely is going on. But I'm too exhausted from messing with it all day to put any more effort in. Looks like I am just leaving the page as is.

Newbie

Posts

Joined
Fri Feb 01, 2013 10:49 am

Newbie

Posts

Joined
Sun Oct 21, 2018 11:13 am
Location - India

Post by straightlight » Sat Nov 10, 2018 8:08 pm

The only way I was able to get this to work was to through the "restore" process until I found the original file that worked.
Source location undescribed.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

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

Post by ADD Creative » Sun Nov 11, 2018 1:04 am

IsItFast wrote:
Sat Nov 10, 2018 1:43 pm
Not sure how to take that suggestion as that code is even in the original unmodified OpenCart file. The only way I was able to get this to work was to through the "restore" process until I found the original file that worked. As I said before the code that is in there is the same that I have been using this entire time so not sure why saving the file is different than restoring it. Something odd definitely is going on. But I'm too exhausted from messing with it all day to put any more effort in. Looks like I am just leaving the page as is.
It can be found on line 465 for the product.tpl you attach to your post. Anyway, whatever you have restored has put back the \ escaping to the generated output.

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 20 guests