// data-id-product instead of using rel tag
This commit is contained in:
1 parent
68edf085d4
commit
ad6ed3dcf1
6 files changed
+66
-10
No files matched your search
@@ -35,7 +35,7 @@ var ajaxCart = {
|
|||||||
overrideButtonsInThePage : function(){
|
overrideButtonsInThePage : function(){
|
||||||
//for every 'add' buttons...
|
//for every 'add' buttons...
|
||||||
$('.ajax_add_to_cart_button').unbind('click').click(function(){
|
$('.ajax_add_to_cart_button').unbind('click').click(function(){
|
||||||
var idProduct = $(this).attr('rel').replace('nofollow', '').replace('ajax_id_product_', '');
|
var idProduct = $(this).data('id-product');
|
||||||
if ($(this).attr('disabled') != 'disabled')
|
if ($(this).attr('disabled') != 'disabled')
|
||||||
ajaxCart.add(idProduct, null, false, this);
|
ajaxCart.add(idProduct, null, false, this);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -72,7 +72,20 @@
|
|||||||
{assign var="btn_class" value="disabled"}
|
{assign var="btn_class" value="disabled"}
|
||||||
{capture assign="btn_more"}<span class="availability">{if (isset($accessory.quantity_all_versions) && $accessory.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{if !$PS_CATALOG_MODE}{l s='Out of stock'}{/if}{/if}</span>{/capture}
|
{capture assign="btn_more"}<span class="availability">{if (isset($accessory.quantity_all_versions) && $accessory.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{if !$PS_CATALOG_MODE}{l s='Out of stock'}{/if}{/if}</span>{/capture}
|
||||||
{/if}
|
{/if}
|
||||||
<a class="{$btn_class}" data-role="button" data-inline="true" data-theme="e" data-icon="plus" data-mini="true" class="exclusive button ajax_add_to_cart_button" href="{$btn_href}" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart'}" data-ajax="false">{l s='Add to cart'}</a>
|
<a
|
||||||
|
class="{$btn_class}"
|
||||||
|
data-role="button"
|
||||||
|
data-inline="true"
|
||||||
|
data-theme="e"
|
||||||
|
data-icon="plus"
|
||||||
|
data-mini="true"
|
||||||
|
class="exclusive button ajax_add_to_cart_button"
|
||||||
|
href="{$btn_href}"
|
||||||
|
data-id-product="{$accessory.id_product|intval}"
|
||||||
|
title="{l s='Add to cart'}"
|
||||||
|
data-ajax="false">
|
||||||
|
{l s='Add to cart'}
|
||||||
|
</a>
|
||||||
{$btn_more}
|
{$btn_more}
|
||||||
</div><!-- .btn-row -->
|
</div><!-- .btn-row -->
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -92,11 +92,24 @@
|
|||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
{/if}
|
{/if}
|
||||||
<a href="javascript:;" class="button ajax_add_to_cart_button btn btn-default" onclick="WishlistBuyProduct('{$token|escape:'html':'UTF-8'}', '{$product.id_product}', '{$product.id_product_attribute}', '{$product.id_product}_{$product.id_product_attribute}', this, {$ajax});" title="{l s='Add to cart' mod='homefeatured'}" rel="nofollow"><span>{l s='Add to cart' mod='blockwishlist'}</span></a>
|
<a
|
||||||
|
href="javascript:void(0);"
|
||||||
|
class="button ajax_add_to_cart_button btn btn-default"
|
||||||
|
onclick="WishlistBuyProduct('{$token|escape:'html':'UTF-8'}', '{$product.id_product}', '{$product.id_product_attribute}', '{$product.id_product}_{$product.id_product_attribute}', this, {$ajax});"
|
||||||
|
title="{l s='Add to cart' mod='homefeatured'}"
|
||||||
|
rel="nofollow">
|
||||||
|
<span>{l s='Add to cart' mod='blockwishlist'}</span>
|
||||||
|
</a>
|
||||||
{else}
|
{else}
|
||||||
<span class="button ajax_add_to_cart_button btn btn-default disabled"><span>{l s='Add to cart' mod='blockwishlist'}</span></span>
|
<span class="button ajax_add_to_cart_button btn btn-default disabled"><span>{l s='Add to cart' mod='blockwishlist'}</span></span>
|
||||||
{/if}
|
{/if}
|
||||||
<a class="button lnk_view btn btn-default" href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category_rewrite)|escape:'html'}" title="{l s='View' mod='blockwishlist'}" rel="nofollow"><span>{l s='View' mod='blockwishlist'}</span></a>
|
<a
|
||||||
|
class="button lnk_view btn btn-default"
|
||||||
|
href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category_rewrite)|escape:'html'}"
|
||||||
|
title="{l s='View' mod='blockwishlist'}"
|
||||||
|
rel="nofollow">
|
||||||
|
<span>{l s='View' mod='blockwishlist'}</span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -106,5 +119,4 @@
|
|||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*}
|
*}
|
||||||
|
|
||||||
{if isset($products)}
|
{if isset($products)}
|
||||||
{*define numbers of product per line in other page for desktop*}
|
{*define numbers of product per line in other page for desktop*}
|
||||||
{if $page_name !='index' && $page_name !='product'}
|
{if $page_name !='index' && $page_name !='product'}
|
||||||
@@ -88,9 +89,23 @@
|
|||||||
{if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE}
|
{if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE}
|
||||||
{if ($product.allow_oosp || $product.quantity > 0)}
|
{if ($product.allow_oosp || $product.quantity > 0)}
|
||||||
{if isset($static_token)}
|
{if isset($static_token)}
|
||||||
<a class="button ajax_add_to_cart_button btn btn-default" rel="ajax_id_product_{$product.id_product|intval} nofollow" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html'}" title="{l s='Add to cart'}"><span>{l s='Add to cart'}</span></a>
|
<a
|
||||||
|
class="button ajax_add_to_cart_button btn btn-default"
|
||||||
|
rel="nofollow"
|
||||||
|
data-id-product="{$product.id_product|intval}"
|
||||||
|
href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html'}"
|
||||||
|
title="{l s='Add to cart'}">
|
||||||
|
<span>{l s='Add to cart'}</span>
|
||||||
|
</a>
|
||||||
{else}
|
{else}
|
||||||
<a class="button ajax_add_to_cart_button btn btn-default" rel="ajax_id_product_{$product.id_product|intval} nofollow" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}", false)|escape:'html'}" title="{l s='Add to cart'}"><span>{l s='Add to cart'}</span></a>
|
<a
|
||||||
|
class="button ajax_add_to_cart_button btn btn-default"
|
||||||
|
rel="nofollow"
|
||||||
|
data-id-product="{$product.id_product|intval}"
|
||||||
|
href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}", false)|escape:'html'}"
|
||||||
|
title="{l s='Add to cart'}">
|
||||||
|
<span>{l s='Add to cart'}</span>
|
||||||
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
{else}
|
{else}
|
||||||
<span class="button ajax_add_to_cart_button btn btn-default disabled"><span>{l s='Add to cart'}</span></span>
|
<span class="button ajax_add_to_cart_button btn btn-default disabled"><span>{l s='Add to cart'}</span></span>
|
||||||
@@ -119,7 +134,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div><!-- .product-container> -->
|
||||||
</li>
|
</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
@@ -149,6 +164,7 @@
|
|||||||
)});
|
)});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{if $page_name !='index' && $page_name !='product'} <!--// excluding page for Grid/List-->
|
{if $page_name !='index' && $page_name !='product'} <!--// excluding page for Grid/List-->
|
||||||
<script type="text/javascript"><!--
|
<script type="text/javascript"><!--
|
||||||
function display(view) {
|
function display(view) {
|
||||||
|
|||||||
@@ -586,7 +586,16 @@ var contentOnly = {if $content_only}true{else}false{/if}
|
|||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<a class="exclusive button ajax_add_to_cart_button" href="{$link->getPageLink('cart', true, NULL, "qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add")|escape:'html'}" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart'}"><span>{l s='Add to cart'}</span></a> </div> </div> </div>
|
<a
|
||||||
|
class="exclusive button ajax_add_to_cart_button"
|
||||||
|
href="{$link->getPageLink('cart', true, NULL, "qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add")|escape:'html'}"
|
||||||
|
data-id-product="{$accessory.id_product|intval}"
|
||||||
|
title="{l s='Add to cart'}">
|
||||||
|
<span>{l s='Add to cart'}</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -112,7 +112,13 @@
|
|||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
{if (!$product->hasAttributes() OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $product->minimal_quantity == 1 AND $product->customizable != 2 AND !$PS_CATALOG_MODE}
|
{if (!$product->hasAttributes() OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $product->minimal_quantity == 1 AND $product->customizable != 2 AND !$PS_CATALOG_MODE}
|
||||||
{if ($product->quantity > 0 OR $product->allow_oosp)}
|
{if ($product->quantity > 0 OR $product->allow_oosp)}
|
||||||
<a class="button ajax_add_to_cart_button btn btn-default" rel="ajax_id_product_{$product->id}" href="{$link->getPageLink('cart', true, NULL, "qty=1&id_product={$product->id}&token={$static_token}&add")|escape:'html'}" title="{l s='Add to cart'}"><span>{l s='Add to cart'}</span></a>
|
<a
|
||||||
|
class="button ajax_add_to_cart_button btn btn-default"
|
||||||
|
data-id-product="ajax_id_product_{$product->id}"
|
||||||
|
href="{$link->getPageLink('cart', true, NULL, "qty=1&id_product={$product->id}&token={$static_token}&add")|escape:'html'}"
|
||||||
|
title="{l s='Add to cart'}">
|
||||||
|
<span>{l s='Add to cart'}</span>
|
||||||
|
</a>
|
||||||
{else}
|
{else}
|
||||||
<span class="ajax_add_to_cart_button button btn btn-default disabled"><span>{l s='Add to cart'}</span></span>
|
<span class="ajax_add_to_cart_button button btn btn-default disabled"><span>{l s='Add to cart'}</span></span>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in new issue
Block a user