Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
commit
a6b2299ed1
5 files changed
+43
-16
No files matched your search
+14
-13
@@ -1104,29 +1104,30 @@ class CartRuleCore extends ObjectModel
|
|||||||
'.($context->customer->id ? 'OR cr.id_customer = '.(int)$context->cart->id_customer : '').'
|
'.($context->customer->id ? 'OR cr.id_customer = '.(int)$context->cart->id_customer : '').'
|
||||||
)
|
)
|
||||||
AND (
|
AND (
|
||||||
cr.carrier_restriction = 0
|
cr.`carrier_restriction` = 0
|
||||||
'.($context->cart->id_carrier ? 'OR c.id_carrier = '.(int)$context->cart->id_carrier : '').'
|
'.($context->cart->id_carrier ? 'OR c.id_carrier = '.(int)$context->cart->id_carrier : '').'
|
||||||
)
|
)
|
||||||
AND (
|
AND (
|
||||||
cr.shop_restriction = 0
|
cr.`shop_restriction` = 0
|
||||||
'.((Shop::isFeatureActive() && $context->shop->id) ? 'OR crs.id_shop = '.(int)$context->shop->id : '').'
|
'.((Shop::isFeatureActive() && $context->shop->id) ? 'OR crs.id_shop = '.(int)$context->shop->id : '').'
|
||||||
)
|
)
|
||||||
AND (
|
AND (
|
||||||
cr.group_restriction = 0
|
cr.`group_restriction` = 0
|
||||||
'.($context->customer->id ? 'OR 0 < (
|
'.($context->customer->id ? 'OR 0 < (
|
||||||
SELECT cg.id_group
|
SELECT cg.`id_group`
|
||||||
FROM '._DB_PREFIX_.'customer_group cg
|
FROM `'._DB_PREFIX_.'customer_group` cg
|
||||||
LEFT JOIN '._DB_PREFIX_.'cart_rule_group crg ON (cg.id_group = crg.id_group AND cg.id_group = '.(int)$context->customer->id_default_group.')
|
INNER JOIN `'._DB_PREFIX_.'cart_rule_group` crg ON cg.id_group = crg.id_group
|
||||||
WHERE cr.id_cart_rule = crg.id_cart_rule
|
WHERE cr.`id_cart_rule` = crg.`id_cart_rule`
|
||||||
AND cg.id_customer = '.(int)$context->customer->id.' LIMIT 1
|
AND cg.`id_customer` = '.(int)$context->customer->id.'
|
||||||
|
LIMIT 1
|
||||||
)' : '').'
|
)' : '').'
|
||||||
)
|
)
|
||||||
AND (
|
AND (
|
||||||
cr.reduction_product <= 0
|
cr.`reduction_product` <= 0
|
||||||
OR cr.reduction_product IN (
|
OR cr.`reduction_product` IN (
|
||||||
SELECT id_product
|
SELECT `id_product`
|
||||||
FROM '._DB_PREFIX_.'cart_product
|
FROM `'._DB_PREFIX_.'cart_product`
|
||||||
WHERE id_cart = '.(int)$context->cart->id.'
|
WHERE `id_cart` = '.(int)$context->cart->id.'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
AND cr.id_cart_rule NOT IN (SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$context->cart->id.')
|
AND cr.id_cart_rule NOT IN (SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$context->cart->id.')
|
||||||
|
|||||||
@@ -431,9 +431,9 @@ abstract class PaymentModuleCore extends Module
|
|||||||
|
|
||||||
// Set the new voucher value
|
// Set the new voucher value
|
||||||
if ($voucher->reduction_tax)
|
if ($voucher->reduction_tax)
|
||||||
$voucher->reduction_amount = $values['tax_incl'] - $order->total_products_wt - $order->total_shipping_tax_incl;
|
$voucher->reduction_amount = $values['tax_incl'] - $order->total_products_wt - ($voucher->free_shipping == 1 ? $order->total_shipping_tax_incl : 0);
|
||||||
else
|
else
|
||||||
$voucher->reduction_amount = $values['tax_excl'] - $order->total_products - $order->total_shipping_tax_excl;
|
$voucher->reduction_amount = $values['tax_excl'] - $order->total_products - ($voucher->free_shipping == 1 ? $order->total_shipping_tax_excl : 0);
|
||||||
|
|
||||||
$voucher->id_customer = $order->id_customer;
|
$voucher->id_customer = $order->id_customer;
|
||||||
$voucher->quantity = 1;
|
$voucher->quantity = 1;
|
||||||
|
|||||||
@@ -571,6 +571,14 @@ class SearchCore
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function removeProductsSearchIndex($products)
|
||||||
|
{
|
||||||
|
if (count($products)) {
|
||||||
|
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'search_index WHERE id_product IN ('.implode(',', $products).')');
|
||||||
|
ObjectModel::updateMultishopTable('Product', array('indexed' => 0), 'a.id_product IN ('.implode(',', $products).')');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected static function setProductsAsIndexed(&$products)
|
protected static function setProductsAsIndexed(&$products)
|
||||||
{
|
{
|
||||||
if (count($products))
|
if (count($products))
|
||||||
|
|||||||
@@ -181,11 +181,13 @@ class AdminStockInstantStateControllerCore extends AdminController
|
|||||||
*/
|
*/
|
||||||
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
|
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
|
||||||
{
|
{
|
||||||
if (Tools::isSubmit('csv') && (int)Tools::getValue('id_warehouse') != -1)
|
if ((Tools::isSubmit('csv_quantities') || Tools::isSubmit('csv_prices')) &&
|
||||||
|
(int)Tools::getValue('id_warehouse') != -1)
|
||||||
$limit = false;
|
$limit = false;
|
||||||
|
|
||||||
$order_by_valuation = false;
|
$order_by_valuation = false;
|
||||||
$order_by_real_quantity = false;
|
$order_by_real_quantity = false;
|
||||||
|
|
||||||
if ($this->context->cookie->{$this->table.'Orderby'} == 'valuation')
|
if ($this->context->cookie->{$this->table.'Orderby'} == 'valuation')
|
||||||
{
|
{
|
||||||
unset($this->context->cookie->{$this->table.'Orderby'});
|
unset($this->context->cookie->{$this->table.'Orderby'});
|
||||||
@@ -200,6 +202,7 @@ class AdminStockInstantStateControllerCore extends AdminController
|
|||||||
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
|
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
|
||||||
|
|
||||||
$nb_items = count($this->_list);
|
$nb_items = count($this->_list);
|
||||||
|
|
||||||
for ($i = 0; $i < $nb_items; ++$i)
|
for ($i = 0; $i < $nb_items; ++$i)
|
||||||
{
|
{
|
||||||
$item = &$this->_list[$i];
|
$item = &$this->_list[$i];
|
||||||
|
|||||||
@@ -77,8 +77,23 @@ class AdminTagsControllerCore extends AdminController
|
|||||||
public function postProcess()
|
public function postProcess()
|
||||||
{
|
{
|
||||||
if ($this->tabAccess['edit'] === '1' && Tools::getValue('submitAdd'.$this->table))
|
if ($this->tabAccess['edit'] === '1' && Tools::getValue('submitAdd'.$this->table))
|
||||||
|
{
|
||||||
if (($id = (int)Tools::getValue($this->identifier)) && ($obj = new $this->className($id)) && Validate::isLoadedObject($obj))
|
if (($id = (int)Tools::getValue($this->identifier)) && ($obj = new $this->className($id)) && Validate::isLoadedObject($obj))
|
||||||
|
{
|
||||||
|
$previousProducts = $obj->getProducts();
|
||||||
|
$removedProducts = array();
|
||||||
|
|
||||||
|
foreach ($previousProducts as $product)
|
||||||
|
if (!in_array($product['id_product'], $_POST['products']))
|
||||||
|
$removedProducts[] = $product['id_product'];
|
||||||
|
|
||||||
|
if (Configuration::get('PS_SEARCH_INDEXATION'))
|
||||||
|
Search::removeProductsSearchIndex($removedProducts);
|
||||||
|
|
||||||
$obj->setProducts($_POST['products']);
|
$obj->setProducts($_POST['products']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return parent::postProcess();
|
return parent::postProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user