• Resolved topfastza

    (@topfastza)


    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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Saiful Islam

    (@codersaiful)

    Thanks for your solution. I will apply.

    Thread Starter topfastza

    (@topfastza)

    Typo:

    I have modified the function in:

    /wp-content/plugins/woo-product-table/assets/js/custom.css

    Should read:

    I have modified the function in:

    /wp-content/plugins/woo-product-table/assets/js/custom.js

    Thread Starter topfastza

    (@topfastza)

    @codersaiful

    Thanks for your solution. I will apply.

    Thanks !
    That would be appreciated

    Thread Starter topfastza

    (@topfastza)

    @codersaiful

    Hi,

    Version 3.0.9 rolled out without the patch.

    We are back to the same problem.

    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

    Please remember to add my patch code to the next update.

    Thanks

    Plugin Contributor UnikForce

    (@unikforce)

    Hi @topfastza,
    We have checked your code and we have patched your code to the latest update that we would release in a few days. So you can update your plugin when we release the next version then it would be patched with that.
    Thanks

    Thread Starter topfastza

    (@topfastza)

    Thank you.
    I will double check before and after I activate the next update from you.

    I will confirm here that all is 100%.

    {edit:spelling}

    • This reply was modified 2 years, 9 months ago by topfastza.
    Thread Starter topfastza

    (@topfastza)

    Hello @unikforce @codersaiful

    I have just run the plugin update:

    Product Table for WooCommerce – (wooproducttable)
    View version 3.1.0

    This worked fine and I see my patch in your code.

    Thanks!

    Plugin Author Saiful Islam

    (@codersaiful)

    Thanks for your confirmation.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Input Quantity Change does not update quantity in Add-to-Vart URL’ is closed to new replies.