[fixes] show link to visit cart after adding item, hide cart button on cart view
diff --git a/erpnext/public/js/shopping_cart.js b/erpnext/public/js/shopping_cart.js
index 63231d9..ddb64fe 100644
--- a/erpnext/public/js/shopping_cart.js
+++ b/erpnext/public/js/shopping_cart.js
@@ -33,10 +33,9 @@
},
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 @@
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();
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index a6ec617..74b5202 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -54,7 +54,7 @@
// 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
diff --git a/erpnext/templates/generators/item.html b/erpnext/templates/generators/item.html
index b62f306..34d345f 100644
--- a/erpnext/templates/generators/item.html
+++ b/erpnext/templates/generators/item.html
@@ -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>
diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js
index e413f0b..0c29569 100644
--- a/erpnext/templates/includes/cart.js
+++ b/erpnext/templates/includes/cart.js
@@ -65,11 +65,11 @@
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 @@
});
$(document).ready(function() {
+ $(".cart-icon").hide();
shopping_cart.bind_events();
});
diff --git a/erpnext/templates/includes/product_page.js b/erpnext/templates/includes/product_page.js
index 0a38c23..f4d9027 100644
--- a/erpnext/templates/includes/product_page.js
+++ b/erpnext/templates/includes/product_page.js
@@ -49,21 +49,6 @@
});
});
- $("#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());