عند إنشاء متجر جديد أو إعادة تشغيل OpenCart، يكون من الضروري أحيانًا مسح البيانات مثل الفئات والمنتجات والسمات والسجلات الأخرى في قاعدة البيانات. حذف المنتجات والفئات في OpenCart
فيما يلي بعض استعلامات SQL لمساعدتك في تنظيف بياناتك:
مسح جميع الفئات في OpenCart 3:
TRUNCATE TABLE oc_category;
TRUNCATE TABLE oc_category_description;
TRUNCATE TABLE oc_category_filter;
TRUNCATE TABLE oc_category_path;
TRUNCATE TABLE oc_category_to_layout;
TRUNCATE TABLE oc_category_to_store;
احذف من oc_seo_url حيث يتم الاستعلام مثل 'category_id=%' ؛
قم بإزالة عناوين URL الخاصة بـ Seo فقط من الفئات:
احذف من oc_seo_url حيث يتم الاستعلام مثل 'category_id=%' ؛
مسح جميع المنتجات في OpenCart 3:
تعيين External_key_checks = 0 ؛
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_dependent;
TRUNCATE TABLE oc_product_dependent;
TRUNCATE TABLE oc_product_reward;
TRUNCATE TABLE oc_product_special;
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;
احذف من oc_seo_url حيث يتم الاستعلام مثل 'product_id=%' ؛
قم بإزالة عنوان URL الخاص بـ Seo فقط من المنتجات:
احذف من oc_seo_url حيث يتم الاستعلام مثل 'product_id=%' ؛
مسح كافة السمات في OpenCart:
TRUNCATE TABLE oc_attribute;
TRUNCATE TABLE oc_attribute_description;
TRUNCATE TABLE oc_attribute_group;
TRUNCATE TABLE oc_attribute_group_description;
TRUNCATE TABLE oc_product_attribute;
مسح جميع الخيارات في OpenCart:
TRUNCATE TABLE oc_option;
TRUNCATE TABLE oc_option_description;
TRUNCATE TABLE oc_option_value;
TRUNCATE TABLE oc_option_value_description;
TRUNCATE TABLE oc_product_option;
إزالة كافة الشركات المصنعة:
TRUNCATE TABLE oc_manufacturer;
حذف جميع الطلبات:
TRUNCATE TABLE oc_order;
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;
إزالة جميع المشترين:
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;
لاحظ أن بعض الجداول قد تكون مفقودة، أو لها بادئة مختلفة، أو تكون فارغة، لذا احذف الصفوف التي تسببت في الخطأ وأعد تشغيل الاستعلام حتى ينجح.