fix: Sider
This commit is contained in:
parent
59514408b9
commit
cd117149e1
@ -8,24 +8,23 @@ $.extend(wishlist, {
|
|||||||
set_wishlist_count: function() {
|
set_wishlist_count: function() {
|
||||||
// set badge count for wishlist icon
|
// set badge count for wishlist icon
|
||||||
var wish_count = frappe.get_cookie("wish_count");
|
var wish_count = frappe.get_cookie("wish_count");
|
||||||
if(frappe.session.user==="Guest") {
|
if (frappe.session.user==="Guest") {
|
||||||
wish_count = 0;
|
wish_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(wish_count) {
|
if (wish_count) {
|
||||||
$(".wishlist").toggleClass('hidden', false);
|
$(".wishlist").toggleClass('hidden', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
var $wishlist = $('.wishlist-icon');
|
var $wishlist = $('.wishlist-icon');
|
||||||
var $badge = $wishlist.find("#wish-count");
|
var $badge = $wishlist.find("#wish-count");
|
||||||
|
|
||||||
if(parseInt(wish_count) === 0 || wish_count === undefined) {
|
if (parseInt(wish_count) === 0 || wish_count === undefined) {
|
||||||
$wishlist.css("display", "none");
|
$wishlist.css("display", "none");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$wishlist.css("display", "inline");
|
$wishlist.css("display", "inline");
|
||||||
}
|
}
|
||||||
if(wish_count) {
|
if (wish_count) {
|
||||||
$badge.html(wish_count);
|
$badge.html(wish_count);
|
||||||
$wishlist.addClass('cart-animate');
|
$wishlist.addClass('cart-animate');
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -129,18 +128,21 @@ $.extend(wishlist, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
frappe.call({
|
frappe.call({
|
||||||
|
async: async,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
method: method,
|
method: method,
|
||||||
args: args,
|
args: args,
|
||||||
callback: function (r) {
|
callback: function (r) {
|
||||||
if (r.exc) {
|
if (r.exc) {
|
||||||
if (failure_action && (typeof failure_action === 'function')) {failure_action();}
|
if (failure_action && (typeof failure_action === 'function')) {
|
||||||
|
failure_action();
|
||||||
|
}
|
||||||
frappe.msgprint({
|
frappe.msgprint({
|
||||||
message: __("Sorry, something went wrong. Please refresh."),
|
message: __("Sorry, something went wrong. Please refresh."),
|
||||||
indicator: "red", title: __("Note")
|
indicator: "red", title: __("Note")
|
||||||
});
|
});
|
||||||
} else {
|
} else if (success_action && (typeof success_action === 'function')) {
|
||||||
if (success_action && (typeof success_action === 'function')) {success_action();}
|
success_action();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -5,7 +5,6 @@ from __future__ import unicode_literals
|
|||||||
no_cache = 1
|
no_cache = 1
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from erpnext.e_commerce.shopping_cart.cart import get_cart_quotation
|
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
settings = frappe.get_doc("E Commerce Settings")
|
settings = frappe.get_doc("E Commerce Settings")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user