diff --git a/docs/components/minishop2/snippets/mscart.md b/docs/components/minishop2/snippets/mscart.md index af480703..d6779b81 100644 --- a/docs/components/minishop2/snippets/mscart.md +++ b/docs/components/minishop2/snippets/mscart.md @@ -41,7 +41,192 @@
[[!msCart?tpl=``]]``` -[![](https://file.modx.pro/files/6/1/f/61f8ee92a1949258329e86d793896b96s.jpg)](https://file.modx.pro/files/6/1/f/61f8ee92a1949258329e86d793896b96.png) +::: details Пример + +```php +Array +( + [total] => Array + ( + [count] => 4 + [weight] => 0 + [cost] => 2 100 + [discount] => 0 + ) + + [products] => Array + ( + [0] => Array + ( + [id] => 4 + [type] => document + [contentType] => text/html + [pagetitle] => Товар 1 + [longtitle] => + [description] => + [alias] => товар-1 + [alias_visible] => 1 + [link_attributes] => + [published] => 1 + [pub_date] => 0 + [unpub_date] => 0 + [parent] => 3 + [isfolder] => 0 + [introtext] => + [richtext] => 1 + [template] => 1 + [menuindex] => 0 + [searchable] => 1 + [cacheable] => 1 + [createdby] => 1 + [createdon] => 1699161918 + [editedby] => 0 + [editedon] => 0 + [deleted] => 0 + [deletedon] => 0 + [deletedby] => 0 + [publishedon] => 1699161918 + [publishedby] => 1 + [menutitle] => + [donthit] => 0 + [privateweb] => 0 + [privatemgr] => 0 + [content_dispo] => 0 + [hidemenu] => 0 + [class_key] => msProduct + [context_key] => web + [content_type] => 1 + [uri] => + [uri_override] => 0 + [hide_children_in_tree] => 0 + [show_in_tree] => 0 + [properties] => + [article] => + [price] => 500 + [old_price] => 0 + [weight] => 0 + [image] => + [thumb] => + [vendor] => 0 + [made_in] => + [new] => 0 + [popular] => 0 + [favorite] => 0 + [tags] => + [color] => + [size] => + [source] => 2 + [vendor.name] => + [vendor.resource] => + [vendor.country] => + [vendor.logo] => + [vendor.address] => + [vendor.phone] => + [vendor.fax] => + [vendor.email] => + [vendor.description] => + [vendor.properties] => + [vendor.rank] => + [key] => ms71f884312767d1249c9093a3aad9b168 + [count] => 3 + [cost] => 1 500 + [discount_price] => 0 + [discount_cost] => 0 + ) + + [1] => Array + ( + [id] => 5 + [type] => document + [contentType] => text/html + [pagetitle] => Товар 2 + [longtitle] => + [description] => + [alias] => товар-1 + [alias_visible] => 1 + [link_attributes] => + [published] => 1 + [pub_date] => 0 + [unpub_date] => 0 + [parent] => 3 + [isfolder] => 0 + [introtext] => + [richtext] => 1 + [template] => 1 + [menuindex] => 0 + [searchable] => 1 + [cacheable] => 1 + [createdby] => 1 + [createdon] => 1699161930 + [editedby] => 1 + [editedon] => 1699161941 + [deleted] => 0 + [deletedon] => 0 + [deletedby] => 0 + [publishedon] => 1699161900 + [publishedby] => 1 + [menutitle] => + [donthit] => 0 + [privateweb] => 0 + [privatemgr] => 0 + [content_dispo] => 0 + [hidemenu] => 0 + [class_key] => msProduct + [context_key] => web + [content_type] => 1 + [uri] => + [uri_override] => 0 + [hide_children_in_tree] => 0 + [show_in_tree] => 0 + [properties] => + [article] => + [price] => 600 + [old_price] => 0 + [weight] => 0 + [image] => + [thumb] => + [vendor] => 0 + [made_in] => + [new] => 0 + [popular] => 1 + [favorite] => 0 + [tags] => + [color] => + [size] => + [source] => 2 + [vendor.name] => + [vendor.resource] => + [vendor.country] => + [vendor.logo] => + [vendor.address] => + [vendor.phone] => + [vendor.fax] => + [vendor.email] => + [vendor.description] => + [vendor.properties] => + [vendor.rank] => + [key] => msb2f01124a10b7f46a6b4e58e999a69bc + [count] => 1 + [cost] => 600 + [discount_price] => 0 + [discount_cost] => 0 + ) + + ) + + [scriptProperties] => Array + ( + [tpl] => + [includeTVs] => + [includeThumbs] => + [toPlaceholder] => + [showLog] => + ) + +) +``` + +::: Также для отладки можно использовать [модификатор print][2]. Просто создайте чанк `TestCart` и укажите в нём: diff --git a/docs/components/minishop2/snippets/msgetorder.md b/docs/components/minishop2/snippets/msgetorder.md index 6fc14b3e..570f540f 100644 --- a/docs/components/minishop2/snippets/msgetorder.md +++ b/docs/components/minishop2/snippets/msgetorder.md @@ -46,7 +46,335 @@
[[!msGetOrder?tpl=``]]``` -[![](https://file.modx.pro/files/3/a/9/3a922d1321d8f853aada28c176b21767s.jpg)](https://file.modx.pro/files/3/a/9/3a922d1321d8f853aada28c176b21767.png) +::: details Пример + +```php +Array +( + [tpl] => + [includeTVs] => + [includeThumbs] => + [toPlaceholder] => + [showLog] => + [order] => Array + ( + [id] => 1 + [user_id] => 2 + [session_id] => + [createdon] => 2023-11-05 08:31:47 + [updatedon] => + [num] => 2311/1 + [cost] => 2100 + [cart_cost] => 2100 + [delivery_cost] => 0 + [weight] => 0 + [status] => 1 + [delivery] => 1 + [payment] => 1 + [context] => web + [order_comment] => + [properties] => + [type] => 0 + ) + + [products] => Array + ( + [0] => Array + ( + [id] => 4 + [type] => document + [contentType] => text/html + [pagetitle] => Товар 1 + [longtitle] => + [description] => + [alias] => товар-1 + [alias_visible] => 1 + [link_attributes] => + [published] => 1 + [pub_date] => 0 + [unpub_date] => 0 + [parent] => 3 + [isfolder] => 0 + [introtext] => + [richtext] => 1 + [template] => 1 + [menuindex] => 0 + [searchable] => 1 + [cacheable] => 1 + [createdby] => 1 + [createdon] => 1699161918 + [editedby] => 0 + [editedon] => 0 + [deleted] => 0 + [deletedon] => 0 + [deletedby] => 0 + [publishedon] => 1699161918 + [publishedby] => 1 + [menutitle] => + [donthit] => 0 + [privateweb] => 0 + [privatemgr] => 0 + [content_dispo] => 0 + [hidemenu] => 0 + [class_key] => msProduct + [context_key] => web + [content_type] => 1 + [uri] => + [uri_override] => 0 + [hide_children_in_tree] => 0 + [show_in_tree] => 0 + [properties] => + [article] => + [price] => 500 + [old_price] => 0 + [weight] => 0 + [image] => + [thumb] => + [vendor] => 0 + [made_in] => + [new] => 0 + [popular] => 0 + [favorite] => 0 + [tags] => + [color] => + [size] => + [source] => 2 + [original_price] => 500.00 + [vendor.name] => + [vendor.resource] => + [vendor.country] => + [vendor.logo] => + [vendor.address] => + [vendor.phone] => + [vendor.fax] => + [vendor.email] => + [vendor.description] => + [vendor.properties] => + [vendor.rank] => + [product_id] => 4 + [order_id] => 1 + [name] => Товар 1 + [count] => 3 + [cost] => 1 500 + [options] => Array + ( + ) + + [order_product_id] => 1 + [discount_price] => 0 + [discount_cost] => 0 + ) + + [1] => Array + ( + [id] => 5 + [type] => document + [contentType] => text/html + [pagetitle] => Товар 2 + [longtitle] => + [description] => + [alias] => товар-1 + [alias_visible] => 1 + [link_attributes] => + [published] => 1 + [pub_date] => 0 + [unpub_date] => 0 + [parent] => 3 + [isfolder] => 0 + [introtext] => + [richtext] => 1 + [template] => 1 + [menuindex] => 0 + [searchable] => 1 + [cacheable] => 1 + [createdby] => 1 + [createdon] => 1699161930 + [editedby] => 1 + [editedon] => 1699161941 + [deleted] => 0 + [deletedon] => 0 + [deletedby] => 0 + [publishedon] => 1699161900 + [publishedby] => 1 + [menutitle] => + [donthit] => 0 + [privateweb] => 0 + [privatemgr] => 0 + [content_dispo] => 0 + [hidemenu] => 0 + [class_key] => msProduct + [context_key] => web + [content_type] => 1 + [uri] => + [uri_override] => 0 + [hide_children_in_tree] => 0 + [show_in_tree] => 0 + [properties] => + [article] => + [price] => 600 + [old_price] => 0 + [weight] => 0 + [image] => + [thumb] => + [vendor] => 0 + [made_in] => + [new] => 0 + [popular] => 1 + [favorite] => 0 + [tags] => + [color] => + [size] => + [source] => 2 + [original_price] => 600.00 + [vendor.name] => + [vendor.resource] => + [vendor.country] => + [vendor.logo] => + [vendor.address] => + [vendor.phone] => + [vendor.fax] => + [vendor.email] => + [vendor.description] => + [vendor.properties] => + [vendor.rank] => + [product_id] => 5 + [order_id] => 1 + [name] => Товар 2 + [count] => 1 + [cost] => 600 + [options] => Array + ( + ) + + [order_product_id] => 2 + [discount_price] => 0 + [discount_cost] => 0 + ) + + ) + + [user] => Array + ( + [id] => 2 + [internalKey] => 2 + [fullname] => Ivan Ivanov + [email] => ivanov@yandex.ru + [phone] => + [mobilephone] => + [blocked] => + [blockeduntil] => 0 + [blockedafter] => 0 + [logincount] => 0 + [lastlogin] => 0 + [thislogin] => 0 + [failedlogincount] => 0 + [sessionid] => + [dob] => 0 + [gender] => 0 + [address] => + [country] => + [city] => + [state] => + [zip] => + [fax] => + [photo] => + [comment] => + [website] => + [extended] => + [username] => ivanov@yandex.ru + [password] => password + [cachepwd] => + [class_key] => modUser + [active] => 1 + [remote_key] => + [remote_data] => + [hash_class] => hashing.modNative + [salt] => e4asd6as62119s6w8aad9a9f5ed174f57325 + [primary_group] => 0 + [session_stale] => + [sudo] => + [createdon] => 2023-11-05 08:31:47 + ) + + [address] => Array + ( + [id] => 1 + [order_id] => 1 + [user_id] => 2 + [createdon] => 2023-11-05 08:31:47 + [updatedon] => + [receiver] => Ivan Ivanov + [phone] => + [email] => ivanov@yandex.ru + [country] => + [index] => + [region] => + [city] => + [metro] => + [street] => + [building] => + [entrance] => + [floor] => + [room] => + [comment] => + [text_address] => + [properties] => + ) + + [delivery] => Array + ( + [id] => 1 + [name] => Самовывоз + [description] => + [price] => 0 + [weight_price] => 0 + [distance_price] => 0 + [logo] => + [rank] => 0 + [active] => 1 + [class] => + [properties] => + [requires] => email,receiver + [free_delivery_amount] => 0 + ) + + [payment] => Array + ( + [id] => 1 + [name] => Оплата наличными + [description] => + [price] => 0 + [logo] => + [rank] => 0 + [active] => 1 + [class] => + [properties] => + ) + + [total] => Array + ( + [cost] => 2 100 + [cart_cost] => 2 100 + [delivery_cost] => 0 + [weight] => 0 + [cart_weight] => 0 + [cart_count] => 4 + [cart_discount] => 0 + ) + + [scriptProperties] => Array + ( + [tpl] => + [includeTVs] => + [includeThumbs] => + [toPlaceholder] => + [showLog] => + ) + +) +``` + +::: ## Создание заказа diff --git a/docs/components/minishop2/snippets/msorder.md b/docs/components/minishop2/snippets/msorder.md index 90827de2..ffedd07f 100644 --- a/docs/components/minishop2/snippets/msorder.md +++ b/docs/components/minishop2/snippets/msorder.md @@ -45,7 +45,83 @@
[[!msOrder?tpl=``]]``` -[![](https://file.modx.pro/files/7/3/e/73ea6a3680166bb81a59b0dd55475614s.jpg)](https://file.modx.pro/files/7/3/e/73ea6a3680166bb81a59b0dd55475614.png) +::: details Пример + +```php +Array +( + [order] => Array + ( + [cost] => 2 300 + [cart_cost] => 2 300 + [delivery_cost] => 0 + [discount_cost] => 0 + ) + + [form] => Array + ( + [receiver] => Ivan Ivanov + [email] => ivanov@yandex.ru + ) + + [deliveries] => Array + ( + [1] => Array + ( + [id] => 1 + [name] => Самовывоз + [description] => + [price] => 0 + [weight_price] => 0.00 + [distance_price] => 0.00 + [logo] => + [rank] => 0 + [active] => 1 + [class] => + [properties] => + [requires] => email,receiver + [free_delivery_amount] => 0.00 + [payments] => Array + ( + [0] => 1 + ) + + ) + + ) + + [payments] => Array + ( + [1] => Array + ( + [id] => 1 + [name] => Оплата наличными + [description] => + [price] => 0 + [logo] => + [rank] => 0 + [active] => 1 + [class] => + [properties] => + ) + + ) + + [errors] => Array + ( + ) + + [scriptProperties] => Array + ( + [tpl] => + [userFields] => + [showLog] => + ) + +) +``` + +::: ## Создание заказа