Sub-product (with <select>) template question

General ShopSite user discussion

Sub-product (with <select>) template question

Postby dlundell » Sun Dec 16, 2007 3:06 am

Hi,

I'm working on a template based on one that Jim posted a year or
so ago (see below). It defines the sub-product as a line of a
<select> form element.

My question is whether it's possible to add a single quantity input box,
such that it adds that quantity of the selected sub-product.

Does anyone know how to do this? Keep in mind that I'm trying to
avoid multiple add-to-cart buttons (which is what the <select>
construct accomplishes).

The Subproduct-AddToCartButton and Product-AddToCartButton
templates don't seem to do it, as aren't passed up to the cart as a
variable, but rather they get filled in with the Subproduct or Product's
item number.

The stock version of the template I'm basing this on (without
any quantity logic added):

[-- DEFINE SUBPRODUCT --]
# A subproduct in this template is just an option for a pull down list
# Note1: Field1 is used to hold the name used for the pull down list
# such as "Brown, Size 8" instead of the actual name which
# might be "Wing Tip - Brown, Size 8".
# Note2: In order to turn off the master:subproduct naming feature
# used
# by ShopSite's shopping cart check the box
# Display subproducts without parent name:
# Under Commerce Setup > Order System > Shopping Cart
#
[--IF PRODUCT.SaleOn--]
<option value="[--PRODUCT.RECORDNUMBER--]">[-- PRODUCT.FIELD1 --] [--
PRODUCT.S
aleAmount --]</option>
[-- ELSE --]
<option value="[--PRODUCT.RECORDNUMBER--]">[-- PRODUCT.FIELD1 --] [--
PRODUCT.P
RICE --]</option>
[-- END_IF --]
[-- END_DEFINE SUBPRODUCT --]

[-- DEFINE PRODUCT --]
<CENTER>
[--PRODUCT.Name--]
<br>
[-- IF product.subproduct --]
<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>
<TABLE>
<TR><TD>
<SELECT name=itemnum>
[-- LOOP SUBPRODUCTS --]
[-- SUBPRODUCTS --]
[-- END_LOOP SUBPRODUCTS --]
</SELECT></TD><TD>
<input type=image src="[-- OUTPUT_DIRECTORY_URL
--]/media/add_to_cart.gif" width
=83 height=20 alt="add_to_cart.gif" hspace=3 vspace=3 border=0
align="bottom" na
me="Add to Cart" alt="Add to Cart">
<input type=image src="[-- OUTPUT_DIRECTORY_URL --]/media/view_cart.gif"
width=7
1 height=20 alt="view_cart.gif" hspace=3 vspace=3 border=0
align="bottom" name="
View Cart" alt="View Cart">
</TD></TR></TABLE>
</form>

[-- ELSE --]
# Need to treat as regular product
# this code still needs to be added
[-- END_IF --]
</CENTER>

[-- END_DEFINE PRODUCT --]
[-- DEFINE MORE_INFO_PAGE --]
[-- END_DEFINE MORE_INFO_PAGE --]

Thanks,

Don
dlundell
 
Posts: 95
Joined: Fri Aug 04, 2006 6:13 pm

RE: Sub-product (with <select>) template question

Postby ShopSite Lauren » Mon Dec 17, 2007 2:41 pm

Don,

I have gotten this question before and I am not sure of a way to do this. The reason is because the quantity input field needs to include the product itemnum. If you have a custom template which displays the subproducts in a pull down menu, where each line in the pull down menu is a different product, the quantity input field would be created with the parent product's itemnum, or the first subproduct's itemnum, it wouldnt change according to the option/product selected in the pull down menu.

-Lauren
ShopSite Lauren
 
Posts: 889
Joined: Fri Aug 11, 2006 1:35 pm
Location: Orem, UT

Re: RE: Sub-product (with <select>) template question

Postby dlundell » Mon Dec 17, 2007 7:47 pm

ShopSite Lauren wrote:Don,

I have gotten this question before and I am not sure of a way to do this. The reason is because the quantity input field needs to include the product itemnum. If you have a custom template which displays the subproducts in a pull down menu, where each line in the pull down menu is a different product, the quantity input field would be created with the parent product's itemnum, or the first subproduct's itemnum, it wouldnt change according to the option/product selected in the pull down menu.



Yes, that's the problem that'd stopped me.

Two solutions I can see for Shopsite -- the first would be to not have the itemnum included in the qnty form field. It's included elsewhere in the form submission, so it seems like it shouldn't be necessary also as part of qnty.

The other, and I think this is one of the biggest holes in Shopsite, would be to fix the fact that you can't manage inventory on items in a pull-down menu (ordering options). A big problem for us (one that may be enough of a reason to move to a different e-commerce solution -- especially as we grow our inventory. Dealing with it using a sub-product hack just doesn't cut it -- especially not if each item has to have its own quantity box and add-to-cart buttons.

It would be great if the Shopsite engineers could give some insight into upcoming features. We have no idea if they're working on this long-time inventory issue, and it'll be in the next version, or if we'll never see it, or something in betwee.

Thanks Lauren,

- dc
dlundell
 
Posts: 95
Joined: Fri Aug 04, 2006 6:13 pm

Postby Jim » Mon Dec 17, 2007 10:38 pm

Two solutions I can see for Shopsite -- the first would be to not have the itemnum included in the qnty form field. It's included elsewhere in the form submission, so it seems like it shouldn't be necessary also as part of qnty.

Since multiple items can be added to the cart at the same time, it is necessary to have the item number with the quantity so that the appropriate quantity gets attached to the correct item.

As for your second comment (manage inventory on items in a pull-down menu ) this will be looked at as time allows, however it is much more difficult than you might think. What happens if you have 5 different options for a product and each option has 5 different possibilities? That would be a large number (3125) of possible skus to keep track of and if you have more options or more possibilities for each option the number adds up quickly.

As for your third comment,(give some insight into upcoming features) I know of no company that tells what features are going to be in future releases. Even Beta versions of most products have gag orders around them so product features won't be announced before the product is released.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby dlundell » Tue Dec 18, 2007 12:15 am

Jim wrote:
Two solutions I can see for Shopsite -- the first would be to not have the itemnum included in the qnty form field. It's included elsewhere in the form submission, so it seems like it shouldn't be necessary also as part of qnty.

Since multiple items can be added to the cart at the same time, it is necessary to have the item number with the quantity so that the appropriate quantity gets attached to the correct item.

As for your second comment (manage inventory on items in a pull-down menu ) this will be looked at as time allows, however it is much more difficult than you might think. What happens if you have 5 different options for a product and each option has 5 different possibilities? That would be a large number (3125) of possible skus to keep track of and if you have more options or more possibilities for each option the number adds up quickly.


One way is to require that SKUs are emunerated when inventory will be managed (no double or triple drop-downs allowed in that case).

It seems a minor burden to make the user define (for example) Blue small, Blue medium, Blue large; Red small, Red medium, Red large (as opposed to a double pull-down). It's possible I'm not understanding your 3125-possibilities example above.

As for your third comment, (give some insight into upcoming features) I know of no company that tells what features are going to be in future releases. Even Beta versions of most products have gag orders around them so product features won't be announced before the product is released.


Adobe Lightroom is a good (and succeessful, so far) example).

- dc
dlundell
 
Posts: 95
Joined: Fri Aug 04, 2006 6:13 pm


Return to User Forum

Who is online

Users browsing this forum: No registered users and 133 guests