A A A

Please consider registering
guest

Log In Register

Login form protected by Login LockDown.


Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
How to add a quantity selection box to the product details page
January 6, 2010
3:27 pm
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline

Some of you may want to offer your customers the ability to add more than 1 item at a time to their shopping carts.

Here's a quick code modification that'll let you do that. 

(At the time of this writing, Market is at version 3.62)

Here's what to do:

In the Market theme file "single.php" you need a code change.

On or around line #181 you'll see the line:

      <input type="hidden" name="quantity" value="1">

You'll need to remove that line.

Then, somewhere else you'll need to add the following type of code to insert an input "text" field, rather than a hidden field:

      <input type="text" name="quantity" value="1" size="4">

So if you want, you can add this code on or around line #269

<tr><td><br/>Quantity: <input type="text" name="quantity" value="1" size="4"></td></tr>

Insert it right before:

      </table>  
<?php if($mkt_outstock != 1) { ?>   

That'll insert the correct code, along with some style formatting that'll make it show up decent.

February 13, 2011
3:18 am
Member
Forum Posts: 16
Member Since:
February 9, 2011
Offline

I SERIOUSLY SCREWED UP MY SITE ATTEMPTING THIS…I followed the steps above and somehow I shut down all of the visibility for my posts.  I think I screwed up on or around line 269 when I put in the new code and then removed it when it didn't work.  Could someone please get me the correct code to replace the entire single.php file?  I have the 4.1 Market Theme maybe that is why this didn't work.  Of course I have only had two to three other attempts at editing  and adding code, those ones worked this one didn't but I did notice you were using it on an earlier version…HELP ME PLEASEFrown

I can't believe how much I am learning from all the mistakes I make…Piper1
February 13, 2011
4:47 am
Member
Forum Posts: 16
Member Since:
February 9, 2011
Offline

I also clicked on the filter button accidently while I was going back and forth, could I have shut down all my posts this way?  I think the best thing is if you just copy all of the current single.php code for me and let me delete whatever mess I have in there no and replace it with the origional version before I tried to get tricky. 

I can't believe how much I am learning from all the mistakes I make…Piper1
February 14, 2011
1:42 pm
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline

Just grab a new copy from the download center.  All versions are included there.

I know you probably don't need the reminder, but for those others reading — when making custom changes, ALWAYS hold onto a backup copy of the file before you start changing stuff.

We've all learned the hard way.

 

As far as the code changes above, I don't see any reason why they wouldn't work with version 4.1.

Make sure you've got all of the quotes entered properly.

 

The last part isn't on the same line anymore — it's around line #263 and now needs to go right before:

</table>  
<?php if($mkt_options['mkt_checkout_button'] != "none") {
          if($mkt_outstock != 1) { ?> 
March 8, 2011
8:07 pm
Member
Forum Posts: 5
Member Since:
February 13, 2011
Offline

Hie,

 

What if i want the quantity selection box to be a drop down box? Can you please help me with the code for this?

 

Thanks

 

Susan

March 9, 2011
12:03 pm
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline

Hi Susan,

Please post future questions in the "Support" forum. The "How to" forum is reserved for finished stuff. It's more of an "instructions" area, versus a "question" area.

Maybe this post will help you:
http://www.markettheme.com/for…..-drop-down

Forum Timezone: UTC 0

Most Users Ever Online: 40

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

icy1: 2371

wreed06: 175

laurie390: 168

StitchTek Services, LLC: 144

boutiqueelliette: 130

yiorgos: 127

Member Stats:

Guest Posters: 428

Members: 2252

Moderators: 1

Admins: 1

Forum Stats:

Groups: 1

Forums: 4

Topics: 2983

Posts: 16042

Moderators: Market Admin (5051)

Administrators: Market Admin (5051)

Market takes e-commerce to the next level with an easy to use, quick setup platform. Learn more or take the tour.