From b3573a881e973fab6809e5b3d063d819fa13b46a Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Mon, 9 May 2016 12:30:58 +0530 Subject: [PATCH] Shopping cart dropdown changes --- erpnext/public/css/website.css | 5 ++--- erpnext/public/js/shopping_cart.js | 3 +-- erpnext/public/less/website.less | 8 ++++---- erpnext/templates/includes/cart.js | 19 +------------------ .../includes/cart/cart_dropdown.html | 11 ++++------- .../templates/includes/cart/cart_items.html | 8 ++------ erpnext/templates/includes/issue_row.html | 9 +++++---- .../includes/order/order_macros.html | 4 ++-- .../templates/includes/transaction_row.html | 16 ++++++++-------- 9 files changed, 29 insertions(+), 54 deletions(-) diff --git a/erpnext/public/css/website.css b/erpnext/public/css/website.css index 8566c5cbc2..de0b02bb31 100644 --- a/erpnext/public/css/website.css +++ b/erpnext/public/css/website.css @@ -70,7 +70,6 @@ border-top: 1px solid #EBEFF2; } .transaction-list-item { - border-bottom: none; padding: 30px; margin: 0px -30px; } @@ -166,7 +165,7 @@ display: none; } .cart-dropdown-container { - width: 350px; + width: 320px; padding: 15px; } .cart-dropdown-container .item-price { @@ -189,7 +188,7 @@ display: none; } .cart-dropdown-container .checkout-btn { - margin: 15px; + padding-top: 25px; } .cart-dropdown-container .col-name-description { margin-bottom: 8px; diff --git a/erpnext/public/js/shopping_cart.js b/erpnext/public/js/shopping_cart.js index c09e3838d2..9d16c62ea8 100644 --- a/erpnext/public/js/shopping_cart.js +++ b/erpnext/public/js/shopping_cart.js @@ -48,8 +48,7 @@ $.extend(shopping_cart, { shopping_cart.set_cart_count(); if (r.message.shopping_cart_menu) { $('.shopping-cart-menu').html(r.message.shopping_cart_menu); - } - + } if(opts.callback) opts.callback(r); } diff --git a/erpnext/public/less/website.less b/erpnext/public/less/website.less index 894340e9b5..357bb8a290 100644 --- a/erpnext/public/less/website.less +++ b/erpnext/public/less/website.less @@ -83,7 +83,6 @@ } .transaction-list-item { - border-bottom: none; padding: 30px; margin: 0px -30px; @@ -213,7 +212,7 @@ } .cart-dropdown-container { - width: 350px; + width: 320px; padding: 15px; .item-price { @@ -241,7 +240,7 @@ } .checkout-btn { - margin:15px; + padding-top:25px; } .col-name-description { margin-bottom:8px; @@ -316,4 +315,5 @@ .homepage-tagline { font-size:40px !important; -} \ No newline at end of file +} + diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js index 931df7a1ba..2a6570f052 100644 --- a/erpnext/templates/includes/cart.js +++ b/erpnext/templates/includes/cart.js @@ -63,23 +63,6 @@ $.extend(shopping_cart, { btn: this, callback: function(r) { frappe.unfreeze(); - if(!r.exc) { - $(".cart-items").html(r.message.items); - $(".cart-tax-items").html(r.message.taxes); - $(".cart-icon").hide(); - } - }, - }); - }); - }, - - bind_remove_item: function() { - $(".cart-items").on("click", ".remove-item", function() { - var item_code = $(this).attr("data-item-code"); - shopping_cart.update_cart({ - item_code: item_code, - qty: "0", - callback: function(r) { location.reload(); if(!r.exc) { $(".cart-items").html(r.message.items); @@ -90,7 +73,7 @@ $.extend(shopping_cart, { }); }); }, - + render_tax_row: function($cart_taxes, doc, shipping_rules) { var shipping_selector; if(shipping_rules) { diff --git a/erpnext/templates/includes/cart/cart_dropdown.html b/erpnext/templates/includes/cart/cart_dropdown.html index 19892d4789..18148ad20e 100644 --- a/erpnext/templates/includes/cart/cart_dropdown.html +++ b/erpnext/templates/includes/cart/cart_dropdown.html @@ -2,13 +2,10 @@
-
+
{{ _("Item") }}
-
- {{ _("Qty") }} -
-
+
{{ _("Price") }}
@@ -17,8 +14,8 @@
{% include "templates/includes/cart/cart_items.html" %}
-
-

{{ _("Checkout") }}

+ {% else %}

{{ _("Cart is Empty") }}

diff --git a/erpnext/templates/includes/cart/cart_items.html b/erpnext/templates/includes/cart/cart_items.html index cd0bb86a56..1445e21887 100644 --- a/erpnext/templates/includes/cart/cart_items.html +++ b/erpnext/templates/includes/cart/cart_items.html @@ -10,7 +10,6 @@ - {{_("Remove")}}
{{ d.get_formatted("amount") }} @@ -20,13 +19,10 @@