[-] FO : #PSCFV-3121 - New JS vars baseUri. This vars must be used instead of baseDir for ajax queries.
This commit is contained in:
@@ -315,6 +315,7 @@ class FrontControllerCore extends Controller
|
||||
'base_dir' => _PS_BASE_URL_.__PS_BASE_URI__,
|
||||
'base_dir_ssl' => $protocol_link.Tools::getShopDomainSsl().__PS_BASE_URI__,
|
||||
'content_dir' => $protocol_content.Tools::getHttpHost().__PS_BASE_URI__,
|
||||
'base_uri' => $protocol_content.Tools::getHttpHost().__PS_BASE_URI__.(!Configuration::get('PS_REWRITING_SETTINGS') ? 'index.php' : ''),
|
||||
'tpl_dir' => _PS_THEME_DIR_,
|
||||
'modules_dir' => _MODULE_DIR_,
|
||||
'mail_dir' => _MAIL_DIR_,
|
||||
|
||||
@@ -122,7 +122,7 @@ var ajaxCart = {
|
||||
//send the ajax request to the server
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: baseDir + 'index.php',
|
||||
url: baseUri,
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
@@ -196,7 +196,7 @@ var ajaxCart = {
|
||||
//send the ajax request to the server
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: baseDir + 'index.php',
|
||||
url: baseUri,
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
@@ -253,7 +253,7 @@ var ajaxCart = {
|
||||
//send the ajax request to the server
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: baseDir + 'index.php',
|
||||
url: baseUri,
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
@@ -351,7 +351,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 + 'index.php?controller=cart&delete&id_product=' + product['id'] + '&ipa=' + product['idCombination'] + '&token=' + static_token + '"> </a>');
|
||||
$('#' + domIdProduct + ' span.remove_link').html('<a class="ajax_cart_block_remove_link" rel="nofollow" href="' + baseUri + '?controller=cart&delete&id_product=' + product['id'] + '&ipa=' + product['idCombination'] + '&token=' + static_token + '"> </a>');
|
||||
if (parseInt(product.price_float) <= 0)
|
||||
$('#' + domIdProduct + ' span.remove_link').html('');
|
||||
},
|
||||
@@ -445,7 +445,7 @@ var ajaxCart = {
|
||||
content += '<a href="' + this.link + '" title="' + this.name + '">' + name + '</a>';
|
||||
|
||||
if (parseFloat(this.price_float) > 0)
|
||||
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="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseUri + '?controller=cart&delete&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
|
||||
else
|
||||
content += '<span class="remove_link"></span>';
|
||||
|
||||
@@ -524,7 +524,7 @@ var ajaxCart = {
|
||||
// If the customization is already displayed on the cart, no update's needed
|
||||
if ($("#deleteCustomizableProduct_" + customizationId + "_" + productId + "_" + productAttributeId).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 + '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>';
|
||||
content += '<li name="customization"><div class="deleteCustomizableProduct" id="deleteCustomizableProduct_' + customizationId + '_' + productId + '_' + (productAttributeId ? productAttributeId : '0') + '"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseUri + '?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(){
|
||||
|
||||
@@ -102,7 +102,7 @@ function WishlistBuyProduct(token, id_product, id_product_attribute, id_quantity
|
||||
$('#' + id_quantity).val(0);
|
||||
WishlistAddProductCart(token, id_product, id_product_attribute, id_quantity)
|
||||
document.forms['addtocart' + '_' + id_product + '_' + id_product_attribute].method='POST';
|
||||
document.forms['addtocart' + '_' + id_product + '_' + id_product_attribute].action=baseDir + 'cart.php';
|
||||
document.forms['addtocart' + '_' + id_product + '_' + id_product_attribute].action=baseUri + '?controller=cart';
|
||||
document.forms['addtocart' + '_' + id_product + '_' + id_product_attribute].elements['token'].value = static_token;
|
||||
document.forms['addtocart' + '_' + id_product + '_' + id_product_attribute].submit();
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ $(function(){ldelim}
|
||||
//send the ajax request to the server
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: baseDir + 'index.php',
|
||||
url: baseUri,
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{$favicon_url}?{$img_update_time}" />
|
||||
<script type="text/javascript">
|
||||
var baseDir = '{$content_dir}';
|
||||
var baseUri = '{$base_uri}';
|
||||
var static_token = '{$static_token}';
|
||||
var token = '{$token}';
|
||||
var priceDisplayPrecision = {$priceDisplayPrecision*$currency->decimals};
|
||||
|
||||
@@ -87,7 +87,7 @@ function changeAddressDelivery(obj)
|
||||
{
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: baseDir,
|
||||
url: baseUri,
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType: 'json',
|
||||
@@ -159,7 +159,7 @@ function changeAddressDelivery(obj)
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: baseDir,
|
||||
url: baseUri,
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType: 'json',
|
||||
@@ -269,7 +269,7 @@ function deleteProductFromSummary(id)
|
||||
id_address_delivery = parseInt(ids[3]);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: baseDir,
|
||||
url: baseUri,
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType: 'json',
|
||||
@@ -392,7 +392,7 @@ function upQuantity(id, qty)
|
||||
id_address_delivery = parseInt(ids[3]);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: baseDir,
|
||||
url: baseUri,
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType: 'json',
|
||||
@@ -470,7 +470,7 @@ function downQuantity(id, qty)
|
||||
{
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: baseDir,
|
||||
url: baseUri,
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType: 'json',
|
||||
@@ -757,7 +757,7 @@ $(document).ready(function() {
|
||||
$('#allow_seperated_package').live('click', function() {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: baseDir,
|
||||
url: baseUri,
|
||||
async: true,
|
||||
cache: false,
|
||||
data: 'controller=cart&ajax=true&allowSeperatedPackage&value='
|
||||
|
||||
@@ -108,7 +108,7 @@ function sendOrderMessage ()
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: baseDir + "index.php?controller=order-detail",
|
||||
url: baseUri + "index.php?controller=order-detail",
|
||||
data: paramString,
|
||||
success: function (msg){
|
||||
$('#block-order-detail').fadeOut('slow', function() {
|
||||
|
||||
@@ -103,7 +103,7 @@ function updateAddresses()
|
||||
var idAddress_invoice = $('input[type=checkbox]#addressesAreEquals:checked').length == 1 ? idAddress_delivery : $('#id_address_invoice').val();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: baseDir,
|
||||
url: baseUri,
|
||||
async: true,
|
||||
cache: false,
|
||||
dataType : "json",
|
||||
|
||||
@@ -89,7 +89,7 @@ function clearLocations(n)
|
||||
function searchLocationsNear(center)
|
||||
{
|
||||
var radius = document.getElementById('radiusSelect').value;
|
||||
var searchUrl = baseDir+'stores.php?ajax=1&latitude=' + center.lat() + '&longitude=' + center.lng() + '&radius=' + radius;
|
||||
var searchUrl = baseUri+'?controller=stores&ajax=1&latitude=' + center.lat() + '&longitude=' + center.lng() + '&radius=' + radius;
|
||||
downloadUrl(searchUrl, function(data) {
|
||||
var xml = parseXml(data);
|
||||
var markerNodes = xml.documentElement.getElementsByTagName('marker');
|
||||
|
||||
Reference in New Issue
Block a user