Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into bootstrap
Conflicts: admin-dev/themes/default/template/controllers/customer_threads/message.tpl admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl admin-dev/themes/default/template/controllers/modules/favorites.tpl admin-dev/themes/default/template/controllers/modules/list.tpl admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl admin-dev/themes/default/template/controllers/orders/_print_pdf_icon.tpl admin-dev/themes/default/template/controllers/orders/form.tpl admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl admin-dev/themes/default/template/controllers/products/associations.tpl admin-dev/themes/default/template/controllers/products/combinations.tpl admin-dev/themes/default/template/controllers/products/images.tpl admin-dev/themes/default/template/controllers/products/informations.tpl admin-dev/themes/default/template/controllers/products/prices.tpl admin-dev/themes/default/template/controllers/referrers/helpers/view/view.tpl admin-dev/themes/default/template/header.tpl admin-dev/themes/default/template/helpers/form/form.tpl admin-dev/themes/default/template/helpers/list/list_header.tpl classes/ProductSale.php classes/helper/HelperList.php controllers/admin/AdminCmsController.php controllers/admin/AdminCustomersController.php controllers/admin/AdminMetaController.php controllers/admin/AdminModulesController.php controllers/admin/AdminPerformanceController.php controllers/admin/AdminProductsController.php controllers/front/ParentOrderController.php install-dev/theme/views/welcome.phtml modules/blocknewproducts/blocknewproducts.php modules/blocktopmenu/blocktopmenu.php modules/importerosc/importerosc.php modules/mailalerts/mailalerts.php modules/shopimporter/shopimporter.php modules/statsstock/statsstock.php themes/default/css/product_list.css
This commit is contained in:
@@ -131,6 +131,9 @@ var ajaxCart = {
|
||||
success: function(jsonData)
|
||||
{
|
||||
ajaxCart.updateCart(jsonData);
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -175,7 +178,7 @@ var ajaxCart = {
|
||||
},
|
||||
|
||||
// add a product in the cart via ajax
|
||||
add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, whishlist){
|
||||
add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, wishlist){
|
||||
if (addedFromProductPage && !checkCustomizations())
|
||||
{
|
||||
alert(fieldRequired);
|
||||
@@ -204,9 +207,9 @@ var ajaxCart = {
|
||||
data: 'controller=cart&add=1&ajax=true&qty=' + ((quantity && quantity != null) ? quantity : '1') + '&id_product=' + idProduct + '&token=' + static_token + ( (parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination): ''),
|
||||
success: function(jsonData,textStatus,jqXHR)
|
||||
{
|
||||
// add appliance to whishlist module
|
||||
if (whishlist && !jsonData.errors)
|
||||
WishlistAddProductCart(whishlist[0], idProduct, idCombination, whishlist[1]);
|
||||
// add appliance to wishlist module
|
||||
if (wishlist && !jsonData.errors)
|
||||
WishlistAddProductCart(wishlist[0], idProduct, idCombination, wishlist[1]);
|
||||
|
||||
// add the picture to the cart
|
||||
var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img');
|
||||
@@ -341,7 +344,7 @@ var ajaxCart = {
|
||||
// If the cart is now empty, show the 'no product in the cart' message and close detail
|
||||
if($('#cart_block dl.products dt').length == 0)
|
||||
{
|
||||
$("#cart_block").stop(true, true).slideUp(200);
|
||||
$("#header #cart_block").stop(true, true).slideUp(200);
|
||||
$('#cart_block_no_products:hidden').slideDown(450);
|
||||
$('#cart_block dl.products').remove();
|
||||
}
|
||||
@@ -719,25 +722,25 @@ $(document).ready(function()
|
||||
cart_qty = parseInt($('.ajax_cart_quantity').html());
|
||||
|
||||
/* roll over cart */
|
||||
var cart_block = new HoverWatcher('#cart_block');
|
||||
var cart_block = new HoverWatcher('#header #cart_block');
|
||||
var shopping_cart = new HoverWatcher('#shopping_cart');
|
||||
|
||||
$("#shopping_cart a:first").hover(
|
||||
function() {
|
||||
$(this).css('border-radius', '3px 3px 0px 0px');
|
||||
if (ajaxCart.nb_total_products > 0 || cart_qty > 0)
|
||||
$("#header_right #cart_block").stop(true, true).slideDown(450);
|
||||
$("#header #cart_block").stop(true, true).slideDown(450);
|
||||
},
|
||||
function() {
|
||||
$('#shopping_cart a').css('border-radius', '3px');
|
||||
setTimeout(function() {
|
||||
if (!shopping_cart.isHoveringOver() && !cart_block.isHoveringOver())
|
||||
$("#header_right #cart_block").stop(true, true).slideUp(450);
|
||||
$("#header #cart_block").stop(true, true).slideUp(450);
|
||||
}, 200);
|
||||
}
|
||||
);
|
||||
|
||||
$("#header_right #cart_block").hover(
|
||||
$("#header #cart_block").hover(
|
||||
function() {
|
||||
$('#shopping_cart a').css('border-radius', '3px 3px 0px 0px');
|
||||
},
|
||||
@@ -745,7 +748,7 @@ $(document).ready(function()
|
||||
$('#shopping_cart a').css('border-radius', '3px');
|
||||
setTimeout(function() {
|
||||
if (!shopping_cart.isHoveringOver())
|
||||
$("#header_right #cart_block").stop(true, true).slideUp(450);
|
||||
$("#header #cart_block").stop(true, true).slideUp(450);
|
||||
}, 200);
|
||||
}
|
||||
);
|
||||
@@ -756,7 +759,10 @@ $(document).ready(function()
|
||||
headers: { "cache-control": "no-cache" },
|
||||
async: true,
|
||||
cache: false,
|
||||
url:$(this).attr('href') + '?rand=' + new Date().getTime()
|
||||
url:$(this).attr('href') + '?rand=' + new Date().getTime(),
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
|
||||
}
|
||||
});
|
||||
$(this).parent().parent().remove();
|
||||
if ($('body').attr('id') == 'order' || $('body').attr('id') == 'order-opc')
|
||||
@@ -825,4 +831,4 @@ function crossselling_serialScroll()
|
||||
force:false
|
||||
});
|
||||
$('#blockcart_list').trigger('goto', 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,15 +364,20 @@ class BlockCMSModel extends ObjectModel
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public static function getCMSBlockPages($id_block)
|
||||
public static function getCMSBlockPages($id_block, $id_shop = false)
|
||||
{
|
||||
$id_shop = ($id_shop !== false) ? $id_shop : Context::getContext()->shop->id;
|
||||
|
||||
$sql = 'SELECT cl.`id_cms`, cl.`meta_title`, cl.`link_rewrite`
|
||||
FROM `'._DB_PREFIX_.'cms_block_page` bcp
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_lang` cl
|
||||
ON (bcp.`id_cms` = cl.`id_cms`)
|
||||
INNER JOIN `'._DB_PREFIX_.'cms` c
|
||||
ON (bcp.`id_cms` = c.`id_cms`)
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_shop` cs
|
||||
ON (c.`id_cms` = cs.`id_cms`)
|
||||
WHERE bcp.`id_cms_block` = '.(int)$id_block.'
|
||||
AND cs.`id_shop` = '.(int)$id_shop.'
|
||||
AND cl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||
AND bcp.`is_category` = 0
|
||||
AND c.`active` = 1
|
||||
@@ -534,8 +539,7 @@ class BlockCMSModel extends ObjectModel
|
||||
{
|
||||
$key = (int)$cmsCategory['id_cms_block'];
|
||||
$content[$key]['display_store'] = $cmsCategory['display_store'];
|
||||
$content[$key]['cms'] = BlockCMSModel::getCMSBlockPages($cmsCategory['id_cms_block']);
|
||||
|
||||
$content[$key]['cms'] = BlockCMSModel::getCMSBlockPages($cmsCategory['id_cms_block'], $id_shop);
|
||||
$links = array();
|
||||
if (count($content[$key]['cms']))
|
||||
{
|
||||
|
||||
@@ -90,12 +90,12 @@ class BlockNewProducts extends Module
|
||||
if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId()))
|
||||
{
|
||||
if (!Configuration::get('NEW_PRODUCTS_NBR'))
|
||||
return;
|
||||
return;
|
||||
$newProducts = false;
|
||||
if (Configuration::get('PS_NB_DAYS_NEW_PRODUCT'))
|
||||
$newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int)Configuration::get('NEW_PRODUCTS_NBR'));
|
||||
$newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int)Configuration::get('NEW_PRODUCTS_NBR'));
|
||||
if (!$newProducts && !Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))
|
||||
return;
|
||||
return;
|
||||
$this->smarty->assign(array(
|
||||
'new_products' => $newProducts,
|
||||
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
|
||||
@@ -145,6 +145,7 @@ class BlockNewProducts extends Module
|
||||
{
|
||||
$this->_clearCache('blocknewproducts.tpl');
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
@@ -214,3 +215,6 @@ class BlockNewProducts extends Module
|
||||
);
|
||||
}
|
||||
}
|
||||
=======
|
||||
}
|
||||
>>>>>>> d49c4cf62e1919c66dc46a4161cb8045153092c8
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<input type="hidden" name="controller" value="search" />
|
||||
<input type="hidden" name="orderby" value="position" />
|
||||
<input type="hidden" name="orderway" value="desc" />
|
||||
<input class="search_query" type="search" id="search_query_top" name="search_query" placeholder="{l s='Search' mod='blocksearch'}" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
<input class="search_query" type="search" id="search_query_top" name="search_query" placeholder="{l s='Search' mod='blocksearch'}" value="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
|
||||
</form>
|
||||
</div>
|
||||
{else}
|
||||
@@ -41,7 +41,7 @@
|
||||
<input type="hidden" name="controller" value="search" />
|
||||
<input type="hidden" name="orderby" value="position" />
|
||||
<input type="hidden" name="orderway" value="desc" />
|
||||
<input class="search_query" type="text" id="search_query_top" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
<input class="search_query" type="text" id="search_query_top" name="search_query" value="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
|
||||
<input type="submit" name="submit_search" value="{l s='Search' mod='blocksearch'}" class="button" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<input type="hidden" name="controller" value="search" />
|
||||
<input type="hidden" name="orderby" value="position" />
|
||||
<input type="hidden" name="orderway" value="desc" />
|
||||
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{if isset($smarty.get.search_query)}{Tools::htmlentitiesUTF8($smarty.get.search_query)|stripslashes}{/if}" />
|
||||
<input type="submit" id="search_button" class="button_mini" value="{l s='Go!' mod='blocksearch'}" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA␍
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
@@ -63,7 +64,7 @@ class blocksharefb extends Module
|
||||
|
||||
if (isset($id_product) && $id_product != '')
|
||||
{
|
||||
$product_infos = new Product((int)$id_product, true, $cookie->id_lang);
|
||||
$product_infos = $this->context->controller->getProduct();
|
||||
$smarty->assign(array(
|
||||
'product_link' => urlencode($link->getProductLink($product_infos)),
|
||||
'product_title' => urlencode($product_infos->name),
|
||||
|
||||
@@ -99,7 +99,7 @@ class BlockSpecials extends Module
|
||||
));
|
||||
}
|
||||
|
||||
return $this->display(__FILE__, 'blockspecials.tpl', $this->getCacheId('blockspecials|'.$random));
|
||||
return $this->display(__FILE__, 'blockspecials.tpl', (Configuration::get('BLOCKSPECIALS_NB_CACHES') ? $this->getCacheId('blockspecials|'.$random) : null));
|
||||
}
|
||||
|
||||
public function hookLeftColumn($params)
|
||||
|
||||
@@ -68,6 +68,11 @@ if ($context->customer->isLogged())
|
||||
$combination_imgs = $obj->getCombinationImages($context->language->id);
|
||||
if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
|
||||
$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];
|
||||
else
|
||||
{
|
||||
$cover = Product::getCover($obj->id);
|
||||
$products[$i]['cover'] = $obj->id.'-'.$cover['id_image'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -62,6 +62,11 @@ if (empty($token) === false)
|
||||
$combination_imgs = $obj->getCombinationImages($context->language->id);
|
||||
if (isset($combination_imgs[$products[$i]['id_product_attribute']][0]))
|
||||
$products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image'];
|
||||
else
|
||||
{
|
||||
$cover = Product::getCover($obj->id);
|
||||
$products[$i]['cover'] = $obj->id.'-'.$cover['id_image'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -99,6 +99,7 @@ class CrossSelling extends Module
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'crossselling.css', 'all');
|
||||
$this->context->controller->addJS(($this->_path).'js/crossselling.js');
|
||||
$this->context->controller->addJqueryPlugin(array('scrollTo', 'serialScroll'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -303,4 +304,4 @@ class CrossSelling extends Module
|
||||
'CROSSSELLING_DISPLAY_PRICE' => Tools::getValue('CROSSSELLING_DISPLAY_PRICE', Configuration::get('CROSSSELLING_DISPLAY_PRICE')),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,8 +200,8 @@ class DateOfDelivery extends Module
|
||||
|
||||
$id_carrier = (int)OrderInvoice::getCarrierId($order_invoice->id);
|
||||
$return = '';
|
||||
if ($datesDelivery = $this->_getDatesOfDelivery($id_carrier, $oos, $order_invoice->date_add))
|
||||
$return = sprintf($this->l('Approximate date of delivery is between %1$s and %2$s'), $datesDelivery[0], $datesDelivery[1]);
|
||||
if (($datesDelivery = $this->_getDatesOfDelivery($id_carrier, $oos, $order_invoice->date_add)) && isset($datesDelivery[0][0]) && isset($datesDelivery[1][0]))
|
||||
$return = sprintf($this->l('Approximate date of delivery is between %1$s and %2$s'), $datesDelivery[0][0], $datesDelivery[1][0]);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
include(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
require_once(dirname(__FILE__).'/../../init.php');
|
||||
|
||||
if (!Module::getInstanceByName('feeder')->active)
|
||||
exit;
|
||||
|
||||
// Get data
|
||||
$number = ((int)(Tools::getValue('n')) ? (int)(Tools::getValue('n')) : 10);
|
||||
$orderBy = Tools::getProductsOrder('by', Tools::getValue('orderby'));
|
||||
@@ -64,7 +67,7 @@ echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
|
||||
if (is_array($image) AND sizeof($image))
|
||||
{
|
||||
$imageObj = new Image($image[0]['id_image']);
|
||||
echo "<![CDATA[<img src='"._PS_BASE_URL_._THEME_PROD_DIR_.$imageObj->getExistingImgPath()."-small_default.jpg' title='".str_replace('&', '', $product['name'])."' alt='thumb' />";
|
||||
echo "<![CDATA[<img src='".$link->getImageLink($product['link_rewrite'], $image[0]['id_image'], 'small_default')."' title='".str_replace('&', '', $product['name'])."' alt='thumb' />";
|
||||
$cdata = false;
|
||||
}
|
||||
if ($cdata)
|
||||
@@ -76,4 +79,4 @@ echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
|
||||
}
|
||||
?>
|
||||
</channel>
|
||||
</rss>
|
||||
</rss>
|
||||
@@ -705,7 +705,7 @@ class HomeSlider extends Module
|
||||
cursor: "move",
|
||||
update: function() {
|
||||
var order = $(this).sortable("serialize") + "&action=updateSlidesPosition";
|
||||
$.post("'._PS_BASE_URL_.__PS_BASE_URI__.'modules/'.$this->name.'/ajax_'.$this->name.'.php?secure_key='.$this->secure_key.'", order);
|
||||
$.post("'.$this->context->shop->physical_uri.$this->context->shop->virtual_uri.'modules/'.$this->name.'/ajax_'.$this->name.'.php?secure_key='.$this->secure_key.'", order);
|
||||
}
|
||||
});
|
||||
$mySlides.hover(function() {
|
||||
|
||||
@@ -88,7 +88,9 @@ class LoyaltyModule extends ObjectModel
|
||||
$currentContext = Context::getContext();
|
||||
$context = clone $currentContext;
|
||||
$context->cart = $cart;
|
||||
$context->customer = new Customer($context->cart->id_customer);
|
||||
// if customer is logged we do not recreate it
|
||||
if(!$context->customer->isLogged(true))
|
||||
$context->customer = new Customer($context->cart->id_customer);
|
||||
$context->language = new Language($context->cart->id_lang);
|
||||
$context->shop = new Shop($context->cart->id_shop);
|
||||
$context->currency = new Currency($context->cart->id_currency, null, $context->shop->id);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>mailalerts</name>
|
||||
<displayName><![CDATA[Mail alerts]]></displayName>
|
||||
<version><![CDATA[2.5]]></version>
|
||||
<version><![CDATA[2.7]]></version>
|
||||
<description><![CDATA[Sends e-mail notifications to customers and merchants.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[administration]]></tab>
|
||||
|
||||
@@ -46,7 +46,7 @@ class MailAlerts extends Module
|
||||
{
|
||||
$this->name = 'mailalerts';
|
||||
$this->tab = 'administration';
|
||||
$this->version = '2.5';
|
||||
$this->version = '2.7';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
@@ -194,6 +194,21 @@ class MailAlerts extends Module
|
||||
$this->init();
|
||||
}
|
||||
|
||||
public function getAllMessages($id)
|
||||
{
|
||||
$messages = Db::getInstance()->executeS('
|
||||
SELECT `message`
|
||||
FROM `'._DB_PREFIX_.'message`
|
||||
WHERE `id_order` = '.(int)$id.'
|
||||
ORDER BY `id_message` ASC
|
||||
');
|
||||
$result = array();
|
||||
foreach ($messages as $message) {
|
||||
$result[] = $message['message'];
|
||||
}
|
||||
return implode('<br/>', $result);
|
||||
}
|
||||
|
||||
public function hookActionValidateOrder($params)
|
||||
{
|
||||
if (!$this->_merchant_order || empty($this->_merchant_mails))
|
||||
@@ -209,9 +224,9 @@ class MailAlerts extends Module
|
||||
$configuration = Configuration::getMultiple(array('PS_SHOP_EMAIL', 'PS_MAIL_METHOD', 'PS_MAIL_SERVER', 'PS_MAIL_USER', 'PS_MAIL_PASSWD', 'PS_SHOP_NAME', 'PS_MAIL_COLOR'), $id_lang, null, $id_shop);
|
||||
$delivery = new Address((int)$order->id_address_delivery);
|
||||
$invoice = new Address((int)$order->id_address_invoice);
|
||||
$order_date_text = Tools::displayDate($order->date_add, (int)$id_lang);
|
||||
$order_date_text = Tools::displayDate($order->date_add);
|
||||
$carrier = new Carrier((int)$order->id_carrier);
|
||||
$message = $order->getFirstMessage();
|
||||
$message = $this->getAllMessages($order->id);
|
||||
|
||||
if (!$message || empty($message))
|
||||
$message = $this->l('No message');
|
||||
@@ -315,6 +330,7 @@ class MailAlerts extends Module
|
||||
'{total_products}' => Tools::displayPrice($order->getTotalProductsWithTaxes(), $currency),
|
||||
'{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency),
|
||||
'{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency),
|
||||
'{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $currency, false),
|
||||
'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency),
|
||||
'{currency}' => $currency->sign,
|
||||
'{message}' => $message
|
||||
@@ -374,16 +390,20 @@ class MailAlerts extends Module
|
||||
public function hookActionUpdateQuantity($params)
|
||||
{
|
||||
$id_product = (int)$params['id_product'];
|
||||
$product = new Product($id_product);
|
||||
$product_has_attributes = $product->hasAttributes();
|
||||
$id_product_attribute = (int)$params['id_product_attribute'];
|
||||
$quantity = (int)$params['quantity'];
|
||||
$context = Context::getContext();
|
||||
$id_shop = (int)$context->shop->id;
|
||||
$id_lang = (int)$context->language->id;
|
||||
$product = new Product($id_product, true, $id_lang, $id_shop, $context);
|
||||
$configuration = Configuration::getMultiple(array('MA_LAST_QTIES', 'PS_STOCK_MANAGEMENT', 'PS_SHOP_EMAIL', 'PS_SHOP_NAME'), $id_lang, null, $id_shop);
|
||||
$configuration = Configuration::getMultiple(array('MA_LAST_QTIES', 'PS_STOCK_MANAGEMENT', 'PS_SHOP_EMAIL', 'PS_SHOP_NAME'), null, null, $id_shop);
|
||||
$ma_last_qties = (int)$configuration['MA_LAST_QTIES'];
|
||||
|
||||
if ($product->active == 1 && (int)$quantity <= $ma_last_qties && !(!$this->_merchant_oos || empty($this->_merchant_mails)) && $configuration['PS_STOCK_MANAGEMENT'])
|
||||
|
||||
$check_oos = ($product_has_attributes && $id_product_attribute) || (!$product_has_attributes && !$id_product_attribute);
|
||||
|
||||
if ($check_oos && $product->active == 1 && (int)$quantity <= $ma_last_qties && !(!$this->_merchant_oos || empty($this->_merchant_mails)) && $configuration['PS_STOCK_MANAGEMENT'])
|
||||
{
|
||||
$iso = Language::getIsoById($id_lang);
|
||||
$product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);
|
||||
@@ -662,8 +682,7 @@ class MailAlerts extends Module
|
||||
'type' => 'textarea',
|
||||
'label' => $this->l('E-mail addresses:'),
|
||||
'name' => 'MA_MERCHANT_MAILS',
|
||||
'desc' => $this->l('One e-mail address per line (e.g. bob@example.com)
|
||||
'),
|
||||
'desc' => $this->l('One e-mail address per line (e.g. bob@example.com)'),
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
@@ -707,4 +726,4 @@ class MailAlerts extends Module
|
||||
'MA_MERCHANT_MAILS' => Tools::getValue('MA_MERCHANT_MAILS', Configuration::get('MA_MERCHANT_MAILS')),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -561,7 +561,7 @@ class ProductComments extends Module
|
||||
<div class="margin-form">
|
||||
">
|
||||
<select name="id_product_comment_criterion" id="id_product_comment_criterion" onchange="window.location=\''.Tools::safeOutput($this->_baseUrl).'&updateCriterion=\'+$(\'#id_product_comment_criterion option:selected\').val()">
|
||||
<option value="--">-- '.$this->l('Choose a criterion').' --</option>';
|
||||
<option value="-">- '.$this->l('Choose a criterion').' -</option>';
|
||||
foreach ($criterions as $foo)
|
||||
$this->_html .= '<option value="'.(int)($foo['id_product_comment_criterion']).'" '.($foo['id_product_comment_criterion'] == $id_criterion ? 'selected="selected"' : '').'>'.$foo['name'].'</option>';
|
||||
$this->_html .= '</select>
|
||||
@@ -705,7 +705,7 @@ class ProductComments extends Module
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'id_product_comment_form' => (int)Tools::getValue('id_product'),
|
||||
'product' => new Product((int)Tools::getValue('id_product'), false, $this->context->language->id),
|
||||
'product' => $this->context->controller->getProduct(),
|
||||
'secure_key' => $this->secure_key,
|
||||
'logged' => (int)$this->context->customer->isLogged(true),
|
||||
'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'),
|
||||
|
||||
@@ -174,7 +174,7 @@ class productsCategory extends Module
|
||||
{
|
||||
$this->context->controller->addCSS($this->_path.'productscategory.css', 'all');
|
||||
$this->context->controller->addJS($this->_path.'productscategory.js');
|
||||
$this->context->controller->addJqueryPlugin('serialScroll');
|
||||
$this->context->controller->addJqueryPlugin(array('scrollTo', 'serialScroll'));
|
||||
}
|
||||
|
||||
public function hookAddProduct($params)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{if count($categoryProducts) > 0 && $categoryProducts !== false}
|
||||
{if isset($categoryProducts) && count($categoryProducts) > 0 && $categoryProducts !== false}
|
||||
<div class="clearfix blockproductscategory">
|
||||
<h2 class="productscategory_h2">{$categoryProducts|@count} {l s='other products in the same category:' mod='productscategory'}</h2>
|
||||
<div id="{if count($categoryProducts) > 5}productscategory{else}productscategory_noscroll{/if}">
|
||||
|
||||
@@ -117,7 +117,7 @@ class PSCleaner extends Module
|
||||
// Remove inexisting or monolanguage configuration value from configuration_lang
|
||||
$query = 'DELETE FROM `'._DB_PREFIX_.'configuration_lang`
|
||||
WHERE `id_configuration` NOT IN (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration`)
|
||||
OR `id_configuration` IN (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration` WHERE name IS NOT NULL AND name != "")';
|
||||
OR `id_configuration` IN (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration` WHERE name IS NULL OR name = "")';
|
||||
if ($db->Execute($query))
|
||||
if ($affected_rows = $db->Affected_Rows())
|
||||
$logs[$query] = $affected_rows;
|
||||
@@ -266,8 +266,6 @@ class PSCleaner extends Module
|
||||
array('stock', 'id_warehouse', 'warehouse', 'id_warehouse'),
|
||||
array('stock', 'id_product', 'product', 'id_product'),
|
||||
array('stock_available', 'id_product', 'product', 'id_product'),
|
||||
array('stock_available', 'id_shop', 'shop', 'id_shop'),
|
||||
array('stock_available', 'id_shop_group', 'shop_group', 'id_shop_group'),
|
||||
array('stock_mvt', 'id_stock', 'stock', 'id_stock'),
|
||||
array('tab_module_preference', 'id_employee', 'employee', 'id_employee'),
|
||||
array('tab_module_preference', 'id_tab', 'tab', 'id_tab'),
|
||||
@@ -333,7 +331,13 @@ class PSCleaner extends Module
|
||||
if ($affected_rows = $db->Affected_Rows())
|
||||
$logs[$query] = $affected_rows;
|
||||
}
|
||||
|
||||
|
||||
// stock_available
|
||||
$query = 'DELETE FROM `'._DB_PREFIX_.'stock_available` WHERE `id_shop` NOT IN (SELECT `id_shop` FROM `'._DB_PREFIX_.'shop`) AND `id_shop_group` NOT IN (SELECT `id_shop_group` FROM `'._DB_PREFIX_.'shop_group`)';
|
||||
if ($db->Execute($query))
|
||||
if ($affected_rows = $db->Affected_Rows())
|
||||
$logs[$query] = $affected_rows;
|
||||
|
||||
Category::regenerateEntireNtree();
|
||||
|
||||
// @Todo: Remove attachment files, images...
|
||||
@@ -605,4 +609,4 @@ class PSCleaner extends Module
|
||||
{
|
||||
return array('value' => '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,6 +183,8 @@ class ReferralprogramProgramModuleFrontController extends ModuleFrontController
|
||||
|
||||
if ((int)($stats['nb_orders']) >= $orderQuantity)
|
||||
$canSendInvitations = true;
|
||||
|
||||
$discountInPercent = Tools::getValue('discount_type', Configuration::get('REFERRAL_DISCOUNT_TYPE')) == 1;
|
||||
|
||||
// Smarty display
|
||||
$this->context->smarty->assign(array(
|
||||
@@ -199,7 +201,7 @@ class ReferralprogramProgramModuleFrontController extends ModuleFrontController
|
||||
'nbRevive' => $nbRevive,
|
||||
'subscribeFriends' => ReferralProgramModule::getSponsorFriend((int)($this->context->customer->id), 'subscribed'),
|
||||
'mails_exists' => (isset($mails_exists) ? $mails_exists : array()),
|
||||
'currencySign' => $this->context->currency->sign
|
||||
'currencySign' => ($discountInPercent ? '%' : $this->context->currency->sign)
|
||||
));
|
||||
$this->setTemplate('program.tpl');
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ class StatsStock extends Module
|
||||
|
||||
$this->html .= '
|
||||
<script type="text/javascript">$(\'#calendar\').slideToggle();</script>
|
||||
|
||||
<div class="panel-heading">'
|
||||
.$this->l('Evaluation of available quantities for sale.').
|
||||
'</div>
|
||||
@@ -92,7 +93,7 @@ class StatsStock extends Module
|
||||
<label class="control-label col-lg-3">'.$this->l('Category').'</label>
|
||||
<div class="col-lg-6">
|
||||
<select name="statsstock_id_category" onchange="this.form.submit();">
|
||||
<option value="0">-- '.$this->l('All').' --</option>';
|
||||
<option value="0">- '.$this->l('All').' -</option>';
|
||||
foreach (Category::getSimpleCategories($this->context->language->id) as $category)
|
||||
$this->html .= '<option value="'.(int)$category['id_category'].'" '.
|
||||
($this->context->cookie->statsstock_id_category == $category['id_category'] ? 'selected="selected"' : '').'>'.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<description><![CDATA[Protect image by watermark.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[administration]]></tab>
|
||||
<confirmUninstall>Are you sure you want to delete your details ?</confirmUninstall>
|
||||
<confirmUninstall>Are you sure you want to delete these details?</confirmUninstall>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
|
||||
Reference in New Issue
Block a user