// Improving ajax form in tab product / quantity
This commit is contained in:
@@ -3548,11 +3548,27 @@ switch ($this->action)
|
|||||||
{
|
{
|
||||||
refreshQtyAvaibilityForm();
|
refreshQtyAvaibilityForm();
|
||||||
ajaxCall({actionQty: \'depends_on_stock\', value: $(this).attr(\'value\')});
|
ajaxCall({actionQty: \'depends_on_stock\', value: $(this).attr(\'value\')});
|
||||||
|
if($(this).val() == 0)
|
||||||
|
$(\'.available_quantity input\').trigger(\'change\');
|
||||||
});
|
});
|
||||||
$(\'.available_quantity\').find(\'input\').change(function(e)
|
$(\'.available_quantity\').find(\'input\').change(function(e)
|
||||||
{
|
{
|
||||||
ajaxCall({actionQty: \'set_qty\', id_product_attribute: $(this).parent().attr(\'id\').split(\'_\')[1], value: $(this).val()});
|
ajaxCall({actionQty: \'set_qty\', id_product_attribute: $(this).parent().attr(\'id\').split(\'_\')[1], value: $(this).val()});
|
||||||
});
|
});
|
||||||
|
$(\'.available_quantity\').find(\'input\').click(function(e)
|
||||||
|
{
|
||||||
|
if(typeof(this.intervalId) != \'undefined\')
|
||||||
|
window.clearInterval(this.intervalId);
|
||||||
|
this.intervalId = window.setInterval(function(it, initialValue)
|
||||||
|
{
|
||||||
|
if(initialValue != $(it).val())
|
||||||
|
{
|
||||||
|
window.clearInterval(it.intervalId);
|
||||||
|
$(it).trigger(\'change\');
|
||||||
|
$(it).trigger(\'click\');
|
||||||
|
}
|
||||||
|
}, 500, this, $(this).val())
|
||||||
|
});
|
||||||
$(\'.out_of_stock\').click(function(e)
|
$(\'.out_of_stock\').click(function(e)
|
||||||
{
|
{
|
||||||
ajaxCall({actionQty: \'out_of_stock\', value: $(this).val()});
|
ajaxCall({actionQty: \'out_of_stock\', value: $(this).val()});
|
||||||
|
|||||||
Reference in New Issue
Block a user