Custom Order/Cart Page

Questions and answers about ShopSite Custom Templates

Custom Order/Cart Page

Postby link3333 » Tue Dec 20, 2011 10:20 am

Hey, I was wondering if someone could give me any tips or guide me with an enhancement to the order page my company wants to do. I'm new to ShopSite. I want to process the SKUs that are currently in the cart, and I see that there are JavaScript variables defined for those, assuming they are formed after the CGI script runs. I want to connect to an SQL database and was hoping to use AJAX with this. My plan is to get ingredients or ingredient IDs from a list of SKUs of food products. I already have a system in place for a reverse recipe search by ingredients. I would like to display a list of top recipes on the order page, have the user select a recipe, and then include a list with check boxes of additional products that the user could order to be able to make the recipe they selected. The ingredient list would replace the recipe list. I would like to have one button to order the multiple ingredients (user selected). This order link doesn't need AJAX to refresh the contents of the page. Also, if it's possible, include a variable sent with the link to the order.cgi page to tell my JavaScript not to run again.

Essentially:
Where can I run JavaScript on the cart/order page, and am I able to use AJAX?
How do I display a checklist of items with default options and a one click order button?

Also, is there any way to have a separate test cart page?
link3333
 
Posts: 3
Joined: Tue Dec 20, 2011 9:57 am

Re: Custom Order/Cart Page

Postby Jim » Tue Dec 20, 2011 10:45 am

Assuming that you have a Pro level ShopSite store, you can add javascript that will be added to the built in CheckIt function, which executes on recalculations, checkout etc, in the backoffice of the store under Commerce Setup > Order System> Shopping cart > Javascript added at start of built-in CheckIt function:

There is no way to pass a parameter to order.cgi to let it know that the javascript has been run once, but you could probably create a cookie and add the value to the cookie and then check the cookie to see if it has been run.

I don't know for sure if you can run ajax but I think it should be possible.

Putting order buttons for products in the cart is done through the Cross-sell items. I don't know if you could have a selectable list of items and a single add to cart button but if you could it would be similar to the multi add to cart which is described in the on line help, (do a search for "multi add" and it is the first item.)

Note that if you are using a custom created template you could have javascript where ever you want it by putting it in the template.

What you are trying to do is definitely not directly supported so you are pretty much on your own as far how to implement it, if it is possible at all.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 94 guests

cron