импорт/экспорт данных из shop-script в битрикс

import/export shop-script bitrix

нынче многие клиенты замучались со старой системой управления сайта (в данной статье shop-script) и хотят перевести свой сайт на более удобную и защищенную систему — в россии популярна нынче 1с-битрикс

импорт новостей из shop-script

через https://www.adminer.org/ или вашу любую программу сформировать sql-запрос и сохранить результат в csv (;)

select
NID as IE_XML_ID,
if(title<>'', title, str_to_date(add_date, "%d.%m.%Y")) as IE_NAME,
picture as IE_PREVIEW_PICTURE,
picture as IE_DETAIL_PICTURE,
"html" as IE_PREVIEW_TEXT_TYPE,
"html" as IE_DETAIL_TEXT_TYPE,
textToMail as IE_PREVIEW_TEXT,
textToPublication as IE_DETAIL_TEXT,
date_format(str_to_date(add_date, "%d.%m.%Y"), "%d.%m.%Y") as IE_ACTIVE_FROM
from ss_news_table
order by str_to_date(add_date, "%d.%m.%Y") desc

на новый сайт (битрикс) сразу
1. скопируйте директорию с изображениями (обычно /products_pictures/)
2. настройте инфоблок на автоуменьшение превью/детальных-изображений

чтоб при импорте csv (через стандартный механизм битрикса)
отметить нужный чекбокс и заполнить инпут к директории с изображениями

импорт категорий и товаров из shop-script


select
productID as IE_XML_ID,
name as IE_NAME,
if (
((select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID))) = 1),
(select name from ss_categories where categoryID = (select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID))),
if (
(select categoryID from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID)) <> 1,
(select name from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID)),
(select name from ss_categories where categoryID = ss_products.categoryID)
)
) as IC_GROUP0,
if (
((select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID))) = 1),
(select sort_order from ss_categories where categoryID = (select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID))),
if (
(select categoryID from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID)) <> 1,
(select sort_order from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID)),
(select sort_order from ss_categories where categoryID = ss_products.categoryID)
)
) as IC_SORT0,
if (
((select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID)) = 1),
(select name from ss_categories where categoryID = ss_products.categoryID),
if (
((select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID))) = 1),
(select name from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID)),
""
)
) as IC_GROUP1,
if (
((select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID)) = 1),
(select sort_order from ss_categories where categoryID = ss_products.categoryID),
if (
((select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID))) = 1),
(select sort_order from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID)),
""
)
) as IC_SORT1,
if (
((select parent from ss_categories where categoryID = ss_products.categoryID) = 1),
"",
if (
((select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID))) = 1),
(select name from ss_categories where categoryID = ss_products.categoryID),
""
)
) as IC_GROUP2,
if (
((select parent from ss_categories where categoryID = ss_products.categoryID) = 1),
"",
if (
((select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = (select parent from ss_categories where categoryID = ss_products.categoryID))) = 1),
(select sort_order from ss_categories where categoryID = ss_products.categoryID),
""
)
) as IC_SORT2,
"html" as IE_PREVIEW_TEXT_TYPE,
"html" as IE_DETAIL_TEXT_TYPE,
brief_description as IE_PREVIEW_TEXT,
description as IE_DETAIL_TEXT,
(select filename from ss_product_pictures where photoID = default_picture limit 1) as IE_PREVIEW_PICTURE,
(select filename from ss_product_pictures where photoID = default_picture limit 1) as IE_DETAIL_PICTURE,
Price as ASZ_cod2,
"USD" as ASZ_cur2,
list_price as IP_PROP4,
in_stock as ASZ_kol,
if (enabled = 1 , "Y", "N") as IE_ACTIVE,
date_format(date_added, "%d.%m.%Y") as IE_ACTIVE_FROM,
sort_order as IE_SORT,
weight as IP_PROP5,
replace(meta_keywords, "\r", "") as IP_PROP9,
replace(meta_description, "\r", "") as IP_PROP8,
status1 as IP_PROP12,
status2 as IP_PROP13,
status3 as IP_PROP14,
status4 as IP_PROP15,
status5 as IP_PROP16,
status6 as IP_PROP17,
status7 as IP_PROP18,
status8 as IP_PROP19,
status9 as IP_PROP20,
status10 as IP_PROP21,
(select group_concat((select name from ss_products where ss_products.productId = ss_related_items.productId) separator "|") from ss_related_items where Owner = ss_products.productId) as IP_PROP7,
(select group_concat(ss_product_options.name, ":", ss_product_options_values.option_value separator "|") as option_ids from ss_product_options_values inner join ss_product_options using (optionID) where ss_product_options_values.productID = ss_products.productID and option_value <> "") as IP_PROP10,
(select group_concat(filename separator "|") as photo_names from ss_product_pictures where ss_product_pictures.productID = ss_products.productID) as IP_PROP11,
product_code as IP_PROP22,
viewed_times as IP_PROP23,
free_shipping as IP_PROP24,
min_order_amount as IP_PROP25,
shipping_freight as IP_PROP26,
date_format(sale_start, "%d.%m.%Y") as IP_PROP27,
date_format(sale_finish, "%d.%m.%Y") as IP_PROP28,
sale_text_before as IP_PROP29,
sale_text_after as IP_PROP30
from ss_products

здесь я привел настройки импорта/экспорта для модуля mlife.asz
его функционала достаточно, чтоб развернуть несложный интернет-магазин на редакции битрикса «старт»
вы можете легко адаптировать код, например, для редакции «малый бизнес», изменив поля ASZ_ на другие

будут вопросы — пишите их в форме ниже
почитайте еще про cms shop script




Enter your email address:

Delivered by FeedBurner

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *