Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2007
    Posts
    11
    Plugin Contributions
    0

    Default SQL Pricing Patch...

    Hi,

    I´m having problems when I try to change the prices on some categories (9 to be exact) with a SQL patch. I don´t know how to make a patch that updates all my specific categories at once but I´m trying one category at a time now with this patch:

    Code:
    UPDATE products SET products_price = products_price * 1.05 WHERE master_categories_id = 30;
    When I try that it says "successful" but nothing happens, no price changes what so ever.
    The master_category is 30 (no products directly under it) but it holds a number of sub-categories which holds the actual products.

    Am I doing something wrong here?

  2. #2
    Join Date
    Jan 2007
    Posts
    11
    Plugin Contributions
    0

    Default Re: SQL Pricing Patch...

    Ok, now I got it working, when I actually entered the right ID in this case the ID of the sub-categories.

    Is it possible though to in some way include every sub-category and sub-sub-category and so on... in any way?

    It´s a little hard to update them one by one when there are in some cases so many sub-, sub-sub- and even sub-sub-sub- categories.?

  3. #3
    Join Date
    Jan 2007
    Posts
    11
    Plugin Contributions
    0

    Default Re: SQL Pricing Patch...

    I´m obviously no sql-expert, but is there anyway you could include more ID:s at once in the sql patch for instance like this:

    Code:
    UPDATE products SET products_price = products_price * 1.05 WHERE master_categories_id = 30,40,50,60,70,80;
    That way I could at least get all the sub-sub-sub categories updated at once.

    Even better if someone knows how select/include the top-category + all it´s sub- and sub-sub- categories and so on.

    Thx!

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: SQL Pricing Patch...

    Quote Originally Posted by GsT View Post
    I´m obviously no sql-expert, but is there anyway you could include more ID:s at once in the sql patch for instance like this:

    Code:
    UPDATE products SET products_price = products_price * 1.05 WHERE master_categories_id = 30,40,50,60,70,80;
    That way I could at least get all the sub-sub-sub categories updated at once.

    Even better if someone knows how select/include the top-category + all it´s sub- and sub-sub- categories and so on.

    Thx!
    Code:
    UPDATE products SET products_price = products_price * 1.05 WHERE master_categories_id = 30 OR master_categories_id = 40  OR master_categories_id = 50 OR master_categories_id = 70 OR master_categories_id = 80;
    Not the most elegant, but simple to follow :)

    Cheers
    Rod

  5. #5
    Join Date
    Jan 2007
    Posts
    11
    Plugin Contributions
    0

    Default Re: SQL Pricing Patch...

    Thank You Rod!

    That will probably save me some 4-6 hours!

    Simplicity is the key, especially in my case.

  6. #6
    Join Date
    Jan 2007
    Posts
    11
    Plugin Contributions
    0

    Default Re: SQL Pricing Patch...

    Ahh, still too complex there cases where there are sub-sub- categories with 80-90 subcategories. It´s too painful to keep track of the ID:s in that case.

    As I said earlier I´m no coder but there must be an easier way to "select" the top-category with all its siblings and products in some other way...

 

 

Similar Threads

  1. v139h Upload SQL Patch via phpMyAdmin in MySQL INSTEAD OF Amin-Tools-Install AQL patch ????
    By shags38 in forum Customization from the Admin
    Replies: 11
    Last Post: 20 Aug 2012, 04:19 AM
  2. Un-do SQL Patch for MAP Pricing addon?
    By Johnnycopilot in forum All Other Contributions/Addons
    Replies: 11
    Last Post: 14 Apr 2012, 08:19 AM
  3. v139h DB/SQL Error when using SQL Patch for Add Pages More Info Sidebox addon
    By maperr55 in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 5 Mar 2012, 09:32 PM
  4. Sql Patch
    By Astarkley in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 2 May 2009, 05:34 AM

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