Hi,
OC V1.5.2.1
When clicking Category and it brings up the products list page, it has a add to cart button against each product, I would prefer customers to go to the product details page before they can add to cart, is there a possible way of doing this? I am not a coder but can follow instructions.
Thank You.
Removing this
from your theme category template will do it
(assuming you're using the default theme). Custom themes may vary, but should work pretty similarly
Code: Select all
<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />
Code: Select all
/catalog/view/theme/default/template/product/category.tpl
Also needs both instances of the line:
html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>';
removed as well otherwise the javascript function on the same page outputs 'null' to screen.
html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>';
removed as well otherwise the javascript function on the same page outputs 'null' to screen.
No, you don't need to remove that one, and it won't output "null", because you are not removing the whole DIV section, but only the buttonchris.dempsey wrote:Also needs both instances of the line:
html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>';
removed as well otherwise the javascript function on the same page outputs 'null' to screen.

See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart
I disagree with the last comment on this page. I suffered the null issue until I commented out the two lines as stated by chris
I change these from
html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>';
to
<!-- html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>'; -->
and the cart button removed without getting the null notice.
OpenCart 1.5.5.1
I change these from
html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>';
to
<!-- html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>'; -->
and the cart button removed without getting the null notice.
OpenCart 1.5.5.1
Joomla & Wordpress Specialist
E-Commerce Specialist
SEO Consultant
Freephone: 0800 756 9975
Website: www.awebserver.co.uk
It's because you've removed:webgeeze wrote:I disagree with the last comment on this page. I suffered the null issue until I commented out the two lines as stated by chris
I change these from
html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>';
to
<!-- html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>'; -->
and the cart button removed without getting the null notice.
OpenCart 1.5.5.1
Code: Select all
<div class="cart">
<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />
</div>
Code: Select all
<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />
See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart
Who is online
Users browsing this forum: No registered users and 28 guests