fix: Empty states and miscellanous fixes
- Added Wishlist and Product Listing empty states
- Hide ‘Write Review’ button f user is not Customer
- Fixed grid view title (missing arg)
- Render empty state if no items form server side
- Removed unused function
- Guest user redirected to login on clicking Wishlist button
- Fixed ‘Notes’ field clearing issue
diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js
index f2b026c..f0781ab 100644
--- a/erpnext/templates/includes/cart.js
+++ b/erpnext/templates/includes/cart.js
@@ -19,7 +19,6 @@
shopping_cart.bind_request_quotation();
shopping_cart.bind_change_qty();
shopping_cart.bind_change_notes();
- shopping_cart.bind_dropdown_cart_buttons();
shopping_cart.bind_coupon_code();
},
@@ -129,8 +128,14 @@
}
}
input.val(newVal);
+
+ let notes = input.closest("td").siblings().find(".notes").text().trim();
var item_code = input.attr("data-item-code");
- shopping_cart.shopping_cart_update({item_code, qty: newVal});
+ shopping_cart.shopping_cart_update({
+ item_code,
+ qty: newVal,
+ additional_notes: notes
+ });
});
},
diff --git a/erpnext/templates/includes/cart/cart_items.html b/erpnext/templates/includes/cart/cart_items.html
index 75441c4..d534b8f 100644
--- a/erpnext/templates/includes/cart/cart_items.html
+++ b/erpnext/templates/includes/cart/cart_items.html
@@ -13,7 +13,7 @@
{{ _('Variant of') }} <a href="{{frappe.db.get_value('Item', variant_of, 'route')}}">{{ variant_of }}</a>
</span>
{% endif %}
- <div class="mt-2">
+ <div class="mt-2 notes">
<textarea data-item-code="{{d.item_code}}" class="form-control" rows="2" placeholder="{{ _('Add notes') }}">{{d.additional_notes or ''}}</textarea>
</div>
</td>