Variable SKU, Price, Name

General ShopSite user discussion

Variable SKU, Price, Name

Postby bakerman » Mon Dec 17, 2007 9:32 am

I am having problems setting up a Variable item in Shopsite so I can add custom items / non-catalog items to a phone order. When I try to add the item it comes up with this error in the cart: "No variable price specified, item not added to the shopping cart." The only thing I can think of is that I am missing something in the product template I created for it. See the code I have been working on below

Code: Select all
<div id="skucart">

<p id="skucart-sku">Description: <input type="text" name="[-- PRODUCT.RecordNumber --]:name" value="" /></p>
<p id="skucart-sku">SKU #: <input type="text" name="[-- PRODUCT.RecordNumber --]:sku" value="" /></p>
<p id="skucart-price">Price: $<input type="text" name="[-- PRODUCT.RecordNumber --]:price" value="" /></p>

<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method="post">
<input type="hidden" name="storeid" value="[-- STORE_ID --]" />
<input type="hidden" name="dbname" value="products" />
<input type="hidden" name="function" value="add" />
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]" />

<table id="skucart-addtocart">
<tr>
<td class="addtocart-quantity">Qty: <input type="text" size="2" name="[-- PRODUCT.RecordNumber --]:qnty" value="1" /></td>
<td class="addtocart-add"><input type="image" value="submit" src="/graphics/addtocart.gif" alt="Add to Cart" /></td>
</tr>
</table>
</form>

</div>



Any ideas why this wouldn't be working? Thanks for any help!
bakerman
 
Posts: 68
Joined: Fri Feb 23, 2007 1:02 pm
Location: Ohio

Postby loren_d_c » Mon Dec 17, 2007 11:36 am

Any ideas why this wouldn't be working?


Yes, it would be because your Name and Price form fields are not within the form. Only form fields after the <form action=...> and before the </form> will be submitted by the browser when that form's submit button is clicked.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby bakerman » Mon Dec 17, 2007 11:55 am

So I need to specify the input types after the form:

Code: Select all
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method="post">

<p id="skucart-sku">Description: <input type="text" name="[-- PRODUCT.RecordNumber --]:name" value="" /></p>
<p id="skucart-sku">SKU #: <input type="text" name="[-- PRODUCT.RecordNumber --]:sku" value="" /></p>
<p id="skucart-price">Price: $<input type="text" name="[-- PRODUCT.RecordNumber --]:price" value="" /></p>

<input type="hidden" name="storeid" value="[-- STORE_ID --]" />
<input type="hidden" name="dbname" value="products" />
<input type="hidden" name="function" value="add" />
<input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]" />
bakerman
 
Posts: 68
Joined: Fri Feb 23, 2007 1:02 pm
Location: Ohio

Postby loren_d_c » Mon Dec 17, 2007 11:59 am

Yes.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby bakerman » Mon Dec 17, 2007 12:13 pm

It works perfectly. Now I have to find out how to remove the text "Variable -" in front of the items... I think I read about that somewhere.
bakerman
 
Posts: 68
Joined: Fri Feb 23, 2007 1:02 pm
Location: Ohio

Postby bakerman » Mon Dec 17, 2007 12:21 pm

bakerman
 
Posts: 68
Joined: Fri Feb 23, 2007 1:02 pm
Location: Ohio

Postby bakerman » Mon Dec 17, 2007 12:28 pm

Another thing I was just thinking of. Is there a way to add a field for weight? There isn't a "variable weight" so we have to add an item called shipping charges. It would be easier, however, to add the weight when the variable item is added to the cart so the shipping will calculate correctly.
bakerman
 
Posts: 68
Joined: Fri Feb 23, 2007 1:02 pm
Location: Ohio

Postby Jim » Mon Dec 17, 2007 3:04 pm

No, there is no way to pass a weight to the shopping cart for a variable item.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby bakerman » Tue Dec 18, 2007 3:08 pm

So there are probably not many people who would like to pass weights to the cart... what are my chances of getting this written into the next upgrade of ShopSite?
bakerman
 
Posts: 68
Joined: Fri Feb 23, 2007 1:02 pm
Location: Ohio


Return to User Forum

Who is online

Users browsing this forum: No registered users and 104 guests