[fixes] show link to visit cart after adding item, hide cart button on cart view

This commit is contained in:
Saurabh 2016-01-06 16:41:50 +05:30
parent df2783dbb0
commit 69f9975748
5 changed files with 5 additions and 25 deletions

View File

@ -33,10 +33,9 @@ $.extend(shopping_cart, {
},
btn: opts.btn,
callback: function(r) {
shopping_cart.set_cart_count();
if(opts.callback)
opts.callback(r);
shopping_cart.set_cart_count();
}
});
}
@ -56,10 +55,6 @@ $.extend(shopping_cart, {
if(cart_count) {
// if($badge.length === 0) {
// var $badge = $('<span class="badge"></span>')
// .appendTo($cart.find("a").addClass("badge-hover"));
// }
$badge.html(cart_count);
} else {
$badge.remove();

View File

@ -54,7 +54,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
// delivery note
if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && allow_delivery) {
cur_frm.add_custom_button(__('Delivery'), this.make_delivery_note, __("Make"));
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
// cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
}
// sales invoice

View File

@ -71,8 +71,7 @@
style="display: none;
padding-left: 0px; padding-right: 0px;
padding-top: 10px;">
<div class="btn btn-success">
{{ _("Item added to cart") }}</div>
<a href="/cart">{{ _("Goto Cart") }}</a>
</div>
</div>
</div>

View File

@ -65,11 +65,11 @@ $.extend(shopping_cart, {
if(!r.exc) {
$(".cart-items").html(r.message.items);
$(".cart-tax-items").html(r.message.taxes);
$(".cart-icon").hide();
}
},
});
});
},
render_tax_row: function($cart_taxes, doc, shipping_rules) {
@ -144,5 +144,6 @@ $.extend(shopping_cart, {
});
$(document).ready(function() {
$(".cart-icon").hide();
shopping_cart.bind_events();
});

View File

@ -49,21 +49,6 @@ frappe.ready(function() {
});
});
$("#item-update-cart button").on("click", function() {
shopping_cart.update_cart({
item_code: get_item_code(),
qty: $("#item-update-cart input").val(),
btn: this,
callback: function(r) {
if(r.exc) {
$("#item-update-cart input").val(qty);
} else {
qty = $("#item-update-cart input").val();
}
},
});
});
$("[itemscope] .item-view-attribute .form-control").on("change", function() {
try {
var item_code = encodeURIComponent(get_item_code());