Post by nlbailey » Sat Sep 24, 2011 9:43 am

I have customized my own template to match my clients website design. In the process the add to cart function on the category page has stopped functioning. It works fine on the product page but not directly from the category list.

If I switch to the default template all is well. How can I find out what is wrong? Where should I start?

Link to site: http://springfieldfireworks.com/store/novelties
Last edited by nlbailey on Sat Oct 01, 2011 6:49 am, edited 1 time in total.

Newbie

Posts

Joined
Wed Sep 14, 2011 1:05 pm

Post by nlbailey » Sat Sep 24, 2011 9:59 am

After digging around I have discovered the script error "ReferenceError: Can't find variable: addToCart". Anyone happen to know what I can do to fix this? As far as I know I haven't messed with any of the controller or model files so no variables should have been accidentally deleted/modified/etc.

Newbie

Posts

Joined
Wed Sep 14, 2011 1:05 pm

Post by 4bco » Sat Sep 24, 2011 10:18 am

Your add to cart button code should look something like...

Code: Select all

<a class="button" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" ><span><?php echo $button_add_to_cart; ?></span></a>
It depends on which version of opencart you are using.

Custom Website Design from BCO ~ Building Companies Online
If we were of assistance to you, please help my family in return with a small donation.


New member

Posts

Joined
Wed Jun 29, 2011 11:40 pm

Post by nlbailey » Sat Sep 24, 2011 10:23 am

After looking at the category.tpl. I see the code that you are referencing and it is there. The button also appears correctly as well but the script that it fires is not working.

Newbie

Posts

Joined
Wed Sep 14, 2011 1:05 pm

Post by grgr » Sat Sep 24, 2011 6:11 pm

I presume that you have mended this as it appears to be working fine?

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by nlbailey » Sat Oct 01, 2011 6:48 am

Yes, I was able to fix it...unfortunately so much has been going wrong with my store I cannot recall how I fixed it!

Newbie

Posts

Joined
Wed Sep 14, 2011 1:05 pm
Who is online

Users browsing this forum: No registered users and 5 guests