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.
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
Hi, Does anyone know how can I remove it from OC3038 please?JAY6390 wrote: ↑Sun Apr 29, 2012 8:58 pmRemoving thisfrom your theme category template will do itCode: Select all
<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />
(assuming you're using the default theme). Custom themes may vary, but should work pretty similarlyCode: Select all
/catalog/view/theme/default/template/product/category.tpl
- catalog/view/theme/<your_theme>/template/product/category.twig:parkookk wrote: ↑Mon Jul 03, 2023 11:20 pmHi, Does anyone know how can I remove it from OC3038 please?JAY6390 wrote: ↑Sun Apr 29, 2012 8:58 pmRemoving thisfrom your theme category template will do itCode: Select all
<input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />
(assuming you're using the default theme). Custom themes may vary, but should work pretty similarlyCode: Select all
/catalog/view/theme/default/template/product/category.tpl
Code: Select all
<button type="button" onclick="cart.add('{{ product.product_id }}', '{{ product.minimum }}');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md">{{ button_cart }}</span></button>
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: stefansmith129 and 205 guests