This commit is contained in:
Thibault GUILLAUME 2015-09-07 10:25:24 +02:00
parent bdb518e339
commit 4dbe931e35
26 changed files with 1965 additions and 1 deletions

@ -1 +0,0 @@
Subproject commit 68b1f89287581d089549578157c3eafdb6c3b414

View File

@ -0,0 +1,5 @@
2014-04-22 18:56:55 +0200 // Changelog updated
2014-03-26 10:01:27 +0100 [-] MO : removed cart rule description from the name in the blockcart
2014-03-24 11:43:28 +0100 / MO blockcart : ps_versions_compliancy modified (1.5.6.1 => 1.6)
2014-03-24 11:01:26 +0100 / MO blockcart : ps_versions_compliancy added
2014-03-20 14:20:42 +0100 Initial commit

View File

@ -0,0 +1,37 @@
# Cart block
## About
Adds a block containing the customer\'s shopping cart.
## Contributing
PrestaShop modules are open-source extensions to the PrestaShop e-commerce solution. Everyone is welcome and even encouraged to contribute with their own improvements.
### Requirements
Contributors **must** follow the following rules:
* **Make your Pull Request on the "dev" branch**, NOT the "master" branch.
* Do not update the module's version number.
* Follow [the coding standards][1].
### Process in details
Contributors wishing to edit a module's files should follow the following process:
1. Create your GitHub account, if you do not have one already.
2. Fork the blockcart project to your GitHub account.
3. Clone your fork to your local machine in the ```/modules``` directory of your PrestaShop installation.
4. Create a branch in your local clone of the module for your changes.
5. Change the files in your branch. Be sure to follow [the coding standards][1]!
6. Push your changed branch to your fork in your GitHub account.
7. Create a pull request for your changes **on the _'dev'_ branch** of the module's project. Be sure to follow [the commit message norm][2] in your pull request. If you need help to make a pull request, read the [Github help page about creating pull requests][3].
8. Wait for one of the core developers either to include your change in the codebase, or to comment on possible improvements you should make to your code.
That's it: you have contributed to this open-source project! Congratulations!
[1]: http://doc.prestashop.com/display/PS16/Coding+Standards
[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message
[3]: https://help.github.com/articles/using-pull-requests

View File

@ -0,0 +1,762 @@
/*
* 2007-2015 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-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
// Retrocompatibility with 1.4
if (typeof baseUri === "undefined" && typeof baseDir !== "undefined")
baseUri = baseDir;
//JS Object : update the cart by ajax actions
var ajaxCart = {
nb_total_products: 0,
//override every button in the page in relation to the cart
overrideButtonsInThePage : function(){
//for every 'add' buttons...
$('.ajax_add_to_cart_button').unbind('click').click(function(){
var idProduct = $(this).attr('rel').replace('nofollow', '').replace('ajax_id_product_', '');
if ($(this).attr('disabled') != 'disabled')
ajaxCart.add(idProduct, null, false, this);
return false;
});
//for product page 'add' button...
$('#add_to_cart input').unbind('click').click(function(){
ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null);
return false;
});
//for 'delete' buttons in the cart block...
$('#cart_block_list .ajax_cart_block_remove_link').unbind('click').click(function(){
// Customized product management
var customizationId = 0;
var productId = 0;
var productAttributeId = 0;
var customizableProductDiv = $($(this).parent().parent()).find("div[id^=deleteCustomizableProduct_]");
if (customizableProductDiv && $(customizableProductDiv).length)
{
$(customizableProductDiv).each(function(){
var ids = $(this).attr('id').split('_');
if (typeof(ids[1]) != 'undefined')
{
customizationId = parseInt(ids[1]);
productId = parseInt(ids[2]);
if (typeof(ids[3]) != 'undefined')
productAttributeId = parseInt(ids[3]);
return false;
}
});
}
// Common product management
if (!customizationId)
{
//retrieve idProduct and idCombination from the displayed product in the block cart
var firstCut = $(this).parent().parent().attr('id').replace('cart_block_product_', '');
firstCut = firstCut.replace('deleteCustomizableProduct_', '');
ids = firstCut.split('_');
productId = parseInt(ids[0]);
if (typeof(ids[1]) != 'undefined')
productAttributeId = parseInt(ids[1]);
}
var idAddressDelivery = $(this).parent().parent().attr('id').match(/.*_\d+_\d+_(\d+)/)[1];
// Removing product from the cart
ajaxCart.remove(productId, productAttributeId, customizationId, idAddressDelivery);
return false;
});
},
// try to expand the cart
expand : function(){
if ($('#cart_block_list').hasClass('collapsed'))
{
$('#cart_block_summary').slideUp(200, function(){
$(this).addClass('collapsed').removeClass('expanded');
$('#cart_block_list').slideDown({
duration: 450,
complete: function(){$(this).addClass('expanded').removeClass('collapsed');}
});
});
// toogle the button expand/collapse button
$('#block_cart_expand').fadeOut('slow', function(){
$('#block_cart_collapse').fadeIn('fast');
});
// save the expand statut in the user cookie
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: baseDir + 'modules/blockcart/blockcart-set-collapse.php' + '?rand=' + new Date().getTime(),
async: true,
cache: false,
data: 'ajax_blockcart_display=expand'
});
}
},
// Fix display when using back and previous browsers buttons
refresh : function(){
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: baseUri + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType : "json",
data: 'controller=cart&ajax=true&token=' + static_token,
success: function(jsonData)
{
ajaxCart.updateCart(jsonData);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
}
});
},
// try to collapse the cart
collapse : function(){
if ($('#cart_block_list').hasClass('expanded'))
{
$('#cart_block_list').slideUp('slow', function(){
$(this).addClass('collapsed').removeClass('expanded');
$('#cart_block_summary').slideDown(450, function(){
$(this).addClass('expanded').removeClass('collapsed');
});
});
$('#block_cart_collapse').fadeOut('slow', function(){
$('#block_cart_expand').fadeIn('fast');
});
// save the expand statut in the user cookie
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: baseDir + 'modules/blockcart/blockcart-set-collapse.php' + '?rand=' + new Date().getTime(),
async: true,
cache: false,
data: 'ajax_blockcart_display=collapse' + '&rand=' + new Date().getTime()
});
}
},
// Update the cart information
updateCartInformation : function (jsonData, addedFromProductPage)
{
ajaxCart.updateCart(jsonData);
//reactive the button when adding has finished
if (addedFromProductPage)
$('#add_to_cart input').removeAttr('disabled').addClass('exclusive').removeClass('exclusive_disabled');
else
$('.ajax_add_to_cart_button').removeAttr('disabled');
},
// add a product in the cart via ajax
add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, wishlist){
if (addedFromProductPage && !checkCustomizations())
{
alert(fieldRequired);
return ;
}
emptyCustomizations();
//disabled the button when adding to not double add if user double click
if (addedFromProductPage)
{
$('#add_to_cart input').attr('disabled', true).removeClass('exclusive').addClass('exclusive_disabled');
$('.filled').removeClass('filled');
}
else
$(callerElement).attr('disabled', true);
if ($('#cart_block_list').hasClass('collapsed'))
this.expand();
//send the ajax request to the server
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: baseUri + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType : "json",
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 wishlist module
if (wishlist && !jsonData.errors)
WishlistAddProductCart(wishlist[0], idProduct, idCombination, wishlist[1]);
// add the picture to the cart
var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img');
if (!$element.length)
$element = $('#bigpic');
var $picture = $element.clone();
var pictureOffsetOriginal = $element.offset();
pictureOffsetOriginal.right = $(window).innerWidth() - pictureOffsetOriginal.left - $element.width();
if ($picture.length)
{
$picture.css({
position: 'absolute',
top: pictureOffsetOriginal.top,
right: pictureOffsetOriginal.right
});
}
var pictureOffset = $picture.offset();
var cartBlock = $('#cart_block');
if (!$('#cart_block')[0] || !$('#cart_block').offset().top || !$('#cart_block').offset().left)
cartBlock = $('#shopping_cart');
var cartBlockOffset = cartBlock.offset();
cartBlockOffset.right = $(window).innerWidth() - cartBlockOffset.left - cartBlock.width();
// Check if the block cart is activated for the animation
if (cartBlockOffset != undefined && $picture.length)
{
$picture.appendTo('body');
$picture
.css({
position: 'absolute',
top: pictureOffsetOriginal.top,
right: pictureOffsetOriginal.right,
zIndex: 4242
})
.animate({
width: $element.attr('width')*0.66,
height: $element.attr('height')*0.66,
opacity: 0.2,
top: cartBlockOffset.top + 30,
right: cartBlockOffset.right + 15
}, 1000)
.fadeOut(100, function() {
ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
$(this).remove();
});
}
else
ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
},
error: function(XMLHttpRequest, textStatus, errorThrown)
{
alert("Impossible to add the product to the cart.\n\ntextStatus: '" + textStatus + "'\nerrorThrown: '" + errorThrown + "'\nresponseText:\n" + XMLHttpRequest.responseText);
//reactive the button when adding has finished
if (addedFromProductPage)
$('#add_to_cart input').removeAttr('disabled').addClass('exclusive').removeClass('exclusive_disabled');
else
$(callerElement).removeAttr('disabled');
}
});
},
//remove a product from the cart via ajax
remove : function(idProduct, idCombination, customizationId, idAddressDelivery){
//send the ajax request to the server
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: baseUri + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType : "json",
data: 'controller=cart&delete=1&id_product=' + idProduct + '&ipa=' + ((idCombination != null && parseInt(idCombination)) ? idCombination : '') + ((customizationId && customizationId != null) ? '&id_customization=' + customizationId : '') + '&id_address_delivery=' + idAddressDelivery + '&token=' + static_token + '&ajax=true',
success: function(jsonData) {
ajaxCart.updateCart(jsonData);
if ($('body').attr('id') == 'order' || $('body').attr('id') == 'order-opc')
deleteProductFromSummary(idProduct+'_'+idCombination+'_'+customizationId+'_'+idAddressDelivery);
},
error: function() {alert('ERROR: unable to delete the product');}
});
},
//hide the products displayed in the page but no more in the json data
hideOldProducts : function(jsonData) {
//delete an eventually removed product of the displayed cart (only if cart is not empty!)
if ($('#cart_block_list dl.products').length > 0)
{
var removedProductId = null;
var removedProductData = null;
var removedProductDomId = null;
//look for a product to delete...
$('#cart_block_list dl.products dt').each(function(){
//retrieve idProduct and idCombination from the displayed product in the block cart
var domIdProduct = $(this).attr('id');
var firstCut = domIdProduct.replace('cart_block_product_', '');
var ids = firstCut.split('_');
//try to know if the current product is still in the new list
var stayInTheCart = false;
for (aProduct in jsonData.products)
{
//we've called the variable aProduct because IE6 bug if this variable is called product
//if product has attributes
if (jsonData.products[aProduct]['id'] == ids[0] && (!ids[1] || jsonData.products[aProduct]['idCombination'] == ids[1]))
{
stayInTheCart = true;
// update the product customization display (when the product is still in the cart)
ajaxCart.hideOldProductCustomizations(jsonData.products[aProduct], domIdProduct);
}
}
//remove product if it's no more in the cart
if (!stayInTheCart)
{
removedProductId = $(this).attr('id');
if (removedProductId != null)
{
var firstCut = removedProductId.replace('cart_block_product_', '');
var ids = firstCut.split('_');
$('#'+removedProductId).addClass('strike').fadeTo('slow', 0, function(){
$(this).slideUp('slow', function(){
$(this).remove();
// If the cart is now empty, show the 'no product in the cart' message and close detail
if($('#cart_block dl.products dt').length == 0)
{
$("#header #cart_block").stop(true, true).slideUp(200);
$('#cart_block_no_products:hidden').slideDown(450);
$('#cart_block dl.products').remove();
}
});
});
$('#cart_block_combination_of_' + ids[0] + (ids[1] ? '_'+ids[1] : '') + (ids[2] ? '_'+ids[2] : '')).fadeTo('fast', 0, function(){
$(this).slideUp('fast', function(){
$(this).remove();
});
});
}
}
});
}
},
hideOldProductCustomizations : function (product, domIdProduct)
{
var customizationList = $('#customization_' + product['id'] + '_' + product['idCombination']);
if(customizationList.length > 0)
{
$(customizationList).find("li").each(function(){
$(this).find("div").each(function() {
var customizationDiv = $(this).attr('id');
var tmp = customizationDiv.replace('deleteCustomizableProduct_', '');
var ids = tmp.split('_');
if ((parseInt(product.idCombination) == parseInt(ids[2])) && !ajaxCart.doesCustomizationStillExist(product, ids[0]))
$('#' + customizationDiv).parent().addClass('strike').fadeTo('slow', 0, function(){
$(this).slideUp('slow');
$(this).remove();
});
});
});
}
var removeLinks = $('#' + domIdProduct).find('.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="' + baseUri + '?controller=cart&amp;delete=1&amp;id_product=' + product['id'] + '&amp;ipa=' + product['idCombination'] + '&amp;token=' + static_token + '"> </a>');
if (product.is_gift)
$('#' + domIdProduct + ' span.remove_link').html('');
},
doesCustomizationStillExist : function (product, customizationId)
{
var exists = false;
$(product.customizedDatas).each(function() {
if (this.customizationId == customizationId)
{
exists = true;
// This return does not mean that we found nothing but simply break the loop
return false;
}
});
return (exists);
},
//refresh display of vouchers (needed for vouchers in % of the total)
refreshVouchers : function (jsonData) {
if (typeof(jsonData.discounts) == 'undefined' || jsonData.discounts.length == 0)
$('#vouchers').hide();
else
{
$('#vouchers tbody').html('');
for (i=0; i < jsonData.discounts.length; i++)
{
if (parseFloat(jsonData.discounts[i].price_float) > 0)
{
var delete_link = '';
if (jsonData.discounts[i].code.length)
delete_link = '<a class="delete_voucher" href="'+jsonData.discounts[i].link+'" title="'+delete_txt+'"><img src="'+img_dir+'icon/delete.gif" alt="'+delete_txt+'" class="icon" /></a>';
$('#vouchers tbody').append($(
'<tr class="bloc_cart_voucher" id="bloc_cart_voucher_'+jsonData.discounts[i].id+'">'
+ '<td class="quantity">1x</td>'
+ '<td class="name" title="'+jsonData.discounts[i].description+'">'+jsonData.discounts[i].name+'</td>'
+ '<td class="price">-'+jsonData.discounts[i].price+'</td>'
+ '<td class="delete">' + delete_link + '</td>'
+ '</tr>'
));
}
}
$('#vouchers').show();
}
},
// Update product quantity
updateProductQuantity : function (product, quantity) {
$('#cart_block_product_' + product.id + '_' + (product.idCombination ? product.idCombination : '0')+ '_' + (product.idAddressDelivery ? product.idAddressDelivery : '0') + ' .quantity').fadeTo('fast', 0, function() {
$(this).text(quantity);
$(this).fadeTo('fast', 1, function(){
$(this).fadeTo('fast', 0, function(){
$(this).fadeTo('fast', 1, function(){
$(this).fadeTo('fast', 0, function(){
$(this).fadeTo('fast', 1);
});
});
});
});
});
},
//display the products witch are in json data but not already displayed
displayNewProducts : function(jsonData) {
//add every new products or update displaying of every updated products
$(jsonData.products).each(function(){
//fix ie6 bug (one more item 'undefined' in IE6)
if (this.id != undefined)
{
//create a container for listing the products and hide the 'no product in the cart' message (only if the cart was empty)
if ($('#cart_block dl.products').length == 0)
{
$('#cart_block_no_products').before('<dl class="products"></dl>');
$('#cart_block_no_products').hide();
}
//if product is not in the displayed cart, add a new product's line
var domIdProduct = this.id + '_' + (this.idCombination ? this.idCombination : '0') + '_' + (this.idAddressDelivery ? this.idAddressDelivery : '0');
var domIdProductAttribute = this.id + '_' + (this.idCombination ? this.idCombination : '0');
if ($('#cart_block_product_'+ domIdProduct).length == 0)
{
var productId = parseInt(this.id);
var productAttributeId = (this.hasAttributes ? parseInt(this.attributes) : 0);
var content = '<dt class="hidden" id="cart_block_product_' + domIdProduct + '">';
content += '<span class="quantity-formated"><span class="quantity">' + this.quantity + '</span>x</span>';
var name = $('<span />').html(this.name).text();
name = (name.length > 12 ? name.substring(0, 10) + '...' : name);
content += '<a href="' + this.link + '" title="' + this.name + '" class="cart_block_product_name">' + name + '</a>';
if (typeof(this.is_gift) == 'undefined' || this.is_gift == 0)
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseUri + '?controller=cart&amp;delete=1&amp;id_product=' + productId + '&amp;token=' + static_token + (this.hasAttributes ? '&amp;ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
else
content += '<span class="remove_link"></span>';
if (typeof(freeProductTranslation) != 'undefined')
content += '<span class="price">' + (parseFloat(this.price_float) > 0 ? this.priceByLine : freeProductTranslation) + '</span>';
content += '</dt>';
if (this.hasAttributes)
content += '<dd id="cart_block_combination_of_' + domIdProduct + '" class="hidden"><a href="' + this.link + '" title="' + this.name + '">' + this.attributes + '</a>';
if (this.hasCustomizedDatas)
content += ajaxCart.displayNewCustomizedDatas(this);
if (this.hasAttributes) content += '</dd>';
$('#cart_block dl.products').append(content);
}
//else update the product's line
else
{
var jsonProduct = this;
if($.trim($('#cart_block_product_' + domIdProduct + ' .quantity').html()) != jsonProduct.quantity || $.trim($('#cart_block_product_' + domIdProduct + ' .price').html()) != jsonProduct.priceByLine)
{
// Usual product
if (!this.is_gift)
$('#cart_block_product_' + domIdProduct + ' .price').text(jsonProduct.priceByLine);
else
$('#cart_block_product_' + domIdProduct + ' .price').html(freeProductTranslation);
ajaxCart.updateProductQuantity(jsonProduct, jsonProduct.quantity);
// Customized product
if (jsonProduct.hasCustomizedDatas)
{
customizationFormatedDatas = ajaxCart.displayNewCustomizedDatas(jsonProduct);
if (!$('#customization_' + domIdProductAttribute).length)
{
if (jsonProduct.hasAttributes)
$('#cart_block_combination_of_' + domIdProduct).append(customizationFormatedDatas);
else
$('#cart_block dl.products').append(customizationFormatedDatas);
}
else
{
$('#customization_' + domIdProductAttribute).html('');
$('#customization_' + domIdProductAttribute).append(customizationFormatedDatas);
}
}
}
}
$('#cart_block dl.products .hidden').slideDown(450).removeClass('hidden');
var removeLinks = $('#cart_block_product_' + domIdProduct).find('a.ajax_cart_block_remove_link');
if (this.hasCustomizedDatas && removeLinks.length)
$(removeLinks).each(function() {
$(this).remove();
});
}
});
},
displayNewCustomizedDatas : function(product)
{
var content = '';
var productId = parseInt(product.id);
var productAttributeId = typeof(product.idCombination) == 'undefined' ? 0 : parseInt(product.idCombination);
var hasAlreadyCustomizations = $('#customization_' + productId + '_' + productAttributeId).length;
if (!hasAlreadyCustomizations)
{
if (!product.hasAttributes)
content += '<dd id="cart_block_combination_of_' + productId + '" class="hidden">';
if ($('#customization_' + productId + '_' + productAttributeId).val() == undefined)
content += '<ul class="cart_block_customizations" id="customization_' + productId + '_' + productAttributeId + '">';
}
$(product.customizedDatas).each(function()
{
var done = 0;
customizationId = parseInt(this.customizationId);
productAttributeId = typeof(product.idCombination) == 'undefined' ? 0 : parseInt(product.idCombination);
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&amp;delete=1&amp;id_product=' + productId + '&amp;ipa=' + productAttributeId + '&amp;id_customization=' + customizationId + '&amp;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(){
if (this['type'] == CUSTOMIZE_TEXTFIELD)
{
$(this.datas).each(function(){
if (this['index'] == 0)
{
content += ' ' + this.truncatedValue.replace(/<br \/>/g, ' ');
done = 1;
return false;
}
})
}
});
// If the customized product did not have any textfield, it will have the customizationId as name
if (!done)
content += customizationIdMessage + customizationId;
if (!hasAlreadyCustomizations) content += '</li>';
// Field cleaning
if (customizationId)
{
$('#uploadable_files li div.customizationUploadBrowse img').remove();
$('#text_fields input').attr('value', '');
}
});
if (!hasAlreadyCustomizations)
{
content += '</ul>';
if (!product.hasAttributes) content += '</dd>';
}
return (content);
},
//genarally update the display of the cart
updateCart : function(jsonData) {
//user errors display
if (jsonData.hasError)
{
var errors = '';
for (error in jsonData.errors)
//IE6 bug fix
if (error != 'indexOf')
errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
alert(errors);
}
else
{
ajaxCart.updateCartEverywhere(jsonData);
ajaxCart.hideOldProducts(jsonData);
ajaxCart.displayNewProducts(jsonData);
ajaxCart.refreshVouchers(jsonData);
//update 'first' and 'last' item classes
$('#cart_block .products dt').removeClass('first_item').removeClass('last_item').removeClass('item');
$('#cart_block .products dt:first').addClass('first_item');
$('#cart_block .products dt:not(:first,:last)').addClass('item');
$('#cart_block .products dt:last').addClass('last_item');
//reset the onlick events in relation to the cart block (it allow to bind the onclick event to the new 'delete' buttons added)
ajaxCart.overrideButtonsInThePage();
}
},
//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')
$('.ajax_cart_shipping_cost').html(freeShippingTranslation);
$('.ajax_cart_tax_cost').text(jsonData.taxCost);
$('.cart_block_wrapping_cost').text(jsonData.wrappingCost);
$('.ajax_block_cart_total').text(jsonData.total);
this.nb_total_products = jsonData.nbTotalProducts;
if (parseInt(jsonData.nbTotalProducts) > 0)
{
$('.ajax_cart_no_product').hide();
$('.ajax_cart_quantity').text(jsonData.nbTotalProducts);
$('.ajax_cart_quantity').fadeIn('slow');
$('.ajax_cart_total').fadeIn('slow');
if (parseInt(jsonData.nbTotalProducts) > 1)
{
$('.ajax_cart_product_txt').each( function () {
$(this).hide();
});
$('.ajax_cart_product_txt_s').each( function () {
$(this).show();
});
}
else
{
$('.ajax_cart_product_txt').each( function () {
$(this).show();
});
$('.ajax_cart_product_txt_s').each( function () {
$(this).hide();
});
}
}
else
{
$('.ajax_cart_quantity, .ajax_cart_product_txt_s, .ajax_cart_product_txt, .ajax_cart_total').each(function(){
$(this).hide();
});
$('.ajax_cart_no_product').show('slow');
}
}
};
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
$('#block_cart_collapse').click(function(){
ajaxCart.collapse();
});
$('#block_cart_expand').click(function(){
ajaxCart.expand();
});
ajaxCart.overrideButtonsInThePage();
var cart_qty = 0;
var current_timestamp = parseInt(new Date().getTime() / 1000);
if (typeof $('.ajax_cart_quantity').html() == 'undefined' || (typeof generated_date != 'undefined' && generated_date != null && (parseInt(generated_date) + 30) < current_timestamp))
ajaxCart.refresh();
else
cart_qty = parseInt($('.ajax_cart_quantity').html());
/* roll over cart */
var cart_block = new HoverWatcher('#header #cart_block');
var shopping_cart = new HoverWatcher('#shopping_cart');
$("#shopping_cart a:first").hover(
function() {
$(this).css('border-radius', '3px 3px 0px 0px');
if (ajaxCart.nb_total_products > 0 || cart_qty > 0)
$("#header #cart_block").stop(true, true).slideDown(450);
},
function() {
$('#shopping_cart a').css('border-radius', '3px');
setTimeout(function() {
if (!shopping_cart.isHoveringOver() && !cart_block.isHoveringOver())
$("#header #cart_block").stop(true, true).slideUp(450);
}, 200);
}
);
$("#header #cart_block").hover(
function() {
$('#shopping_cart a').css('border-radius', '3px 3px 0px 0px');
},
function() {
$('#shopping_cart a').css('border-radius', '3px');
setTimeout(function() {
if (!shopping_cart.isHoveringOver())
$("#header #cart_block").stop(true, true).slideUp(450);
}, 200);
}
);
$(document).on('click', '.delete_voucher', function(){
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
async: true,
cache: false,
url:$(this).attr('href') + '?rand=' + new Date().getTime(),
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
}
});
$(this).parent().parent().remove();
if ($('body').attr('id') == 'order' || $('body').attr('id') == 'order-opc')
{
if (typeof(updateAddressSelection) != 'undefined')
updateAddressSelection();
else
location.reload();
}
return false;
});
$('#cart_navigation input').click(function(){
$(this).attr('disabled', true).removeClass('exclusive').addClass('exclusive_disabled');
$(this).closest("form").get(0).submit();
});
});

