first commit
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
.favoritesButton svg{
|
||||
width:24px;
|
||||
height:24px;
|
||||
}
|
||||
.remove-fav.btn {
|
||||
position: absolute;
|
||||
top:-20px;
|
||||
right:calc(50% - 20px);
|
||||
z-index: 2;
|
||||
padding:6px!important;
|
||||
line-height:0!important;
|
||||
}
|
||||
#favoriteproducts_block_account .product-flags { display: none }
|
||||
.remove-fav.in_progress {animation: unset;background:none}
|
||||
|
||||
.alert_note{
|
||||
}
|
||||
.alert_note a{
|
||||
text-decoration: underline;
|
||||
}
|
||||
.icon-button {
|
||||
}
|
||||
.box-info-product .wrap_alert{
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.box-info-product .wrap_alert .alert_note{
|
||||
margin-left: 10px;
|
||||
width: 142px;
|
||||
}
|
||||
.wrap_alert:hover .alert_note {
|
||||
display: block;
|
||||
}
|
||||
.svgic {
|
||||
display: inline-block;
|
||||
fill: currentColor;
|
||||
height: 20px;
|
||||
pointer-events: none;
|
||||
vertical-align: top;
|
||||
width: 20px;
|
||||
}
|
||||
.smooth02{transition:all .2s ease-in-out}
|
||||
.smooth05{transition:all .5s ease-in-out}
|
||||
.in_progress {
|
||||
background-image: url("../svg/loader.svg") !important;
|
||||
background-repeat:no-repeat !important;
|
||||
background-position: 50% 50%;
|
||||
background-size: cover;
|
||||
-webkit-animation: rotation 0.6s ease-in-out infinite;
|
||||
animation: rotation 0.6s ease-in-out infinite;
|
||||
}
|
||||
.in_progress use {
|
||||
opacity: 0
|
||||
}
|
||||
.pk-infomessage a {color:inherit;text-decoration: underline;}
|
||||
.pk-infomessage {
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
top:114px;
|
||||
right:20px;
|
||||
width:300px;
|
||||
}
|
||||
.pk-close-popup {
|
||||
position: absolute;
|
||||
top:10px;
|
||||
right:10px;
|
||||
display: block;
|
||||
}
|
||||
.pk-close-popup svg{
|
||||
width:14px;
|
||||
height: 14px;
|
||||
color:#fff;
|
||||
margin: 0 5px 0 0
|
||||
}
|
||||
.pk-infomessage-item {
|
||||
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
|
||||
margin-bottom: 20px;
|
||||
font-size: 15px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.pk-infomessage-item > div:first-child {
|
||||
padding: 20px;
|
||||
}
|
||||
.pk-infomessage-item.state-error {
|
||||
background-color: #dc5300;
|
||||
color:#fff;
|
||||
}
|
||||
.pk-infomessage-item.state-success {
|
||||
background-color: #03a912;
|
||||
color:#fff;
|
||||
}
|
||||
.pk-infomessage-item.state-info {
|
||||
background-color: #4aaee8;
|
||||
color:#fff;
|
||||
}
|
||||
.pk-close-timer {
|
||||
position: absolute;
|
||||
bottom:0;
|
||||
left:0;
|
||||
width:100%;
|
||||
height: 4px;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
}
|
||||
.flex-container {
|
||||
display: flex;
|
||||
}
|
||||
.align-items-center {
|
||||
align-items: center
|
||||
}
|
||||
.relative {position: relative;}
|
||||
@-webkit-keyframes rotation{
|
||||
0%{-webkit-transform: scale(1); opacity:1;}
|
||||
100%{-webkit-transform: scale(1.8); opacity:0;}
|
||||
}
|
||||
@keyframes rotation{
|
||||
0%{transform: scale(1); opacity:1;}
|
||||
100%{transform: scale(1.8); opacity:0;}
|
||||
}
|
||||
.product-miniature .favoritesButton > span {display: none}
|
||||
.product-information .wrap_alert {margin-top: 40px}
|
||||
35
themes/ayon_/modules/pk_favorites/views/assets/css/index.php
Normal file
35
themes/ayon_/modules/pk_favorites/views/assets/css/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
||||
35
themes/ayon_/modules/pk_favorites/views/assets/index.php
Normal file
35
themes/ayon_/modules/pk_favorites/views/assets/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
||||
@@ -0,0 +1,173 @@
|
||||
(function($) {
|
||||
$.fn.pkPopupFav = function(options) {
|
||||
|
||||
var defaults = {action: 'show', state: 'success', text: 'Success'},
|
||||
options = $.extend(defaults, options),
|
||||
mainclass = 'pk-infomessage',
|
||||
itemclass = 'pk-infomessage-item',
|
||||
closeclass = 'pk-close-popup',
|
||||
timerclass = 'pk-close-timer',
|
||||
closebutton = '<a href="#" class="'+closeclass+'"><svg class="svgic"><use xlink:href="#si-cross"></use></svg></a>',
|
||||
timetoclose = 5000,
|
||||
$parent = $('body'),
|
||||
$th = $(this);
|
||||
|
||||
$parent.on('click', '.'+closeclass, function() {
|
||||
hidePopup($(this));
|
||||
return false;
|
||||
});
|
||||
|
||||
if ($('.'+mainclass).length == 0 ) {
|
||||
$parent.append('<div class="'+mainclass+'"></div>');
|
||||
}
|
||||
|
||||
if (options.action == 'show') {
|
||||
showPopup($th);
|
||||
}
|
||||
|
||||
if (options.action == 'hide') {
|
||||
hidePopup($th);
|
||||
}
|
||||
|
||||
function showPopup($el) {
|
||||
var classes = itemclass+' relative state-'+options.state;
|
||||
$('.'+mainclass).append('<div class="'+classes+'"><div>'+options.text+'</div>'+closebutton+'<div class="'+timerclass+'"></div></div>');
|
||||
$('.'+timerclass).animate({
|
||||
width: "0"
|
||||
}, timetoclose, 'linear', function() {
|
||||
hidePopup($(this));
|
||||
});
|
||||
}
|
||||
|
||||
function hidePopup($el) {
|
||||
$el.parent().animate({
|
||||
height: "0"
|
||||
}, 300, function() {
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
var fButton = 'favoritesButton',
|
||||
removeButton = 'remove-fav';
|
||||
|
||||
$('body').on('click', '.'+fButton, function(){
|
||||
|
||||
if ($(this).hasClass('addToFav')) {
|
||||
addToFavorites($(this), false);
|
||||
}
|
||||
|
||||
if ($(this).hasClass('removeFromFav')) {
|
||||
removeFromFavorites($(this), false);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
$('body').on('click', '.'+removeButton, function(){
|
||||
|
||||
removeFromFavorites($(this), true);
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
// add remove button to favorites page
|
||||
if ( $('#favoriteproducts_block_account')[0] ) {
|
||||
$('#favoriteproducts_block_account .product-miniature').each(function (index, value) {
|
||||
$(this).append('<div class="'+removeButton+' btn"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></div>');
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function ToggleButtonState(button) {
|
||||
|
||||
button.toggleClass('removeFromFav').toggleClass('addToFav').toggleClass('icon_checked');
|
||||
|
||||
}
|
||||
|
||||
function hideProduct(item) {
|
||||
|
||||
item.closest('.product-miniature').slideUp();
|
||||
|
||||
}
|
||||
|
||||
function addToFavorites($th, icon_button) {
|
||||
|
||||
$.ajax({
|
||||
url: favorites.favorite_products_url_add + '&rand=' + new Date().getTime(),
|
||||
type: "POST",
|
||||
headers: { "cache-control": "no-cache" },
|
||||
data: {
|
||||
"id_product": $th.data('pid')
|
||||
},
|
||||
success: function(result){
|
||||
ToggleButtonState($th);
|
||||
$('body').pkPopupFav({state:"success", text: favorites.phrases.added});
|
||||
$th.find('span').text(favorites.phrases.remove);
|
||||
},
|
||||
error: function(){},
|
||||
beforeSend: function(){
|
||||
beforeSendCallback(icon_button, $th);
|
||||
},
|
||||
complete: function(){
|
||||
completeCallback(icon_button, $th);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function removeFromFavorites($th, icon_button) {
|
||||
|
||||
if (icon_button) {
|
||||
pid = $th.parent().data('id-product');
|
||||
} else {
|
||||
pid = $th.data('pid')
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: favorites.favorite_products_url_remove + '&rand=' + new Date().getTime(),
|
||||
type: "POST",
|
||||
headers: { "cache-control": "no-cache" },
|
||||
data: {
|
||||
"id_product": pid
|
||||
},
|
||||
success: function(result){
|
||||
if (icon_button) {
|
||||
hideProduct($th);
|
||||
} else {
|
||||
ToggleButtonState($th);
|
||||
}
|
||||
$('body').pkPopupFav({state:"info", text: favorites.phrases.removed});
|
||||
$th.find('span').text(favorites.phrases.add);
|
||||
},
|
||||
error: function(){},
|
||||
beforeSend: function(){
|
||||
beforeSendCallback(icon_button, $th);
|
||||
},
|
||||
complete: function(){
|
||||
completeCallback(icon_button, $th);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function completeCallback(icon_button, $th) {
|
||||
if (icon_button) {
|
||||
$th.removeClass('in_progress');
|
||||
} else {
|
||||
$th.find('svg').removeClass('in_progress');
|
||||
}
|
||||
}
|
||||
|
||||
function beforeSendCallback(icon_button, $th) {
|
||||
if (icon_button) {
|
||||
$th.addClass('in_progress');
|
||||
} else {
|
||||
$th.find('svg').addClass('in_progress');
|
||||
}
|
||||
}
|
||||
35
themes/ayon_/modules/pk_favorites/views/assets/js/index.php
Normal file
35
themes/ayon_/modules/pk_favorites/views/assets/js/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 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-2014 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;
|
||||
Reference in New Issue
Block a user