Last active
June 6, 2023 18:01
-
-
Save lrkwz/9668137 to your computer and use it in GitHub Desktop.
Magento quantity dropdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getEnableQtyIncrements() ){ ?> | |
<select class="input-text qty" name="qty" id="qty"> | |
<?php $i = (Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getMinSaleQty()?Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getMinSaleQty():1); ?> | |
<?php do { ?> | |
<option value="<?php echo $i?>"> | |
<?php echo $i?> | |
<?php $i+= Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQtyIncrements() ?> | |
</option> | |
<?php } while ($i <= (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getMaxSaleQty()) ?> | |
</select> | |
<?php } else { ?> | |
<input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" /> | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should go into