tm theme
This commit is contained in:
@@ -41,7 +41,7 @@ var ajaxCart = {
|
||||
return false;
|
||||
});
|
||||
//for product page 'add' button...
|
||||
$('#add_to_cart input').unbind('click').click(function(){
|
||||
$('#add_to_cart button').unbind('click').click(function(){
|
||||
ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null);
|
||||
return false;
|
||||
});
|
||||
@@ -169,7 +169,7 @@ var ajaxCart = {
|
||||
|
||||
//reactive the button when adding has finished
|
||||
if (addedFromProductPage)
|
||||
$('#add_to_cart input').removeAttr('disabled').addClass('exclusive').removeClass('exclusive_disabled');
|
||||
$('#add_to_cart button').removeAttr('disabled').removeClass('disabled');
|
||||
else
|
||||
$('.ajax_add_to_cart_button').removeAttr('disabled');
|
||||
},
|
||||
@@ -185,7 +185,7 @@ var ajaxCart = {
|
||||
//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');
|
||||
$('#add_to_cart button').attr('disabled', true).addClass('disabled');
|
||||
$('.filled').removeClass('filled');
|
||||
}
|
||||
else
|
||||
@@ -208,32 +208,36 @@ var ajaxCart = {
|
||||
if (whishlist && !jsonData.errors)
|
||||
WishlistAddProductCart(whishlist[0], idProduct, idCombination, whishlist[1]);
|
||||
|
||||
// add the picture to the cart
|
||||
var $element = $(callerElement).parents('.ajax_block_product').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();
|
||||
// add the picture to the cart
|
||||
var $element = $(callerElement).parents('.ajax_block_product').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();
|
||||
if ($picture.length)
|
||||
{
|
||||
$picture.css({
|
||||
position: 'absolute',
|
||||
top: pictureOffsetOriginal.top,
|
||||
right: pictureOffsetOriginal.right
|
||||
});
|
||||
}
|
||||
if (typeof(contentOnly) != 'undefined') {
|
||||
var $contentOnly = contentOnly;
|
||||
}
|
||||
var pictureOffset = $picture.offset();
|
||||
if (($contentOnly && $contentOnly !=true) || !$contentOnly) {
|
||||
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)
|
||||
if (cartBlockOffset != undefined && $picture.length && (($contentOnly && $contentOnly !=true) || !$contentOnly))
|
||||
{
|
||||
$picture.appendTo('body');
|
||||
$picture
|
||||
@@ -263,15 +267,20 @@ var ajaxCart = {
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
else if ($contentOnly && $contentOnly !=false) {
|
||||
window.parent.ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
|
||||
ajaxCart.updateCartInformation(jsonData, addedFromProductPage);
|
||||
}
|
||||
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');
|
||||
$('#add_to_cart button').removeAttr('disabled').removeClass('disabled');
|
||||
else
|
||||
$(callerElement).removeAttr('disabled');
|
||||
}
|
||||
@@ -487,7 +496,7 @@ var ajaxCart = {
|
||||
content += '<span class="remove_link"></span>';
|
||||
content += '</dt>';
|
||||
if (this.hasAttributes)
|
||||
content += '<dd id="cart_block_combination_of_' + domIdProduct + '" class="unvisible">';
|
||||
content += '<dd id="cart_block_combination_of_' + domIdProduct + '" class="unvisible">';
|
||||
if (this.hasCustomizedDatas)
|
||||
content += ajaxCart.displayNewCustomizedDatas(this);
|
||||
if (this.hasAttributes) content += '</dd>';
|
||||
@@ -606,8 +615,8 @@ var ajaxCart = {
|
||||
var t = $('#layer_cart').outerHeight(true);
|
||||
if (t < h)
|
||||
var n = parseInt(((h-t) / 2) + s) + 'px';
|
||||
$('.layer_cart_overlay').css('width',$('body').width());
|
||||
$('.layer_cart_overlay').css('height',$('body').height());
|
||||
$('.layer_cart_overlay').css('width','100%');
|
||||
$('.layer_cart_overlay').css('height','100%');
|
||||
$('.layer_cart_overlay').show();
|
||||
$('#layer_cart').css({'top': n}).fadeIn('fast');
|
||||
crossselling_serialScroll();
|
||||
@@ -771,12 +780,13 @@ $(document).ready(function()
|
||||
});
|
||||
|
||||
$('#cart_navigation input').click(function(){
|
||||
$(this).attr('disabled', true).removeClass('exclusive').addClass('exclusive_disabled');
|
||||
$(this).attr('disabled', true).addClass('disabled');
|
||||
$(this).closest("form").get(0).submit();
|
||||
});
|
||||
|
||||
$('#layer_cart .cross, #layer_cart .continue, .layer_cart_overlay').click(function(){
|
||||
$('.layer_cart_overlay').hide(); $('#layer_cart').fadeOut('fast'); return false;
|
||||
$('.layer_cart_overlay').hide();
|
||||
$('#layer_cart').fadeOut('fast'); return false;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -795,35 +805,16 @@ function HoverWatcher(selector){
|
||||
})
|
||||
}
|
||||
|
||||
function crossselling_serialScrollFixLock(event, targeted, scrolled, items, position)
|
||||
{
|
||||
serialScrollNbImages = $('#blockcart_list li:visible').length;
|
||||
serialScrollNbImagesDisplayed = 4;
|
||||
|
||||
var leftArrow = position == 0 ? true : false;
|
||||
var rightArrow = position + serialScrollNbImagesDisplayed >= serialScrollNbImages ? true : false;
|
||||
|
||||
$('#blockcart_scroll_left').css('cursor', leftArrow ? 'default' : 'pointer').css('display', leftArrow ? 'none' : 'block').fadeTo(0, leftArrow ? 0 : 1);
|
||||
$('#blockcart_scroll_right').css('cursor', rightArrow ? 'default' : 'pointer').fadeTo(0, rightArrow ? 0 : 1).css('display', rightArrow ? 'none' : 'block');
|
||||
return true;
|
||||
}
|
||||
|
||||
function crossselling_serialScroll()
|
||||
{
|
||||
$('#blockcart_list').serialScroll({
|
||||
items:'li:visible',
|
||||
prev:'#blockcart_scroll_left',
|
||||
next:'#blockcart_scroll_right',
|
||||
axis:'x',
|
||||
offset:0,
|
||||
start:0,
|
||||
stop:true,
|
||||
onBefore:crossselling_serialScrollFixLock,
|
||||
duration:300,
|
||||
step: 1,
|
||||
lazy: true,
|
||||
lock: false,
|
||||
force:false
|
||||
$('#blockcart_caroucel').bxSlider({
|
||||
minSlides: 2,
|
||||
maxSlides: 4,
|
||||
slideWidth: 178,
|
||||
slideMargin: 20,
|
||||
moveSlides: 1,
|
||||
infiniteLoop: false,
|
||||
hideControlOnEnd: true,
|
||||
pager: false
|
||||
});
|
||||
$('#blockcart_list').trigger('goto', 0);
|
||||
}
|
||||
+14
-11
@@ -1,4 +1,3 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
@@ -23,13 +22,17 @@
|
||||
* @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;
|
||||
$(document).ready(function() {
|
||||
$('#crossselling_list_car').bxSlider({
|
||||
minSlides: 2,
|
||||
maxSlides: 6,
|
||||
slideWidth: 178,
|
||||
slideMargin: 20,
|
||||
pager: false,
|
||||
nextText: '',
|
||||
prevText: '',
|
||||
moveSlides:1,
|
||||
infiniteLoop:false,
|
||||
hideControlOnEnd: true
|
||||
});
|
||||
});
|
||||
@@ -24,7 +24,7 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
$(function(){
|
||||
$(document).ready(function(){
|
||||
|
||||
if (typeof(homeslider_speed) == 'undefined')
|
||||
homeslider_speed = 500;
|
||||
@@ -33,5 +33,14 @@ $(function(){
|
||||
if (typeof(homeslider_loop) == 'undefined')
|
||||
homeslider_loop = true;
|
||||
|
||||
$('#homeslider').bxSlider();
|
||||
$('#homeslider').bxSlider({
|
||||
infiniteLoop: homeslider_loop,
|
||||
hideControlOnEnd: true,
|
||||
pager: false,
|
||||
autoHover: true,
|
||||
auto: homeslider_loop,
|
||||
speed: homeslider_speed,
|
||||
pause: homeslider_pause,
|
||||
controls: true
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 2007-2013 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-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$('#bxslider1').bxSlider({
|
||||
minSlides: 2,
|
||||
maxSlides: 6,
|
||||
slideWidth: 178,
|
||||
slideMargin: 20,
|
||||
pager: false,
|
||||
nextText: '',
|
||||
prevText: '',
|
||||
moveSlides:1,
|
||||
infiniteLoop:false,
|
||||
hideControlOnEnd: true
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user