Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Modifying minimum quantity via PHPmyadmin

    Hello,
    there are several hundred products at one of my clients sites, and I have been asked to change the min quantities to 12 (1 dozen) from the default of 1 single item. Is there a way to do this via PHPmyadmin and how, or preferrably is there a way to do this via ZenCart's admin panel? Thanks for any help

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Modifying minimum quantity via PHPmyadmin

    There are 2 settings to think about:
    products_quantity_order_min
    products_quantity_mixed

    If your Products use Attributes, does the 12 minimum allow for a mix of Attributes on a Product or must the Product and Attributes be 12?

    Can the customer order:
    3 Red 4 Yellow and 5 Green?
    This is products_quantity_mixed YES


    Or, do they need to order 12 Red or 12 Yellow or 12 Green?
    This is products_quantity_mixed NO ...

    To update all Products to require a minimum of 12, backup your database ...

    Then you can issue this statement in your Tools ... Insert SQL Patch ...
    PHP Code:
    UPDATE products SET products_quantity_order_min=12
    If all Products can be a mix of Attributes (this includes products without Attributes as well)
    PHP Code:
    UPDATE products SET products_quantity_mixed=1
    If all Products can NOT be a mix of Attributes (this includes products without Attributes as well)
    PHP Code:
    UPDATE products SET products_quantity_mixed=0
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Modifying minimum quantity via PHPmyadmin

    Linda, thank you so much that is perfect - by the way some products would have to be manually changed because some products can be bought in 3's or 6's but there are only a couple of categories like that ... the majority of the products need to be bought in dozens, so thank you very much for the elegant solution.

    As an aside, how did you know this, and how could I learn it, I know you are a developer here, and I know you are a database Guru, but are those commands something that we mere mortals can/should know or learn from somewhere?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Modifying minimum quantity via PHPmyadmin

    You just trip over these things the more you work with databases and php ...

    Knowing what the code expects for settings, you can do global updates on numerous conditions like this ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Modifying minimum quantity via PHPmyadmin

    Well I thought this worked Linda however in practice it doesn't ... I issued the SQL query UPDATE products SET products_quantity_mixed=0; which should in theory stop people buying odd amounts . For example I need people to buy a product in lumps of 12 and other products in lumps of 25, and although I can set the amount that people can buy in the shop if someone adds say 13 items to the cart the cart lets them through to checkout, I don't want this. The buyer must buy either 12 or 24 or 36 or 48 etc, ie multiples of 12 I cannot see anyway to make the cart do this ? The same is true for items of 25 they must be sold in lumps of 25, ie 25, 50, 75, not 26, 27 or 35 etc.

    So to sum up some items need to be sold in quantities of, and I would also like to be able to modify categories rather than individual items as this way of modifying items will take me days of tedious individual pricing. Please help if you can, thanks.

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Modifying minimum quantity via PHPmyadmin

    IF you set the Product Units to 12 then you have to buy in units of 12 on each product then they have to buy 12 of any given product but can combine mixed attributes when mixed is turned on ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Feb 2006
    Location
    UK
    Posts
    306
    Plugin Contributions
    1

    Default Re: Modifying minimum quantity via PHPmyadmin

    Thank you yes, I have found out that is the case, is there a way to do this to categories via SQL though? So, change all the Product Units to 12 in one category, 6 in another category, and 25 in yet another .. other than how I am currently doing it, ie manually one at a time for 900+ products !

  8. #8
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Modifying minimum quantity via PHPmyadmin

    First you need to consider whether you are planning to update based on ALL the categories a given product is found in (ie: links), or only based on master-categories-id.

    Then you'll have to consider whether this is supposed to happen for all products in all subcategories below the category you mention, or if it only happens for items at that one level.

    Then, you'll have to write a SQL query with an appropriate combination of joins between the products table, the products_to_categories table, and the categories table, using the selection criteria for category/product selection resulting from those answers.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Nov 2006
    Location
    Indiana
    Posts
    192
    Plugin Contributions
    0

    Default Re: Modifying minimum quantity via PHPmyadmin

    I love it Linda! Is there a way to do this for only one category and not all products?

    When I use EZ Pop, Product Qty. Min. and Product Qty. Units default to 1 and I'd like to quickly reset all the items to 0.25 without individually editing them....


    Quote Originally Posted by Ajeh View Post
    There are 2 settings to think about:
    products_quantity_order_min
    products_quantity_mixed

    If your Products use Attributes, does the 12 minimum allow for a mix of Attributes on a Product or must the Product and Attributes be 12?

    Can the customer order:
    3 Red 4 Yellow and 5 Green?
    This is products_quantity_mixed YES


    Or, do they need to order 12 Red or 12 Yellow or 12 Green?
    This is products_quantity_mixed NO ...

    To update all Products to require a minimum of 12, backup your database ...

    Then you can issue this statement in your Tools ... Insert SQL Patch ...
    PHP Code:
    UPDATE products SET products_quantity_order_min=12
    If all Products can be a mix of Attributes (this includes products without Attributes as well)
    PHP Code:
    UPDATE products SET products_quantity_mixed=1
    If all Products can NOT be a mix of Attributes (this includes products without Attributes as well)
    PHP Code:
    UPDATE products SET products_quantity_mixed=0

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Modifying minimum quantity via PHPmyadmin

    If the master_categories_id is the same on all of the products then you can add a condition such as:
    PHP Code:
    WHERE master_categories_id 32 
    Just be sure to do a backup and be sure to check before and after on these ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Import Product Attributes Via phpMyAdmin?
    By Andor1211 in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 3 Apr 2012, 10:20 AM
  2. Product CSV Export via PhpMyAdmin ?
    By gp999 in forum General Questions
    Replies: 5
    Last Post: 9 Sep 2011, 09:59 AM
  3. Importing Products Via phpMyAdmin
    By JasonDamisch in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 20 Jul 2011, 05:14 PM
  4. Add meta tags via phpmyadmin?
    By disciple in forum General Questions
    Replies: 1
    Last Post: 12 Feb 2008, 02:46 AM
  5. Resending admin password via phpmyadmin
    By Raichumaximus in forum General Questions
    Replies: 2
    Last Post: 9 Oct 2007, 09:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg