Skip to Content
author's profile photo Former Member
Former Member

Shopping cart

Hai friends,

I need a help regarding BSP Shopping cart.My doubt is,i have a page where i can add items to my shopping basket.the items page contains a button(value=add to cart") and mat no, mat description,net price..etc...if i click on particular button only that item sholud add to my cart(means i have to collect these records to another internal table).how can i do this... if you give some sample code that will be good help

urjent..

thanks in advance

leoiz

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 06, 2004 at 09:33 AM

    You should take a look at the TUTORIAL_MVC_3/4 examples under SE80 in your system the bookshop example is a great place to start.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 06, 2004 at 10:03 AM

    Hello Leoiz,

    could be this the answer to your question?

    I assume, that you are ready to display the items on the layout. Thsi could be the content of an internal table:

    basket_items:

    int_no type syindex,

    mat_no type matnr,

    description type string,

    net_price type numc10,

    currency type cuky.

    ...

    <table>

    <%loop at basket_items into basket_item.%>

    <tr><td><%=basket_item-mat_no%></td>

    <td><%=basket_item-description%></td>

    ...

    <td><input type="button" value="Add to cart" onClick="addToCart('<%=basket_item-int_no%>'"></td></tr>

    <%endloop.%>

    So you need a javascript function 'addToCart' which

    stores the value of the selected row := basket_item-int_no into a abap-field declared at the page types (autoflag on) and submitting a post to the page. After this you will be able to process the data in the event:

    onInputProcessing.

    The major step will be to store the data, if you are dealing with anonymous login.

    That's only a rough explanation.

    Regards, Stefan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.