Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

4eshir

Newbie
  
  • Posts

    2
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

4eshir's Achievements

Newbie

Newbie (1/14)

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

Recent Badges

0

Reputation

  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//
Guest
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.