0

Do you know how I can get the "Qty Increments" on the product page?

Product page back end: enter image description here

Code 'addtocart.phtml': enter image description here

With this code, I have a blank field.

Thanks in advance.

0

Try following way:


<?php
$qtyIncrements = 0;
$validators =  $block->getQuantityValidators();
if(isset($validators['validate-item-quantity']) && isset($validators['validate-item-quantity']['qtyIncrements'])) {
    $qtyIncrements = $validators['validate-item-quantity']['qtyIncrements'];
}
?>
<input type="number" name="inc_qty" value="<?php echo $qtyIncrements;?>"/>

Check here how to add stock data into product view block

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.