removed from_quantity use from specific pricing

This commit is contained in:
Shreesh Arora
2022-06-22 20:19:58 +05:30
parent caa7398581
commit 2d0826109b
3 changed files with 3 additions and 25 deletions

View File

@@ -580,15 +580,6 @@ $(document).ready(function () {
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-2" for="sp_from_quantity">{l s='Starting at'}</label>
<div class="col-lg-4">
<div class="input-group">
<span class="input-group-addon">{l s='unit'}</span>
<input type="text" name="sp_from_quantity" id="sp_from_quantity" value="1" />
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-2" for="sp_price">{l s='Room type price'}
{if $country_display_tax_label}
@@ -732,7 +723,6 @@ $(document).ready(function () {
{/if}
<th>{l s='Impact'}</th>
<th>{l s='Period'}</th>
<th>{l s='From (quantity)'}</th>
<th>{l s='Action'}</th>
</tr>
</thead>

View File

@@ -1271,7 +1271,7 @@ class AdminProductsControllerCore extends AdminController
$id_group = Tools::getValue('sp_id_group');
$id_customer = Tools::getValue('sp_id_customer');
$price = Tools::getValue('leave_bprice') ? '-1' : Tools::getValue('sp_price');
$from_quantity = Tools::getValue('sp_from_quantity');
$from_quantity = 1;
$reduction = (float)(Tools::getValue('sp_reduction'));
$reduction_tax = Tools::getValue('sp_reduction_tax');
$reduction_type = !$reduction ? 'amount' : Tools::getValue('sp_reduction_type');
@@ -4295,7 +4295,6 @@ class AdminProductsControllerCore extends AdminController
<td>'.$fixed_price.'</td>
<td>'.$impact.'</td>
<td>'.$period.'</td>
<td>'.$specific_price['from_quantity'].'</th>
<td>'.((!$rule->id && $can_delete_specific_prices) ? '<a class="btn btn-default" name="delete_link" href="'.self::$currentIndex.'&id_product='.(int)Tools::getValue('id_product').'&action=deleteSpecificPrice&id_specific_price='.(int)($specific_price['id_specific_price']).'&token='.Tools::getValue('token').'"><i class="icon-trash"></i></a>': '').'</td>
</tr>';
$i++;
@@ -5484,7 +5483,7 @@ class AdminProductsControllerCore extends AdminController
}
$this->tpl_form_vars['custom_form'] = $data->fetch();
}
public function getModalDuplicateOptions()
{
$tpl = $this->createTemplate('modal-duplicate-options.tpl');

View File

@@ -100,11 +100,6 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
'align' => 'center',
'filter_key' => 'gl!name'
),
'from_quantity' => array(
'title' => $this->l('From quantity'),
'align' => 'center',
'class' => 'fixed-width-xs'
),
'reduction_type' => array(
'title' => $this->l('Reduction type'),
'align' => 'center',
@@ -221,13 +216,6 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
'name' => 'name'
),
),
array(
'type' => 'text',
'label' => $this->l('From quantity'),
'name' => 'from_quantity',
'maxlength' => 10,
'required' => true,
),
array(
'type' => 'text',
'label' => $this->l('Price (tax excl.)'),
@@ -345,6 +333,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
public function processSave()
{
$_POST['from_quantity'] = 1;
$_POST['price'] = Tools::getValue('leave_bprice_on') ? '-1' : Tools::getValue('price');
if (Validate::isLoadedObject(($object = parent::processSave()))) {
/** @var SpecificPriceRule $object */