Lorem ipsum

STEP add quantity to Inline VO products

<script>
function add_quantity(){
$('.products.products-inline .product').each(function() {
var form = $(this).find('form[action="/action/Cart/addCartItem/"]');
if (form.find('fieldset').length === 0) {
var priceId = form.find('input[name="priceId"]').val();
var fieldset ='<fieldset> <input type="hidden" name="priceId" value="${priceId}" /> <span class="quantity"> <span class="increase-tooltip js-increase-tooltip" data-trigger="manual" data-container="body" data-original-title="Není možné zakoupit více než 9999 ks." aria-hidden="true" role="tooltip" data-testid="tooltip"></span> <span class="decrease-tooltip js-decrease-tooltip" data-trigger="manual" data-container="body" data-original-title="Minimální množství, které lze zakoupit, je 1 ks." aria-hidden="true" role="tooltip" data-testid="tooltip"></span> <input type="number" name="amount" value="1" class="amount" autocomplete="off" data-decimals="0" data-max="9999" data-min="1" step="any" min="1" max="9999" data-testid="cartAmount" aria-label="Množství"/> <span class="increase" aria-label="Zvýšit množství" tabindex="0" role="button" data-testid="increase"></span> <span class="decrease" aria-label="Snížit množství" tabindex="0" role="button" data-testid="decrease"></span> </span> <button type="submit" class="btn btn-plain btn-cart add-to-cart-button" data-testid="buttonAddToCart"> <span class="sr-only">Do košíku</span> </button> </fieldset>';
form.prepend(fieldset);
}
});
}

$(document).ready(function(){
add_quantity();
});
document.addEventListener('ShoptetDOMPageContentLoaded', function() {
add_quantity();
});
document.addEventListener('ShoptetDOMPageMoreProductsLoaded', function() {
add_quantity();
});
</script>