<?php
/**
 * Webkul Software.
 *
 * @category  Webkul
 * @package   Webkul_Marketplace
 * @author    Webkul
 * @copyright Copyright (c) Webkul Software Private Limited (https://webkul.com)
 * @license   https://store.webkul.com/license.html
 */
?>
<?php
    /** @var $block \Webkul\Marketplace\Block\Product\Create */
    $helper = $this->helper(\Webkul\Marketplace\Helper\Data::class);
    $globalProductLimitQty = $helper->getGlobalProductLimitQty();
    $productId=$this->getRequest()->getParam('id');
if ($productId) {
    $productColl = $block->getProduct($productId);
    $productTypeId = $productColl['type_id'];
    $mpProductCartLimit = $productColl['mp_product_cart_limit'];
} else {
    $productTypeId = $this->getRequest()->getParam('type');
    $mpProductCartLimit = '';
}
?>
<?php if ($productTypeId != 'downloadable' && $productTypeId != 'virtual'): ?>
    <div class="field">
        <label class="label"><?= $block->escapeHtml(__('Allowed Product Qty on Product Purchase for Customer')) ?>:</label>
        <div class="control">
            <input type="text" class="input-text validate-number" name="product[mp_product_cart_limit]" id="mp_product_cart_limit" value="<?= $block->escapeHtml($mpProductCartLimit); ?>"/>
            <span><?= $block->escapeHtml(__("By default %1 qty will be allowed for customer to add in cart.", $globalProductLimitQty));?></span>
        </div>
    </div>
<?php endif; ?>
