Today one of my clients addressed me for help. And the help was as follows, he needed to remove all the goods and orders from the online store. Since he sold his ready-made online store, and the new owner needed the store clean without goods and orders.
The first thing that probably comes to you is the problem? Why not remove all products from the admin panel by selecting the desired items and clicking the delete button, and do the same thing from the orders.
And I agree with this completely with you, remove all the goods from the Opencart store by this method the right decision, but what if you do not have 500 products in the store and for example 20-30 thousand, you imagine how much time it takes to remove all these goods and orders from the admin panel, this you need half a day to sit and squeeze the button to remove.
Therefore, we will go the other way and remove all the goods and orders from the store in a few minutes, I would even say a few seconds, all we need to do is clear the necessary tables in the database.
And so, in order to quickly remove all the goods in opencart go to your database that is connected to your store via phpmyadmin, (if you do not know what database you need to enter, open the configuration file config.php, which is located in your website root and peep at the name of your database), and in the list of tables, find the following tables:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
oc_product oc_product_attribute oc_product_description oc_product_discount oc_product_image oc_product_option oc_product_option_value oc_product_related oc_product_related oc_product_reward oc_product_special oc_product_tag oc_product_to_category oc_product_to_download oc_product_to_layout oc_product_to_store oc_review |
Well, or the second option is more correct and faster, it will also delete all link URLs specifically tied to the goods, you can simply execute the SQL query:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
TRUNCATE TABLE oc_product; TRUNCATE TABLE oc_product_attribute; TRUNCATE TABLE oc_product_description; TRUNCATE TABLE oc_product_discount; TRUNCATE TABLE oc_product_image; TRUNCATE TABLE oc_product_option; TRUNCATE TABLE oc_product_option_value; TRUNCATE TABLE oc_product_related; TRUNCATE TABLE oc_product_related; TRUNCATE TABLE oc_product_reward; TRUNCATE TABLE oc_product_special; TRUNCATE TABLE oc_product_tag; TRUNCATE TABLE oc_product_to_category; TRUNCATE TABLE oc_product_to_download; TRUNCATE TABLE oc_product_to_layout; TRUNCATE TABLE oc_product_to_store; TRUNCATE TABLE oc_review; DELETE FROM oc_url_alias WHERE query LIKE 'product_id=%'; |
That's all, now your store does not have a single product.
Our next task will be to clear all orders in opencart, that is, zero order numbers, so that subsequent order numbers start from the first, well, there were no old orders in the store.
We will do exactly the same as with the cleaning of the goods, we still go to the database and mark all the tables that begin with oc_order And just choose the bottom at the bottom of the page. This way you can delete all orders from the opencart store.
PS: Forgot to specify: You do not need to clear the oc_order_status table, there are order status titles in it, if you clear it, then all Order statuses must be registered manually again.
You can also simply execute a SQL query to quickly clear orders:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
TRUNCATE TABLE oc_order; TRUNCATE TABLE oc_orderreviews_log; TRUNCATE TABLE oc_order_comment; TRUNCATE TABLE oc_order_download; TRUNCATE TABLE oc_order_field; TRUNCATE TABLE oc_order_fraud; TRUNCATE TABLE oc_order_history; TRUNCATE TABLE oc_order_option; TRUNCATE TABLE oc_order_product; TRUNCATE TABLE oc_order_recurring; TRUNCATE TABLE oc_order_recurring_transaction; TRUNCATE TABLE oc_order_total; TRUNCATE TABLE oc_order_voucher; |
Well, that's all, you will agree that it is faster and easier than sitting for hours and deleting goods and orders from the administrative panel of the store. You can also go through FTP to your site in the image folder /image/data/ and delete the folders with photos that you do not need anymore.
Finally, if you want, you can also delete users and all customers from the opencart store, for this, execute the following query or manually clean the tables from the list below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
TRUNCATE oc_customer; TRUNCATE oc_customer_activity; TRUNCATE oc_customer_history; TRUNCATE oc_customer_login; TRUNCATE oc_customer_ip; TRUNCATE oc_customer_online; TRUNCATE oc_customer_reward; TRUNCATE oc_customer_transaction; TRUNCATE oc_customer_search; TRUNCATE oc_customer_wishlist; TRUNCATE oc_custom_field; TRUNCATE oc_custom_field_customer_group; TRUNCATE oc_custom_field_description; TRUNCATE oc_custom_field_value; TRUNCATE oc_custom_field_value_description; |
In such a simple way and having spent just a couple of minutes, we completely cleaned our online store of old orders and the entire product base.
Good luck to you.
No Comment
You can post first response comment.