Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2007
    Location
    Mount Maunganui, New Zealand
    Posts
    419
    Plugin Contributions
    0

    Default Change sort order of products in a category using phpmyadmin

    Hi Ajeh and others in the know,
    A few years ago you kindly suggested some samples, to change store quantities all to 100 using phpmyadmin.
    I was hoping you might throw me an example for another...
    Would like to change all products in category 5 for example, to have a sort order of 200. (would like them below other products when a search word is used, as they are accessories)
    I would just change them manually but there are 2000 products on the site.
    Thanks

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

    Default Re: Change sort order of products in a category using phpmyadmin

    If all of the Products in categories_id 5 are using that for the master_categories_id then you could use:
    Code:
    UPDATE products set products_sort_order = 200 WHERE master_categories_id = 5;
    NOTE: be sure to backup your database before attempting 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!

  3. #3
    Join Date
    Jan 2007
    Location
    Mount Maunganui, New Zealand
    Posts
    419
    Plugin Contributions
    0

    Default Re: Change sort order of products in a category using phpmyadmin

    Awesome. That worked a treat.
    Thanks for the response and code!

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

    Default Re: Change sort order of products in a category using phpmyadmin

    Thanks for the update that this worked for you ...
    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
    Jan 2007
    Location
    Mount Maunganui, New Zealand
    Posts
    419
    Plugin Contributions
    0

    Default Re: Change sort order of products in a category using phpmyadmin

    Might I ask the php code, to change all products in Category id 1, to have a manufacturer of: XYZ ?

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

    Default Re: Change sort order of products in a category using phpmyadmin

    What is the manufactuers_id for the manufacturer of: XYZ ?
    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
    Jan 2007
    Location
    Mount Maunganui, New Zealand
    Posts
    419
    Plugin Contributions
    0

    Default Re: Change sort order of products in a category using phpmyadmin

    4, thanks

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

    Default Re: Change sort order of products in a category using phpmyadmin

    If ALL Products that are using categories_id 1 for their master_categories_id need to have their manufacturers_id to be changed to 4, then in the Tools ... Install SQL Patches, you could use:

    Code:
    UPDATE products SET manufacturers_id = 4 WHERE master_categories_id = 1;
    NOTE: be sure to backup your database before doing 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!

  9. #9
    Join Date
    Jan 2007
    Location
    Mount Maunganui, New Zealand
    Posts
    419
    Plugin Contributions
    0

    Default Re: Change sort order of products in a category using phpmyadmin

    Thanks for the solution again Ajeh :)
    I've used this, to change all of our hire/rental items to a manufacturer of "Hire"
    And the purchase items to a manufacturer of "Sales"
    This allows me to export a report for hire and a report for purchases made for any month, for our accountant.
    (perhaps there is a better way, but thought I'd write this in case someone in future may find it useful)

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

    Default Re: Change sort order of products in a category using phpmyadmin

    Thanks for the update that this worked for you ...
    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!

 

 

Similar Threads

  1. v151 Change sort order of products to date added to category
    By Bee01 in forum Customization from the Admin
    Replies: 2
    Last Post: 25 May 2013, 02:21 PM
  2. change sort order of linked products?
    By joshuabaer23 in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 3 Oct 2010, 09:45 PM
  3. How to Change Sort Order of Upcoming Products?
    By DJLQD in forum General Questions
    Replies: 1
    Last Post: 1 Aug 2010, 01:47 AM
  4. How do I change the sort order of a category?
    By libracorn in forum Setting Up Categories, Products, Attributes
    Replies: 12
    Last Post: 7 Mar 2009, 06:02 AM
  5. Sort Order products by price within category
    By manage-it in forum General Questions
    Replies: 0
    Last Post: 22 May 2006, 02:52 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