Basic Order Options Modifiers

General ShopSite user discussion

Basic Order Options Modifiers

Postby GiftSpecialists » Tue Oct 09, 2012 1:40 pm

I know that i can use a price modifier with the basic ordering options, but is there a way to hard code a custom template to also use weight and sku modifiers?

Example - something like this:

<option value="Mixed Imported Beers;2,5,-sku">Mixed Imported Beers</option>

Thanks for any help.
Rick,

www.GiftSpecialistsInc.com
www.WineGiftClub.com - Gifts for wine lovers
www.BeerOnTheWall.com - Gifts for beer lovers
GiftSpecialists
 
Posts: 130
Joined: Thu Aug 17, 2006 7:20 am
Location: Modesto, California

Re: Basic Order Options Modifiers

Postby Jim » Wed Oct 10, 2012 10:24 am

No, with the basic order options the only thing that can be modified is the price.

Using the advanced order options you can change the price, weight and sku, although the weight and sku are not in the form that is submitted to the cart, so they don't need to be on the store page. They are looked up in the database when the product is added to the cart. You can see the code that is needed on the store page by looking at the Order Anywhere html for a product with advanced options. The following code is for a product with 2 order options, color and size, It has text appended to the option (Jim or Jim in most cases) and a price modifier. Each product also has an sku modifier, weight modifier, quantity fields and an image which are not reflected in the order anywhere code and thus must be defined in the product advanced options fields.

Looking at one of the options we have <option value="red large Jim;2.00">red large Jim</option>
note that the options for color (red) and size (large) and modifier text (Jim) and price modifier (2.00) are all included in the value part of the option input. If an option such as color is multiple words like "light blue" it is in the option with just a space between it and the next option. In the code below is an example with "light green" "extra small" and "Jim was here" for the options and text.

When the product is added to the cart a look up of the product will be done by combining all the options i.e. red large Jim 2.00 with the product identifier (guid, record number or sku) and if that combination is not in the database the product will not be added to the cart. This is a safety mechanism so that someone can't just make up a new product or change price etc and rip the store off by getting a product with different options or at a lower price. Since this may prevent a merchant from creating products on the fly using orderAnywhere there is an option to disable the check on the Commerce Setup > Order System > Shopping Cart screen in the field "Ordering Options can be defined outside of ShopSite"


Code: Select all
<form action="http://my.domain.com/cgi-bin/sc/order.cgi" method="post">
<select name="2:finopt:0" size="1">
<option value="Select one of each;n">Select one of each</option>
<option value="red large Jim;2.00">red large Jim</option>
<option value="red med JIM;4.00">red med JIM</option>
<option value="red small JIM;0.50">red small JIM</option>
<option value="green large JIM;-1.00">green large JIM</option>
<option value="green med JIM;2.00">green med JIM</option>
<option value="green small JIM;1.50">green small JIM</option>
<option value="white large JIM;-2.00">white large JIM</option>
<option value="white med JIM;+5.00">white med JIM</option>
<option value="white small JIM;3.00">white small JIM</option>
<option value="light green extra small Jim was here;+5.00">light green extra small Jim was here</option>
</select>
<input type="hidden" name="2:finoptnum" value="1">
<br><input type=hidden name="storeid" value="*100bd218ab0744409e25">
<input type=hidden name="dbname" value="products">
<input type=hidden name="function" value="add">
<input type=hidden name="guid" value="2370538a-ec7d-11e1-8905-000347315335">
<input type=submit value="Add To Cart">
<input type=submit name="checkout" value="View Cart">
</form>
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 119 guests