Checking Contents of Shopping Cart using Liquid

Using Liquid is it possible to check what items are in the shopping cart? If so can someone point me in the right direction?
Basically what I am looking to achieve is when a page loads check to see if certain items are in the shopping cart. If they are in the shopping cart I do something otherwise I do something else. If I can check quantities, even better.
I am still working to grasp everything liquid. =>

Hi Lynda,
Take a look at this guide - Reference guide - e-Commerce related - it also supports the "on-the-fly" cart update Robert mentioned.
Let me know how this works.
Thanks,
Mihai
PS: On the cart.html page you can insert
<pre>{{cart | json}}</pre>
to see what other cart properties you can access (like the individual products and so on).
At the moment though there are few fields that are "numeric", so this means that you can't apply mathematical operations to most of them. This will be fixed in the future, see Bug: Liquid math filters don't work with module data

Similar Messages

  • Grouping of Shopping Carts using the report  BBP_SC_TRANSFER_GROUPED

    Hi Experts,
    I am a new SRM consultant and have been asked to investigate an issue regarding grouping of Shopping Carts using the report  BBP_SC_TRANSFER_GROUPED.
    The wanted scenario:
    For one specific vendor we wish to pool/group request coming from various shopping carts into one PO e.g. once a day. The shopping carts for that vendor can be destinguished by one specific product category.
    We are on classic scenario hence the PO will be created in our ECC system.                                                                               
    Settings we have done to accomplish what we want:
    1. We have set up the transfer for grouping on the specific product category in the sourcing area in the IMG structure
    2. We have run the report BBP_SC_TRANSFER_GROUPED (grouping takes place according to the product category)
    This approach works, the shopping carts gets grouped into one PO in ECC. however the line items from the Shopping Carts are mixed in the PO eg SC1: Item A, Item B, Item C, Item D SC2: Item 1, Item 2, Item 3, Item 4 PO (Current result) Item A, Item 1, Item B, Item 2, Item C, Item 3, Item D, Item 4.
    This seems quite strange, as there are no logic reason for this split. It would be understandable if it was a matter of delivery dates of the goods, but they are not in any order i.e. first coming delivery date first.
    Does anyone know how to correct this or can anyone clarify why this sequence mix happens?
    For me it seems like a program errror.
    Hope you can help me solve this issues
    Cheers Christian
    Edited by: Christian Gjellerup on Aug 6, 2010 3:34 PM
    Edited by: Christian Gjellerup on Aug 6, 2010 3:35 PM

    Hi,
    In SRM -Product categories = Purchasing group in SAP R/3.
    During the transfer of P.R   from R/3 you have enter the Purchasing group in R/3.
    In SRM in the PPOMA_BBP in the extended attribute you can enter the exact product categories
    or else enter * in the product categoies and the backend logical system
    in SPRO --define objects in backend system --- in this enter the purchasing group and category Id
    check your default settings in the SRM web browser
    Regards
    G.Ganesh Kumar

  • Need Help Badly on Shopping Cart Using JSP And Java Servlet

    Hi All,
    This is the 1st time i am trying to create a shopping cart using JSP and Servlet.
    I have read through a few acticles but i still do not get the whole idea of how it works.
    Please guide me as i need help very badly.
    Thanks.
    This is one of the jsp page which displays the category of products user would like to buy : Products.jsp
    <html>
    <head>
    <title>Purchase Order</title>
    </head>
    <body topmargin="30">
    <table border="0" width="100%" id="table1" cellpadding="2">
         <tr>
              <td bgcolor="#990000" width="96">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">
              Code</font></b></td>
              <td bgcolor="#990000" width="260">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">
              Description </font></b></td>
              <td bgcolor="#990000" width="130">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">Brand
              </font></b></td>
              <td bgcolor="#990000" width="146">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">UOM
              </font></b></td>
              <td bgcolor="#990000" width="57">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">Unit<br>
              Price </font></b></td>
              <td bgcolor="#990000" width="62">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">
              Carton<br>
              Price </font></b></td>
              <td bgcolor="#990000" width="36">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">
              Qty</font></b></td>
              <td bgcolor="#990000" width="65">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">Add<br>
              To Cart</font></b></td>
         </tr>
    <tr>
    <td align="center" width="96" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">123</font>
    </td>
    <td align="center" width="260" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">Tom Yam</font>
    </td>
    <td align="center" width="130" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">Nissin</font>
    </td>
    <td align="center" width="146" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">12 x 10's</font>
    </td>
    <td align="center" width="57" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">$3.85</font>
    </td>
    <td align="center" width="62" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">$46.2</font>
    </td>
    <td align="center" width="36" bgcolor="#CCCCCC">
    <!--webbot bot="Validation" S-Data-Type="Integer" S-Number-Separators="x" -->
    <p align="center"><input type="Integer" name="Q10005" size="1"></p>
    </td>
    <td align="center" width="65" bgcolor="#CCCCCC">
    <p><input type="checkbox" name="checkbox" value="123"></p>
    </tr>
    <tr>
    </table>
    <table border="0" width="100%" id="table2">
         <tr>
              <td>
              <div align="right">          
                   <input type="hidden" name="hAction" value="AddToCart"/> 
              <input type=submit name="submit" value="Add To Cart"/>                     
    </div>
    </td>
         </tr>
    </table>
    </body>
    </html>
    After user has make his selection by entering the qty and ticking on the check box, he would click the "Add To Cart" button ... and this would call my servlet : AddToAddControlSerlvet.java
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.io.*;
    import java.util.*;
    import java.util.ArrayList;
    public class AddToCartControlServlet extends HttpServlet
         public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException,IOException
              String action = req.getParameter("hAction");
              if (action.equals("AddToCart"))
                   addToCart(req,res);
         public void addToCart(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
              try
                   String url = "";
                   String[] addList = req.getParameterValues("checkbox");
                   HttpSession sess = req.getSession(true);
                   //String sessionID = sess.getId();
                   DBClass dbClass = new DBClass();
                   ArrayList cartList = new ArrayList();
                   for (int i = 0; i < addList.length; i++)
                        String productCode = (String)addList;
                        int qty = Integer.parseInt(req.getParameter("Q"+productCode));
                        Products product = dbClass.getProductDetail(productCode);
                        double totalUnitAmt = qty * product.getUnitPrice();
                        double totalCartonAmt = qty * product.getCartonPrice();
                        Order order = new Order(product.getProductCode(),product.getProductDesc(),product.getBrandName(),product.getUom(),qty,product.getUnitPrice(),product.getCartonPrice(),totalUnitAmt,totalCartonAmt);
                        cartList.add(order);
                   sess.setAttribute("cartList", cartList);
                   url = "/Cart/CartDetails.jsp";
                   ServletContext sc = getServletContext();
                   RequestDispatcher rd = sc.getRequestDispatcher(url);
                   rd.forward(req, res);
              catch (Exception e)
                   System.out.println(e);
    From here, i would get the list of items which user has selected and add to the cartList, then i would direct the user to CartDetails.jsp which displayed the items user has selected.
    From there, user would be able to remove or to continue shopping by selecting other category.
    How i do store all the items user has selected ... everytime he would wan to view his cart ...
    As i would be calling from jsp to servlet .. or jsp to servlet ... and i do not know how i should go about in creating the shopping cart.

    Hi !
    Yon can use a data structure as vector and store the items selected by the user into the vector . Keep the vector in session using session object , so the user can access the entire shopping cart from anywhere in the application .
    Then , you can change the cart accordingly .
    Hope this works.
    Cheers ,
    Pranav

  • Check status for Shopping Cart to include F-53 postings

    Dear SRM GURUS
    we are following a classic scenarios and SRM version 4.0 where in we create a shopping cart in SRM and a  purchase Req is created in backend and based on that we create a Purchase Order and do a Goods receipts and Invoice Booking in MIRO in R3.
    When we check the status of shopping cart we are able to view all in SRM check status for shopping cart.
    Now my requiremnt is that when after MIRO in R/3 we run F-53  for payement to vendor.
    Whether this can be displayed in the shopping cart check status that as to when actual payement was made to the vendor through F-53.
    regards,
    Nimish Sheth

    F-53  transaction(R/3) status in SRM

  • SRM XI Content for Shopping Cart model (Extended Classic)

    We've loaded the XI content for SRM (XI7_0_SRM_SERVER_7.xxxx) from the sap marketplace and reviewed the data types, messages, and interfaces. It appears there are no pre-built integration scenarios associated with a Shopping Cart model (Purchase Orders, Advance shipment notice, etc). Does a set of pre-built integration scenarios exist, or are these generally built manually? We are going to be pushing purchase orders from ECC to SUS in most of our scenarios. Thanks in advance.

    Usually SAP provides the integration scenarios with template systems. But you can always create your own integration scenarios in your own SWC by making a dependency in SLD and using the Interfaces/Message Types and Datatypes in the SAP standard content.
    VJ

  • Availability check on rejecting shopping cart in UWL

    Dear all,
    We are using SRM 7.0 and the portal in an approval workflow for shopping carts. On ECC side we create reservations for stock - materials.
    Now we have the problem that in the UWL a availability check is started when the user approves or rejects the shopping cart. This is a problem when he wants to reject a shopping cart, which has been created some time ago and the articles aren't available anymore. In this case an error message is shown:
    /sapsrm/cx_pdo_error Document check returned at least one error message. The action can not be carried out. For more details, see message area Availability check for 05.01.2011: 7 ST. Lead time for 30 ST: 14.01.2011. Availability check for 05.01.2011: 7 ST. Lead time for 30 ST: 14.01.2011.
    How can we disable this availability check on approving and/or rejecting shopping carts?
    Thank you very much for your help.
    Best regards,
    Thomas

    Hi Thomas ,
    Try to implement in driver badi. It work for budget check. I have no demo system and can't verify it. Hope it will help you.

  • Shopping cart using Workflow??

    Hello Expert could anyone plz tell me why we need shopping cart ? i mean what is the necessity of it ? and how to implement shopping cart  with WORKFLOW ?
    Useful answer will be rewarded.
    Thanks
    A v I

    Hi,
       most of the Badi's that are related to business document will trigger when the approver take the decision.. if the error raise by the standard code.. approver must be seen in the SC screen.. if the error is raise by the check badi then you can debug the check badi in BBP_PD.. put the break point in DOC_CHECK badi and click the check message again in the bottom of the details screen..
    Saravanan

  • I lose JQuery functionality after checking out from shopping cart...

    Hi Folks,
    I have set up a slideshow using JQuery.  I have started a one month eCommerce subscription but have not yet added the clients domain name to BC (therefore still using the http://clientsite.businesscatalyst.com domanin).
    After checking out from the shopping cart I am redirected to http://clientsite.worldsecuresystems.com/...
    When this happens I seem to lose functionality of my javascript plugins such as slideshow and 'prettyphoto' plugin.
    Any thoughts would be much appreciated.
    Thanks and regards
    Brendon

    Hi Brendon, if you search the forums there is a lot on this. "Dom Killing" , "Add to cart jquery" etc.
    You should see all the discussions as it is quite intensive because of the way the BC scripting works and varius sollutions depending on your coding and BC knowledge.

  • How to attach files while Creating shopping cart using FM- BBP_PD_SC_CREATE

    Hi
    I am trying to create shopping cart from R/3 system using RFC calls to FM's BBP_PD_SC_CREATE, BBP_PD_SC_SAVE & BBP_PD_SC_COMMIT.
    Also I have to attach files as we do in Standard SAP shopping cart creation process..
    But I see a parameter IT_ATTACH to pass the attachments in the FM - BBP_PD_SC_CREATE..Is that the right one to use? If yes, can you suggest the values to be passed in the same if you have done this before..
    Thanks
    Geetha
    Edited by: GEETHA VASUDEVAN on Apr 20, 2009 6:17 PM

    Hi
    I am trying to create shopping cart from R/3 system using RFC calls to FM's BBP_PD_SC_CREATE, BBP_PD_SC_SAVE & BBP_PD_SC_COMMIT.
    Also I have to attach files as we do in Standard SAP shopping cart creation process..
    But I see a parameter IT_ATTACH to pass the attachments in the FM - BBP_PD_SC_CREATE..Is that the right one to use? If yes, can you suggest the values to be passed in the same if you have done this before..
    Thanks
    Geetha
    Edited by: GEETHA VASUDEVAN on Apr 20, 2009 6:17 PM

  • How to change Vendor text  in shopping cart using BADI/Function module

    Hi
    If any could help me out that i want to change vendor text using BADI/FMs.
    Using  BADI" bbp_catalog_transfer"   i dint find any parameter for vendor text. please let me know if there any idea to resolve the problem

    Hi,
    you should find the vendor text within the BAdi
    BBP_DOC_CHANGE
    Method for shopping carts
    BBP_SC_CHANGE
    Here you could use the Changing Parameter
    CT_LONGTEXT
    The table contains 2 important fields:
    TDID, where you can identify the type of text, in your case this should be ITXT for standard shopping carts (vendor text within positions)
    TDLINE: which contains the text
    You are now able to change the vendor text directly within this BAdi with standard ABAP methods.
    Best regards
    Andreas

  • Creating limit shopping cart using catalogs in SRM

    Hi,
    Can we create "limit shopping carts" in srm using catalogs or we can only use it for free text items? how do we integrate catalogs for use in "create limit item"? is it standard or required any customization? please explain.
    Thanks
    Deepu

    Hi. What you could try is using BBP_DOC_CHANGE_BADI.
    When SY-UCOMM = 'ADDI' that is when items are being added to the cart from a catalogue, presuming you have configured ADDI in your catalogue call structure.
    Then, you can try and change the item category to LIMI and see what happens.
    If that does not work (and I don't think it will be that easy) then you can create a limit item manually and debug the DOC_CHANGE BADI to look at all the item values to see what else might need assing in there.
    It might work, I have done some serious manipulation of items using this BADI.
    Regards,
    Dave.

  • Default Check Status timeframe(Shopping Cart)

    Hi All SRM experts,
    Is it possible to make default timeframe for particular timeframe such as to last 90 days in the shopping cart check status screen ? because defaulted is last 7 days. Please kindly advise. Thank's in advance

    Hello,
    First pl try the follow path
    IMG->Supplier Relationship Management->SRM Server->Cross-Application Basic Settings->Personalization->Personalize Display
    IMG->Supplier Relationship Management->SRM Server->Business Add-Ins (BAdIs)->Interface Configuration->Determine Screen Variants
    I am not sure whether it is available in below SRM 5.0
    If does not help
    you can ask your ABAP consultant to check the template
    bbpsc04/99/saplbbp_sc_ui_its_4000.html
    for this change
    BR
    Dinesh

  • Develop simple shopping cart using ADDT

    Hi, I'm new here.I just wondering if its possible to develop a very simple shopping cart application using ADDT?Anyone have any ideas?
    I'm thinking to develop a very simple shopping cart with no shipping cost,tax details and all that.Just an image,description of the product and price.All the orders with be send to 1 or many emails.No payment gateway needed.That's it.And of course got basic common shopping cart features like 'Add to cart','Remove item',session, that's all.Any ideas guys?
    Thanks

    Duh, I figured it out.
    <cfset bar = arraydeleteat(SESSION.shoppingcart, i)>
    I am having a problem when looping not sure why. I think
    because I'm deleting an item in the array it tries to loop to that
    index in the array. It will say "The element at position 3 cannot
    be found". I guess I normally wouldn't have to delete multiple
    positions in the array with a normal shopping cart unless they
    selected two different id's. I'll work on a more advanced shopping
    cart and post again.

  • Shopping Cart using Coldfusion

    Hi, I am relatively new to Coldfusion and I am wondering how to create a shopping cart for a website using coldfusion. Thanks

    This is probably going to come across to you as unnecessarily snarky, but your request is analogous to "I am relatively new to architecture and engineering and I am wondering how to create a skyscraper". The short, glib answer is that you have to learn architecture and engineering first.
    You will need to learn the basics of the language, and you'll have to learn how to track and persist user-specific values using something like the Session or Client scopes. You will need to learn how to store user-specific and non-user-specific values within a relational database, and fetch them as needed.
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/

  • Clearing Network field in shopping cart using BBP_PD_SC_GETDETAIL

    Hi,
    in  Doc_Change badi to clear out the Network value from BBP_PDS_ACC-NETWORK field whenever user enters some value using the Activity Search help.
    i think code has to be written using fm BBP_PD_SC_GETDETAIL but who can we clear network field based on search help.
    Thanks ,
    Goutam.

    Hi Pradeep,
    I still cant find the deduct_ind. How could this happen, the DEDUCT_IND field is not in E_item?
    CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
          EXPORTING
            i_guid    = iv_doc_guid
          IMPORTING
            e_header  = lt_sc_header
          TABLES
            e_item    = lt_sc_item
            e_account = lt_sc_account.
         LOOP AT lt_sc_item INTO ls_sc_item
          WHERE del_ind IS INITIAL AND deduct_ind IS INITIAL.
        ENDLOOP.
    Error: No component exists with the name "DEDUCT_IND", but there is a component with a similar name "DEL_IND".
    Appreciate helps!
    Thanks.

Maybe you are looking for

  • Weblogic Server 10.3.0 and LDAP authentication Issue

    Hi - I have configured my WebLogic Server 10.3.0 for LDAP authentication (OID = 10.1.4.3.0) and so far the authentication works fine but I am having issue in terms of authorization. I am not able to access the default web logic administrator console

  • "loadjava" is unknow command in SQL*Plus (Oracle8i)

    I am attempting to laod a java class in the database but when I type the command "loadjava" the SQL*Plus prompt indicates this is an unknown command. Is there a configuration problem I should address with the DBA?

  • BBC iPlayer - This content doesnt seem to be working

    Hi all, I have tried so many fixes but cant seem to fix the problem When I log into my user and go on the BBC iPlayer website and click on any video, it loads perfectly fine. However, when my mum logs onto her user account she cant play any videos. T

  • Abap unit test debug

    when use unit test,how to start up debug model?

  • Problem with a new external monitor

    I'm having some trouble with my new external monitor (Samsung BX 2231) Last week when I connected the screen, there where no problems at all. I was using it as an extension of my desktop (as a second screen). When I changed the wallpaper of the exter