New store, quickly associate all your products, categories..
Posted: Sat Dec 15, 2012 11:08 pm
Assuming you have created a new store and want to assign everything to your new store quickly run the following SQL queries via PHPMYADMIN.
WARNING backup your database before running this.
1. Update the "1" to match your new store ID.
2. Optional - update the "0" to match the store ID you are copying from.
WARNING backup your database before running this.
1. Update the "1" to match your new store ID.
2. Optional - update the "0" to match the store ID you are copying from.
Code: Select all
INSERT INTO category_to_store (category_id, store_id)
SELECT category_id, 1 FROM category_to_store WHERE store_id = 0;
INSERT INTO information_to_store (information_id, store_id)
SELECT information_id, 1 FROM information_to_store WHERE store_id = 0;
INSERT INTO layout_route (layout_id , store_id, route)
SELECT layout_id , 1, route FROM layout_route WHERE store_id = 0;
INSERT INTO manufacturer_to_store (manufacturer_id, store_id)
SELECT manufacturer_id, 1 FROM manufacturer_to_store WHERE store_id = 0;
INSERT INTO product_to_store (product_id, store_id)
SELECT product_id, 1 FROM product_to_store WHERE store_id = 0;