Hello
I am building a website where i sell engraved tags. I am using text fields for the customer to specify their engraving wishes. If the customers wants to buy the same item twice or more they need to delete the field before inserting new text. This is not optimal, I therefore need the textbox option fields to clear after pressing "add to cart".
Any solutions, ideas?
Regards
Frederik
you can insert quantity:2 and then add to cart
Mass update product descriptions/Hromadná změna popisků zboží
My problem is when the customer wants the same product twice, but with differents engravings. As it is now, the customer need to clear all the text fields and enter the new text. Then pressing add to cart again. I therefore seek to way to clear all options after pressing add to cart.
Any ideas?
Any ideas?
Tested on 1.5.5.1 and 1.5.6
1. EDIT: catalog/view/theme/default/template/product/product.tpl
2. FIND:
3. REPLACE WITH:
Be sure not to alter the rest of the code in that section.
1. EDIT: catalog/view/theme/default/template/product/product.tpl
2. FIND:
Code: Select all
$('#button-cart').bind('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
dataType: 'json',
success: function(json) {
3. REPLACE WITH:
Code: Select all
$('#button-cart').bind('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
dataType: 'json',
success: function(json) {
$('input[name^=option][type=text]').val('');
$('input[name^=option][type=radio]').prop("checked", false).end().buttonset("refresh");
$('select[name^=option]').each(function() { this.selectedIndex = 0; });
$('input[name^=option][type=checkbox]').prop("checked", false).end().buttonset("refresh");
$('textarea[name^=option]').val('');
Well, the best way, to find out, would be to just try ut out...
You cannot ruin anything, as long as you keep a backup-file.
Ernie
You cannot ruin anything, as long as you keep a backup-file.
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Who is online
Users browsing this forum: dparakhiya and 67 guests