This is an automated email from the ASF dual-hosted git repository.

gsperi pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 58d05e2e43 Improved: notify message when adding a product to cart 
(OFBIZ-9521)
58d05e2e43 is described below

commit 58d05e2e438ce4bb515ff3cf6cc8572f3a02b1a4
Author: Giulio Speri <giulio.sp...@mpstyle.it>
AuthorDate: Fri Apr 22 00:26:34 2022 +0200

    Improved: notify message when adding a product to cart (OFBIZ-9521)
    
    When a product is successfully added to the shopping cart, a notify
    message is displayed with detail of the productId added.
    
    Thanks Sourabh Punyani for your work.
---
 applications/order/config/OrderUiLabels.xml                           | 4 ++++
 .../java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java  | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/applications/order/config/OrderUiLabels.xml 
b/applications/order/config/OrderUiLabels.xml
index f14dde010a..e6996fef1e 100644
--- a/applications/order/config/OrderUiLabels.xml
+++ b/applications/order/config/OrderUiLabels.xml
@@ -16309,4 +16309,8 @@
         <value xml:lang="en">Lookup Return Header</value>
         <value xml:lang="nl">Retouren zoeken/vinden</value>
     </property>
+    <property key="ItemAddedSuccessfully">
+       <value xml:lang="en">Item ${productId} added successfully</value>
+       <value xml:lang="it">Articolo ${productId} aggiunto con successo</value>
+    </property>
 </resource>
diff --git 
a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
 
b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
index 208984564b..f8a3a1c69c 100644
--- 
a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
+++ 
b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
@@ -695,6 +695,8 @@ public class ShoppingCartEvents {
         if (cart.viewCartOnAdd()) {
             return "viewcart";
         }
+        request.setAttribute("_EVENT_MESSAGE_", 
UtilProperties.getMessage("OrderUiLabels", "ItemAddedSuccessfully",
+                UtilMisc.toMap("productId", productId), 
UtilHttp.getLocale(request)));
         return "success";
     }
 

Reply via email to