chrometweaks.org

Can someone tell me how to start a web iPage hosting service from home?

Click Here To View All Answers...


Quick question... Can someone tell me how to start a web iPage hosting service from home? Many thanks for any answer or 2. My 2nd question... Hi,.

I have several parent categories, and my products are stored in 2 nested levels of subcategories within these parent categories..

(ie: parent_category>>sub_ cat_level_1>>sub_cat_level_2>>products).

I am wondering if anyone can give me some help on the sql query that I need to execute if I want to modify the weight/price of my products base on the product's parent_category? Alternatively, if someone can point me to a contribution that can take care of these, it would be nice too.....

Comments (257)

You betcha! however you might want to make sure and wait for another member here to confirm this as I am on the fence. Better yet, why don't you e-mail the iPage guys because they can answer your iPage question better...

Comment #1

Bruyndoncx, thank you for your reply, It seems the quick updates contribution only deal with stock and price.. I really need something that can modify and upate product weight as well.. the reason I had asked sql help was because I have a large of amount of products, upwards of thousands... so I would prefer to update them all at once if possible...

Comment #2

How do you update product now? Are you familiar with using SQL queries in phpMyAdmin or similar program?..

Comment #3

Currently, I have no otherway of updating the weight and price of my products except do update them item by item (yes.. it is literrally quite painful on my wrist).....

I am some what familiar with myPhpAdmin, I can execute some very simple sql queries. but I can't figure out how to piece together the sql command that would let me update all my products, base on categories at one go... For example, one of my category is DVDs, and every single product pretty much have the same weight, so I want set every single product inside the category of DVD to a certain weight. and if I can do that, I can probably play with the sql query to set other categories on sale with very little effort..

But I do need help in putting the sql query together to start with....

Comment #4

I know I will get comment on this, because I did not take the time to find the exact mySQL statement..

You can create a comma delimited text file using Excell that will basically be like the following (exact coding is available at www.mysql.com).

UPDATE products SELECT products_weight WHERE (and here I need some help, because we need a JOIN statement to tie products_id to categories table through table products_to_categories.).

If no one comes to the rescue, I'll work on it later tonight and post a response...

Comment #5

Thanks for your help!! The JOIN statement part is the most difficult.. because the the categories table has a field call parent_id, and I don't know how to tie the parent_id into the statement.. But I know I probably need to use it somewhere as I want to update products base on the entire category, including any subcategories recursively...

Comment #6

Haven't had time to get into it yet, but the join may not be as dificult as you think. The product_to_catagories table doesn't know or care if you have subdirectories. This is handled elsewhere. You need only state the product weight, product_id and draw a relation to the specific category is shown in..

I haven't had enough training in mySQL to know if you can specify and/or statements to get the recursive function you are looking for...

Comment #7

Seksaini.

Just ran this, and works on mySQL 4.01. Hopefully will work on the version you are using..

UPDATE products, products_to_categories SET products_weight = {your weight} WHERE products.products_id = products_to_categories.products_id AND products_to_categories.categories_id = {your categoryID}.

Replace {your weight} with dcimal value of your weight ie: 1.25 and, of course, {your category id} with whatever number the category id is. NOTE do not use the braces! I only put them in for clarity..

Let me know how it goes.

Hth..

Comment #8

This should also work for doing more than one categorie at a time:.

UPDATE products, products_to_categories SET products_weight = {your weight} WHERE products.products_id = products_to_categories.products_id AND (products_to_categories.categories_id = {your categoryID} OR products_to_categories.categories_id = {your categoryID})..

Comment #9

Geotex - let first me say that I really appreciate that you are taken time from your schedule to tackle this problem for me on this holiday day weekend. I tried the SQL query you came up with, and I don't think they work on products that are within the nested subcategories..

Ie: they will work for this situation if I sepecify the category_id for catA-.

CatA -> products.

But they will not work for products inside subcatA if I only specify the category_id for catA (which is what I want to do).

CatA -> subcatA -> products.

Am I right? or Am I missing something? I am trying to look for something where I can specify the id/name of the top level category (catA in the above example), and then have every product inside every subcategory be modified. this is why I said the value in parent_id probably needs to be used somewhere... I hope I am making sense.....

Comment #10

UPDATE products, products_to_categories SET products_price = {amount}, products_weight = {your weight} WHERE products.products_id = products_to_categories.products_id AND (products_to_categories.categories_id = {your categoryID1} OR products_to_categories.categories_id = {your categoryID2}  OR products_to_categories.categories_id = {your categoryID3}).

This will let you set price and weight, and you can add more than one category. Table products_to_categories doesn't know about subcategories. That is defined in table categories...

Comment #11

See.

Http://forums.oscommerce.com/index.php?sho...=0&#entry399011.

For the select statement..

If you change that one by putting all tables listed in the FROM clause into your UPDATE clause; and taking the EXACT WHERE clause, you then only need to specify the SET clause similar to the pseudo code example listed above ....

Hope this helps,..

Comment #12

Hi,.

I have several parent categories, and my products are stored in 2 nested levels of subcategories within these parent categories..

(ie: parent_category>>sub_ cat_level_1>>sub_cat_level_2>>products).

I am wondering if anyone can give me some help on the sql query that I need to execute if I want to modify the weight/price of my products base on the product's parent_category? Alternatively, if someone can point me to a contribution that can take care of these, it would be nice too.....

Comment #13

The quick updates contribution is pretty handy and might get you a long way, messing around with updates in sql is not recommended if you don't know sql well enough..

Comment #14


This question was taken from a support group/message board and re-posted here so others can learn from it.