order anywhere.... multiple items on one page

General ShopSite user discussion

order anywhere.... multiple items on one page

Postby JPW2105 » Fri May 20, 2011 4:03 am

Hello,

Cueless person asking a question. Hopefully it will be an easy answer for someone.

I would like to use several order anywhere buttons on one .php page (.php is purely for there to provide password protection on the page).

There are "quantity" boxes for each item. What I would like to do is to have say 15 items on one page with only one add to cart button at the bottom. However, when there is "0" placed in the quantity amount, when 'add to cart' is pressed, it addes them to the cart but with the value of 0. Ideally, I would like them not to be added to the cart.

Is there anyway I can place a piece of code onto the page that interupts the sending process to stop a blank item being added to the cart. Here are the code snippets.

To add the item with the quantity box,
Code: Select all
    <input type="hidden" name="dbname" value="products" />
    <input type="hidden" name="function" value="add" />
    <input type="hidden" name="itemnum" value="2">
    <input type="text" size="1" name="2:qnty" maxlength="2" value="0"><br /><span class="dealerbody">Quantity</span>


To submit the form.
Code: Select all
<input type=image  src="http://store/shopsite-images/en-US/buttons/sleek/sleek-add.gif"   width="83" height="20" vspace="7" hspace="0" border="0"  align="bottom" alt="Add to Cart" name="Add to Cart">


Is there a piece of code that will make the process ignore if quantity is declared as "0"..?

Thank you for your time.
JPW2105
 
Posts: 18
Joined: Fri May 20, 2011 3:54 am

Re: order anywhere.... multiple items on one page

Postby BFChris » Fri May 20, 2011 7:26 am

Check out this tutorial from Lexiconn:

http://support.lexiconn.com/news/viewtopic.php?t=326&sid=e6806dd07ede7a730fa814624db0c2fb

I think it will do what you want.
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Re: order anywhere.... multiple items on one page

Postby JPW2105 » Fri May 20, 2011 7:37 am

Thanks for that, but that's for designing a ShopSite template, I'm looking to do something in good ol' regular html utilizing the "order anywhere" feature.

Thanks anyway
JPW2105
 
Posts: 18
Joined: Fri May 20, 2011 3:54 am

Re: order anywhere.... multiple items on one page

Postby BFChris » Fri May 20, 2011 7:54 am

You can still use the same basic idea.....just replace the Shopsite template tags with hard-coded data.

The Javascript that runs it will work the same.
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Re: order anywhere.... multiple items on one page

Postby JPW2105 » Fri May 20, 2011 12:13 pm

I just don't understand that, I'm sorry. I've looked at it and I can see this...

Code: Select all
[-- DEFINE PRODUCT --]
<P><input type="checkbox" name="itemnum" value="[-- PRODUCT.RECORDNUMBER --]">
[--PRODUCT.Name--]
[--PRODUCT.Price--]
 Quantity <input type="text" size="2" name="[-- PRODUCT.RECORDNUMBER --]:qnty" value="1">
<br>[-- Product.ProductDescription --]
# Generate the Ordering Option Menus
[-- IF PRODUCT.DisplayOrderingOptions --]
  <br>[-- PRODUCT.OptionText --]
  [-- ORDER_OPTION_MENU LINE --]
[-- END_IF --]


But how does that fit in with this page www.wamplerpedals.com/dealers/ which is the template I'm currently working on to try to get this done...?
JPW2105
 
Posts: 18
Joined: Fri May 20, 2011 3:54 am

Re: order anywhere.... multiple items on one page

Postby BFChris » Fri May 20, 2011 1:26 pm

The important parts are as follows:

Code: Select all
<input id="2_check" type=checkbox name=itemnum value="2" style="visibility: hidden;">


to replace:

Code: Select all
<input type="hidden" name="itemnum" value="2">


and

Code: Select all
<input id="2_quantity" type=text size="2" name="2:qnty"
value="0" onchange="var checkVal = document.getElementById('2_check'); (this.value > 0 && checkVal.checked==false ) ? checkVal.checked=true : checkVal.checked=false;">


to replace:

Code: Select all
<input type="text" size="1" name="2:qnty" maxlength="2" value="0">
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Re: order anywhere.... multiple items on one page

Postby JPW2105 » Fri May 20, 2011 1:48 pm

You are my new best friend, that worked like a dream.

Thank you so much. Thank you. I was almost ready to give up then... thank you
JPW2105
 
Posts: 18
Joined: Fri May 20, 2011 3:54 am


Return to User Forum

Who is online

Users browsing this forum: No registered users and 50 guests