Zen Cart Logo
Forums / General Questions / resetting all product minimums to zero

resetting all product minimums to zero

Locked

Views: 1,921

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
23 Jun 2006, 4:01 PM
#1
smap avatar

smap

New Zenner

Join Date:
May 2006
Posts:
42
Plugin Contributions:
0

resetting all product minimums to zero

Hello.

I'm trying to find a way to reset all product minimums to zero (disable product minimums) without going in to each and every product in the site.

I was thinking at least there should be a way to do with with a SQL statement unfortunately I can't write it myself. :)

Does anyone know of a way to do this?

Thanks

23 Jun 2006, 4:49 PM
#2
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: resetting all product minimums to zero

Hi

If you want to display the products when there is no stock, there is a setting in admin->configuration->stock > Products status in Catalog when out of stock should be set to and if you select 1 (default 0), the product status will remain on

How to write sql queries is not my forte'

23 Jun 2006, 5:13 PM
#3
smap avatar

smap

New Zenner

Join Date:
May 2006
Posts:
42
Plugin Contributions:
0

Re: resetting all product minimums to zero

Parafanaylya:

If you want to display the products when there is no stock

Not exactly but thanks. The client I'm building the site for initially wanted minimum purchase quantities on most products. They've since changed their mind and now want to allow shoppers to order 1 (or more of course) of any product.

I'm looking for a way to 'get rid of' or disable product minimum purchase quantites without revisiting every product in the store.

23 Jun 2006, 5:19 PM
#4
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: resetting all product minimums to zero

This is something that I'm waiting for in an easy populate module that's due for release quite shortly (hopefully), as I have hundreds of products with min quantities that need editing

23 Jun 2006, 6:04 PM
#5
smap avatar

smap

New Zenner

Join Date:
May 2006
Posts:
42
Plugin Contributions:
0

Re: resetting all product minimums to zero

Well it was actually pretty easy using phpMyAdmin if you have access to that.

I went to the SQL tab and used the interface to build the query:

SELECT *
FROM `products`
WHERE `products_quantity_order_min` >1

I then checked all the resulting rows, selected Edit, then used Firefox's search to continually find products_quantity_order_min and change it to 1.

Took only a few minutes and everything seems OK.

Of course I backed up the database first. :)

23 Jun 2006, 6:11 PM
#6
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: resetting all product minimums to zero

That's pretty cool, but I have the following to do:

x no of products min qty 50
y no of products min qty 72
z no of products min qty 24

as a wholesaler, I don't want people buying 3 of the product, and if they do buy, they must buy in units eg, 50 or 100, nothing in between. I don't know how to do SQL queries.

parafanaylya

23 Jun 2006, 6:24 PM
#7
smap avatar

smap

New Zenner

Join Date:
May 2006
Posts:
42
Plugin Contributions:
0

Re: resetting all product minimums to zero

Parafanaylya:

That's pretty cool, but I have the following to do:

x no of products min qty 50
y no of products min qty 72
z no of products min qty 24

as a wholesaler, I don't want people buying 3 of the product, and if they do buy, they must buy in units eg, 50 or 100, nothing in between. I don't know how to do SQL queries.

parafanaylya

phpMyAdmin doesn't require you to write any SQL by hand. It has a point-and-click interface that basically does it for you. Of course your web host must have it installed or at least support it for this to even be an option.

The method I used would only be useful to you if you could query the database based on existing product categories. Select all products in category X, change all min qty to 50. Repeat for Y and Z with 72 and 24 min qty respectively.

In my situation, resetting all min qty to 1 ... it seems to do the trick.

23 Jun 2006, 6:46 PM
#8
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: resetting all product minimums to zero

I understand what buttons to push, but don't understand what's happening. I've gone to the SQL tab in products, checked the relevant products, double clicked the fields into the query box and I get this answer:

SQL query: Documentation

SELECT *
FROM zen_products
WHERE 1 products_quantity_order_min >24 products_quantity_order_units >24
LIMIT 0 , 30

MySQL said: Documentation
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'products_quantity_order_min> 24products_quantity_order_unit

23 Jun 2006, 6:56 PM
#9
smap avatar

smap

New Zenner

Join Date:
May 2006
Posts:
42
Plugin Contributions:
0

Re: resetting all product minimums to zero

SELECT *
FROM `zen_products`
WHERE `products_quantity_order_min` >24
AND `products_quantity_order_units` >24
LIMIT 0 , 30

There was a "1" (inserted automatically by phpMySqlAdmin) in your code and also I think you need an AND inbetween the 2 qualifiers.

I also had to change 'zen_products' to 'products' for my table name, but otherwise the code above is cut-and-paste from a successful query for me.

23 Jun 2006, 7:40 PM
#10
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: resetting all product minimums to zero

I'm getting really close to cracking this. My query reads:

Code:

SELECT *
FROM zen_products
WHERE products_quantity_order_min >24
AND products_quantity_order_units >24
LIMIT 0 , 30

but, it's not picking up the products I've selected with the checkboxes. The LIMIT 0, 30 are obviously the product by page, but how does it see the selected products in the query, i.e. what should the query read eg

product id 1 to 23 to have the values > products_quantity_order_min` >24

AND products_quantity_order_units` >24

23 Jun 2006, 7:49 PM
#11
smap avatar

smap

New Zenner

Join Date:
May 2006
Posts:
42
Plugin Contributions:
0

Re: resetting all product minimums to zero

Parafanaylya:

but, it's not picking up the products I've selected with the checkboxes

When I got a results page (showing records rows that could be individually checked), I scrolled to the bottom, there was an option to select all (which I did). Then next to the 'select all' link, there was a little edit icon which loaded the result set up in an edit page. From there is where I changed all the 'products_quantity_order_min' to 1 (this is where I used the browser's find function to skip right to each record's field). There was some kind of save mechanism at the bottom of the edit page which I used after making all the edits.

I then re-ran the query and came up with zero results, so I know my changes were saved (no records any longer satisfied the query).

. The LIMIT 0, 30 are obviously the product by page, but how does it see the selected products in the query, i.e. what should the query read eg

product id 1 to 23 to have the values

Yes there was some drop-down or fill-in where I set the number of products to display per-page to 9999. I then hit "go" (or something similar) to refresh the query. Then checked all result rows and edited.

23 Jun 2006, 8:29 PM
#12
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: resetting all product minimums to zero

When I got a results page (showing records rows that could be individually checked), I scrolled to the bottom, there was an option to select all (which I did). Then next to the 'select all' link, there was a little edit icon

I got to this point: checked products to be edited, clicked on the pencil (edit) icon and that was the end of my editing. The database won't go to the next step in the process - possibly server/host issues

23 Jun 2006, 8:36 PM
#13
smap avatar

smap

New Zenner

Join Date:
May 2006
Posts:
42
Plugin Contributions:
0

Re: resetting all product minimums to zero

Parafanaylya:

I got to this point: checked products to be edited, clicked on the pencil (edit) icon and that was the end of my editing. The database won't go to the next step in the process - possibly server/host issues

Hmm ya sounds possible. Maybe your host only allows viewing data over phpMySqlAdmin.

Sorry your results weren't better...

23 Jun 2006, 8:46 PM
#14
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: resetting all product minimums to zero

No - I have edited sort orders there in the last week