View File

@ -0,0 +1,29 @@
<?php
/*
* 2007-2015 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-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
// @TODO Find the reason why the blockcart.php is includ multiple time
$context = Context::getContext();
$blockCart = Module::getInstanceByName('blockcart');
echo $blockCart->hookAjaxCall(array('cookie' => $context->cookie, 'cart' => $context->cart));

View File

@ -0,0 +1,116 @@
{*
* 2007-2015 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-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{ldelim}
"products": [
{if $products}
{foreach from=$products item=product name='products'}
{assign var='productId' value=$product.id_product}
{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, $product.id_product_attribute)|addslashes|replace:'\\\'':'\''}",
"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:'html'}",
"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}",
"idCombination": {if isset($product.attributes_small)}{$productAttributeId}{else}0{/if},
"idAddressDelivery": {if isset($product.id_address_delivery)}{$product.id_address_delivery}{else}0{/if},
"is_gift" : {if isset($product.is_gift) && $product.is_gift}1{else}0{/if},
{if isset($product.attributes_small)}
"hasAttributes": true,
"attributes": "{$product.attributes_small|addslashes|replace:'\\\'':'\''}",
{else}
"hasAttributes": false,
{/if}
"hasCustomizedDatas": {if isset($customizedDatas.$productId.$productAttributeId)}true{else}false{/if},
"customizedDatas":[
{if isset($customizedDatas.$productId.$productAttributeId[$product.id_address_delivery])}
{foreach from=$customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] key='id_customization' item='customization' name='customizedDatas'}{ldelim}
{* This empty line was made in purpose (product addition debug), please leave it here *}
"customizationId": {$id_customization},
"quantity": "{$customization.quantity}",
"datas": [
{foreach from=$customization.datas key='type' item='datas' name='customization'}
{ldelim}
"type": "{$type}",
"datas":
[
{foreach from=$datas key='index' item='data' name='datas'}
{ldelim}
"index": {$index},
"value": "{Tools::nl2br($data.value|addslashes|replace: '\\\'':'\'')}",
"truncatedValue": "{Tools::nl2br($data.value|truncate:28:'...'|addslashes|replace: '\\\'':'\'')}"
{rdelim}{if !$smarty.foreach.datas.last},{/if}
{/foreach}]
{rdelim}{if !$smarty.foreach.customization.last},{/if}
{/foreach}
]
{rdelim}{if !$smarty.foreach.customizedDatas.last},{/if}
{/foreach}
{/if}
]
{rdelim}{if !$smarty.foreach.products.last},{/if}
{/foreach}{/if}
],
"discounts": [
{if $discounts}{foreach from=$discounts item=discount name='discounts'}
{ldelim}
"id": "{$discount.id_discount}",
"name": "{$discount.name|truncate:18:'...'|addslashes|replace:'\\\'':'\''}",
"description": "{$discount.description|addslashes|replace:'\\\'':'\''}",
"nameDescription": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|addslashes|replace:'\\\'':'\''}",
"code": "{$discount.code}",
"link": "{$link->getPageLink("$order_process", true, NULL, "deleteDiscount={$discount.id_discount}")|escape:'html'}",
"price": "{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}",
"price_float": "{if $priceDisplay == 1}{$discount.value_tax_exc}{else}{$discount.value_real}{/if}"
{rdelim}
{if !$smarty.foreach.discounts.last},{/if}
{/foreach}{/if}
],
"shippingCost": "{$shipping_cost|html_entity_decode:2:'UTF-8'}",
"shippingCostFloat": "{$shipping_cost_float|html_entity_decode:2:'UTF-8'}",
{if isset($tax_cost)}
"taxCost": "{$tax_cost|html_entity_decode:2:'UTF-8'}",
{/if}
"wrappingCost": "{$wrapping_cost|html_entity_decode:2:'UTF-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" : [
{foreach from=$errors key=k item=error name='errors'}
"{$error|addslashes|html_entity_decode:2:'UTF-8'}"
{if !$smarty.foreach.errors.last},{/if}
{/foreach}
]
{else}
"hasError" : false
{/if}
{rdelim}

View File

@ -0,0 +1,43 @@
<?php
/*
* 2007-2015 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-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../init.php');
if ( isset($_POST['ajax_blockcart_display']) || isset($_GET['ajax_blockcart_display']))
{
if (Tools::getValue('ajax_blockcart_display') == 'collapse')
{
Context::getContext()->cookie->ajax_blockcart_display = 'collapsed';
die ('collapse status of the blockcart module updated in the cookie');
}
if (Tools::getValue('ajax_blockcart_display') == 'expand')
{
Context::getContext()->cookie->ajax_blockcart_display = 'expanded';
die ('expand status of the blockcart module updated in the cookie');
}
die ('ERROR : bad status setted. Only collapse or expand status of the blockcart module are available.');
}
else die('ERROR : No status setted.');

View File

@ -0,0 +1,160 @@
/* Special style for block cart*/
#left_column #cart_block, #right_column #cart_block {
}
#header #cart_block .title_block, #header #cart_block h4 {
display: none;
}
#header #cart_block {
z-index: 10;
display:none;
position: absolute;
right: 0;
top: 65px;
height: auto;
width: 200px;
-moz-border-bottom-right-radius: 3px;
-moz-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
box-shadow: 0 1px 0 #C6C6C6;
background:#eee
}
#cart_block.cart_block_hover {display:block}
#cart_block .title_block span, #header #cart_block h4 {
float: right;
padding-left: 10px;
text-transform: none;
background-position: left top;
background-repeat: no-repeat;
cursor: pointer
}
#cart_block .block_content {padding:8px 8px 16px 8px;}
#cart_block #cart_block_summary {display:none}
#cart_block .quantity-formated {
display:inline-block;
padding-right:2px;
min-width:18px;
vertical-align: top;
}
#cart_block .cart_block_product_name {font-weight:bold}
#cart_block .remove_link, #cart_block .deleteCustomizableProduct {
float:right;
display:inline-block;
margin:1px 0 0 5px;
height:12px;
width:12px
}
#cart_block .remove_link a, #cart_block .ajax_cart_block_remove_link {
display:inline-block;
height:12px;
width:12px;
background: url(img/icon/delete.gif) no-repeat 0 0
}
#cart_block .price {
float:right
}
#cart_block #cart_block_list dl {
padding-bottom:10px
}
#cart_block #cart_block_list dt {padding:4px 0}
#cart_block #cart_block_list dt a {font-weight:bold; display: inline-block; max-width: 95px}
#cart_block #cart_block_list dd {
margin-left:20px
}
#cart_block #cart-prices {
padding:10px 4px;
line-height:20px;
font-weight:bold;
border-top:1px solid #999
}
#cart_block #cart_block_shipping_cost,
#cart_block #cart_block_total {
float:right
}
#cart_block #cart_block_shipping_cost {font-weight:bold}
#cart_block #cart-buttons .button_small {display:none;}
#cart_block #cart-buttons #button_order_cart {
float:right;
padding-left:20px
}
#cart_block #cart-buttons #button_order_cart span {
position:absolute;
top:-1px;
left:-12px;
display:block;
height:26px;
width:26px;
background:url(img/icon/pict_add_cart.png) no-repeat 0 0
}
#cart_block table#vouchers {
clear: both;
width:100%
}
#cart_block table#vouchers tr td{
padding: 2px;
}
#cart_block table#vouchers tr td.quantity{
margin-right:5px;
min-width:18px
}
#cart_block table#vouchers tr td.delete{
padding-left: 0;
padding-right: 0;
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;
}

