[-] FO : #PSTEST-981 - Minimal quantity not setted correctly on combibination
This commit is contained in:
@@ -253,7 +253,7 @@
|
|||||||
<label>{l s='Minimum quantity:'}</label>
|
<label>{l s='Minimum quantity:'}</label>
|
||||||
</td>
|
</td>
|
||||||
<td style="padding-bottom:5px;">
|
<td style="padding-bottom:5px;">
|
||||||
<input size="3" maxlength="6" name="minimal_quantity" id="minimal_quantity" type="text" value="{$minimal_quantity}" />
|
<input size="3" maxlength="6" name="attribute_minimal_quantity" id="attribute_minimal_quantity" type="text" value="{$minimal_quantity}" />
|
||||||
<p>{l s='The minimum quantity to buy this product (set to 1 to disable this feature)'}</p>
|
<p>{l s='The minimum quantity to buy this product (set to 1 to disable this feature)'}</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -207,7 +207,7 @@
|
|||||||
<p class="preference_description">{l s='The minimum quantity to buy this product (set to 1 to disable this feature)'}</p>
|
<p class="preference_description">{l s='The minimum quantity to buy this product (set to 1 to disable this feature)'}</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="col-left"><label>{l s='Displayed text when in-stock:'}</label></td>
|
<td class="col-left"><label>{l s='Displayed text when in-stock:'}</label></td>
|
||||||
<td style="padding-bottom:5px;">
|
<td style="padding-bottom:5px;">
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ class CombinationCore extends ObjectModel
|
|||||||
public $price;
|
public $price;
|
||||||
|
|
||||||
public $ecotax;
|
public $ecotax;
|
||||||
|
|
||||||
|
public $minimal_quantity = 1;
|
||||||
|
|
||||||
public $quantity;
|
public $quantity;
|
||||||
|
|
||||||
@@ -69,6 +71,7 @@ class CombinationCore extends ObjectModel
|
|||||||
'ecotax' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'size' => 20),
|
'ecotax' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'size' => 20),
|
||||||
'quantity' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'size' => 10),
|
'quantity' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'size' => 10),
|
||||||
'weight' => array('type' => self::TYPE_INT, 'validate' => 'isFloat'),
|
'weight' => array('type' => self::TYPE_INT, 'validate' => 'isFloat'),
|
||||||
|
'minimal_quantity' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
'default_on' => array('type' => self::TYPE_INT, 'validate' => 'isBool'),
|
'default_on' => array('type' => self::TYPE_INT, 'validate' => 'isBool'),
|
||||||
'available_date' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
|
'available_date' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
|
||||||
'reference' => array('type' => self::TYPE_STRING, 'size' => 32),
|
'reference' => array('type' => self::TYPE_STRING, 'size' => 32),
|
||||||
|
|||||||
@@ -615,7 +615,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
Tools::getValue('attribute_default'),
|
Tools::getValue('attribute_default'),
|
||||||
Tools::getValue('attribute_location'),
|
Tools::getValue('attribute_location'),
|
||||||
Tools::getValue('attribute_upc'),
|
Tools::getValue('attribute_upc'),
|
||||||
Tools::getValue('minimal_quantity'),
|
Tools::getValue('attribute_minimal_quantity'),
|
||||||
Tools::getValue('available_date_attribute'));
|
Tools::getValue('available_date_attribute'));
|
||||||
|
|
||||||
Hook::exec('actionProductAttributeUpdate', array('id_product_attribute' => (int)$id_product_attribute));
|
Hook::exec('actionProductAttributeUpdate', array('id_product_attribute' => (int)$id_product_attribute));
|
||||||
@@ -648,7 +648,8 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
Tools::getValue('attribute_ean13'),
|
Tools::getValue('attribute_ean13'),
|
||||||
Tools::getValue('attribute_default'),
|
Tools::getValue('attribute_default'),
|
||||||
Tools::getValue('attribute_location'),
|
Tools::getValue('attribute_location'),
|
||||||
Tools::getValue('attribute_upc')
|
Tools::getValue('attribute_upc'),
|
||||||
|
Tools::getValue('attribute_minimal_quantity')
|
||||||
);
|
);
|
||||||
$this->updateDownloadProduct($product, 0, $id_product_attribute);
|
$this->updateDownloadProduct($product, 0, $id_product_attribute);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ class CartControllerCore extends FrontController
|
|||||||
{
|
{
|
||||||
// If product has attribute, minimal quantity is set with minimal quantity of attribute
|
// If product has attribute, minimal quantity is set with minimal quantity of attribute
|
||||||
$minimal_quantity = ($this->id_product_attribute) ? Attribute::getAttributeMinimalQty($this->id_product_attribute) : $product->minimal_quantity;
|
$minimal_quantity = ($this->id_product_attribute) ? Attribute::getAttributeMinimalQty($this->id_product_attribute) : $product->minimal_quantity;
|
||||||
$this->errors[] = Tools::displayError('You must add').' '.$minimal_quantity.' '.Tools::displayError('Minimum quantity');
|
$this->errors[] = Tools::displayError('You must add', false).' '.$minimal_quantity.' '.Tools::displayError('Minimum quantity', false);
|
||||||
}
|
}
|
||||||
else if (!$updateQuantity)
|
else if (!$updateQuantity)
|
||||||
$this->errors[] = Tools::displayError('You already have the maximum quantity available for this product.', false);
|
$this->errors[] = Tools::displayError('You already have the maximum quantity available for this product.', false);
|
||||||
|
|||||||
Reference in New Issue
Block a user