[*] MO : updated controllers for mobile theme
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14114 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -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) == '/' ? '' : '/');
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ class ProductControllerCore extends FrontController
|
||||
}
|
||||
else
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'tools.js',
|
||||
_THEME_MOBILE_JS_DIR_.'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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user