View File

@ -0,0 +1,357 @@
<?php
/*
* 2007-2015 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-2015 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 (!defined('_PS_VERSION_'))
exit;
class BlockCart extends Module
{
public function __construct()
{
$this->name = 'blockcart';
$this->tab = 'front_office_features';
$this->version = '1.5.8';
$this->author = 'PrestaShop';
$this->need_instance = 0;
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Cart block');
$this->description = $this->l('Adds a block containing the customer\'s shopping cart.');
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
}
public function assignContentVars($params)
{
global $errors;
// Set currency
if ((int)$params['cart']->id_currency && (int)$params['cart']->id_currency != $this->context->currency->id)
$currency = new Currency((int)$params['cart']->id_currency);
else
$currency = $this->context->currency;
$taxCalculationMethod = Group::getPriceDisplayMethod((int)Group::getCurrent()->id);
$useTax = !($taxCalculationMethod == PS_TAX_EXC);
$products = $params['cart']->getProducts(true);
$nbTotalProducts = 0;
foreach ($products as $product)
$nbTotalProducts += (int)$product['cart_quantity'];
$cart_rules = $params['cart']->getCartRules();
if (empty($cart_rules))
$base_shipping = $params['cart']->getOrderTotal($useTax, Cart::ONLY_SHIPPING);
else
{
$base_shipping_with_tax = $params['cart']->getOrderTotal(true, Cart::ONLY_SHIPPING);
$base_shipping_without_tax = $params['cart']->getOrderTotal(false, Cart::ONLY_SHIPPING);
if ($useTax)
$base_shipping = $base_shipping_with_tax;
else
$base_shipping = $base_shipping_without_tax;
}
$shipping_cost = Tools::displayPrice($base_shipping, $currency);
$shipping_cost_float = Tools::convertPrice($base_shipping, $currency);
$wrappingCost = (float)($params['cart']->getOrderTotal($useTax, Cart::ONLY_WRAPPING));
$totalToPay = $params['cart']->getOrderTotal($useTax);
if ($useTax && Configuration::get('PS_TAX_DISPLAY') == 1)
{
$totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false);
$this->smarty->assign('tax_cost', Tools::displayPrice($totalToPay - $totalToPayWithoutTaxes, $currency));
}
// The cart content is altered for display
foreach ($cart_rules as &$cart_rule)
{
if ($cart_rule['free_shipping'])
{
$shipping_cost = Tools::displayPrice(0, $currency);
$shipping_cost_float = 0;
$cart_rule['value_real'] -= Tools::convertPrice($base_shipping_with_tax, $currency);
$cart_rule['value_tax_exc'] = Tools::convertPrice($base_shipping_without_tax, $currency);
}
if ($cart_rule['gift_product'])
{
foreach ($products as &$product)
if ($product['id_product'] == $cart_rule['gift_product']
&& $product['id_product_attribute'] == $cart_rule['gift_product_attribute'])
{
$product['is_gift'] = 1;
$product['total_wt'] = Tools::ps_round($product['total_wt'] - $product['price_wt'],
(int)$currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
$product['total'] = Tools::ps_round($product['total'] - $product['price'],
(int)$currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
$cart_rule['value_real'] = Tools::ps_round($cart_rule['value_real'] - $product['price_wt'],
(int)$currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
$cart_rule['value_tax_exc'] = Tools::ps_round($cart_rule['value_tax_exc'] - $product['price'],
(int)$currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
}
}
}
$total_free_shipping = 0;
if ($free_shipping = Tools::convertPrice(floatval(Configuration::get('PS_SHIPPING_FREE_PRICE')), $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)),
'CUSTOMIZE_FILE' => Product::CUSTOMIZE_FILE,
'CUSTOMIZE_TEXTFIELD' => Product::CUSTOMIZE_TEXTFIELD,
'discounts' => $cart_rules,
'nb_total_products' => (int)($nbTotalProducts),
'shipping_cost' => $shipping_cost,
'shipping_cost_float' => $shipping_cost_float,
'show_wrapping' => $wrappingCost > 0 ? true : false,
'show_tax' => (int)(Configuration::get('PS_TAX_DISPLAY') == 1 && (int)Configuration::get('PS_TAX')),
'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency),
'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::BOTH_WITHOUT_SHIPPING), $currency),
'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),
'free_shipping' => $total_free_shipping
));
if (count($errors))
$this->smarty->assign('errors', $errors);
if (isset($this->context->cookie->ajax_blockcart_display))
$this->smarty->assign('colapseExpandStatus', $this->context->cookie->ajax_blockcart_display);
}
public function getContent()
{
$output = '';
if (Tools::isSubmit('submitBlockCart'))
{
$ajax = Tools::getValue('PS_BLOCK_CART_AJAX');
if ($ajax != 0 && $ajax != 1)
$output .= $this->displayError($this->l('Ajax: Invalid choice.'));
else
Configuration::updateValue('PS_BLOCK_CART_AJAX', (int)($ajax));
if (($productNbr = (int)Tools::getValue('PS_BLOCK_CART_XSELL_LIMIT') < 0))
$output .= $this->displayError($this->l('Please complete the "Products to display" field.'));
else
{
Configuration::updateValue('PS_BLOCK_CART_XSELL_LIMIT', (int)(Tools::getValue('PS_BLOCK_CART_XSELL_LIMIT')));
$output .= $this->displayConfirmation($this->l('Settings updated'));
}
Configuration::updateValue('PS_BLOCK_CART_SHOW_CROSSSELLING', (int)(Tools::getValue('PS_BLOCK_CART_SHOW_CROSSSELLING')));
}
return $output.$this->renderForm();
}
public function install()
{
if (
parent::install() == false
|| $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_XSELL_LIMIT', 12) == false
|| Configuration::updateValue('PS_BLOCK_CART_SHOW_CROSSSELLING', 1) == false)
return false;
return true;
}
public function hookRightColumn($params)
{
if (Configuration::get('PS_CATALOG_MODE'))
return;
// @todo this variable seems not used
$this->smarty->assign(array(
'order_page' => (strpos($_SERVER['PHP_SELF'], 'order') !== false),
'blockcart_top' => (isset($params['blockcart_top']) && $params['blockcart_top']) ? true : false,
));
$this->assignContentVars($params);
return $this->display(__FILE__, 'blockcart.tpl');
}
public function hookLeftColumn($params)
{
return $this->hookRightColumn($params);
}
public function hookAjaxCall($params)
{
if (Configuration::get('PS_CATALOG_MODE'))
return;
$this->assignContentVars($params);
$res = Tools::jsonDecode($this->display(__FILE__, 'blockcart-json.tpl'), true);
if (is_array($res) && ($id_product = Tools::getValue('id_product')) && Configuration::get('PS_BLOCK_CART_SHOW_CROSSSELLING'))
{
$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;
}
public function hookActionCartListOverride($params)
{
if (!Configuration::get('PS_BLOCK_CART_AJAX'))
return;
$this->assignContentVars(array('cookie' => $this->context->cookie, 'cart' => $this->context->cart));
$params['json'] = $this->display(__FILE__, 'blockcart-json.tpl');
}
public function hookHeader()
{
if (Configuration::get('PS_CATALOG_MODE'))
return;
$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', 'bxslider'));
}
}
public function hookTop($params)
{
$params['blockcart_top'] = true;
return $this->hookRightColumn($params);
}
public function hookDisplayNav($params)
{
$params['blockcart_top'] = true;
return $this->hookTop($params);
}
public function renderForm()
{
$fields_form = array(
'form' => array(
'legend' => array(
'title' => $this->l('Settings'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'switch',
'label' => $this->l('Ajax cart'),
'name' => 'PS_BLOCK_CART_AJAX',
'is_bool' => true,
'desc' => $this->l('Activate Ajax mode for the cart (compatible with the default theme).'),
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
),
),
array(
'type' => 'switch',
'label' => $this->l('Show cross-selling'),
'name' => 'PS_BLOCK_CART_SHOW_CROSSSELLING',
'is_bool' => true,
'desc' => $this->l('Activate cross-selling display for the cart.'),
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'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')
)
),
);
$helper = new HelperForm();
$helper->show_toolbar = false;
$helper->table = $this->table;
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
$helper->default_form_language = $lang->id;
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
$this->fields_form = array();
$helper->identifier = $this->identifier;
$helper->submit_action = 'submitBlockCart';
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab
.'&module_name='.$this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->tpl_vars = array(
'fields_value' => $this->getConfigFieldsValues(),
'languages' => $this->context->controller->getLanguages(),
'id_language' => $this->context->language->id
);
return $helper->generateForm(array($fields_form));
}
public function getConfigFieldsValues()
{
return array(
'PS_BLOCK_CART_AJAX' => (bool)Tools::getValue('PS_BLOCK_CART_AJAX', Configuration::get('PS_BLOCK_CART_AJAX')),
'PS_BLOCK_CART_SHOW_CROSSSELLING' => (bool)Tools::getValue('PS_BLOCK_CART_SHOW_CROSSSELLING', Configuration::get('PS_BLOCK_CART_SHOW_CROSSSELLING')),
'PS_BLOCK_CART_XSELL_LIMIT' => (int)Tools::getValue('PS_BLOCK_CART_XSELL_LIMIT', Configuration::get('PS_BLOCK_CART_XSELL_LIMIT'))
);
}
}

View File

@ -0,0 +1,176 @@
{*
* 2007-2015 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-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{*************************************************************************************************************************************}
{* IMPORTANT : If you change some data here, you have to report these changes in the ./blockcart-json.js (to let ajaxCart available) *}
{*************************************************************************************************************************************}
{if $ajax_allowed}
<script type="text/javascript">
var CUSTOMIZE_TEXTFIELD = {$CUSTOMIZE_TEXTFIELD};
var img_dir = '{$img_dir|addslashes}';
</script>
{/if}
<script type="text/javascript">
var customizationIdMessage = '{l s='Customization #' mod='blockcart' js=1}';
var removingLinkText = '{l s='remove this product from my cart' mod='blockcart' js=1}';
var freeShippingTranslation = '{l s='Free shipping!' mod='blockcart' js=1}';
var freeProductTranslation = '{l s='Free!' mod='blockcart' js=1}';
var delete_txt = '{l s='Delete' mod='blockcart' js=1}';
var generated_date = {$smarty.now|intval};
</script>
<!-- MODULE Block cart -->
<div id="cart_block" class="block exclusive">
<h4 class="title_block">
<a href="{$link->getPageLink("$order_process", true)|escape:'html'}" title="{l s='View my shopping cart' mod='blockcart'}" rel="nofollow">{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}>&nbsp;</span>
<span id="block_cart_collapse" {if isset($colapseExpandStatus) && $colapseExpandStatus eq 'collapsed'}class="hidden"{/if}>&nbsp;</span>
{/if}
</h4>
<div class="block_content">
<!-- block summary -->
<div id="cart_block_summary" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed || !isset($colapseExpandStatus)}collapsed{else}expanded{/if}">
<span class="ajax_cart_quantity" {if $cart_qties <= 0}style="display:none;"{/if}>{$cart_qties}</span>
<span class="ajax_cart_product_txt_s" {if $cart_qties <= 1}style="display:none"{/if}>{l s='Products' mod='blockcart'}</span>
<span class="ajax_cart_product_txt" {if $cart_qties > 1}style="display:none"{/if}>{l s='Product' mod='blockcart'}</span>
<span class="ajax_cart_total" {if $cart_qties == 0}style="display:none"{/if}>
{if $cart_qties > 0}
{if $priceDisplay == 1}
{convertPrice price=$cart->getOrderTotal(false)}
{else}
{convertPrice price=$cart->getOrderTotal(true)}
{/if}
{/if}
</span>
<span class="ajax_cart_no_product" {if $cart_qties != 0}style="display:none"{/if}>{l s='(empty)' mod='blockcart'}</span>
</div>
<!-- block list of products -->
<div id="cart_block_list" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed || !isset($colapseExpandStatus)}expanded{else}collapsed{/if}">
{if $products}
<dl class="products">
{foreach from=$products item='product' name='myLoop'}
{assign var='productId' value=$product.id_product}
{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}{else}0{/if}_{if $product.id_address_delivery}{$product.id_address_delivery}{else}0{/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, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html'}" title="{$product.name|escape:html:'UTF-8'}">
{$product.name|truncate:13:'...'|escape:html:'UTF-8'}</a>
<span class="remove_link">{if !isset($customizedDatas.$productId.$productAttributeId) && (!isset($product.is_gift) || !$product.is_gift)}<a rel="nofollow" class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&amp;id_product={$product.id_product}&amp;ipa={$product.id_product_attribute}&amp;id_address_delivery={$product.id_address_delivery}&amp;token={$static_token}", true)|escape:'html'}" title="{l s='Please remove this product from my cart.' mod='blockcart'}">&nbsp;</a>{/if}</span>
<span class="price">
{if !isset($product.is_gift) || !$product.is_gift}
{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice p="`$product.total`"}{else}{displayWtPrice p="`$product.total_wt`"}{/if}
{else}
<b>{l s='Free!' mod='blockcart'}</b>
{/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}_{$product.id_address_delivery|intval}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">
<a href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html'}" title="{l s='Product detail' mod='blockcart'}">{$product.attributes_small}</a>
{/if}
<!-- Customizable datas -->
{if isset($customizedDatas.$productId.$productAttributeId[$product.id_address_delivery])}
{if !isset($product.attributes_small)}<dd id="cart_block_combination_of_{$product.id_product}_{if $product.id_product_attribute}{$product.id_product_attribute}{else}0{/if}_{if $product.id_address_delivery}{$product.id_address_delivery}{else}0{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">{/if}
<ul class="cart_block_customizations" id="customization_{$productId}_{$productAttributeId}">
{foreach from=$customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] 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}_{$product.id_address_delivery|intval}"><a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&amp;id_product={$product.id_product|intval}&amp;ipa={$product.id_product_attribute|intval}&amp;id_customization={$id_customization}&amp;token={$static_token}", true)|escape:'html'}" rel="nofollow"> </a></div>
<span class="quantity-formated"><span class="quantity">{$customization.quantity}</span>x</span>{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}
{$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|replace:"<br />":" "|truncate:28:'...'|escape:html:'UTF-8'}
{else}
{l s='Customization #%d:' sprintf=$id_customization|intval mod='blockcart'}
{/if}
</li>
{/foreach}
</ul>
{if !isset($product.attributes_small)}</dd>{/if}
{/if}
{if isset($product.attributes_small)}</dd>{/if}
{/foreach}
</dl>
{/if}
<p {if $products}class="hidden"{/if} id="cart_block_no_products">{l s='No products' mod='blockcart'}</p>
{if $discounts|@count > 0}
<table id="vouchers"{if $discounts|@count == 0} style="display:none;"{/if}>
{foreach from=$discounts item=discount}
{if $discount.value_real > 0}
<tr class="bloc_cart_voucher" id="bloc_cart_voucher_{$discount.id_discount}">
<td class="quantity">1x</td>
<td class="name" title="{$discount.description}">{$discount.name|truncate:18:'...'|escape:'html':'UTF-8'}</td>
<td class="price">-{if $priceDisplay == 1}{convertPrice price=$discount.value_tax_exc}{else}{convertPrice price=$discount.value_real}{/if}</td>
<td class="delete">
{if strlen($discount.code)}
<a class="delete_voucher" href="{$link->getPageLink('$order_process', true)}?deleteDiscount={$discount.id_discount}" title="{l s='Delete' mod='blockcart'}" rel="nofollow"><img src="{$img_dir}icon/delete.gif" alt="{l s='Delete' mod='blockcart'}" class="icon" /></a>
{/if}
</td>
</tr>
{/if}
{/foreach}
</table>
{/if}
<p id="cart-prices">
<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
<span>{l s='Shipping' mod='blockcart'}</span>
<br/>
{if $show_wrapping}
{assign var='cart_flag' value='Cart::ONLY_WRAPPING'|constant}
<span id="cart_block_wrapping_cost" class="price cart_block_wrapping_cost">{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false, $cart_flag)}{else}{convertPrice price=$cart->getOrderTotal(true, $cart_flag)}{/if}</span>
<span>{l s='Wrapping' mod='blockcart'}</span>
<br/>
{/if}
{if $show_tax && isset($tax_cost)}
<span id="cart_block_tax_cost" class="price ajax_cart_tax_cost">{$tax_cost}</span>
<span>{l s='Tax' mod='blockcart'}</span>
<br/>
{/if}
<span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>
<span>{l s='Total' mod='blockcart'}</span>
</p>
{if $use_taxes && $display_tax_label == 1 && $show_tax}
{if $priceDisplay == 0}
<p id="cart-price-precisions">
{l s='Prices are tax included' mod='blockcart'}
</p>
{/if}
{if $priceDisplay == 1}
<p id="cart-price-precisions">
{l s='Prices are tax excluded' mod='blockcart'}
</p>
{/if}
{/if}
<p id="cart-buttons">
{if $order_process == 'order'}<a href="{$link->getPageLink("$order_process", true)|escape:'html'}" class="button_small" title="{l s='View my shopping cart' mod='blockcart'}" rel="nofollow">{l s='Cart' mod='blockcart'}</a>{/if}
<a href="{$link->getPageLink("$order_process", true)|escape:'html'}" id="button_order_cart" class="exclusive{if $order_process == 'order-opc'}_large{/if}" title="{l s='Check out' mod='blockcart'}" rel="nofollow"><span></span>{l s='Check out' mod='blockcart'}</a>
</p>
</div>
</div>
</div>
<!-- /MODULE Block cart -->

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>blockcart</name>
<displayName><![CDATA[Cart block]]></displayName>
<version><![CDATA[1.5.8]]></version>
<description><![CDATA[Adds a block containing the customer&#039;s shopping cart.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>blockcart</name>
<displayName><![CDATA[Bloc panier]]></displayName>
<version><![CDATA[1.5.8]]></version>
<description><![CDATA[Ajoute un bloc avec le contenu du panier du client]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@ -0,0 +1,47 @@
{*
* 2007-2015 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-2015 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='blockcart'}" 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:'html':'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}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2015 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-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2015 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-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2015 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-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

BIN
modules/blockcart/logo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 995 B

BIN
modules/blockcart/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,60 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{blockcart}prestashop>blockcart_c2e1362a9710a3dd86f937c2ea1f336d'] = 'Bloc panier';
$_MODULE['<{blockcart}prestashop>blockcart_e03093a5753b436ee1de63b6e3e1bd02'] = 'Ajoute un bloc avec le contenu du panier du client';
$_MODULE['<{blockcart}prestashop>blockcart_a21e5718d2a196280b729438933501c7'] = 'Ajax : choix non valable.';
$_MODULE['<{blockcart}prestashop>blockcart_02c793e3df4632db20e4d6e146095d62'] = 'Vous devez remplir le champ "Produits Affichés".';
$_MODULE['<{blockcart}prestashop>blockcart_c888438d14855d7d96a2724ee9c306bd'] = 'Mise à jour réussie';
$_MODULE['<{blockcart}prestashop>blockcart_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
$_MODULE['<{blockcart}prestashop>blockcart_614a8820aa4ac08ce2ee398a41b10778'] = 'Panier Ajax';
$_MODULE['<{blockcart}prestashop>blockcart_eefd19ecf1f6d94a308dcfc95981bbf9'] = 'Activer le mode Ajax du panier (compatible avec le thème par défaut).';
$_MODULE['<{blockcart}prestashop>blockcart_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé';
$_MODULE['<{blockcart}prestashop>blockcart_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé';
$_MODULE['<{blockcart}prestashop>blockcart_a87a2d4a45b5a7e682089167c1d5232a'] = 'Activer le cross-selling';
$_MODULE['<{blockcart}prestashop>blockcart_89e535251f4749df29ad3a288deaa017'] = 'Activer l\'affichage du cross-selling dans le panier.';
$_MODULE['<{blockcart}prestashop>blockcart_ce8bd2479bb85218eb304a9a2903a157'] = 'Produits à afficher dans les ventes croisées';
$_MODULE['<{blockcart}prestashop>blockcart_5f2effb52d25d197793288dfa94c27ce'] = 'Détermine le nombre de produits affichés dans le bloc ventes croisées.';
$_MODULE['<{blockcart}prestashop>blockcart_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
$_MODULE['<{blockcart}prestashop>blockcart_20351b3328c35ab617549920f5cb4939'] = 'Personnalisation';
$_MODULE['<{blockcart}prestashop>blockcart_ed6e9a09a111035684bb23682561e12d'] = 'supprimer cet article du panier';
$_MODULE['<{blockcart}prestashop>blockcart_c6995d6cc084c192bc2e742f052a5c74'] = 'Livraison gratuite !';
$_MODULE['<{blockcart}prestashop>blockcart_e7a6ca4e744870d455a57b644f696457'] = 'Offert !';
$_MODULE['<{blockcart}prestashop>blockcart_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
$_MODULE['<{blockcart}prestashop>blockcart_0c3bf3014aafb90201805e45b5e62881'] = 'Voir mon panier';
$_MODULE['<{blockcart}prestashop>blockcart_a85eba4c6c699122b2bb1387ea4813ad'] = 'Panier';
$_MODULE['<{blockcart}prestashop>blockcart_068f80c7519d0528fb08e82137a72131'] = 'Produits';
$_MODULE['<{blockcart}prestashop>blockcart_deb10517653c255364175796ace3553f'] = 'Produit';
$_MODULE['<{blockcart}prestashop>blockcart_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(vide)';
$_MODULE['<{blockcart}prestashop>blockcart_0da4d96cad73748e2f608d31cfb3247c'] = 'supprimer cet article du panier';
$_MODULE['<{blockcart}prestashop>blockcart_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Détails de l\'article';
$_MODULE['<{blockcart}prestashop>blockcart_3d9e3bae9905a12dae384918ed117a26'] = 'Personnalisation n°%d :';
$_MODULE['<{blockcart}prestashop>blockcart_09dc02ecbb078868a3a86dded030076d'] = 'Aucun produit';
$_MODULE['<{blockcart}prestashop>blockcart_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Livraison';
$_MODULE['<{blockcart}prestashop>blockcart_ba794350deb07c0c96fe73bd12239059'] = 'Emballage';
$_MODULE['<{blockcart}prestashop>blockcart_4b78ac8eb158840e9638a3aeb26c4a9d'] = 'Taxes';
$_MODULE['<{blockcart}prestashop>blockcart_96b0141273eabab320119c467cdcaf17'] = 'Total';
$_MODULE['<{blockcart}prestashop>blockcart_0d11c2b75cf03522c8d97938490466b2'] = 'Les prix sont TTC';
$_MODULE['<{blockcart}prestashop>blockcart_41202aa6b8cf7ae885644717dab1e8b4'] = 'Les prix sont HT';
$_MODULE['<{blockcart}prestashop>blockcart_377e99e7404b414341a9621f7fb3f906'] = 'Commander';
$_MODULE['<{blockcart}prestashop>crossselling_ef2b66b0b65479e08ff0cce29e19d006'] = 'Les clients qui ont acheté ce produit ont également acheté...';
$_MODULE['<{blockcart}prestashop>crossselling_dd1f775e443ff3b9a89270713580a51b'] = 'Précédent';
$_MODULE['<{blockcart}prestashop>crossselling_4351cfebe4b61d8aa5efa1d020710005'] = 'Afficher';
$_MODULE['<{blockcart}prestashop>crossselling_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Suivant';
$_MODULE['<{blockcart}prestashop>blockcart_03e9618cc6e69fe15a57c7377827a804'] = 'À définir';
$_MODULE['<{blockcart}prestashop>blockcart_98b3009e61879600839e1ee486bb3282'] = 'Fermer la fenêtre';
$_MODULE['<{blockcart}prestashop>blockcart_544c3bd0eac526113a9c66542be1e5bc'] = 'Produit ajouté au panier avec succès';
$_MODULE['<{blockcart}prestashop>blockcart_694e8d1f2ee056f98ee488bdc4982d73'] = 'Quantité';
$_MODULE['<{blockcart}prestashop>blockcart_e5694b7726ceaf2f057e5f06cf86209e'] = 'Il y a [1]%d[/1] produits dans votre panier.';
$_MODULE['<{blockcart}prestashop>blockcart_fc86c43dbffcadc193832a310f7a444a'] = 'Il y a 1 produit dans votre panier.';
$_MODULE['<{blockcart}prestashop>blockcart_db205f01b4fd580fb5daa9072d96849d'] = 'Total produits';
$_MODULE['<{blockcart}prestashop>blockcart_21034ae6d01a83e702839a72ba8a77b0'] = '(HT)';
$_MODULE['<{blockcart}prestashop>blockcart_1f87346a16cf80c372065de3c54c86d9'] = 'TTC';
$_MODULE['<{blockcart}prestashop>blockcart_f4e8b53a114e5a17d051ab84d326cae5'] = 'Frais de port';
$_MODULE['<{blockcart}prestashop>blockcart_300225ee958b6350abc51805dab83c24'] = 'Continuer mes achats';
$_MODULE['<{blockcart}prestashop>blockcart_7e0bf6d67701868aac3116ade8fea957'] = 'Commander';
return $_MODULE;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2015 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-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@ -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);
}