cancel
Showing results for 
Search instead for 
Did you mean: 

Shopping cart

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

RieSe
Contributor
0 Kudos

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

Former Member
0 Kudos

Hey stefan,

Thanx man, i got an idea after i had gone thro ur code.

i may ask some more questions plz clarify them if have solution,,

Former Member
0 Kudos

Hi leoiz,

Don't forget to assign points to Stefan. Click on the yellow star. It is <b>SDN</b> way of saying thanks.

Regards,

Subramanian V.

Former Member
0 Kudos

Yap, i did that,

thanks Subramanian.

Former Member
0 Kudos

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.