[*] FO : combination link from product page are now the same as the combination link from blocklayered
// Cart is now accepting the combination link
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
{assign var='productAttributeId' value=$product.id_product_attribute}
|
||||
{ldelim}
|
||||
"id": {$product.id_product},
|
||||
"link": "{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop)|addslashes|replace:'\\\'':'\''}",
|
||||
"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},
|
||||
"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}",
|
||||
"name": "{$product.name|html_entity_decode:2:'UTF-8'|escape|truncate:15:'...':true}",
|
||||
|
||||
@@ -62,14 +62,14 @@ var removingLinkText = '{l s='remove this product from my cart' mod='blockcart'
|
||||
{assign var='productAttributeId' value=$product.id_product_attribute}
|
||||
<dt id="cart_block_product_{$product.id_product}{if $product.id_product_attribute}_{$product.id_product_attribute}{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
|
||||
<span class="quantity-formated"><span class="quantity">{$product.cart_quantity}</span>x</span>
|
||||
<a class="cart_block_product_name" href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop)}" title="{$product.name|escape:html:'UTF-8'}">
|
||||
<a class="cart_block_product_name" href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)}" title="{$product.name|escape:html:'UTF-8'}">
|
||||
{$product.name|truncate:13:'...'|escape:html:'UTF-8'}</a>
|
||||
<span class="remove_link">{if !isset($blockcart_customizedDatas.$productId.$productAttributeId)}<a rel="nofollow" class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete&id_product={$product.id_product}&ipa={$product.id_product_attribute}&token={$static_token}")}" title="{l s='remove this product from my cart' mod='blockcart'}"> </a>{/if}</span>
|
||||
<span class="price">{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice p="`$product.total`"}{else}{displayWtPrice p="`$product.total_wt`"}{/if}</span>
|
||||
</dt>
|
||||
{if isset($product.attributes_small)}
|
||||
<dd id="cart_block_combination_of_{$product.id_product}{if $product.id_product_attribute}_{$product.id_product_attribute}{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
|
||||
<a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop)}" title="{l s='Product detail'}">{$product.attributes_small}</a>
|
||||
<a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)}" title="{l s='Product detail'}">{$product.attributes_small}</a>
|
||||
{/if}
|
||||
|
||||
<!-- Customizable datas -->
|
||||
|
||||
@@ -88,6 +88,7 @@ function initLayered()
|
||||
{
|
||||
initSliders();
|
||||
initLocationChange();
|
||||
updateProductUrl();
|
||||
if (window.location.href.split('#').length == 2 && window.location.href.split('#')[1] != '')
|
||||
{
|
||||
var params = window.location.href.split('#')[1];
|
||||
@@ -318,6 +319,7 @@ function reloadContent(params_plus)
|
||||
|
||||
if(slideUp)
|
||||
$.scrollTo('#product_list', 400);
|
||||
updateProductUrl();
|
||||
}
|
||||
});
|
||||
ajaxQueries.push(ajaxQuery);
|
||||
@@ -352,3 +354,11 @@ function getUrlParams()
|
||||
params = '#'+window.location.href.split('#')[1];
|
||||
return params;
|
||||
}
|
||||
|
||||
function updateProductUrl()
|
||||
{
|
||||
// Adding the filters to URL product
|
||||
$('ul#product_list li.ajax_block_product .product_img_link').attr('href', $('ul#product_list li.ajax_block_product .product_img_link').attr('href') + param_product_url);
|
||||
$('ul#product_list li.ajax_block_product h3 a').attr('href', $('ul#product_list li.ajax_block_product h3 a').attr('href') + param_product_url);
|
||||
$('ul#product_list li.ajax_block_product .product_desc a').attr('href', $('ul#product_list li.ajax_block_product .product_desc a').attr('href') + param_product_url);
|
||||
}
|
||||
|
||||
@@ -2385,6 +2385,7 @@ class BlockLayered extends Module
|
||||
|
||||
//generate SEO link
|
||||
$paramSelected = '';
|
||||
$param_product_url = '';
|
||||
$optionCheckedArray = array();
|
||||
$paramGroupSelectedArray = array();
|
||||
$titleValues = array();
|
||||
@@ -2419,6 +2420,9 @@ class BlockLayered extends Module
|
||||
$paramSelected .= '/'.str_replace('-', '_', Tools::link_rewrite($filterName)).$paramGroupSelected;
|
||||
$optionCheckedArray[Tools::link_rewrite($filterName)] = $paramGroupSelected;
|
||||
}
|
||||
// select only attribute and group attribute to display an unique product combination link
|
||||
if (!empty($paramGroupSelected) && $typeFilter['type'] == 'id_attribute_group')
|
||||
$param_product_url .= '/'.str_replace('-', '_', Tools::link_rewrite($filterName)).$paramGroupSelected;
|
||||
}
|
||||
|
||||
$blackList = array('weight','price');
|
||||
@@ -2460,7 +2464,6 @@ class BlockLayered extends Module
|
||||
$parameters = '';
|
||||
foreach ($optionCheckedCloneArray as $keyGroup => $valueGroup)
|
||||
$parameters .= '/'.str_replace('-', '_', $keyGroup).$valueGroup;
|
||||
|
||||
// Check if there is an non indexable attribute or feature in the url
|
||||
foreach ($nonIndexable as $value)
|
||||
if (strpos($parameters, '/'.$value) !== false)
|
||||
@@ -2489,7 +2492,7 @@ class BlockLayered extends Module
|
||||
|
||||
$cache = array('layered_show_qties' => (int)Configuration::get('PS_LAYERED_SHOW_QTIES'), 'id_category_layered' => (int)$id_parent,
|
||||
'selected_filters' => $selectedFilters, 'n_filters' => (int)$nFilters, 'nbr_filterBlocks' => count($filterBlocks), 'filters' => $filterBlocks,
|
||||
'title_values' => $titleValues, 'current_friendly_url' => htmlentities($paramSelected), 'nofollow' => !empty($paramSelected) || $nofollow);
|
||||
'title_values' => $titleValues, 'current_friendly_url' => htmlentities($paramSelected), 'param_product_url' => htmlentities($param_product_url), 'nofollow' => !empty($paramSelected) || $nofollow);
|
||||
|
||||
return $cache;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
{if $nbr_filterBlocks != 0}
|
||||
<script type="text/javascript">
|
||||
current_friendly_url = '#{$current_friendly_url}';
|
||||
param_product_url = '#{$param_product_url}';
|
||||
</script>
|
||||
<div id="layered_block_left" class="block">
|
||||
<h4>{l s='Catalog' mod='blocklayered'}</h4>
|
||||
|
||||
Reference in New Issue
Block a user