Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

4eshir

Новачок
  
  • Публікації

    2
  • З нами

  • Відвідування

1 подписчик

Відвідувачі профілю

Блок відвідувачів профілю відключений і не буде доступний широкому іншим користувачам

4eshir's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Репутація

  1. Решено. Всему виной был неправильный класс веса, установленный по умолчанию (0 вместо 1 или 2).
  2. Ситуация следующая: Товар, который был добавлен в БД не через админку, а по хранимой процедуре, которую дергали из 1C не добавляется в корзину. При этом товар, прописанный через админку сайта, отрабатывается как надо. Еще в процессе написания процедур прошерстил на предмет хранения товаров все таблицы, поэтому уверен в том, что различия между, назовем их так, web-товарами и 1с-товарами - минимальна. Код контролера тоже не вызывает у меня приступов фэйспалма на предмет личных косяков. Собственно, привожу процедуры, по которым товар вносится в БД из 1С, и прошу тыкнуть пальцем в ошибку: Основная процедура, которую из 1С дергают. create procedure oc_db_ui( `code` varchar(5), `articule` varchar(25), `full_name` varchar(255), `price` decimal(15,2), `ostat` int(11), `ed_izmer` varchar(25), `weight` decimal(15,3), `is_group` boolean, `parent` varchar(5), `soon_be` boolean, `active` boolean, `sort_by` int(11), `image` boolean ) begin if (`is_group`) then set @cat_id = (select `category_id` from `oc_1c_category` where `code_1c` = `code`); if (@cat_id) then call oc_update_cat(@cat_id, `full_name`, `parent`, `active`, `sort_by`); else insert into `oc_1c_category` (`code_1c`) values (`code`); set @cat_id = (select `category_id` from `oc_1c_category` where `code_1c` = `code`); call oc_insert_cat(@cat_id, `full_name`, `parent`, `active`, `sort_by`); end if; else set @prod_id = (select product_id from oc_1c_product where code_1c = code); if (@prod_id) then call oc_update_prod(@prod_id, `articule`, `full_name`, `price`, `ostat`, `ed_izmer`, `weight`, `parent`, `soon_be`, `active`, `sort_by`, `image`); else insert into `oc_1c_product` (`code_1c`) values (`code`); set @prod_id = (select `product_id` from `oc_1c_product` where `code_1c` = `code`); call oc_insert_prod(@prod_id, `articule`, `full_name`, `price`, `ostat`, `ed_izmer`, `weight`, `parent`, `soon_be`, `active`, `sort_by`, `image`); end if; end if; end// Дальше идут понятные по названию процедуры инсерта и апдейта каталогов и товаров: create procedure oc_insert_cat( `code` varchar(5), `full_name` varchar(255), `parent` varchar(5), `active` boolean, `sort_by` int(11) ) begin set @parent = (select if(`parent` = '00000', 0, (select `category_id` from `oc_1c_category` where `code_1c` = `parent`))); insert into `oc_category` (`category_id`,`image`, `parent_id`, `sort_order`, `status`, `date_added`, `date_modified`) values (`code`,'', @parent, `sort_by`, `active`, now(), now()); insert into `oc_category_description` (`category_id`,`name`, `language_id`) values (`code`,`full_name`,1); insert into `oc_category_to_store` (`category_id`, `store_id`) values (`code`, 0); end// create procedure oc_update_cat( `code` varchar(5), `full_name` varchar(255), `parent` varchar(5), `active` boolean, `sort_by` int(11) ) begin set @parent = (select if(`parent` = '00000', 0, (select `category_id` from `oc_1c_category` where `code` = `parent`))); update `oc_category` set `image`='', `parent_id`=@parent, `sort_order`=`sort_by`, `status`=`active`, `date_added`=now(), `date_modified`=now() where `category_id`=`code`; update `oc_category_description` set `name`=`full_name`, `language_id`=1 where `category_id`=`code`; end// create procedure oc_insert_prod( `code` varchar(5), `articule` varchar(25), `full_name` varchar(255), `price` decimal(15,2), `ostat` int(11), `ed_izmer` varchar(25), `weight` decimal(15,3), `parent` varchar(5), `soon_be` boolean, `active` boolean, `sort_by` int(11), `image` boolean ) begin set @parent = (select if(`parent` = '00000', 0, (select `category_id` from `oc_1c_category` where `code_1c` = `parent`))); set @img = (select if(`image`, concat("foto/",(select `code_1c` from `oc_1c_product` where `product_id`=`code`),"_1.jpg"), null)); insert into `oc_product` (`product_id`,`model`, `price`, `quantity`, `weight`, `main_category_id`, `sort_order`, `status`, `image`) values (`code`,`articule`, `price`, `ostat`, `weight`, @parent, `sort_by`, `active`, @img); insert into `oc_product_description` (`product_id`,`name`) values (`code`,`full_name`); insert into `oc_product_featured` (`product_id`) values (`code`); insert into `oc_product_to_category` (`product_id`, `category_id`) values (`code`, @parent); insert into `oc_product_to_store` (`product_id`, `store_id`) values (`code`, 0); end// create procedure oc_update_prod( `code` varchar(5), `articule` varchar(25), `full_name` varchar(255), `price` decimal(15,2), `ostat` int(11), `ed_izmer` varchar(25), `weight` decimal(15,3), `parent` varchar(5), `soon_be` boolean, `active` boolean, `sort_by` int(11), `image` boolean ) begin set @parent = (select if(`parent` = '00000', 0, (select `category_id` from `oc_1c_category` where `code_1c` = `parent`))); set @img = (select if(`image`, concat("foto/",(select `code_1c` from `oc_1c_product` where `product_id`=`code`),"_1.jpg"), null)); update `oc_product` set `model`=`articule`, `price`=`price`, `quantity`=`ostat`, `weight`=`weight`, `main_category_id`=@parent, `sort_order`=`sort_by`, `status`=`active`, `image`=@img where `product_id`=`code`; update `oc_product_description` set `name`=`full_name` where `product_id`=`code`; update `oc_product_to_category` set `category_id`= @parent where `product_id`=`code`; update `oc_product_to_store` set `store_id` = 0 where `product_id`=`code`; end//

×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.