Importing goods to OpenCart at BD level (MySQL+PHP)Імпорт товарів в OpenCart на рівні БД (MySQL+PHP)
1 .A list of goods to be imported.
To select missing goods, you need to meet approximately the following request:
Select old_products* FROM old_products LEFT OUTER JOIN oc_product ON old_products.products_model = oc_product.sk WHERE oc_product.sk IS NULL
However, then you still need to draw the product categories and do LEFT JOIN according to the result of the previous request (usually, you can create temporary tables).But importing in OpenCart is too early
The 2ndAfter such preparation of the goods to import, you need to do cleaning from excessive HTML formating of the product description.That is, to get with the help of strip_tags() excess tags style, h1, h2, h3 and so on, but remaining b, i, strong and so on - there is a list.Moreover, there is a ready PHP code, which cleansing is made for previous products.3 .In addition, in the product descriptions for import, it is necessary to adjust the URLs of the images so that they indicate a new site (cover https://address-old site).and 4.And, in the descriptions, the links to the video on YouTube are inserted, but the curve (through x-shockwave-flash) on the old site - you need to correct it so that the video on the new site appears properly.and 5.In addition, on the goods (translation) works a content manager, and it is desirable that new imported goods be marked somehow for the content manager (tags or properties) to distinguish new goods.6 .The new website is two-speaking (Ukr/Rus), so when importing it should be noticed.For translation the purchased module https://opencartforum.com/files/file/5277-perevod-na-vse-yazyki-sayta-tovary-kategorii-stati/ there are the following options to filter the goods for translation:
7 .The final result of the work: processed goods, as mentioned above, and imported to OpenCart (probably the imports are better performed through the CSV file rather than directed in the BD).
Так вийшло, що імпорт у БД нового сайту зробили через XML feed. І частина товарів (близько 900) не потрапила на новий сайт.
Зі старого сайту (osCommerce) перенесені у БД нового сайту (OpenCart) таблиці продуктів та категорій, які називаються відповідно: old_products, old_categories, old_categories_description, old_products_to_categories
1. Потрібно підготувати перелік товарів для імпорту
Щоб вибрати відсутні товари, потрібно виконати приблизно такий запит:
SELECT old_products.* FROM old_products LEFT OUTER JOIN oc_product ON old_products.products_model = oc_product.sku WHERE oc_product.sku IS NULL
Однак, потім потрібно ще підтягнути категорії товарів і зробити LEFT JOIN за результатом попереднього запиту (звичайно, можна створювати тимчасові таблиці).
Але імпортувати в OpenCart ще зарано 😁
2. Після такої підготовки товарів до імпорту, потрібно провести очищення від зайвого HTML форматування опису товарів. Тобто, прибрати за допомогою strip_tags() зайві теги style, h1, h2, h3 та ін., але залишаються b, i, strong тощо - є перелік. Більш того, є готовий PHP-код, яким очищення зроблено для попередніх товарів.
3. Крім того, в описах товарів для імпорту потрібне корегування URL зображень так, щоб вони вказували на новий сайт (прибрати https://адреса-старого-сайту).
4. І ще, в описах вставлені посилання на відео на YouTube, але криво (через x-shockwave-flash) на старому сайті - потрібно скоригувати, щоб на новому сайті відео відображалось адекватно.
5. Крім того, над товарами (перекладом) працює контент-менеджер, і бажано нові імпортовані товари відзначити якось для контент-менеджера (теги або властивості), щоб відокремити нові товари.
6. Новий сайт двомовний (укр/рус), тому при імпорті це потрібно зауважити. Для перекладу придбаний модуль https://opencartforum.com/files/file/5277-perevod-na-vse-yazyki-sayta-tovary-kategorii-stati/ там є такі варіанти відфільтрувати товари для перекладу:
7. Кінцевий результат роботи: оброблені товари, як зазначено вище, та імпортовані в OpenCart (напевно імпорт краще виконувати через CSV файл, а не напряму писати в БД).
Client's feedback on cooperation with Aleksandr S.
Importing goods to OpenCart at BD level (MySQL+PHP)A very professional approach to work, the executor succeeds in the smallest details, offers solutions. I recommend it!
Freelancer's feedback on cooperation with Oleg Sribny
Importing goods to OpenCart at BD level (MySQL+PHP)The scope of the work turned out to be a bit greater and more complex than in the initial task. The first stage is completed. It is very pleasant to work with the customer, understands the specifics, I recommend. We will continue further.
-
proposal concealed by client
-
proposal concealed by client
-
proposal concealed by client
-
proposal concealed by client
-
В общем, сумму можно смело подимать раза в 3? Тем более, что ни файл импорта, ни сайт не были засвечены. И подходов может быть несколько.
-
В данном случае помоему проще было бы поправить модуль импорта xml, что бы корректно залились все товары