diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index 15d32e41b..eddca44d2 100755 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -974,6 +974,18 @@ class FrontControllerCore extends Controller */ public function setMobileTemplate($template) { + // Needed for site map + $blockmanufacturer = Module::getInstanceByName('blockmanufacturer'); + $blocksupplier = Module::getInstanceByName('blocksupplier'); + $this->context->smarty->assign('categoriesTree', Category::getRootCategory()->recurseLiteCategTree(0)); + $this->context->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1)); + $this->context->smarty->assign('voucherAllowed', (int)Configuration::get('PS_VOUCHERS')); + $this->context->smarty->assign('display_manufacturer_link', (((int)$blockmanufacturer->id) ? true : false)); + $this->context->smarty->assign('display_supplier_link', (((int)$blocksupplier->id) ? true : false)); + $this->context->smarty->assign('PS_DISPLAY_SUPPLIERS', Configuration::get('PS_DISPLAY_SUPPLIERS')); + $this->context->smarty->assign('display_store', Configuration::get('PS_STORES_DISPLAY_SITEMAP')); + + $mobile_template = ''; $tpl_file = basename($template); $dirname = dirname($template).(substr(dirname($template), -1, 1) == '/' ? '' : '/'); diff --git a/controllers/front/IdentityController.php b/controllers/front/IdentityController.php index 888387848..674e3dce1 100644 --- a/controllers/front/IdentityController.php +++ b/controllers/front/IdentityController.php @@ -125,7 +125,8 @@ class IdentityControllerCore extends FrontController public function setMedia() { parent::setMedia(); - $this->addCSS(_THEME_CSS_DIR_.'identity.css'); + if ($this->context->getMobileDevice() == false) + $this->addCSS(_THEME_CSS_DIR_.'identity.css'); } } diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index 65807c984..531b36dec 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -53,6 +53,7 @@ class ProductControllerCore extends FrontController } else $this->addJS(array( + _THEME_JS_DIR_.'tools.js', _THEME_MOBILE_JS_DIR_.'product.js' )); diff --git a/themes/default/js/product.js b/themes/default/js/product.js index 481e49c1f..df27d62fc 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -202,7 +202,7 @@ function updateDisplay() $('#quantityAvailableTxtMultiple').show(); } } - } + } else { //show the hook out of stock @@ -340,7 +340,7 @@ function updateDisplay() $('#not_impacted_by_discount').show(); else $('#not_impacted_by_discount').hide(); - + var taxExclPrice = (display_specific_price ? (specific_currency ? display_specific_price : display_specific_price * currencyRate) : priceTaxExclWithoutGroupReduction) + selectedCombination['price'] * currencyRate; if (display_specific_price) @@ -388,23 +388,25 @@ function updateDisplay() productPriceWithoutReduction += ecotaxAmount; //productPrice = ps_round(productPrice * currencyRate, 2); - if (productPrice > 0) - $('#our_price_display').text(formatCurrency(productPrice, currencyFormat, currencySign, currencyBlank)); - else - $('#our_price_display').text(formatCurrency(0, currencyFormat, currencySign, currencyBlank)); - + var our_price = ''; + if (productPrice > 0) { + our_price = formatCurrency(productPrice, currencyFormat, currencySign, currencyBlank); + } else { + our_price = formatCurrency(0, currencyFormat, currencySign, currencyBlank); + } + $('#our_price_display').text(our_price); $('#old_price_display').text(formatCurrency(productPriceWithoutReduction, currencyFormat, currencySign, currencyBlank)); if (productPriceWithoutReduction > productPrice) $('#old_price,#old_price_display,#old_price_display_taxes').show(); else $('#old_price,#old_price_display,#old_price_display_taxes').hide(); - /* Special feature: "Display product price tax excluded on product page" */ + // Special feature: "Display product price tax excluded on product page" if (!noTaxForThisProduct) var productPricePretaxed = productPrice / tax; else var productPricePretaxed = productPrice; $('#pretaxe_price_display').text(formatCurrency(productPricePretaxed, currencyFormat, currencySign, currencyBlank)); - /* Unit price */ + // Unit price productUnitPriceRatio = parseFloat(productUnitPriceRatio); if (productUnitPriceRatio > 0 ) { @@ -412,7 +414,7 @@ function updateDisplay() $('#unit_price_display').text(formatCurrency(newUnitPrice, currencyFormat, currencySign, currencyBlank)); } - /* Ecotax */ + // Ecotax var ecotaxAmount = !displayPrice ? ps_round(selectedCombination['ecotax'] * (1 + ecotaxTax_rate / 100), 2) : selectedCombination['ecotax']; $('#ecotax_price_display').text(formatCurrency(ecotaxAmount, currencyFormat, currencySign, currencyBlank)); }