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/
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 PMHi,
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 -
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 PMHi
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 problemHi,
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
DeepuHi. 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. -
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 IHi,
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 -
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?
ThanksDuh, 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. -
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 -
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. -
Errors when I try to create shopping cart using BBP_PD_SC_CREATE
Hi
I am trying to run the FM - BBP_PD_SC_CREATE with the following data:
IHEADER:_
GUID: 00000000000000000000000000000001
DESCRIPTION: TEST
CURRENCY: USD
PROCESS_TYPE: SHC
POSTING_DATE: 03/24/2009
I_SRC_OBJECT_TYPE: BUS2121
IITEM:_
GUID 00000000000000000000000000000002
PARENT 00000000000000000000000000000001
NUMBER_INT 0000000001
DESCRIPTION TEST
CATEGORY_ID A05
QUANTITY 1.000
UNIT EA
PRICE 10.00
PRICE_UNIT 1
SUBTYPE
GROSS_PRICE 10.00
CATALOG_PRICE 0.00
CURRENCY USD
DEL_DATCAT 1
DELIV_DATE 03/24/2009
DELIV_TIME 10:27:00
PRODUCT_TYPE 01
LOGSYS_FI GDVCLNT100
BE_LOG_SYSTEM GDVCLNT100 BE_REFOBJ_ITEM2
BE_REFOBJ_FYEAR2
BE_STGE_LOC
BE_PLANT 0013
BE_BATCH
BE_VAL_TYPE
BE_MOVE_REAS 0000
BE_EXPERYDATE
BE_PUR_GROUP 7AA
BE_PUR_ORG 0004
BE_CO_CODE 100
BE_DOC_TYPE EC
BE_MOVE_TYPE 201
BE_PO_PRICE 1
ZZREQ_NAME LOGON_ID
DUMMY_EEW_PDISS_SC
DUMMY_EEW_PDISC_SC
ZZUNAME_ATS LOGON_ID
IACCOUNT:_
CLIENT
GUID 00000000000000000000000000000003
P_GUID 00000000000000000000000000000002
DISTR_PERC 100.00
ACC_NO 0001
ACC_CAT CC
G_L_ACCT 3500
BUS_AREA A
COST_CTR 100A419
IPARTNER:_
CLIENT
PARTNER_GUID 00000000000000000000000000000006
P_GUID 00000000000000000000000000000001
PARTNER_FCT 00000016
ADDR_TYPE 1
ADDR_ORIGIN A
ADDR_NO 1072637
PARTNER_ID 5111147
IORGDATA:_
CLIENT
GUID 00000000000000000000000000000007
P_GUID 00000000000000000000000000000001
PROC_ORG_RESP_ID 50030051
PROC_ORG_ID 50030050
PROC_GROUP_ID 50030051
I get the following errors in E_MESSAGES
M MSGID MSG MESSAGE
E BBP_PD 050 Partner of type Requester is not authorized for this document. Check entry
E BBP_PD 551 No organizational data exists on item level
Can anyone help? Am I missing any inputs/parameters?
Thanks
Geethahi,
Check in t.code: PPOSA_BBP whether the person who is creating the SC is attched to the organisation ID 50030050 ,Business partner is attached. The error is you have not defined the person in the organisation and check in the attrtibute tab : the account assignment details
Regards
G.Ganesh Kumar -
Attach files to a Shopping Cart in SRM portal using a ABAP program.
Hello.
We need to attach files to a Shopping Cart using a ABAP program and see them in SRM portal.
Currently we know how to attach files in the backend using the function Xxxxxxxxxx but with this function we can not see the attachment in the SRM portal.
Do you know someway to attach files direclty in the front-end using a program?
Maybe i have to attach first in the back-end and after that transfer to front-end?
I have seen some thread but the solution provided is in the other way arround (transfer from front-end to backend) and then is not useful for my proble.
Thanks in advance.
Kr,
Angel.Hello Angel,
You can attach a file to SC ,and it is a standard functionality provided in SRM.
While creating a Shopping cart,under Documents and attachements tab,there is an option to select a local file and attach it to a SC
If you are looking at attaching the document in SRM and sending it to BE system.(R/3 system), then have a look at SAP note Note 1057932 - FAQ: Atachment transfer to backend, Required Configurations.
The Following BADIs will have to be implemented to allow the above functionality
For transfer of attachments in PO , activate the BADI BBP_CREATE_PO_BACK. Set the values of the following parameters in the
method BBP_CREATE_PO_BACK~Fill_PO_INTERFACE
CV_ATTACH_TRANSFER_ACTIVE = 'X'
CV_ATTACH_BE_STORAGE_CAT = 'DMS_C1_ST'
CV_ATTACH_BE_DOC_TYPE = 'SRM'.
For transfer of attachments in PR, activate the BADI
BBP_CREATE_REQ_BACK. Set the values of the following parameters in the method BBP_CREATE_REQ_BACK~FILL_REQ_INTERFACE
CV_ATTACH_TRANSFER_ACTIVE = 'X'
CV_ATTACH_BE_STORAGE_CAT = 'DMS_C1_ST'
CV_ATTACH_BE_DOC_TYPE = 'SRM'.
Award points if useful.
Thanks
Arshad -
Shopping Cart creation using Upload File
Hi
We want to create Shopping cart using the Upload Program in SRM 7.01. We can use the FM BBP_PD_SC_CREATE and BBP_PD_SC_SAVE for this.
However wanted to understand the check points that we need to keep in mind while creating the SC from any legacy system using Flat File. Are there any constraints, precautions that we should take or some prechecks/prerequisites that need to be fulfilled.
Any input in this regard would be welcome.
Regards
RajDear Poster,
As no response has been provided to the thread in some time I must assume the issue is resolved, if the question is still valid please create a new thread rephrasing the query and providing as much data as possible to promote response from the community.
Best Regards,
SDN SRM Moderation Team -
I have been a long time iTunes store shopper, and traditionally I've always looked forward to the updates, but one of the changes in the most recent version really irks me. I absolutely cannot stand the new wish list feature. In my opinion, it's a buggier, worse version of the shopping cart, and I seriously wish they would just bring the old one back.
But, since that probably isn't going to happen, I have some questions in hopes of making the new "feature" a little easier to deal with:
1) Is there any way to make the wish list sort by genre? It used to be really nice with the shopping cart when I could sort through whatever music I had in it by the kind of music I was in the mood for. This is one of many features which, as far as I can tell, is gone.
2) Is there any way to make it so the wish-list page doesn't reset each time you buy a song? Every time I buy a song, the page refreshes back to the top of the page with all my previous sorting set back to default. This is HIGHLY annoying when I want to buy more than one song, and I have to re-search for the next one after buying the first.
3) Is there any way to see all your wish-list music on one page rather than having to sort through the 4-5 pages I currently have?
I really appreciate what Apple was trying to do with the Wish List, but unless I'm missing something, they took out more features than they added. Simple ones that make a big difference. I think they aimed it more for people who want to go through and pick a lot of music, and then buy it all at once. They took out a lot of what made large shopping carts easy and quick to navigate and buy from. I for one used the shopping cart more as a place to store all the music I EVENTUALLY wanted to buy rather than a more immediate place to chuck my upcoming purchases. Every time I saw a song on iTunes that I liked, regardless of my immediate intent of buying it, it went in the shopping cart. I may not get to it for months, but it would stay there, and I could get to it easily when I wanted to.
I highly doubt I'm the only person who used it like that, and for those of us who did, I think the wish-list is a crappy alternative.Well after my post on this very issue was removed (because it was deemed more feedback than a question - which I'm fine with), it would likely have helped.
As far as I can tell, there is only ONE WAY to get to your shopping cart, er, wish list.
1) Login
2) On the left bar (the section where your shopping cart used to be, along with your playlists), you have to click on iTunes Store. You'll see your Wish List in the Quick Links section...
Thats it. Clicking anywhere else, like the 'Home' link or whatever, will not help you...if this is all too crazy, yeah, it is. I mean, making it difficult to purchase sounds really, um, crazy, particularly if you shop by shopping cart - which means you actually spend money on more music than "single buy". Ugh!
On the other question on how to "Add to Wish List". In the section where songs are listed (with fixed sized columns that you can't adjust in this version - had to rub that in), you'll see a button to "BUY SONG". To the right of that text is an arrow (in the button, not another column) that if clicked gives you more options. One of them is to add to your wish list. Can't tell if the fixed sized columns are also affecting your view (maybe you're not seeing the entire button?).
Message was edited by: EdSF -
How to change position for items in shopping cart
Hello,
I am creating shopping cart using flat file. But i am not able to change the position for items i.e. both items contain position as 0000000001.
Following are the item details of shopping cart which is created through portal. (from tcode BBP_PD)
Items:
Pos Type Quantity Unit Ordered_Prod Description Gross price
0000000001 1 EA keyboard 100,00
0000000002 1 EA CPU 1.000,00
Following are the item details of shopping cart which is created using flat file & BAPI BBP_PD_SC_CREATE.(from tcode BBP_PD)
Items:
Pos Type Quantity Unit Ordered_Prod Description Gross price
0000000001 1 EA MONITOR 1,00
0000000001 1 EA MONITOR 1,00
Position is not getting changed for item 2 & only first record is getting uploaded 2 times. My code is creating Shopping cart number .
Please tell me how to change position of each item.
Thanks & regards,
Edited by: Ketkee Bhale on Sep 14, 2011 3:58 PMModerator message - Cross post locked
Rob
Maybe you are looking for
-
Custom fields in SRM 7.0
Hi all, Im working on SRM 7.0.I need to add few custom fields in SC and PO screen at header level.I have worked on similar requirement in SRM 5.0 but not on SRM 7.0.Can anybody explain what are the differences in the proceudre for addition of custom
-
Java.lang.NoSuchMethodError while running the Application on MI client
Hi Experts During development I run my application through NWDS and worked perfect. But when I run my application only through MI client. It through error on my programmed methods: java.lang.NoSuchMethodError: Any advice is highly appreciated! Micha
-
ICal won't accept Google Calendar password
can't sync with my Google calendars anymore. I have deleted the calendar accounts on my Mac. Set up the 2-stpe passwords on Google. Tried to create new accounts in iCal with my email address (is not a gmail account) and app specific password: - used
-
Is it possible to preserve albums in iphoto backup to disc ?
Is it possible to preserve albums when archiving iphoto to disc ?
-
Hi, does anybody have any idea how to change file permissions on a apache server. I have created ftp app that transfers file from a computer to a server and I need to change the file permissions to 0777. I'm using FileTransferClient from enterprisedt