[+] Dispatcher
This commit is contained in:
@@ -119,11 +119,11 @@ var ajaxCart = {
|
||||
//send the ajax request to the server
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: baseDir + 'cart.php',
|
||||
url: baseDir + 'index.php',
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
data: 'ajax=true&token=' + static_token,
|
||||
data: 'controller=cart&ajax=true&token=' + static_token,
|
||||
success: function(jsonData)
|
||||
{
|
||||
ajaxCart.updateCart(jsonData);
|
||||
@@ -180,11 +180,11 @@ var ajaxCart = {
|
||||
//send the ajax request to the server
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: baseDir + 'cart.php',
|
||||
url: baseDir + 'index.php',
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
data: 'add=1&ajax=true&qty=' + ((quantity && quantity != null) ? quantity : '1') + '&id_product=' + idProduct + '&token=' + static_token + ( (parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination): ''),
|
||||
data: 'controller=cart&add=1&ajax=true&qty=' + ((quantity && quantity != null) ? quantity : '1') + '&id_product=' + idProduct + '&token=' + static_token + ( (parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination): ''),
|
||||
success: function(jsonData,textStatus,jqXHR)
|
||||
{
|
||||
// add appliance to whishlist module
|
||||
@@ -230,11 +230,11 @@ var ajaxCart = {
|
||||
//send the ajax request to the server
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: baseDir + 'cart.php',
|
||||
url: baseDir + 'index.php',
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
data: 'delete=1&id_product=' + idProduct + '&ipa=' + ((idCombination != null && parseInt(idCombination)) ? idCombination : '') + ((customizationId && customizationId != null) ? '&id_customization=' + customizationId : '') + '&token=' + static_token + '&ajax=true',
|
||||
data: 'controller=cart&delete=1&id_product=' + idProduct + '&ipa=' + ((idCombination != null && parseInt(idCombination)) ? idCombination : '') + ((customizationId && customizationId != null) ? '&id_customization=' + customizationId : '') + '&token=' + static_token + '&ajax=true',
|
||||
success: function(jsonData) {
|
||||
ajaxCart.updateCart(jsonData);
|
||||
if ($('body').attr('id') == 'order' || $('body').attr('id') == 'order-opc')
|
||||
@@ -327,7 +327,7 @@ var ajaxCart = {
|
||||
}
|
||||
var removeLinks = $('#cart_block_product_' + domIdProduct).find('a.ajax_cart_block_remove_link');
|
||||
if (!product.hasCustomizedDatas && !removeLinks.length)
|
||||
$('#' + domIdProduct + ' span.remove_link').html('<a class="ajax_cart_block_remove_link" rel="nofollow" href="' + baseDir + 'cart.php?delete&id_product=' + product['id'] + '&ipa=' + product['idCombination'] + '&token=' + static_token + '" title="' + removingLinkText + '"> </a>');
|
||||
$('#' + domIdProduct + ' span.remove_link').html('<a class="ajax_cart_block_remove_link" rel="nofollow" href="' + baseDir + 'index.php?controller=cart&delete&id_product=' + product['id'] + '&ipa=' + product['idCombination'] + '&token=' + static_token + '" title="' + removingLinkText + '"> </a>');
|
||||
},
|
||||
|
||||
doesCustomizationStillExist : function (product, customizationId)
|
||||
@@ -416,7 +416,7 @@ var ajaxCart = {
|
||||
content += '<span class="quantity-formated"><span class="quantity">' + this.quantity + '</span>x</span>';
|
||||
var name = (this.name.length > 12 ? this.name.substring(0, 10) + '...' : this.name);
|
||||
content += '<a href="' + this.link + '" title="' + this.name + '">' + name + '</a>';
|
||||
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseDir + 'cart.php?delete&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
|
||||
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseDir + 'index.php?controller=cart&delete&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
|
||||
content += '<span class="price">' + this.priceByLine + '</span>';
|
||||
content += '</dt>';
|
||||
if (this.hasAttributes)
|
||||
@@ -483,7 +483,7 @@ var ajaxCart = {
|
||||
// If the customization is already displayed on the cart, no update's needed
|
||||
if($('#cart_block').find("div[id^=deleteCustomizableProduct_" + customizationId + "_]").length)
|
||||
return ('');
|
||||
content += '<li name="customization"><div class="deleteCustomizableProduct" id="deleteCustomizableProduct_' + customizationId + '_' + productId + '_' + (productAttributeId ? productAttributeId : '0') + '"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseDir + 'cart.php?delete&id_product=' + productId + '&ipa=' + productAttributeId + '&id_customization=' + customizationId + '&token=' + static_token + '"> </a></div><span class="quantity-formated"><span class="quantity">' + parseInt(this.quantity) + '</span>x</span>';
|
||||
content += '<li name="customization"><div class="deleteCustomizableProduct" id="deleteCustomizableProduct_' + customizationId + '_' + productId + '_' + (productAttributeId ? productAttributeId : '0') + '"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseDir + 'index.php?controller=cart&delete&id_product=' + productId + '&ipa=' + productAttributeId + '&id_customization=' + customizationId + '&token=' + static_token + '"> </a></div><span class="quantity-formated"><span class="quantity">' + parseInt(this.quantity) + '</span>x</span>';
|
||||
|
||||
// Give to the customized product the first textfield value as name
|
||||
$(this.datas).each(function(){
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
"name": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|addslashes}",
|
||||
"description": "{$discount.description|addslashes}",
|
||||
"nameDescription": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'}",
|
||||
"link": "{$link->getPageLink('order.php', true)}?deleteDiscount={$discount.id_discount}",
|
||||
"link": "{$link->getPageLink('order', true)}?deleteDiscount={$discount.id_discount}",
|
||||
"price": "-{if $discount.value_real != '!'}{if $priceDisplay == 1}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_tax_exc}{else}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_real}{/if}{/if}"
|
||||
{rdelim}
|
||||
{if !$smarty.foreach.discounts.last},{/if}
|
||||
|
||||
@@ -38,7 +38,7 @@ var removingLinkText = '{l s='remove this product from my cart' mod='blockcart'
|
||||
<!-- MODULE Block cart -->
|
||||
<div id="cart_block" class="block exclusive">
|
||||
<h4>
|
||||
<a href="{$link->getPageLink("$order_process.php", true)}">{l s='Cart' mod='blockcart'}</a>
|
||||
<a href="{$link->getPageLink("$order_process", true)}">{l s='Cart' mod='blockcart'}</a>
|
||||
{if $ajax_allowed}
|
||||
<span id="block_cart_expand" {if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !isset($colapseExpandStatus)}class="hidden"{/if}> </span>
|
||||
<span id="block_cart_collapse" {if isset($colapseExpandStatus) && $colapseExpandStatus eq 'collapsed'}class="hidden"{/if}> </span>
|
||||
@@ -63,7 +63,7 @@ var removingLinkText = '{l s='remove this product from my cart' mod='blockcart'
|
||||
<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)}" title="{$product.name|escape:html:'UTF-8'}">{t text=$product.name length='10' encode='true'}</a>
|
||||
<span class="remove_link">{if !isset($customizedDatas.$productId.$productAttributeId)}<a rel="nofollow" class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart.php')}?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="remove_link">{if !isset($customizedDatas.$productId.$productAttributeId)}<a rel="nofollow" class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart')}?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)}
|
||||
@@ -77,7 +77,7 @@ var removingLinkText = '{l s='remove this product from my cart' mod='blockcart'
|
||||
<ul class="cart_block_customizations" id="customization_{$productId}_{$productAttributeId}">
|
||||
{foreach from=$customizedDatas.$productId.$productAttributeId key='id_customization' item='customization' name='customizations'}
|
||||
<li name="customization">
|
||||
<div class="deleteCustomizableProduct" id="deleteCustomizableProduct_{$id_customization|intval}_{$product.id_product|intval}_{$product.id_product_attribute|intval}"><a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart.php')}?delete&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization}&token={$static_token}"> </a></div>
|
||||
<div class="deleteCustomizableProduct" id="deleteCustomizableProduct_{$id_customization|intval}_{$product.id_product|intval}_{$product.id_product_attribute|intval}"><a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart')}?delete&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization}&token={$static_token}"> </a></div>
|
||||
<span class="quantity-formated"><span class="quantity">{$customization.quantity}</span>x</span>{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}{t text=$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|replace:"<br />":" " length='28' encode='true'}
|
||||
{else}
|
||||
{l s='Customization #' mod='blockcart'}{$id_customization|intval}{l s=':' mod='blockcart'}
|
||||
@@ -101,7 +101,7 @@ var removingLinkText = '{l s='remove this product from my cart' mod='blockcart'
|
||||
<tr class="bloc_cart_voucher" id="bloc_cart_voucher_{$discount.id_discount}">
|
||||
<td class="name" title="{$discount.description}">{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|escape:'htmlall':'UTF-8'}</td>
|
||||
<td class="price">-{if $discount.value_real != '!'}{if $priceDisplay == 1}{convertPrice price=$discount.value_tax_exc}{else}{convertPrice price=$discount.value_real}{/if}{/if}</td>
|
||||
<td class="delete"><a href="{$link->getPageLink("$order_process.php", true)}?deleteDiscount={$discount.id_discount}" title="{l s='Delete'}"><img src="{$img_dir}icon/delete.gif" alt="{l s='Delete'}" width="11" height="13" class="icon" /></a></td>
|
||||
<td class="delete"><a href="{$link->getPageLink("$order_process", true)}?deleteDiscount={$discount.id_discount}" title="{l s='Delete'}"><img src="{$img_dir}icon/delete.gif" alt="{l s='Delete'}" width="11" height="13" class="icon" /></a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
@@ -139,8 +139,8 @@ var removingLinkText = '{l s='remove this product from my cart' mod='blockcart'
|
||||
{/if}
|
||||
{/if}
|
||||
<p id="cart-buttons">
|
||||
{if $order_process == 'order'}<a href="{$link->getPageLink("$order_process.php", true)}" class="button_small" title="{l s='Cart' mod='blockcart'}">{l s='Cart' mod='blockcart'}</a>{/if}
|
||||
<a href="{$link->getPageLink("$order_process.php", true)}{if $order_process == 'order'}?step=1{/if}" id="button_order_cart" class="exclusive{if $order_process == 'order-opc'}_large{/if}" title="{l s='Check out' mod='blockcart'}">{l s='Check out' mod='blockcart'}</a>
|
||||
{if $order_process == 'order'}<a href="{$link->getPageLink("$order_process", true)}" class="button_small" title="{l s='Cart' mod='blockcart'}">{l s='Cart' mod='blockcart'}</a>{/if}
|
||||
<a href="{$link->getPageLink("$order_process", true)}{if $order_process == 'order'}?step=1{/if}" id="button_order_cart" class="exclusive{if $order_process == 'order-opc'}_large{/if}" title="{l s='Check out' mod='blockcart'}">{l s='Check out' mod='blockcart'}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user