[*] MO : TM - Blockcart added Layer
This commit is contained in:
@@ -141,13 +141,16 @@ class ProductSaleCore
|
||||
$groups = FrontController::getCurrentCustomerGroups();
|
||||
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||
|
||||
$sql = 'SELECT p.id_product, pl.`link_rewrite`, pl.`name`, pl.`description_short`, MAX(image_shop.`id_image`) id_image, il.`legend`,
|
||||
ps.`quantity` AS sales, p.`ean13`, p.`upc`, cl.`link_rewrite` AS category, p.show_price, p.available_for_order, p.quantity, p.customizable,
|
||||
IFNULL(pa.minimal_quantity, p.minimal_quantity) as minimal_quantity, p.out_of_stock
|
||||
$sql = 'SELECT p.id_product, MAX(product_attribute_shop.id_product_attribute) id_product_attribute, pl.`link_rewrite`, pl.`name`, pl.`description_short`, MAX(image_shop.`id_image`) id_image, il.`legend`,
|
||||
ps.`quantity` AS sales, p.`ean13`, p.`upc`, cl.`link_rewrite` AS category, p.show_price, p.available_for_order, IFNULL(stock.quantity, 0) as quantity, p.customizable,
|
||||
IFNULL(pa.minimal_quantity, p.minimal_quantity) as minimal_quantity, stock.out_of_stock
|
||||
FROM `'._DB_PREFIX_.'product_sale` ps
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product`
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (ps.`id_product` = pa.`id_product` AND pa.default_on = 1)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
|
||||
ON (p.`id_product` = pa.`id_product`)
|
||||
'.Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.`default_on` = 1').'
|
||||
'.Product::sqlStock('p', 'product_attribute_shop', false, $context->shop).'
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
|
||||
ON p.`id_product` = pl.`id_product`
|
||||
AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').'
|
||||
|
||||
@@ -654,4 +654,62 @@ class OrderDetailCore extends ObjectModel
|
||||
$query->where('od.`id_order_detail` = '.(int)$this->id_order_detail);
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getCrossSells($id_product, $id_lang, $limit = 12)
|
||||
{
|
||||
if (!$id_product || !$id_lang)
|
||||
return;
|
||||
|
||||
$front = true;
|
||||
if (!in_array(Context::getContext()->controller->controller_type, array('front', 'modulefront')))
|
||||
$front = false;
|
||||
|
||||
$orders = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT o.id_order
|
||||
FROM '._DB_PREFIX_.'orders o
|
||||
LEFT JOIN '._DB_PREFIX_.'order_detail od ON (od.id_order = o.id_order)
|
||||
WHERE o.valid = 1 AND od.product_id = '.(int)$id_product);
|
||||
|
||||
if (sizeof($orders))
|
||||
{
|
||||
$list = '';
|
||||
foreach ($orders AS $order)
|
||||
$list .= (int)$order['id_order'].',';
|
||||
$list = rtrim($list, ',');
|
||||
|
||||
$orderProducts = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT DISTINCT od.product_id, p.id_product, pl.name, pl.link_rewrite, p.reference, i.id_image, product_shop.show_price, cl.link_rewrite category, p.ean13, p.out_of_stock, p.id_category_default
|
||||
FROM '._DB_PREFIX_.'order_detail od
|
||||
LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = od.product_id)
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = od.product_id'.Shop::addSqlRestrictionOnLang('pl').')
|
||||
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').')
|
||||
LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = od.product_id)
|
||||
WHERE od.id_order IN ('.$list.')
|
||||
AND pl.id_lang = '.(int)$id_lang.'
|
||||
AND cl.id_lang = '.(int)$id_lang.'
|
||||
AND od.product_id != '.(int)$id_product.'
|
||||
AND i.cover = 1
|
||||
AND product_shop.active = 1'
|
||||
.($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '').'
|
||||
ORDER BY RAND()
|
||||
LIMIT '.(int)$limit.'
|
||||
');
|
||||
|
||||
$taxCalc = Product::getTaxCalculationMethod();
|
||||
if (is_array($orderProducts))
|
||||
{
|
||||
foreach ($orderProducts AS &$orderProduct)
|
||||
{
|
||||
$orderProduct['image'] = Context::getContext()->link->getImageLink($orderProduct['link_rewrite'], (int)$orderProduct['product_id'].'-'.(int)$orderProduct['id_image'], ImageType::getFormatedName('medium'));
|
||||
$orderProduct['link'] = Context::getContext()->link->getProductLink((int)$orderProduct['product_id'], $orderProduct['link_rewrite'], $orderProduct['category'], $orderProduct['ean13']);
|
||||
if ($taxCalc == 0 OR $taxCalc == 2)
|
||||
$orderProduct['displayed_price'] = Product::getPriceStatic((int)$orderProduct['product_id'], true, NULL);
|
||||
elseif ($taxCalc == 1)
|
||||
$orderProduct['displayed_price'] = Product::getPriceStatic((int)$orderProduct['product_id'], false, NULL);
|
||||
}
|
||||
return Product::getProductsProperties($id_lang, $orderProducts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>blockbestsellers</name>
|
||||
<displayName><![CDATA[Top-seller block]]></displayName>
|
||||
<version><![CDATA[1.2]]></version>
|
||||
<version><![CDATA[1.3]]></version>
|
||||
<description><![CDATA[Add a block displaying your store's top-selling products.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
|
||||
@@ -253,6 +253,14 @@ var ajaxCart = {
|
||||
.fadeOut(100, function() {
|
||||
ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
|
||||
$(this).remove();
|
||||
if (!jsonData.hasError)
|
||||
{
|
||||
$('.crossseling').html(jsonData.crossSelling)
|
||||
$(jsonData.products).each(function(){
|
||||
if (this.id != undefined && this.id == parseInt(idProduct))
|
||||
ajaxCart.updateLayer(this);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -581,6 +589,25 @@ var ajaxCart = {
|
||||
return (content);
|
||||
},
|
||||
|
||||
updateLayer : function(product) {
|
||||
$('#layer_cart_product_title').text(product.name);
|
||||
$('#layer_cart_product_attributes').text('');
|
||||
if (product.hasAttributes && product.hasAttributes == true)
|
||||
$('#layer_cart_product_attributes').html(product.attributes);
|
||||
$('#layer_cart_product_price').text(product.price);
|
||||
$('#layer_cart_product_quantity').text(product.quantity);
|
||||
$('.layer_cart_img').prop({'src' : product.image, 'alt' : product.name, 'title' : product.name});
|
||||
var h = parseInt($(window).height());
|
||||
var s = parseInt($(window).scrollTop());
|
||||
var t = $('#layer_cart').outerHeight(true);
|
||||
if (t < h)
|
||||
var n = parseInt(((h-t) / 2) + s) + 'px';
|
||||
$('.layer_cart_overlay').css('width',$('body').width());
|
||||
$('.layer_cart_overlay').css('height',$('body').height());
|
||||
$('.layer_cart_overlay').show();
|
||||
$('#layer_cart').css({'top': n}).fadeIn('fast');
|
||||
crossselling_serialScroll();
|
||||
},
|
||||
|
||||
//genarally update the display of the cart
|
||||
updateCart : function(jsonData) {
|
||||
@@ -615,7 +642,6 @@ var ajaxCart = {
|
||||
//update general cart informations everywhere in the page
|
||||
updateCartEverywhere : function(jsonData) {
|
||||
$('.ajax_cart_total').text($.trim(jsonData.productTotal));
|
||||
|
||||
if (parseFloat(jsonData.shippingCostFloat) > 0 || jsonData.nbTotalProducts < 1)
|
||||
$('.ajax_cart_shipping_cost').text(jsonData.shippingCost);
|
||||
else if (typeof(freeShippingTranslation) != 'undefined')
|
||||
@@ -623,6 +649,16 @@ var ajaxCart = {
|
||||
$('.ajax_cart_tax_cost').text(jsonData.taxCost);
|
||||
$('.cart_block_wrapping_cost').text(jsonData.wrappingCost);
|
||||
$('.ajax_block_cart_total').text(jsonData.total);
|
||||
$('.ajax_block_products_total').text(jsonData.productTotal);
|
||||
$('.ajax_total_price_wt').text(jsonData.total_price_wt);
|
||||
|
||||
if (parseFloat(jsonData.freeShippingFloat) > 0)
|
||||
{
|
||||
$('.ajax_cart_free_shipping').html(jsonData.freeShipping);
|
||||
$('.freeshipping').fadeIn(0);
|
||||
}
|
||||
else if (parseFloat(jsonData.freeShippingFloat) == 0)
|
||||
$('.freeshipping').fadeOut(0);
|
||||
|
||||
this.nb_total_products = jsonData.nbTotalProducts;
|
||||
|
||||
@@ -664,24 +700,8 @@ var ajaxCart = {
|
||||
}
|
||||
};
|
||||
|
||||
function HoverWatcher(selector){
|
||||
this.hovering = false;
|
||||
var self = this;
|
||||
|
||||
this.isHoveringOver = function() {
|
||||
return self.hovering;
|
||||
}
|
||||
|
||||
$(selector).hover(function() {
|
||||
self.hovering = true;
|
||||
}, function() {
|
||||
self.hovering = false;
|
||||
})
|
||||
}
|
||||
|
||||
//when document is loaded...
|
||||
$(document).ready(function(){
|
||||
// expand/collapse management
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#block_cart_collapse').click(function(){
|
||||
ajaxCart.collapse();
|
||||
});
|
||||
@@ -753,4 +773,56 @@ $(document).ready(function(){
|
||||
$(this).attr('disabled', true).removeClass('exclusive').addClass('exclusive_disabled');
|
||||
$(this).closest("form").get(0).submit();
|
||||
});
|
||||
|
||||
$('#layer_cart .cross, #layer_cart .continue, .layer_cart_overlay').click(function(){
|
||||
$('.layer_cart_overlay').hide(); $('#layer_cart').fadeOut('fast'); return false;
|
||||
});
|
||||
});
|
||||
|
||||
function HoverWatcher(selector){
|
||||
this.hovering = false;
|
||||
var self = this;
|
||||
|
||||
this.isHoveringOver = function() {
|
||||
return self.hovering;
|
||||
}
|
||||
|
||||
$(selector).hover(function() {
|
||||
self.hovering = true;
|
||||
}, function() {
|
||||
self.hovering = false;
|
||||
})
|
||||
}
|
||||
|
||||
function crossselling_serialScrollFixLock(event, targeted, scrolled, items, position)
|
||||
{
|
||||
serialScrollNbImages = $('#blockcart_list li:visible').length;
|
||||
serialScrollNbImagesDisplayed = 4;
|
||||
|
||||
var leftArrow = position == 0 ? true : false;
|
||||
var rightArrow = position + serialScrollNbImagesDisplayed >= serialScrollNbImages ? true : false;
|
||||
|
||||
$('#blockcart_scroll_left').css('cursor', leftArrow ? 'default' : 'pointer').css('display', leftArrow ? 'none' : 'block').fadeTo(0, leftArrow ? 0 : 1);
|
||||
$('#blockcart_scroll_right').css('cursor', rightArrow ? 'default' : 'pointer').fadeTo(0, rightArrow ? 0 : 1).css('display', rightArrow ? 'none' : 'block');
|
||||
return true;
|
||||
}
|
||||
|
||||
function crossselling_serialScroll()
|
||||
{
|
||||
$('#blockcart_list').serialScroll({
|
||||
items:'li:visible',
|
||||
prev:'#blockcart_scroll_left',
|
||||
next:'#blockcart_scroll_right',
|
||||
axis:'x',
|
||||
offset:0,
|
||||
start:0,
|
||||
stop:true,
|
||||
onBefore:crossselling_serialScrollFixLock,
|
||||
duration:300,
|
||||
step: 1,
|
||||
lazy: true,
|
||||
lock: false,
|
||||
force:false
|
||||
});
|
||||
$('#blockcart_list').trigger('goto', 0);
|
||||
}
|
||||
@@ -31,8 +31,9 @@
|
||||
{ldelim}
|
||||
"id": {$product.id_product},
|
||||
"link": "{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|addslashes|replace:'\\\'':'\''}",
|
||||
"quantity": {$product.cart_quantity},
|
||||
"quantity": {$product.cart_quantity|intval},
|
||||
"priceByLine": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}",
|
||||
"image": "{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|addslashes|replace:'\\\'':'\''}",
|
||||
"name": "{$product.name|html_entity_decode:2:'UTF-8'|truncate:15:'...':true|escape:'htmlall'}",
|
||||
"price": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}",
|
||||
"price_float": "{$product.total}",
|
||||
@@ -99,6 +100,8 @@
|
||||
"nbTotalProducts": "{$nb_total_products}",
|
||||
"total": "{$total|html_entity_decode:2:'UTF-8'}",
|
||||
"productTotal": "{$product_total|html_entity_decode:2:'UTF-8'}",
|
||||
"freeShipping": "{displayWtPrice|html_entity_decode:2:'UTF-8' p=$free_shipping}",
|
||||
"freeShippingFloat": "{$free_shipping|html_entity_decode:2:'UTF-8'}",
|
||||
{if isset($errors) && $errors}
|
||||
"hasError" : true,
|
||||
"errors" : [
|
||||
|
||||
@@ -110,4 +110,51 @@
|
||||
text-align: right;
|
||||
width: 15px;
|
||||
}
|
||||
|
||||
#layer_cart {
|
||||
background-color:#f9f9f9;
|
||||
border:1px solid #dcdcdc;
|
||||
padding:4px;
|
||||
position:absolute;
|
||||
left:0;
|
||||
clear:both;
|
||||
display:none;
|
||||
z-index:99;
|
||||
}
|
||||
.layer_cart_overlay {
|
||||
background-color:#000;
|
||||
display:none;
|
||||
height:100%;
|
||||
left:0;
|
||||
position:fixed;
|
||||
top:0;
|
||||
width:100%;
|
||||
z-index:98;
|
||||
opacity:.50;
|
||||
-moz-opacity:.50;
|
||||
filter:alpha(opacity=50);
|
||||
}
|
||||
* html .layer_cart_overlay {
|
||||
filter:alpha(opacity=50);
|
||||
position:absolute;
|
||||
left:0;
|
||||
margin-left:-160px;
|
||||
}
|
||||
#layer_cart .continue {
|
||||
cursor: pointer;
|
||||
}
|
||||
#layer_cart p {
|
||||
padding: 0px;
|
||||
}
|
||||
#blockcart_list {
|
||||
width: 232px;
|
||||
overflow: hidden;
|
||||
}
|
||||
#blockcart_list ul {
|
||||
display: block;
|
||||
height: 90px;
|
||||
}
|
||||
#blockcart_list li {
|
||||
list-style-type: none;
|
||||
float: left;
|
||||
width: 58px;
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class BlockCart extends Module
|
||||
{
|
||||
$this->name = 'blockcart';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.2';
|
||||
$this->version = '1.3';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
@@ -99,6 +99,17 @@ class BlockCart extends Module
|
||||
}
|
||||
}
|
||||
|
||||
$total_free_shipping = 0;
|
||||
if ($free_shipping = Tools::convertPrice(floatval(Configuration::get('PS_SHIPPING_FREE_PRICE')), new Currency(intval($params['cart']->id_currency))))
|
||||
{
|
||||
$total_free_shipping = floatval($free_shipping - ($params['cart']->getOrderTotal(true, Cart::ONLY_PRODUCTS) + $params['cart']->getOrderTotal(true, Cart::ONLY_DISCOUNTS)));
|
||||
$discounts = $params['cart']->getCartRules(CartRule::FILTER_ACTION_SHIPPING);
|
||||
if ($total_free_shipping < 0)
|
||||
$total_free_shipping = 0;
|
||||
if (is_array($discounts) && count($discounts))
|
||||
$total_free_shipping = 0;
|
||||
}
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'products' => $products,
|
||||
'customizedDatas' => Product::getAllCustomizedDatas((int)($params['cart']->id)),
|
||||
@@ -115,7 +126,8 @@ class BlockCart extends Module
|
||||
'total' => Tools::displayPrice($totalToPay, $currency),
|
||||
'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order',
|
||||
'ajax_allowed' => (int)(Configuration::get('PS_BLOCK_CART_AJAX')) == 1 ? true : false,
|
||||
'static_token' => Tools::getToken(false)
|
||||
'static_token' => Tools::getToken(false),
|
||||
'free_shipping' => $total_free_shipping
|
||||
));
|
||||
if (count($errors))
|
||||
$this->smarty->assign('errors', $errors);
|
||||
@@ -134,6 +146,16 @@ class BlockCart extends Module
|
||||
else
|
||||
Configuration::updateValue('PS_BLOCK_CART_AJAX', (int)($ajax));
|
||||
$output .= $this->displayConfirmation($this->l('Settings updated'));
|
||||
|
||||
if (!($productNbr = Tools::getValue('PS_BLOCK_CART_XSELL_LIMIT')) || empty($productNbr))
|
||||
$output .= $this->displayError($this->l('Please complete the "products to display" field.'));
|
||||
elseif ((int)($productNbr) == 0)
|
||||
$output .= $this->displayError($this->l('Invalid number.'));
|
||||
else
|
||||
{
|
||||
Configuration::updateValue('PS_BLOCK_CART_XSELL_LIMIT', (int)(Tools::getValue('PS_BLOCK_CART_XSELL_LIMIT')));
|
||||
$output .= $this->displayConfirmation($this->l('Settings updated'));
|
||||
}
|
||||
}
|
||||
return $output.$this->renderForm();
|
||||
}
|
||||
@@ -145,7 +167,8 @@ class BlockCart extends Module
|
||||
|| $this->registerHook('top') == false
|
||||
|| $this->registerHook('header') == false
|
||||
|| $this->registerHook('actionCartListOverride') == false
|
||||
|| Configuration::updateValue('PS_BLOCK_CART_AJAX', 1) == false)
|
||||
|| Configuration::updateValue('PS_BLOCK_CART_AJAX', 1) == false
|
||||
|| Configuration::updateValue('PS_BLOCK_CART_XSELL_LIMIT', 12) == false)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -172,7 +195,13 @@ class BlockCart extends Module
|
||||
return;
|
||||
|
||||
$this->assignContentVars($params);
|
||||
$res = $this->display(__FILE__, 'blockcart-json.tpl');
|
||||
$res = Tools::jsonDecode($this->display(__FILE__, 'blockcart-json.tpl'), true);
|
||||
if (is_array($res) && $id_product = Tools::getValue('id_product'))
|
||||
{
|
||||
$this->smarty->assign('orderProducts', OrderDetail::getCrossSells($id_product, $this->context->language->id, Configuration::get('PS_BLOCK_CART_XSELL_LIMIT')));
|
||||
$res['crossSelling'] = $this->display(__FILE__, 'crossselling.tpl');
|
||||
}
|
||||
$res = Tools::jsonEncode($res);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -192,7 +221,10 @@ class BlockCart extends Module
|
||||
|
||||
$this->context->controller->addCSS(($this->_path).'blockcart.css', 'all');
|
||||
if ((int)(Configuration::get('PS_BLOCK_CART_AJAX')))
|
||||
{
|
||||
$this->context->controller->addJS(($this->_path).'ajax-cart.js');
|
||||
$this->context->controller->addJqueryPlugin(array('scrollTo', 'serialScroll'));
|
||||
}
|
||||
}
|
||||
|
||||
public function hookTop($params)
|
||||
@@ -227,7 +259,14 @@ class BlockCart extends Module
|
||||
'label' => $this->l('Disabled')
|
||||
)
|
||||
),
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Products to display in cross selling'),
|
||||
'name' => 'PS_BLOCK_CART_XSELL_LIMIT',
|
||||
'class' => 'fixed-width-xs',
|
||||
'desc' => $this->l('Define the number of products to be displayed in the cross selling block.')
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
@@ -260,7 +299,7 @@ class BlockCart extends Module
|
||||
{
|
||||
return array(
|
||||
'PS_BLOCK_CART_AJAX' => Tools::getValue('PS_BLOCK_CART_AJAX', Configuration::get('PS_BLOCK_CART_AJAX')),
|
||||
'PS_BLOCK_CART_XSELL_LIMIT' => Tools::getValue('PS_BLOCK_CART_XSELL_LIMIT', Configuration::get('PS_BLOCK_CART_XSELL_LIMIT'))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>blockcart</name>
|
||||
<displayName><![CDATA[Cart block]]></displayName>
|
||||
<version><![CDATA[1.2]]></version>
|
||||
<version><![CDATA[1.3]]></version>
|
||||
<description><![CDATA[Adds a block containing the customer's shopping cart.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
{*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
{if isset($orderProducts) && count($orderProducts) > 0}
|
||||
<h2>{l s='Customers who bought this product also bought:' mod='blockcart'}</h2>
|
||||
<a id="blockcart_scroll_left" class="blockcart_scroll_left{if count($orderProducts) < 5} hidden{/if}" title="{l s='Previous' mod='crossselling'}" rel="nofollow">{l s='Previous' mod='blockcart'}</a>
|
||||
<div id="blockcart_list">
|
||||
<ul {if count($orderProducts) > 4}style="width: {math equation="width * nbImages" width=58 nbImages=$orderProducts|@count}px"{/if}>
|
||||
{foreach from=$orderProducts item='orderProduct' name=orderProduct}
|
||||
<li>
|
||||
<a href="{$orderProduct.link}" title="{$orderProduct.name|htmlspecialchars}" class="lnk_img"><img src="{$orderProduct.image}" alt="{$orderProduct.name|htmlspecialchars}" /></a>
|
||||
<p class="product_name"><a href="{$orderProduct.link}" title="{$orderProduct.name|htmlspecialchars}">{$orderProduct.name|truncate:15:'...'|escape:'htmlall':'UTF-8'}</a></p>
|
||||
{if $orderProduct.show_price == 1 AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
|
||||
<span class="price_display">
|
||||
<span class="price">{convertPrice price=$orderProduct.displayed_price}</span>
|
||||
</span>
|
||||
{else}
|
||||
<br />
|
||||
{/if}
|
||||
<!-- <a title="{l s='View' mod='blockcart'}" href="{$orderProduct.link}" class="button_small">{l s='View' mod='blockcart'}</a><br /> -->
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
<a id="blockcart_scroll_right" class="blockcart_scroll_right{if count($orderProducts) < 5} hidden{/if}" title="{l s='Next' mod='blockcart'}" rel="nofollow">{l s='Next' mod='blockcart'}</a>
|
||||
{/if}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
function upgrade_module_1_3($object)
|
||||
{
|
||||
return Configuration::updateValue('PS_BLOCK_CART_XSELL_LIMIT', 12);
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>blocknewproducts</name>
|
||||
<displayName><![CDATA[New products block]]></displayName>
|
||||
<version><![CDATA[1.4]]></version>
|
||||
<version><![CDATA[1.5]]></version>
|
||||
<description><![CDATA[Displays a block featuring your store's newest products.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>homefeatured</name>
|
||||
<displayName><![CDATA[Featured products on the homepage.]]></displayName>
|
||||
<version><![CDATA[1.1]]></version>
|
||||
<version><![CDATA[1.2]]></version>
|
||||
<description><![CDATA[Displays featured products in the middle of your homepage.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
|
||||
@@ -126,7 +126,7 @@ var generated_date = {$smarty.now|intval};
|
||||
</tbody>
|
||||
</table>
|
||||
<p id="cart-prices">
|
||||
<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
|
||||
<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{if $shipping_cost_float == 0}{l s='Free shipping!' mod='blockcart'}{else}{$shipping_cost}{/if}</span>
|
||||
<span>{l s='Shipping' mod='blockcart'}</span>
|
||||
<br/>
|
||||
{if $show_wrapping}
|
||||
@@ -162,4 +162,34 @@ var generated_date = {$smarty.now|intval};
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="layer_cart">
|
||||
<div class="layer_cart_product">
|
||||
<h2>{l s='Product successfully added to your shopping cart' mod='blockcart'}</h2>
|
||||
<img class="layer_cart_img" alt="img" src="{$base_dir}img/404.gif"/>
|
||||
<div class="layer_cart_product_info">
|
||||
<span id="layer_cart_product_title" style="font-size:1em"></span>
|
||||
<span id="layer_cart_product_attributes"></span>
|
||||
<p>{l s='Quantity:' mod='blockcart'} <span id="layer_cart_product_quantity"></span></p>
|
||||
<p>{l s='Total:' mod='blockcart'} <span id="layer_cart_product_price"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layer_cart_cart">
|
||||
<span class="cross" title="{l s='Close window' mod='blockcart'}"></span>
|
||||
<span>{l s='Cart' mod='blockcart'}</span> <span class="ajax_cart_quantity">{$cart_qties}</span> <span class="ajax_cart_product_txt{if $cart_qties > 1} hidden{/if}">{l s='item' mod='blockcart'}</span><span class="ajax_cart_product_txt_s{if $cart_qties < 2} hidden{/if}">{l s='items' mod='blockcart'}</span>
|
||||
<span>{l s='Total products' mod='blockcart'}{if $priceDisplay == 1} {l s='(tax exclu.):' mod='blockcart'}{else} {l s='(tax incl.):' mod='blockcart'}{/if}</span> <span class="ajax_block_products_total">{if $cart_qties > 0}{convertPrice price=$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS)}{/if}</span>
|
||||
{if $show_wrapping}
|
||||
<span>{l s='Wrapping' mod='blockcart'}{if $priceDisplay == 1} {l s='(tax exclu.):' mod='blockcart'}{else} {l s='(tax incl.):' mod='blockcart'}{/if}</span> <span class="price cart_block_wrapping_cost">{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false, Cart::ONLY_WRAPPING)}{else}{convertPrice price=$cart->getOrderTotal(true, Cart::ONLY_WRAPPING)}{/if}</span>
|
||||
{/if}
|
||||
<span>{l s='Total shipping (tax exclu.):' mod='blockcart'}</span> <span class="ajax_cart_shipping_cost">{if $shipping_cost_float == 0}{l s='Free shipping!' mod='blockcart'}{else}{$shipping_cost}{/if}</span>
|
||||
{if $show_tax && isset($tax_cost)}
|
||||
<span>{l s='Tax' mod='blockcart'}</span><span id="cart_block_tax_cost" class="price ajax_cart_tax_cost">{$tax_cost}</span>
|
||||
{/if}
|
||||
<span>{l s='Total:' mod='blockcart'}{if $priceDisplay == 1} {l s='(tax exclu.):' mod='blockcart'}{else} {l s='(tax incl.):' mod='blockcart'}{/if}</span> <span class="ajax_cart_total">{if $cart_qties > 0}{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false)}{else}{convertPrice price=$cart->getOrderTotal(true)}{/if}{/if}</span>
|
||||
<span class="freeshipping{if $cart_qties > 0 && ($free_shipping <= 0 || $shipping_cost_float == 0)} hidden{/if}"><span>{l s='Spend just' mod='blockcart'}</span> <span class="ajax_cart_free_shipping">{convertPrice price=$free_shipping}</span><span> {l s='more and get' mod='blockcart'}</span> <span>{l s='FREE SHIPPING!' mod='blockcart'}</span></span>
|
||||
<span class="continue" title="{l s='Continue shopping' mod='blockcart'}">{l s='Continue shopping' mod='blockcart'}</span>
|
||||
<a href="{$link->getPageLink("$order_process", true)|escape:'html'}" title="{l s='Procedd to checkout' mod='blockcart'}" rel="nofollow">{l s='Procedd to checkout' mod='blockcart'}</a>
|
||||
</div>
|
||||
<div class="crossseling"></div>
|
||||
</div>
|
||||
<div class="layer_cart_overlay"></div>
|
||||
<!-- /MODULE Block cart -->
|
||||
Reference in New Issue
Block a user