Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / How to Set a Default Quantity in Adding New Product?

How to Set a Default Quantity in Adding New Product?

Views: 2,328

Results 1 to 7 of 7
7 Sep 2013, 9:23 AM
#1
syadidister avatar

syadidister

New Zenner

Join Date:
Sep 2013
Location:
Malaysia
Posts:
12
Plugin Contributions:
0

How to Set a Default Quantity in Adding New Product?

How to Set a Default Quantity in Adding New Product?

so that i have less column to key in, and can add new products faster.

Pls help

7 Sep 2013, 3:08 PM
#2
responsivezc avatar

responsivezc

New Zenner

Join Date:
Aug 2013
Posts:
85
Plugin Contributions:
8

Re: How to Set a Default Quantity in Adding New Product?

Hi,

The only way to do it is by editing the following file:
/YOUR_ADMIN/includes/modules/product/collect_info.php

Look for the following line:

<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_quantity', ($pInfo->products_quantity?$pInfo->products_quantity:5)); ?></td>

Replace the line with the following

<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_quantity', ($pInfo->products_quantity?$pInfo->products_quantity:5)); ?></td>

I have set the default quantity to 5, you can change the number to a different one.

7 Sep 2013, 5:43 PM
#3
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,843
Plugin Contributions:
17

Re: How to Set a Default Quantity in Adding New Product?

:dontgetit both look the same and... I hope this is the same for the OP's ZC version since it was not mentioned.

Should be around line 275 in 1.5.# but was changed in 2011 so may not work on earlier versions.

If there are a lot of products involved, why not investigate Easy Populate? Just pick one that suits your needs. http://www.zen-cart.com/search.php?searchid=1821417

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

7 Sep 2013, 6:29 PM
#4
responsivezc avatar

responsivezc

New Zenner

Join Date:
Aug 2013
Posts:
85
Plugin Contributions:
8

Re: How to Set a Default Quantity in Adding New Product?

Hi,

Sorry this is the proper code, now the 2 lines are not the same.

Open the following file:
/YOUR_ADMIN/includes/modules/product/collect_info.php

Look for the following line:

<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td>

Replace the line with the following

<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_quantity', ($pInfo->products_quantity?$pInfo->products_quantity:5)); ?></td>

I have set the default quantity to 5, you can change the number to a different one.

9 Sep 2013, 3:02 AM
#5
syadidister avatar

syadidister

New Zenner

Join Date:
Sep 2013
Location:
Malaysia
Posts:
12
Plugin Contributions:
0

Re: How to Set a Default Quantity in Adding New Product?

It works. Thank you very much

23 Sep 2013, 4:04 AM
#6
syadidister avatar

syadidister

New Zenner

Join Date:
Sep 2013
Location:
Malaysia
Posts:
12
Plugin Contributions:
0

Re: How to Set a Default Quantity in Adding New Product?

responsivezc : if i want to set a default weight ?
is this still the same file to edit ?

i need this default weight, so that the order doesn't go to free delivery

23 Sep 2013, 10:24 AM
#7
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,717
Plugin Contributions:
56

Re: How to Set a Default Quantity in Adding New Product?

Yes, same file.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.