Input Quantity Change does not update quantity in Add-to-Vart URL
-
Problem
When the user changes a Product Item Quantity in the text input box, the URL for the Add-to-Basket does not get Updated with the new quantity.
Result Behaviour
The quantity of Product Items added to the Cart is the amount from the initial Page Load – and not the current amount chosen in the Quantity Input Text Box
Workaround
I have modified the function in:
/wp-content/plugins/woo-product-table/assets/js/custom.css
See the last few lines below:
$('body').on('change', '.wpt_row input.input-text.qty.text', function() { var temp_number = $(this).parents('tr.wpt_row').data('temp_number'); var Qty_Val = $(this).val(); var product_id = $(this).parents('tr').data('product_id'); var thisRow = '#table_id_' + temp_number + ' tr.product_id_' + product_id; $( thisRow + ' input.input-text.qty.text').val(Qty_Val); $( thisRow ).attr('data-quantity', Qty_Val); $( thisRow + ' a.wpt_woo_add_cart_button').attr('data-quantity', Qty_Val); $( thisRow + ' a.add_to_cart_button ').attr('data-quantity', Qty_Val); // [ my custom fix : Update new quantity to Add to Cart URL] ------------ [ BEG ] var Item_URL = '?add-to-cart=' + product_id + '&quantity=' + Qty_Val; $( thisRow + ' a.add_to_cart_button ').attr('href', Item_URL); // [ my custom fix : Update new quantity to Add to Cart URL] ------------ [ END ] <snip> <etc> });
Issue
This works now for me, but my concern is that any updates from woo-product-table will overwrite my patch fix.
– – –
Has anyone else has this issue ?
At first I thought it may be related to the [+] [-] Quantity Plugin – but the issue is still there when I disable that.
Thanks
Rich
- The topic ‘Input Quantity Change does not update quantity in Add-to-Vart URL’ is closed to new replies.