You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
What's the shortest path as far as an external link for a customer ready to buy one particular item? For instance, let's say I have another site just devoted to product X. It's available on my CCP5 site but buried 3 catagories deep. They're ready to buy from siteX. They click a link and I want them to go right to the checkout screen. How would I link that? I can get them to product description pretty easily, but can I go one deeper?
The "add to cart" is a submit-style button so maybe this isn't possible?
Thanks,
Dave
Offline
Yes, but not to the product screen. You can get them to the shopping cart screen with the product already added by either doing a GET with a URL:
http://www.yourdomain.com/ccp5/cgi-bin/ … quantity=1
Or you could do a form POST (which will keep this info out of the URL:
<FORM METHOD="POST" ACTION="http://www.yourdomain.com/ccp5/cgi-bin/cp-app.cgi">
<INPUT TYPE="HIDDEN" NAME="pg" VALUE="ste_cart_add_proc">
<INPUT TYPE="HIDDEN" NAME="ref" VALUE="XXX">
<INPUT TYPE="HIDDEN" NAME="price" VALUE="10.00">
<INPUT TYPE="HIDDEN" NAME="quantity" VALUE="1">
<INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Add To Cart">
</FORM>
Using either of these (GET or POST) would post a quantity of 1 of product XXX for $10.00 into the cart and direct the user to the cart page.
___________________________
Nick Hendler
Webmaster, Kryptronic, Inc.
Offline
This seems very interesting... but when I try it I get:
The was an error adding the item you selected to your shopping cart. The quantity submitted is invalid. Please try again.
Two things could cause this:
(1) You did not pass the field 'quantity' as a valid number.
(2) You have a maximum quantity allowed set and your quantity exceeded the maximum allowed.
___________________________
Nick Hendler
Webmaster, Kryptronic, Inc.
Offline
OK Nick... now lets take this one step further.
We need customers to complete one entire purchase from start to finish for each item they wish to buy. Being able to update or add additional quantities is what we are trying to work around, and we're looking to bypass the "view shopping cart" step entirely and go straight from the product detail page (with all of the associated product options) to the 1st checkout page (ste_chkout_proc).
SELECT PRODUCT-->PRODUCT DETAIL (and add options)-->CHEKOUT (ste_chkout_proc)
We use direct links from our HTML product page to the product detail page for each corresponding item.
http://www.48hourprint.com/cgi-bin/ccp5 … ef=bc_5000
So I changed this to:
http://www.48hourprint.com/cgi-bin/ccp5 … quantity=1
Then, I tried to update the product detail display page by commenting out:
############################
(CGIGET TYPE="SUB" VALUE="ste_prod_show_addtocart_detail")
############################
and adding:
############################
<INPUT TYPE="IMAGE" SRC="(CGIVAR)images_path(/CGIVAR)/button/submit_update.gif" WIDTH="(CGIVAR)site_button_image_width(/CGIVAR)" HEIGHT="(CGIVAR)site_button_image_height(/CGIVAR)" BORDER="0" VALUE="submit"> <A HREF="(CGIVAR)common_url(/CGIVAR)&pg=ste_chkout_proc"><IMG SRC="(CGIVAR)images_path(/CGIVAR)/button/submit_checkout.gif" WIDTH="(CGIVAR)site_button_image_width(/CGIVAR)" HEIGHT="(CGIVAR)site_button_image_height(/CGIVAR)" BORDER="0"></A>
</CENTER></FORM>
############################
But of course still the shopping cart is still empty...
The idea is there, but the excecution isn't! Thanks in advance for any ideas....
Offline
Back out that change and in the file ./cgi-bin/library/modules/ste_cart.pl in the routine 'ste_cart_add_proc' change the line:
$fd_pg = "cart";
Which appears at the top of the routine to:
$fd_pg = "ste_chkout_proc";
That should do what you need it to do.
___________________________
Nick Hendler
Webmaster, Kryptronic, Inc.
Offline
Whoa! Isn't this subject to abuse? I just tried this on my site and I can add any item at whatever cost I specify in the URL? Anyway to stop this from being abused?
Best regards,
Randy Domingo
Darkgear.com
Offline
The program works like this so that it can accept items from many different sources - remote HTML pages, discounted category pages, product detail pages, etc. It is very common for carts to pass prices in URLs (especially on those that have you build your own HTML). There is some checking in the code, though, to make sure the post is coming from a trusted source (based on the HTTP_REFERER variable).
___________________________
Nick Hendler
Webmaster, Kryptronic, Inc.
Offline
Is there no way to have an external "add to cart" button anywhere that will simply add the product to the cart with whatever price is in the system rather than specifying it with:
<INPUT TYPE="HIDDEN" NAME="price" VALUE="10.00">
This would mean that prices have to be maintained in two places and with roughly 2,000 products to deal with, this could cause a problem.....and a migrane.
MJL
Offline
In the file ./cgi-bin/library/modules/ste_cart.pl in the routine 'ste_cart_add_cgi_api_proc' what you'll want to do is to modify the SQL statement and resulting array to include your price variables, then instead of using:
$cart_amtprod = $q->param('price');
In there, use a variable or formula to figure out the price based on values in the product table.
Offline