From 52795535ae5a1a86363d38f22e72383c1e83820b Mon Sep 17 00:00:00 2001
From: jimagie
Date: Thu, 22 Oct 2026 23:22:27 +0500
Subject: [PATCH] Vinoteca: wine shop on 1C-Bitrix (module, template,
components, pages)
---
.access.php | 8 +
.bottom.menu.php | 9 +
.catalog.menu.php | 4 +
.catalog.menu_ext.php | 6 +
.personal.menu.php | 71 +
.section.php | 5 +
.top.menu.php | 8 +
404.php | 53 +
about/index.php | 4 +
articles/index.php | 32 +
brands/index.php | 54 +
catalog/.section.php | 2 +
catalog/index.php | 8 +
catalog/lang/en/index.php | 3 +
catalog/lang/pl/index.php | 3 +
catalog/lang/ru/index.php | 3 +
catalog/sidebar.php | 45 +
compare/index.php | 27 +
consent/index.php | 41 +
consent/lang/en/index.php | 16 +
consent/lang/pl/index.php | 16 +
consent/lang/ru/index.php | 16 +
forgot-password/index.php | 4 +
include/about.php | 14 +
include/about_title.php | 1 +
include/catalog_title.php | 1 +
include/company_about.php | 1 +
include/company_logo.php | 1 +
include/company_logo_mobile.php | 1 +
include/company_name.php | 1 +
include/copyright.php | 1 +
include/facebook_plugin.php | 9 +
include/home-story.php | 3 +
include/info.php | 51 +
include/personal.php | 1 +
include/reg_info.php | 7 +
include/schedule.php | 1 +
include/sender.php | 7 +
include/socnet_footer.php | 17 +
include/socnet_sidebar.php | 18 +
include/telephone.php | 1 +
include/twitter.php | 6 +
include/viewed_product.php | 38 +
index.php | 184 +
lang/en/404.php | 9 +
lang/en/index.php | 19 +
lang/pl/404.php | 9 +
lang/pl/index.php | 19 +
lang/ru/404.php | 9 +
lang/ru/index.php | 19 +
local/components/jinove/about/class.php | 87 +
.../components/jinove/about/lang/en/class.php | 4 +
.../components/jinove/about/lang/pl/class.php | 4 +
.../components/jinove/about/lang/ru/class.php | 4 +
.../templates/.default/lang/en/template.php | 36 +
.../templates/.default/lang/pl/template.php | 38 +
.../templates/.default/lang/ru/template.php | 38 +
.../jinove/about/templates/.default/script.js | 125 +
.../jinove/about/templates/.default/style.css | 390 ++
.../about/templates/.default/template.php | 120 +
local/components/jinove/auth.forgot/class.php | 30 +
.../jinove/auth.forgot/lang/en/class.php | 3 +
.../jinove/auth.forgot/lang/pl/class.php | 3 +
.../jinove/auth.forgot/lang/ru/class.php | 3 +
.../templates/.default/lang/en/template.php | 16 +
.../templates/.default/lang/pl/template.php | 16 +
.../templates/.default/lang/ru/template.php | 16 +
.../auth.forgot/templates/.default/script.js | 83 +
.../templates/.default/template.php | 40 +
local/components/jinove/auth.login/class.php | 44 +
.../jinove/auth.login/lang/en/class.php | 3 +
.../jinove/auth.login/lang/pl/class.php | 3 +
.../jinove/auth.login/lang/ru/class.php | 3 +
.../templates/.default/lang/en/template.php | 24 +
.../templates/.default/lang/pl/template.php | 24 +
.../templates/.default/lang/ru/template.php | 24 +
.../auth.login/templates/.default/script.js | 94 +
.../auth.login/templates/.default/style.css | 234 +
.../templates/.default/template.php | 59 +
.../components/jinove/auth.register/class.php | 37 +
.../jinove/auth.register/lang/en/class.php | 3 +
.../jinove/auth.register/lang/pl/class.php | 3 +
.../jinove/auth.register/lang/ru/class.php | 3 +
.../templates/.default/lang/en/template.php | 26 +
.../templates/.default/lang/pl/template.php | 26 +
.../templates/.default/lang/ru/template.php | 26 +
.../templates/.default/script.js | 89 +
.../templates/.default/template.php | 63 +
local/components/jinove/auth.reset/class.php | 42 +
.../jinove/auth.reset/lang/en/class.php | 3 +
.../jinove/auth.reset/lang/pl/class.php | 3 +
.../jinove/auth.reset/lang/ru/class.php | 3 +
.../templates/.default/lang/en/template.php | 18 +
.../templates/.default/lang/pl/template.php | 18 +
.../templates/.default/lang/ru/template.php | 18 +
.../auth.reset/templates/.default/script.js | 90 +
.../templates/.default/template.php | 56 +
local/components/jinove/cart/class.php | 42 +
.../components/jinove/cart/lang/en/class.php | 4 +
.../components/jinove/cart/lang/pl/class.php | 4 +
.../components/jinove/cart/lang/ru/class.php | 4 +
.../templates/.default/lang/en/template.php | 42 +
.../templates/.default/lang/pl/template.php | 42 +
.../templates/.default/lang/ru/template.php | 42 +
.../jinove/cart/templates/.default/script.js | 387 ++
.../jinove/cart/templates/.default/style.css | 659 +++
.../cart/templates/.default/template.php | 139 +
.../jinove/catalog.listing/.description.php | 10 +
.../jinove/catalog.listing/class.php | 220 +
.../jinove/catalog.listing/lang/en/class.php | 4 +
.../jinove/catalog.listing/lang/pl/class.php | 4 +
.../jinove/catalog.listing/lang/ru/class.php | 4 +
.../templates/.default/country.php | 18 +
.../templates/.default/lang/en/country.php | 2 +
.../templates/.default/lang/en/template.php | 9 +
.../templates/.default/lang/pl/country.php | 2 +
.../templates/.default/lang/pl/template.php | 9 +
.../templates/.default/lang/ru/country.php | 2 +
.../templates/.default/lang/ru/template.php | 9 +
.../templates/.default/template.php | 19 +
.../jinove/catalog.megamenu/.description.php | 11 +
.../jinove/catalog.megamenu/class.php | 40 +
.../templates/.default/lang/en/template.php | 12 +
.../templates/.default/lang/pl/template.php | 12 +
.../templates/.default/lang/ru/template.php | 12 +
.../templates/.default/script.js | 50 +
.../templates/.default/template.php | 41 +
local/components/jinove/order.done/class.php | 69 +
.../jinove/order.done/lang/en/class.php | 6 +
.../jinove/order.done/lang/pl/class.php | 6 +
.../jinove/order.done/lang/ru/class.php | 6 +
.../templates/.default/lang/en/template.php | 18 +
.../templates/.default/lang/pl/template.php | 18 +
.../templates/.default/lang/ru/template.php | 18 +
.../order.done/templates/.default/script.js | 69 +
.../order.done/templates/.default/style.css | 130 +
.../templates/.default/template.php | 54 +
local/components/jinove/order/class.php | 39 +
.../components/jinove/order/lang/en/class.php | 4 +
.../components/jinove/order/lang/pl/class.php | 4 +
.../components/jinove/order/lang/ru/class.php | 4 +
.../templates/.default/lang/en/template.php | 29 +
.../templates/.default/lang/pl/template.php | 29 +
.../templates/.default/lang/ru/template.php | 29 +
.../jinove/order/templates/.default/script.js | 118 +
.../jinove/order/templates/.default/style.css | 294 ++
.../order/templates/.default/template.php | 111 +
.../components/jinove/personal.nav/class.php | 31 +
.../templates/.default/lang/en/template.php | 7 +
.../templates/.default/lang/pl/template.php | 7 +
.../templates/.default/lang/ru/template.php | 7 +
.../personal.nav/templates/.default/script.js | 21 +
.../templates/.default/template.php | 18 +
.../jinove/personal.orders/class.php | 43 +
.../jinove/personal.orders/lang/en/class.php | 3 +
.../jinove/personal.orders/lang/pl/class.php | 3 +
.../jinove/personal.orders/lang/ru/class.php | 3 +
.../templates/.default/lang/en/template.php | 15 +
.../templates/.default/lang/pl/template.php | 15 +
.../templates/.default/lang/ru/template.php | 15 +
.../templates/.default/style.css | 91 +
.../templates/.default/template.php | 53 +
.../jinove/personal.profile/class.php | 37 +
.../jinove/personal.profile/lang/en/class.php | 3 +
.../jinove/personal.profile/lang/pl/class.php | 3 +
.../jinove/personal.profile/lang/ru/class.php | 3 +
.../templates/.default/lang/en/template.php | 31 +
.../templates/.default/lang/pl/template.php | 31 +
.../templates/.default/lang/ru/template.php | 31 +
.../templates/.default/script.js | 111 +
.../templates/.default/style.css | 171 +
.../templates/.default/template.php | 75 +
.../jinove/personal.reviews/class.php | 35 +
.../jinove/personal.reviews/lang/en/class.php | 3 +
.../jinove/personal.reviews/lang/pl/class.php | 3 +
.../jinove/personal.reviews/lang/ru/class.php | 3 +
.../templates/.default/lang/en/template.php | 8 +
.../templates/.default/lang/pl/template.php | 8 +
.../templates/.default/lang/ru/template.php | 8 +
.../templates/.default/style.css | 16 +
.../templates/.default/template.php | 46 +
local/modules/jinove.vinoteca/.settings.php | 54 +
local/modules/jinove.vinoteca/include.php | 12 +
.../modules/jinove.vinoteca/install/index.php | 69 +
.../jinove.vinoteca/install/version.php | 6 +
.../jinove.vinoteca/lang/en/install/index.php | 5 +
.../lang/en/lib/breadcrumbs.php | 2 +
.../jinove.vinoteca/lang/en/lib/cart.php | 5 +
.../lang/en/lib/catalog/comparison.php | 17 +
.../lang/en/lib/catalog/enumnames.php | 96 +
.../lang/en/lib/catalog/favorites.php | 7 +
.../jinove.vinoteca/lang/en/lib/checkout.php | 9 +
.../lang/en/lib/dateformat.php | 15 +
.../jinove.vinoteca/lang/en/lib/news.php | 6 +
.../jinove.vinoteca/lang/en/lib/offers.php | 6 +
.../jinove.vinoteca/lang/en/lib/search.php | 10 +
.../lang/pl/lib/breadcrumbs.php | 2 +
.../jinove.vinoteca/lang/pl/lib/cart.php | 7 +
.../lang/pl/lib/catalog/comparison.php | 17 +
.../lang/pl/lib/catalog/enumnames.php | 96 +
.../lang/pl/lib/catalog/favorites.php | 7 +
.../jinove.vinoteca/lang/pl/lib/checkout.php | 9 +
.../lang/pl/lib/dateformat.php | 15 +
.../jinove.vinoteca/lang/pl/lib/news.php | 6 +
.../jinove.vinoteca/lang/pl/lib/offers.php | 6 +
.../jinove.vinoteca/lang/pl/lib/search.php | 10 +
.../jinove.vinoteca/lang/ru/install/index.php | 5 +
.../lang/ru/lib/breadcrumbs.php | 2 +
.../jinove.vinoteca/lang/ru/lib/cart.php | 7 +
.../lang/ru/lib/catalog/comparison.php | 17 +
.../lang/ru/lib/catalog/enumnames.php | 96 +
.../lang/ru/lib/catalog/favorites.php | 7 +
.../jinove.vinoteca/lang/ru/lib/checkout.php | 9 +
.../lang/ru/lib/dateformat.php | 15 +
.../jinove.vinoteca/lang/ru/lib/news.php | 6 +
.../jinove.vinoteca/lang/ru/lib/offers.php | 6 +
.../jinove.vinoteca/lang/ru/lib/search.php | 10 +
local/modules/jinove.vinoteca/lib/account.php | 29 +
local/modules/jinove.vinoteca/lib/altcha.php | 85 +
.../jinove.vinoteca/lib/articleschema.php | 81 +
.../jinove.vinoteca/lib/breadcrumbs.php | 53 +
local/modules/jinove.vinoteca/lib/cached.php | 37 +
local/modules/jinove.vinoteca/lib/cart.php | 273 +
.../lib/catalog/brandschema.php | 143 +
.../lib/catalog/comparison.php | 240 +
.../jinove.vinoteca/lib/catalog/countries.php | 33 +
.../jinove.vinoteca/lib/catalog/enumnames.php | 35 +
.../jinove.vinoteca/lib/catalog/favorite.php | 95 +
.../jinove.vinoteca/lib/catalog/favorites.php | 88 +
.../jinove.vinoteca/lib/catalog/listing.php | 186 +
.../lib/catalog/localizedtext.php | 79 +
.../jinove.vinoteca/lib/catalog/media.php | 32 +
.../jinove.vinoteca/lib/catalog/megamenu.php | 130 +
.../jinove.vinoteca/lib/catalog/photosort.php | 44 +
.../lib/catalog/pricepresets.php | 65 +
.../lib/catalog/pricerange.php | 48 +
.../jinove.vinoteca/lib/catalog/prices.php | 35 +
.../jinove.vinoteca/lib/catalog/related.php | 110 +
.../lib/catalog/reviewstats.php | 150 +
.../lib/catalog/searchmeta.php | 105 +
.../jinove.vinoteca/lib/catalog/sections.php | 89 +
.../lib/catalog/wineschema.php | 151 +
.../jinove.vinoteca/lib/catalog/winestats.php | 75 +
.../modules/jinove.vinoteca/lib/checkout.php | 351 ++
local/modules/jinove.vinoteca/lib/config.php | 53 +
local/modules/jinove.vinoteca/lib/consent.php | 18 +
.../jinove.vinoteca/lib/controller/auth.php | 82 +
.../jinove.vinoteca/lib/controller/basket.php | 168 +
.../lib/controller/catalog.php | 94 +
.../lib/controller/compare.php | 118 +
.../lib/controller/favorite.php | 94 +
.../lib/controller/filter/formguard.php | 66 +
.../jinove.vinoteca/lib/controller/lead.php | 208 +
.../jinove.vinoteca/lib/controller/news.php | 42 +
.../jinove.vinoteca/lib/controller/order.php | 97 +
.../lib/controller/password.php | 125 +
.../lib/controller/profile.php | 152 +
.../lib/controller/register.php | 124 +
.../jinove.vinoteca/lib/controller/review.php | 130 +
.../jinove.vinoteca/lib/controller/state.php | 29 +
.../jinove.vinoteca/lib/dateformat.php | 19 +
.../modules/jinove.vinoteca/lib/language.php | 21 +
local/modules/jinove.vinoteca/lib/money.php | 19 +
.../jinove.vinoteca/lib/navigation.php | 34 +
local/modules/jinove.vinoteca/lib/news.php | 162 +
local/modules/jinove.vinoteca/lib/offers.php | 339 ++
.../jinove.vinoteca/lib/offerschema.php | 89 +
local/modules/jinove.vinoteca/lib/origin.php | 17 +
.../jinove.vinoteca/lib/pageschema.php | 70 +
.../jinove.vinoteca/lib/personal/orders.php | 73 +
.../jinove.vinoteca/lib/personal/reviews.php | 51 +
local/modules/jinove.vinoteca/lib/phone.php | 21 +
.../modules/jinove.vinoteca/lib/redirect.php | 46 +
.../modules/jinove.vinoteca/lib/retention.php | 38 +
local/modules/jinove.vinoteca/lib/routing.php | 36 +
local/modules/jinove.vinoteca/lib/search.php | 320 ++
local/modules/jinove.vinoteca/lib/seo.php | 122 +
local/modules/jinove.vinoteca/lib/sitemap.php | 164 +
.../jinove.vinoteca/lib/storeschema.php | 61 +
.../jinove_halyk/.description.php | 45 +
.../sale_payment/jinove_halyk/handler.php | 186 +
.../jinove_halyk/lang/en/.description.php | 8 +
.../jinove_halyk/lang/pl/.description.php | 8 +
.../jinove_halyk/lang/ru/.description.php | 8 +
.../jinove_paypal/.description.php | 53 +
.../sale_payment/jinove_paypal/handler.php | 229 +
.../jinove_paypal/lang/en/.description.php | 10 +
.../jinove_paypal/lang/pl/.description.php | 10 +
.../jinove_paypal/lang/ru/.description.php | 10 +
local/php_interface/init.php | 21 +
local/templates/jinove_wine/.description.php | 8 +
.../assets/brand/vinoteca-icon-512.png | Bin 0 -> 31884 bytes
.../assets/brand/vinoteca-icon.svg | 13 +
.../jinove_wine/assets/fonts/f0.woff2 | Bin 0 -> 14540 bytes
.../jinove_wine/assets/fonts/f1.woff2 | Bin 0 -> 25904 bytes
.../jinove_wine/assets/fonts/f10.woff2 | Bin 0 -> 8520 bytes
.../jinove_wine/assets/fonts/f11.woff2 | Bin 0 -> 15120 bytes
.../jinove_wine/assets/fonts/f12.woff2 | Bin 0 -> 2552 bytes
.../jinove_wine/assets/fonts/f2.woff2 | Bin 0 -> 33736 bytes
.../jinove_wine/assets/fonts/f3.woff2 | Bin 0 -> 23416 bytes
.../jinove_wine/assets/fonts/f4.woff2 | Bin 0 -> 11220 bytes
.../jinove_wine/assets/fonts/f5.woff2 | Bin 0 -> 37640 bytes
.../jinove_wine/assets/fonts/f6.woff2 | Bin 0 -> 21168 bytes
.../jinove_wine/assets/fonts/f7.woff2 | Bin 0 -> 14500 bytes
.../jinove_wine/assets/fonts/f8.woff2 | Bin 0 -> 9444 bytes
.../jinove_wine/assets/fonts/f9.woff2 | Bin 0 -> 24836 bytes
.../jinove_wine/assets/js/vino-altcha.js | 46 +
.../jinove_wine/assets/js/vino-busy.js | 34 +
.../jinove_wine/assets/js/vino-cart.js | 97 +
.../jinove_wine/assets/js/vino-compare.js | 103 +
.../jinove_wine/assets/js/vino-fav.js | 63 +
.../jinove_wine/assets/js/vino-favorites.js | 33 +
.../jinove_wine/assets/js/vino-gate.js | 104 +
.../jinove_wine/assets/js/vino-header.js | 107 +
.../jinove_wine/assets/js/vino-password.js | 37 +
.../jinove_wine/assets/js/vino-phone.js | 165 +
.../jinove_wine/assets/js/vino-reveal-init.js | 3 +
.../jinove_wine/assets/js/vino-reveal.js | 28 +
.../jinove_wine/assets/js/vino-review.js | 139 +
.../jinove_wine/assets/js/vino-shots.js | 36 +
.../jinove_wine/assets/js/vino-slider.js | 86 +
.../jinove_wine/assets/js/vino-sommelier.js | 118 +
.../jinove_wine/assets/js/vino-state.js | 20 +
.../jinove_wine/assets/js/vino-subscribe.js | 86 +
.../jinove_wine/assets/map/vinoteca-dark.json | 1 +
.../jinove_wine/assets/media/bottle-stub.svg | 1 +
.../templates/jinove_wine/catalog-styles.css | 1418 +++++
.../breadcrumb/vinoteca/lang/en/template.php | 2 +
.../breadcrumb/vinoteca/lang/pl/template.php | 2 +
.../breadcrumb/vinoteca/lang/ru/template.php | 2 +
.../bitrix/breadcrumb/vinoteca/template.php | 28 +
.../vinoteca/lang/en/template.php | 6 +
.../vinoteca/lang/pl/template.php | 6 +
.../vinoteca/lang/ru/template.php | 6 +
.../vinoteca/result_modifier.php | 6 +
.../catalog.compare.result/vinoteca/script.js | 68 +
.../catalog.compare.result/vinoteca/style.css | 203 +
.../vinoteca/template.php | 50 +
.../catalog.compare.result/vinoteca/tools.php | 12 +
.../.default/component_epilog.php | 15 +
.../.default/lang/en/template.php | 63 +
.../.default/lang/pl/template.php | 63 +
.../.default/lang/ru/template.php | 63 +
.../.default/result_modifier.php | 208 +
.../bitrix/catalog.element/.default/script.js | 95 +
.../catalog.element/.default/template.php | 91 +
.../catalog.item/vinoteca/card/template.php | 24 +
.../vinoteca/lang/en/card/template.php | 1 +
.../vinoteca/lang/en/line/template.php | 3 +
.../vinoteca/lang/en/parts/buy.php | 5 +
.../vinoteca/lang/en/parts/rating.php | 2 +
.../vinoteca/lang/en/parts/tools.php | 3 +
.../vinoteca/lang/en/result_modifier.php | 2 +
.../vinoteca/lang/pl/card/template.php | 1 +
.../vinoteca/lang/pl/line/template.php | 3 +
.../vinoteca/lang/pl/parts/buy.php | 5 +
.../vinoteca/lang/pl/parts/rating.php | 2 +
.../vinoteca/lang/pl/parts/tools.php | 3 +
.../vinoteca/lang/pl/result_modifier.php | 2 +
.../vinoteca/lang/ru/card/template.php | 1 +
.../vinoteca/lang/ru/line/template.php | 3 +
.../vinoteca/lang/ru/parts/buy.php | 5 +
.../vinoteca/lang/ru/parts/rating.php | 2 +
.../vinoteca/lang/ru/parts/tools.php | 3 +
.../vinoteca/lang/ru/result_modifier.php | 2 +
.../catalog.item/vinoteca/line/template.php | 25 +
.../catalog.item/vinoteca/parts/buy.php | 22 +
.../catalog.item/vinoteca/parts/rating.php | 10 +
.../catalog.item/vinoteca/parts/tools.php | 13 +
.../catalog.item/vinoteca/result_modifier.php | 86 +
.../bitrix/catalog.item/vinoteca/template.php | 10 +
.../vinoteca-tiles/lang/en/template.php | 3 +
.../vinoteca-tiles/lang/pl/template.php | 4 +
.../vinoteca-tiles/lang/ru/template.php | 4 +
.../vinoteca-tiles/result_modifier.php | 21 +
.../vinoteca-tiles/template.php | 31 +
.../vinoteca/component_epilog.php | 23 +
.../vinoteca/lang/en/template.php | 17 +
.../vinoteca/lang/pl/template.php | 18 +
.../vinoteca/lang/ru/template.php | 18 +
.../vinoteca/result_modifier.php | 15 +
.../catalog.section/vinoteca/template.php | 91 +
.../.default/lang/en/template.php | 18 +
.../.default/lang/pl/template.php | 18 +
.../.default/lang/ru/template.php | 18 +
.../catalog.smart.filter/.default/script.js | 18 +
.../.default/template.php | 94 +
.../catalog.top/vinoteca-row/template.php | 15 +
.../bitrix/catalog/vinoteca/country.php | 6 +
.../bitrix/catalog/vinoteca/element.php | 129 +
.../catalog/vinoteca/lang/en/element.php | 5 +
.../catalog/vinoteca/lang/en/section.php | 2 +
.../catalog/vinoteca/lang/en/sections.php | 8 +
.../catalog/vinoteca/lang/pl/element.php | 5 +
.../catalog/vinoteca/lang/pl/section.php | 2 +
.../catalog/vinoteca/lang/pl/sections.php | 8 +
.../catalog/vinoteca/lang/ru/element.php | 5 +
.../catalog/vinoteca/lang/ru/section.php | 2 +
.../catalog/vinoteca/lang/ru/sections.php | 8 +
.../bitrix/catalog/vinoteca/script.js | 337 ++
.../bitrix/catalog/vinoteca/section.php | 64 +
.../bitrix/catalog/vinoteca/sections.php | 64 +
.../bitrix/menu/vinoteca_footer/template.php | 11 +
.../menu/vinoteca_top/lang/en/template.php | 8 +
.../menu/vinoteca_top/lang/pl/template.php | 8 +
.../menu/vinoteca_top/lang/ru/template.php | 8 +
.../bitrix/menu/vinoteca_top/template.php | 25 +
.../news.list/vhero/component_epilog.php | 9 +
.../news.list/vhero/lang/en/template.php | 3 +
.../news.list/vhero/lang/pl/template.php | 3 +
.../news.list/vhero/lang/ru/template.php | 3 +
.../news.list/vhero/result_modifier.php | 18 +
.../bitrix/news.list/vhero/script.js | 23 +
.../bitrix/news.list/vhero/template.php | 36 +
.../vinoteca-brands/lang/en/template.php | 4 +
.../vinoteca-brands/lang/pl/template.php | 4 +
.../vinoteca-brands/lang/ru/template.php | 4 +
.../vinoteca-brands/result_modifier.php | 12 +
.../news.list/vinoteca-brands/template.php | 49 +
.../vinoteca-news-list/result_modifier.php | 17 +
.../news.list/vinoteca-news-list/script.js | 66 +
.../news.list/vinoteca-news-list/style.css | 24 +
.../news.list/vinoteca-news-list/template.php | 26 +
.../vinoteca-news/result_modifier.php | 8 +
.../news.list/vinoteca-news/template.php | 19 +
.../vinoteca-offers/lang/en/template.php | 2 +
.../vinoteca-offers/lang/pl/template.php | 2 +
.../vinoteca-offers/lang/ru/template.php | 2 +
.../vinoteca-offers/result_modifier.php | 21 +
.../news.list/vinoteca-offers/style.css | 130 +
.../news.list/vinoteca-offers/template.php | 39 +
.../vinoteca-reviews/lang/en/template.php | 27 +
.../vinoteca-reviews/lang/pl/template.php | 28 +
.../vinoteca-reviews/lang/ru/template.php | 28 +
.../vinoteca-reviews/result_modifier.php | 23 +
.../news.list/vinoteca-reviews/template.php | 105 +
.../news.detail/.default/component_epilog.php | 11 +
.../news.detail/.default/lang/en/template.php | 8 +
.../news.detail/.default/lang/pl/template.php | 8 +
.../news.detail/.default/lang/ru/template.php | 8 +
.../news.detail/.default/result_modifier.php | 51 +
.../bitrix/news.detail/.default/template.php | 37 +
.../news.list/.default/lang/en/template.php | 7 +
.../news.list/.default/lang/pl/template.php | 7 +
.../news.list/.default/lang/ru/template.php | 7 +
.../news.list/.default/result_modifier.php | 32 +
.../bitrix/news.list/.default/script.js | 82 +
.../bitrix/news.list/.default/style.css | 76 +
.../bitrix/news.list/.default/template.php | 46 +
.../bitrix/news/vinoteca-brands/detail.php | 87 +
.../news/vinoteca-brands/lang/en/detail.php | 7 +
.../news/vinoteca-brands/lang/en/news.php | 5 +
.../news/vinoteca-brands/lang/pl/detail.php | 7 +
.../news/vinoteca-brands/lang/pl/news.php | 5 +
.../news/vinoteca-brands/lang/ru/detail.php | 7 +
.../news/vinoteca-brands/lang/ru/news.php | 5 +
.../bitrix/news/vinoteca-brands/news.php | 46 +
.../news.detail/.default/component_epilog.php | 17 +
.../news.detail/.default/result_modifier.php | 26 +
.../bitrix/news.detail/.default/style.css | 99 +
.../bitrix/news.detail/.default/template.php | 24 +
.../bitrix/news/vinoteca-news/detail.php | 57 +
.../news/vinoteca-news/lang/en/detail.php | 4 +
.../news/vinoteca-news/lang/en/news.php | 3 +
.../news/vinoteca-news/lang/pl/detail.php | 4 +
.../news/vinoteca-news/lang/pl/news.php | 3 +
.../news/vinoteca-news/lang/ru/detail.php | 4 +
.../news/vinoteca-news/lang/ru/news.php | 3 +
.../bitrix/news/vinoteca-news/news.php | 39 +
.../bitrix/news/vinoteca-news/style.css | 9 +
.../news.detail/.default/component_epilog.php | 16 +
.../news.detail/.default/lang/en/template.php | 6 +
.../news.detail/.default/lang/pl/template.php | 6 +
.../news.detail/.default/lang/ru/template.php | 6 +
.../news.detail/.default/result_modifier.php | 24 +
.../bitrix/news.detail/.default/script.js | 36 +
.../bitrix/news.detail/.default/style.css | 133 +
.../bitrix/news.detail/.default/template.php | 42 +
.../bitrix/news/vinoteca-offers/detail.php | 60 +
.../news/vinoteca-offers/lang/en/detail.php | 4 +
.../news/vinoteca-offers/lang/en/news.php | 6 +
.../news/vinoteca-offers/lang/pl/detail.php | 4 +
.../news/vinoteca-offers/lang/pl/news.php | 6 +
.../news/vinoteca-offers/lang/ru/detail.php | 4 +
.../news/vinoteca-offers/lang/ru/news.php | 6 +
.../bitrix/news/vinoteca-offers/news.php | 31 +
.../bitrix/news/vinoteca-offers/style.css | 22 +
.../search.page/.default/lang/en/template.php | 11 +
.../search.page/.default/lang/pl/template.php | 12 +
.../search.page/.default/lang/ru/template.php | 12 +
.../search.page/.default/result_modifier.php | 12 +
.../bitrix/search.page/.default/style.css | 111 +
.../bitrix/search.page/.default/template.php | 54 +
.../bitrix/search.title/vinoteca/ajax.php | 10 +
.../vinoteca/lang/en/template.php | 12 +
.../vinoteca/lang/pl/template.php | 12 +
.../vinoteca/lang/ru/template.php | 12 +
.../search.title/vinoteca/result_modifier.php | 8 +
.../bitrix/search.title/vinoteca/script.js | 161 +
.../bitrix/search.title/vinoteca/template.php | 31 +
.../vinoteca/lang/en/template.php | 5 +
.../vinoteca/lang/pl/template.php | 5 +
.../vinoteca/lang/ru/template.php | 5 +
.../system.pagenavigation/vinoteca/style.css | 73 +
.../vinoteca/template.php | 52 +
local/templates/jinove_wine/footer.php | 185 +
local/templates/jinove_wine/header.php | 91 +
.../templates/jinove_wine/lang/en/footer.php | 62 +
.../templates/jinove_wine/lang/en/header.php | 10 +
.../templates/jinove_wine/lang/pl/footer.php | 62 +
.../templates/jinove_wine/lang/pl/header.php | 10 +
.../templates/jinove_wine/lang/ru/footer.php | 62 +
.../templates/jinove_wine/lang/ru/header.php | 10 +
local/templates/jinove_wine/legal-styles.css | 69 +
.../templates/jinove_wine/template_styles.css | 4542 +++++++++++++++++
login/index.php | 4 +
offers/index.php | 33 +
personal/cart/index.php | 4 +
personal/favorites/index.php | 32 +
personal/index.php | 4 +
personal/order/done/index.php | 4 +
personal/order/index.php | 4 +
personal/orders/index.php | 4 +
personal/reviews/index.php | 4 +
pl/.bottom.menu.php | 9 +
pl/.catalog.menu.php | 4 +
pl/.catalog.menu_ext.php | 2 +
pl/.section.php | 5 +
pl/.top.menu.php | 8 +
pl/about/index.php | 2 +
pl/articles/index.php | 2 +
pl/brands/index.php | 2 +
pl/catalog/index.php | 2 +
pl/compare/index.php | 2 +
pl/consent/index.php | 2 +
pl/forgot-password/index.php | 2 +
pl/include/home-story.php | 3 +
pl/index.php | 2 +
pl/login/index.php | 2 +
pl/offers/index.php | 2 +
pl/personal/cart/index.php | 2 +
pl/personal/favorites/index.php | 2 +
pl/personal/index.php | 2 +
pl/personal/order/done/index.php | 2 +
pl/personal/order/index.php | 2 +
pl/personal/orders/index.php | 2 +
pl/personal/reviews/index.php | 2 +
pl/privacy/index.php | 2 +
pl/register/index.php | 2 +
pl/reset-password/index.php | 2 +
pl/search/index.php | 2 +
privacy/index.php | 61 +
privacy/lang/en/index.php | 45 +
privacy/lang/pl/index.php | 45 +
privacy/lang/ru/index.php | 45 +
register/index.php | 4 +
reset-password/index.php | 4 +
ru/.bottom.menu.php | 9 +
ru/.catalog.menu.php | 4 +
ru/.catalog.menu_ext.php | 2 +
ru/.section.php | 5 +
ru/.top.menu.php | 8 +
ru/about/index.php | 2 +
ru/articles/index.php | 2 +
ru/brands/index.php | 2 +
ru/catalog/index.php | 2 +
ru/compare/index.php | 2 +
ru/consent/index.php | 2 +
ru/forgot-password/index.php | 2 +
ru/include/home-story.php | 3 +
ru/index.php | 2 +
ru/login/index.php | 2 +
ru/offers/index.php | 2 +
ru/personal/cart/index.php | 2 +
ru/personal/favorites/index.php | 2 +
ru/personal/index.php | 2 +
ru/personal/order/done/index.php | 2 +
ru/personal/order/index.php | 2 +
ru/personal/orders/index.php | 2 +
ru/personal/reviews/index.php | 2 +
ru/privacy/index.php | 2 +
ru/register/index.php | 2 +
ru/reset-password/index.php | 2 +
ru/search/index.php | 2 +
search/index.php | 5 +
urlrewrite.php | 123 +
586 files changed, 27619 insertions(+)
create mode 100644 .access.php
create mode 100644 .bottom.menu.php
create mode 100644 .catalog.menu.php
create mode 100644 .catalog.menu_ext.php
create mode 100644 .personal.menu.php
create mode 100644 .section.php
create mode 100644 .top.menu.php
create mode 100644 404.php
create mode 100644 about/index.php
create mode 100644 articles/index.php
create mode 100644 brands/index.php
create mode 100644 catalog/.section.php
create mode 100644 catalog/index.php
create mode 100644 catalog/lang/en/index.php
create mode 100644 catalog/lang/pl/index.php
create mode 100644 catalog/lang/ru/index.php
create mode 100644 catalog/sidebar.php
create mode 100644 compare/index.php
create mode 100644 consent/index.php
create mode 100644 consent/lang/en/index.php
create mode 100644 consent/lang/pl/index.php
create mode 100644 consent/lang/ru/index.php
create mode 100644 forgot-password/index.php
create mode 100644 include/about.php
create mode 100644 include/about_title.php
create mode 100644 include/catalog_title.php
create mode 100644 include/company_about.php
create mode 100644 include/company_logo.php
create mode 100644 include/company_logo_mobile.php
create mode 100644 include/company_name.php
create mode 100644 include/copyright.php
create mode 100644 include/facebook_plugin.php
create mode 100644 include/home-story.php
create mode 100644 include/info.php
create mode 100644 include/personal.php
create mode 100644 include/reg_info.php
create mode 100644 include/schedule.php
create mode 100644 include/sender.php
create mode 100644 include/socnet_footer.php
create mode 100644 include/socnet_sidebar.php
create mode 100644 include/telephone.php
create mode 100644 include/twitter.php
create mode 100644 include/viewed_product.php
create mode 100644 index.php
create mode 100644 lang/en/404.php
create mode 100644 lang/en/index.php
create mode 100644 lang/pl/404.php
create mode 100644 lang/pl/index.php
create mode 100644 lang/ru/404.php
create mode 100644 lang/ru/index.php
create mode 100644 local/components/jinove/about/class.php
create mode 100644 local/components/jinove/about/lang/en/class.php
create mode 100644 local/components/jinove/about/lang/pl/class.php
create mode 100644 local/components/jinove/about/lang/ru/class.php
create mode 100644 local/components/jinove/about/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/about/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/about/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/about/templates/.default/script.js
create mode 100644 local/components/jinove/about/templates/.default/style.css
create mode 100644 local/components/jinove/about/templates/.default/template.php
create mode 100644 local/components/jinove/auth.forgot/class.php
create mode 100644 local/components/jinove/auth.forgot/lang/en/class.php
create mode 100644 local/components/jinove/auth.forgot/lang/pl/class.php
create mode 100644 local/components/jinove/auth.forgot/lang/ru/class.php
create mode 100644 local/components/jinove/auth.forgot/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/auth.forgot/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/auth.forgot/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/auth.forgot/templates/.default/script.js
create mode 100644 local/components/jinove/auth.forgot/templates/.default/template.php
create mode 100644 local/components/jinove/auth.login/class.php
create mode 100644 local/components/jinove/auth.login/lang/en/class.php
create mode 100644 local/components/jinove/auth.login/lang/pl/class.php
create mode 100644 local/components/jinove/auth.login/lang/ru/class.php
create mode 100644 local/components/jinove/auth.login/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/auth.login/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/auth.login/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/auth.login/templates/.default/script.js
create mode 100644 local/components/jinove/auth.login/templates/.default/style.css
create mode 100644 local/components/jinove/auth.login/templates/.default/template.php
create mode 100644 local/components/jinove/auth.register/class.php
create mode 100644 local/components/jinove/auth.register/lang/en/class.php
create mode 100644 local/components/jinove/auth.register/lang/pl/class.php
create mode 100644 local/components/jinove/auth.register/lang/ru/class.php
create mode 100644 local/components/jinove/auth.register/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/auth.register/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/auth.register/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/auth.register/templates/.default/script.js
create mode 100644 local/components/jinove/auth.register/templates/.default/template.php
create mode 100644 local/components/jinove/auth.reset/class.php
create mode 100644 local/components/jinove/auth.reset/lang/en/class.php
create mode 100644 local/components/jinove/auth.reset/lang/pl/class.php
create mode 100644 local/components/jinove/auth.reset/lang/ru/class.php
create mode 100644 local/components/jinove/auth.reset/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/auth.reset/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/auth.reset/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/auth.reset/templates/.default/script.js
create mode 100644 local/components/jinove/auth.reset/templates/.default/template.php
create mode 100644 local/components/jinove/cart/class.php
create mode 100644 local/components/jinove/cart/lang/en/class.php
create mode 100644 local/components/jinove/cart/lang/pl/class.php
create mode 100644 local/components/jinove/cart/lang/ru/class.php
create mode 100644 local/components/jinove/cart/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/cart/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/cart/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/cart/templates/.default/script.js
create mode 100644 local/components/jinove/cart/templates/.default/style.css
create mode 100644 local/components/jinove/cart/templates/.default/template.php
create mode 100644 local/components/jinove/catalog.listing/.description.php
create mode 100644 local/components/jinove/catalog.listing/class.php
create mode 100644 local/components/jinove/catalog.listing/lang/en/class.php
create mode 100644 local/components/jinove/catalog.listing/lang/pl/class.php
create mode 100644 local/components/jinove/catalog.listing/lang/ru/class.php
create mode 100644 local/components/jinove/catalog.listing/templates/.default/country.php
create mode 100644 local/components/jinove/catalog.listing/templates/.default/lang/en/country.php
create mode 100644 local/components/jinove/catalog.listing/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/catalog.listing/templates/.default/lang/pl/country.php
create mode 100644 local/components/jinove/catalog.listing/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/catalog.listing/templates/.default/lang/ru/country.php
create mode 100644 local/components/jinove/catalog.listing/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/catalog.listing/templates/.default/template.php
create mode 100644 local/components/jinove/catalog.megamenu/.description.php
create mode 100644 local/components/jinove/catalog.megamenu/class.php
create mode 100644 local/components/jinove/catalog.megamenu/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/catalog.megamenu/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/catalog.megamenu/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/catalog.megamenu/templates/.default/script.js
create mode 100644 local/components/jinove/catalog.megamenu/templates/.default/template.php
create mode 100644 local/components/jinove/order.done/class.php
create mode 100644 local/components/jinove/order.done/lang/en/class.php
create mode 100644 local/components/jinove/order.done/lang/pl/class.php
create mode 100644 local/components/jinove/order.done/lang/ru/class.php
create mode 100644 local/components/jinove/order.done/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/order.done/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/order.done/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/order.done/templates/.default/script.js
create mode 100644 local/components/jinove/order.done/templates/.default/style.css
create mode 100644 local/components/jinove/order.done/templates/.default/template.php
create mode 100644 local/components/jinove/order/class.php
create mode 100644 local/components/jinove/order/lang/en/class.php
create mode 100644 local/components/jinove/order/lang/pl/class.php
create mode 100644 local/components/jinove/order/lang/ru/class.php
create mode 100644 local/components/jinove/order/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/order/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/order/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/order/templates/.default/script.js
create mode 100644 local/components/jinove/order/templates/.default/style.css
create mode 100644 local/components/jinove/order/templates/.default/template.php
create mode 100644 local/components/jinove/personal.nav/class.php
create mode 100644 local/components/jinove/personal.nav/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/personal.nav/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/personal.nav/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/personal.nav/templates/.default/script.js
create mode 100644 local/components/jinove/personal.nav/templates/.default/template.php
create mode 100644 local/components/jinove/personal.orders/class.php
create mode 100644 local/components/jinove/personal.orders/lang/en/class.php
create mode 100644 local/components/jinove/personal.orders/lang/pl/class.php
create mode 100644 local/components/jinove/personal.orders/lang/ru/class.php
create mode 100644 local/components/jinove/personal.orders/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/personal.orders/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/personal.orders/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/personal.orders/templates/.default/style.css
create mode 100644 local/components/jinove/personal.orders/templates/.default/template.php
create mode 100644 local/components/jinove/personal.profile/class.php
create mode 100644 local/components/jinove/personal.profile/lang/en/class.php
create mode 100644 local/components/jinove/personal.profile/lang/pl/class.php
create mode 100644 local/components/jinove/personal.profile/lang/ru/class.php
create mode 100644 local/components/jinove/personal.profile/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/personal.profile/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/personal.profile/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/personal.profile/templates/.default/script.js
create mode 100644 local/components/jinove/personal.profile/templates/.default/style.css
create mode 100644 local/components/jinove/personal.profile/templates/.default/template.php
create mode 100644 local/components/jinove/personal.reviews/class.php
create mode 100644 local/components/jinove/personal.reviews/lang/en/class.php
create mode 100644 local/components/jinove/personal.reviews/lang/pl/class.php
create mode 100644 local/components/jinove/personal.reviews/lang/ru/class.php
create mode 100644 local/components/jinove/personal.reviews/templates/.default/lang/en/template.php
create mode 100644 local/components/jinove/personal.reviews/templates/.default/lang/pl/template.php
create mode 100644 local/components/jinove/personal.reviews/templates/.default/lang/ru/template.php
create mode 100644 local/components/jinove/personal.reviews/templates/.default/style.css
create mode 100644 local/components/jinove/personal.reviews/templates/.default/template.php
create mode 100644 local/modules/jinove.vinoteca/.settings.php
create mode 100644 local/modules/jinove.vinoteca/include.php
create mode 100644 local/modules/jinove.vinoteca/install/index.php
create mode 100644 local/modules/jinove.vinoteca/install/version.php
create mode 100644 local/modules/jinove.vinoteca/lang/en/install/index.php
create mode 100644 local/modules/jinove.vinoteca/lang/en/lib/breadcrumbs.php
create mode 100644 local/modules/jinove.vinoteca/lang/en/lib/cart.php
create mode 100644 local/modules/jinove.vinoteca/lang/en/lib/catalog/comparison.php
create mode 100644 local/modules/jinove.vinoteca/lang/en/lib/catalog/enumnames.php
create mode 100644 local/modules/jinove.vinoteca/lang/en/lib/catalog/favorites.php
create mode 100644 local/modules/jinove.vinoteca/lang/en/lib/checkout.php
create mode 100644 local/modules/jinove.vinoteca/lang/en/lib/dateformat.php
create mode 100644 local/modules/jinove.vinoteca/lang/en/lib/news.php
create mode 100644 local/modules/jinove.vinoteca/lang/en/lib/offers.php
create mode 100644 local/modules/jinove.vinoteca/lang/en/lib/search.php
create mode 100644 local/modules/jinove.vinoteca/lang/pl/lib/breadcrumbs.php
create mode 100644 local/modules/jinove.vinoteca/lang/pl/lib/cart.php
create mode 100644 local/modules/jinove.vinoteca/lang/pl/lib/catalog/comparison.php
create mode 100644 local/modules/jinove.vinoteca/lang/pl/lib/catalog/enumnames.php
create mode 100644 local/modules/jinove.vinoteca/lang/pl/lib/catalog/favorites.php
create mode 100644 local/modules/jinove.vinoteca/lang/pl/lib/checkout.php
create mode 100644 local/modules/jinove.vinoteca/lang/pl/lib/dateformat.php
create mode 100644 local/modules/jinove.vinoteca/lang/pl/lib/news.php
create mode 100644 local/modules/jinove.vinoteca/lang/pl/lib/offers.php
create mode 100644 local/modules/jinove.vinoteca/lang/pl/lib/search.php
create mode 100644 local/modules/jinove.vinoteca/lang/ru/install/index.php
create mode 100644 local/modules/jinove.vinoteca/lang/ru/lib/breadcrumbs.php
create mode 100644 local/modules/jinove.vinoteca/lang/ru/lib/cart.php
create mode 100644 local/modules/jinove.vinoteca/lang/ru/lib/catalog/comparison.php
create mode 100644 local/modules/jinove.vinoteca/lang/ru/lib/catalog/enumnames.php
create mode 100644 local/modules/jinove.vinoteca/lang/ru/lib/catalog/favorites.php
create mode 100644 local/modules/jinove.vinoteca/lang/ru/lib/checkout.php
create mode 100644 local/modules/jinove.vinoteca/lang/ru/lib/dateformat.php
create mode 100644 local/modules/jinove.vinoteca/lang/ru/lib/news.php
create mode 100644 local/modules/jinove.vinoteca/lang/ru/lib/offers.php
create mode 100644 local/modules/jinove.vinoteca/lang/ru/lib/search.php
create mode 100644 local/modules/jinove.vinoteca/lib/account.php
create mode 100644 local/modules/jinove.vinoteca/lib/altcha.php
create mode 100644 local/modules/jinove.vinoteca/lib/articleschema.php
create mode 100644 local/modules/jinove.vinoteca/lib/breadcrumbs.php
create mode 100644 local/modules/jinove.vinoteca/lib/cached.php
create mode 100644 local/modules/jinove.vinoteca/lib/cart.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/brandschema.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/comparison.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/countries.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/enumnames.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/favorite.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/favorites.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/listing.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/localizedtext.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/media.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/megamenu.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/photosort.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/pricepresets.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/pricerange.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/prices.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/related.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/reviewstats.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/searchmeta.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/sections.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/wineschema.php
create mode 100644 local/modules/jinove.vinoteca/lib/catalog/winestats.php
create mode 100644 local/modules/jinove.vinoteca/lib/checkout.php
create mode 100644 local/modules/jinove.vinoteca/lib/config.php
create mode 100644 local/modules/jinove.vinoteca/lib/consent.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/auth.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/basket.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/catalog.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/compare.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/favorite.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/filter/formguard.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/lead.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/news.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/order.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/password.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/profile.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/register.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/review.php
create mode 100644 local/modules/jinove.vinoteca/lib/controller/state.php
create mode 100644 local/modules/jinove.vinoteca/lib/dateformat.php
create mode 100644 local/modules/jinove.vinoteca/lib/language.php
create mode 100644 local/modules/jinove.vinoteca/lib/money.php
create mode 100644 local/modules/jinove.vinoteca/lib/navigation.php
create mode 100644 local/modules/jinove.vinoteca/lib/news.php
create mode 100644 local/modules/jinove.vinoteca/lib/offers.php
create mode 100644 local/modules/jinove.vinoteca/lib/offerschema.php
create mode 100644 local/modules/jinove.vinoteca/lib/origin.php
create mode 100644 local/modules/jinove.vinoteca/lib/pageschema.php
create mode 100644 local/modules/jinove.vinoteca/lib/personal/orders.php
create mode 100644 local/modules/jinove.vinoteca/lib/personal/reviews.php
create mode 100644 local/modules/jinove.vinoteca/lib/phone.php
create mode 100644 local/modules/jinove.vinoteca/lib/redirect.php
create mode 100644 local/modules/jinove.vinoteca/lib/retention.php
create mode 100644 local/modules/jinove.vinoteca/lib/routing.php
create mode 100644 local/modules/jinove.vinoteca/lib/search.php
create mode 100644 local/modules/jinove.vinoteca/lib/seo.php
create mode 100644 local/modules/jinove.vinoteca/lib/sitemap.php
create mode 100644 local/modules/jinove.vinoteca/lib/storeschema.php
create mode 100644 local/php_interface/include/sale_payment/jinove_halyk/.description.php
create mode 100644 local/php_interface/include/sale_payment/jinove_halyk/handler.php
create mode 100644 local/php_interface/include/sale_payment/jinove_halyk/lang/en/.description.php
create mode 100644 local/php_interface/include/sale_payment/jinove_halyk/lang/pl/.description.php
create mode 100644 local/php_interface/include/sale_payment/jinove_halyk/lang/ru/.description.php
create mode 100644 local/php_interface/include/sale_payment/jinove_paypal/.description.php
create mode 100644 local/php_interface/include/sale_payment/jinove_paypal/handler.php
create mode 100644 local/php_interface/include/sale_payment/jinove_paypal/lang/en/.description.php
create mode 100644 local/php_interface/include/sale_payment/jinove_paypal/lang/pl/.description.php
create mode 100644 local/php_interface/include/sale_payment/jinove_paypal/lang/ru/.description.php
create mode 100644 local/php_interface/init.php
create mode 100644 local/templates/jinove_wine/.description.php
create mode 100644 local/templates/jinove_wine/assets/brand/vinoteca-icon-512.png
create mode 100644 local/templates/jinove_wine/assets/brand/vinoteca-icon.svg
create mode 100644 local/templates/jinove_wine/assets/fonts/f0.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f1.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f10.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f11.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f12.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f2.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f3.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f4.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f5.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f6.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f7.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f8.woff2
create mode 100644 local/templates/jinove_wine/assets/fonts/f9.woff2
create mode 100644 local/templates/jinove_wine/assets/js/vino-altcha.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-busy.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-cart.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-compare.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-fav.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-favorites.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-gate.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-header.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-password.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-phone.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-reveal-init.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-reveal.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-review.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-shots.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-slider.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-sommelier.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-state.js
create mode 100644 local/templates/jinove_wine/assets/js/vino-subscribe.js
create mode 100644 local/templates/jinove_wine/assets/map/vinoteca-dark.json
create mode 100644 local/templates/jinove_wine/assets/media/bottle-stub.svg
create mode 100644 local/templates/jinove_wine/catalog-styles.css
create mode 100644 local/templates/jinove_wine/components/bitrix/breadcrumb/vinoteca/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/breadcrumb/vinoteca/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/breadcrumb/vinoteca/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/breadcrumb/vinoteca/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.compare.result/vinoteca/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.compare.result/vinoteca/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.compare.result/vinoteca/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.compare.result/vinoteca/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.compare.result/vinoteca/script.js
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.compare.result/vinoteca/style.css
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.compare.result/vinoteca/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.compare.result/vinoteca/tools.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.element/.default/component_epilog.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.element/.default/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.element/.default/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.element/.default/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.element/.default/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.element/.default/script.js
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.element/.default/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/card/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/en/card/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/en/line/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/en/parts/buy.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/en/parts/rating.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/en/parts/tools.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/en/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/pl/card/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/pl/line/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/pl/parts/buy.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/pl/parts/rating.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/pl/parts/tools.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/pl/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/ru/card/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/ru/line/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/ru/parts/buy.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/ru/parts/rating.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/ru/parts/tools.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/lang/ru/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/line/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/parts/buy.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/parts/rating.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/parts/tools.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.item/vinoteca/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.section.list/vinoteca-tiles/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.section.list/vinoteca-tiles/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.section.list/vinoteca-tiles/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.section.list/vinoteca-tiles/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.section.list/vinoteca-tiles/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.section/vinoteca/component_epilog.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.section/vinoteca/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.section/vinoteca/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.section/vinoteca/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.section/vinoteca/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.section/vinoteca/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.smart.filter/.default/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.smart.filter/.default/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.smart.filter/.default/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.smart.filter/.default/script.js
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.smart.filter/.default/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog.top/vinoteca-row/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/country.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/element.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/lang/en/element.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/lang/en/section.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/lang/en/sections.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/lang/pl/element.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/lang/pl/section.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/lang/pl/sections.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/lang/ru/element.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/lang/ru/section.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/lang/ru/sections.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/script.js
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/section.php
create mode 100644 local/templates/jinove_wine/components/bitrix/catalog/vinoteca/sections.php
create mode 100644 local/templates/jinove_wine/components/bitrix/menu/vinoteca_footer/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/menu/vinoteca_top/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/menu/vinoteca_top/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/menu/vinoteca_top/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/menu/vinoteca_top/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vhero/component_epilog.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vhero/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vhero/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vhero/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vhero/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vhero/script.js
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vhero/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-brands/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-brands/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-brands/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-brands/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-brands/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-news-list/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-news-list/script.js
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-news-list/style.css
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-news-list/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-news/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-news/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-offers/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-offers/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-offers/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-offers/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-offers/style.css
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-offers/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-reviews/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-reviews/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-reviews/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-reviews/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news.list/vinoteca-reviews/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.detail/.default/component_epilog.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.detail/.default/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.detail/.default/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.detail/.default/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.detail/.default/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.detail/.default/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.list/.default/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.list/.default/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.list/.default/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.list/.default/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.list/.default/script.js
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.list/.default/style.css
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/bitrix/news.list/.default/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/lang/en/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/lang/en/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/lang/pl/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/lang/pl/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/lang/ru/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/lang/ru/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-brands/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/bitrix/news.detail/.default/component_epilog.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/bitrix/news.detail/.default/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/bitrix/news.detail/.default/style.css
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/bitrix/news.detail/.default/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/lang/en/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/lang/en/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/lang/pl/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/lang/pl/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/lang/ru/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/lang/ru/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-news/style.css
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/bitrix/news.detail/.default/component_epilog.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/bitrix/news.detail/.default/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/bitrix/news.detail/.default/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/bitrix/news.detail/.default/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/bitrix/news.detail/.default/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/bitrix/news.detail/.default/script.js
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/bitrix/news.detail/.default/style.css
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/bitrix/news.detail/.default/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/lang/en/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/lang/en/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/lang/pl/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/lang/pl/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/lang/ru/detail.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/lang/ru/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/news.php
create mode 100644 local/templates/jinove_wine/components/bitrix/news/vinoteca-offers/style.css
create mode 100644 local/templates/jinove_wine/components/bitrix/search.page/.default/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/search.page/.default/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/search.page/.default/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/search.page/.default/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/search.page/.default/style.css
create mode 100644 local/templates/jinove_wine/components/bitrix/search.page/.default/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/search.title/vinoteca/ajax.php
create mode 100644 local/templates/jinove_wine/components/bitrix/search.title/vinoteca/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/search.title/vinoteca/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/search.title/vinoteca/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/search.title/vinoteca/result_modifier.php
create mode 100644 local/templates/jinove_wine/components/bitrix/search.title/vinoteca/script.js
create mode 100644 local/templates/jinove_wine/components/bitrix/search.title/vinoteca/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/system.pagenavigation/vinoteca/lang/en/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/system.pagenavigation/vinoteca/lang/pl/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/system.pagenavigation/vinoteca/lang/ru/template.php
create mode 100644 local/templates/jinove_wine/components/bitrix/system.pagenavigation/vinoteca/style.css
create mode 100644 local/templates/jinove_wine/components/bitrix/system.pagenavigation/vinoteca/template.php
create mode 100644 local/templates/jinove_wine/footer.php
create mode 100644 local/templates/jinove_wine/header.php
create mode 100644 local/templates/jinove_wine/lang/en/footer.php
create mode 100644 local/templates/jinove_wine/lang/en/header.php
create mode 100644 local/templates/jinove_wine/lang/pl/footer.php
create mode 100644 local/templates/jinove_wine/lang/pl/header.php
create mode 100644 local/templates/jinove_wine/lang/ru/footer.php
create mode 100644 local/templates/jinove_wine/lang/ru/header.php
create mode 100644 local/templates/jinove_wine/legal-styles.css
create mode 100644 local/templates/jinove_wine/template_styles.css
create mode 100644 login/index.php
create mode 100644 offers/index.php
create mode 100644 personal/cart/index.php
create mode 100644 personal/favorites/index.php
create mode 100644 personal/index.php
create mode 100644 personal/order/done/index.php
create mode 100644 personal/order/index.php
create mode 100644 personal/orders/index.php
create mode 100644 personal/reviews/index.php
create mode 100644 pl/.bottom.menu.php
create mode 100644 pl/.catalog.menu.php
create mode 100644 pl/.catalog.menu_ext.php
create mode 100644 pl/.section.php
create mode 100644 pl/.top.menu.php
create mode 100644 pl/about/index.php
create mode 100644 pl/articles/index.php
create mode 100644 pl/brands/index.php
create mode 100644 pl/catalog/index.php
create mode 100644 pl/compare/index.php
create mode 100644 pl/consent/index.php
create mode 100644 pl/forgot-password/index.php
create mode 100644 pl/include/home-story.php
create mode 100644 pl/index.php
create mode 100644 pl/login/index.php
create mode 100644 pl/offers/index.php
create mode 100644 pl/personal/cart/index.php
create mode 100644 pl/personal/favorites/index.php
create mode 100644 pl/personal/index.php
create mode 100644 pl/personal/order/done/index.php
create mode 100644 pl/personal/order/index.php
create mode 100644 pl/personal/orders/index.php
create mode 100644 pl/personal/reviews/index.php
create mode 100644 pl/privacy/index.php
create mode 100644 pl/register/index.php
create mode 100644 pl/reset-password/index.php
create mode 100644 pl/search/index.php
create mode 100644 privacy/index.php
create mode 100644 privacy/lang/en/index.php
create mode 100644 privacy/lang/pl/index.php
create mode 100644 privacy/lang/ru/index.php
create mode 100644 register/index.php
create mode 100644 reset-password/index.php
create mode 100644 ru/.bottom.menu.php
create mode 100644 ru/.catalog.menu.php
create mode 100644 ru/.catalog.menu_ext.php
create mode 100644 ru/.section.php
create mode 100644 ru/.top.menu.php
create mode 100644 ru/about/index.php
create mode 100644 ru/articles/index.php
create mode 100644 ru/brands/index.php
create mode 100644 ru/catalog/index.php
create mode 100644 ru/compare/index.php
create mode 100644 ru/consent/index.php
create mode 100644 ru/forgot-password/index.php
create mode 100644 ru/include/home-story.php
create mode 100644 ru/index.php
create mode 100644 ru/login/index.php
create mode 100644 ru/offers/index.php
create mode 100644 ru/personal/cart/index.php
create mode 100644 ru/personal/favorites/index.php
create mode 100644 ru/personal/index.php
create mode 100644 ru/personal/order/done/index.php
create mode 100644 ru/personal/order/index.php
create mode 100644 ru/personal/orders/index.php
create mode 100644 ru/personal/reviews/index.php
create mode 100644 ru/privacy/index.php
create mode 100644 ru/register/index.php
create mode 100644 ru/reset-password/index.php
create mode 100644 ru/search/index.php
create mode 100644 search/index.php
create mode 100644 urlrewrite.php
diff --git a/.access.php b/.access.php
new file mode 100644
index 0000000..0659fdc
--- /dev/null
+++ b/.access.php
@@ -0,0 +1,8 @@
+
+$PERM["personal"]["7"]="W";
+$PERM["catalog"]["7"]="W";
+$PERM["news"]["7"]="W";
+$PERM["about"]["7"]="W";
+$PERM["index.php"]["7"]="W";
+$PERM["/"]["*"]="R";
+?>
\ No newline at end of file
diff --git a/.bottom.menu.php b/.bottom.menu.php
new file mode 100644
index 0000000..9a4ad56
--- /dev/null
+++ b/.bottom.menu.php
@@ -0,0 +1,9 @@
+
\ No newline at end of file
diff --git a/.section.php b/.section.php
new file mode 100644
index 0000000..0aacaaf
--- /dev/null
+++ b/.section.php
@@ -0,0 +1,5 @@
+ 'Vinoteca: a curated wine shop. Wines from the best regions of the world, fair prices and a sommelier to help you choose.',
+ 'robots' => 'index, follow',
+];
diff --git a/.top.menu.php b/.top.menu.php
new file mode 100644
index 0000000..f0fa711
--- /dev/null
+++ b/.top.menu.php
@@ -0,0 +1,8 @@
+SetTitle(Loc::getMessage("VINO_404_TITLE"));
+$APPLICATION->SetPageProperty("title", Loc::getMessage("VINO_404_TITLE"));
+$APPLICATION->SetPageProperty("description", Loc::getMessage("VINO_404_TITLE"));
+$APPLICATION->SetPageProperty("robots", "noindex, follow");
+$APPLICATION->SetPageProperty("vino_alternates", "N");
+Asset::getInstance()->addJs(SITE_TEMPLATE_PATH . "/assets/js/vino-slider.js");
+?>
+
+
+
+
= Loc::getMessage("VINO_404_SECTIONS") ?>
+ IncludeComponent("bitrix:catalog.section.list", "vinoteca-tiles", \Jinove\Vinoteca\Catalog\Listing::sectionTilesParams() + array("VINO_SCHEMA" => "N"), false); ?>
+
+
+
+
+
+
+
= Loc::getMessage("VINO_404_LIKE") ?>
+
+
+
+
+
+
+ IncludeComponent("bitrix:catalog.top", "vinoteca-row", \Jinove\Vinoteca\Catalog\Listing::prepareBestsellers(), false); ?>
+
+
+
+
+
+
+
diff --git a/about/index.php b/about/index.php
new file mode 100644
index 0000000..5c7b105
--- /dev/null
+++ b/about/index.php
@@ -0,0 +1,4 @@
+IncludeComponent("jinove:about", ".default", array());
+require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php");
diff --git a/articles/index.php b/articles/index.php
new file mode 100644
index 0000000..4dd0523
--- /dev/null
+++ b/articles/index.php
@@ -0,0 +1,32 @@
+IncludeComponent("bitrix:news", "vinoteca-news", array(
+ "IBLOCK_TYPE" => "news",
+ "IBLOCK_ID" => \Jinove\Vinoteca\News::iblockId(),
+ "CHECK_DATES" => "Y",
+ "SEF_MODE" => "Y",
+ "SEF_FOLDER" => \Jinove\Vinoteca\News::folder(),
+ "SEF_URL_TEMPLATES" => array(
+ "news" => "",
+ "section" => "",
+ "detail" => "#ELEMENT_CODE#/",
+ ),
+ "DETAIL_FIELD_CODE" => array("PREVIEW_PICTURE", "PREVIEW_TEXT", "DETAIL_TEXT", "DETAIL_PICTURE", "ACTIVE_FROM", "TIMESTAMP_X"),
+ "DETAIL_PROPERTY_CODE" => array("NAME_EN", "NAME_PL", "PREVIEW_TEXT_EN", "PREVIEW_TEXT_PL", "DETAIL_TEXT_EN", "DETAIL_TEXT_PL"),
+ "USE_SEARCH" => "N",
+ "USE_RSS" => "N",
+ "USE_RATING" => "N",
+ "USE_CATEGORIES" => "N",
+ "USE_FILTER" => "N",
+ "USE_REVIEW" => "N",
+ "USE_PERMISSIONS" => "N",
+ "AJAX_MODE" => "N",
+ "CACHE_TYPE" => "A",
+ "CACHE_TIME" => "36000000",
+ "CACHE_GROUPS" => "N",
+ "SET_STATUS_404" => "Y",
+ "SHOW_404" => "Y",
+ "FILE_404" => "",
+ "MESSAGE_404" => "",
+), false);
+require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php");
diff --git a/brands/index.php b/brands/index.php
new file mode 100644
index 0000000..ff16ff3
--- /dev/null
+++ b/brands/index.php
@@ -0,0 +1,54 @@
+addCss(SITE_TEMPLATE_PATH . "/catalog-styles.css");
+$APPLICATION->SetPageProperty("og_image", VINO_HOST . SITE_TEMPLATE_PATH . "/assets/media/og-catalog.jpg");
+$APPLICATION->IncludeComponent("bitrix:news", "vinoteca-brands", array(
+ "IBLOCK_TYPE" => "catalog",
+ "IBLOCK_ID" => VINO_BRANDS_IBLOCK,
+ "NEWS_COUNT" => "100",
+ "SORT_BY1" => "SORT",
+ "SORT_ORDER1" => "ASC",
+ "SORT_BY2" => "NAME",
+ "SORT_ORDER2" => "ASC",
+ "CHECK_DATES" => "Y",
+ "SEF_MODE" => "Y",
+ "SEF_FOLDER" => SITE_DIR . "brands/",
+ "SEF_URL_TEMPLATES" => array(
+ "news" => "",
+ "section" => "",
+ "detail" => "#ELEMENT_CODE#/",
+ ),
+ "LIST_FIELD_CODE" => array("PREVIEW_PICTURE"),
+ "LIST_PROPERTY_CODE" => array("COUNTRY", "REGION"),
+ "DETAIL_FIELD_CODE" => array("PREVIEW_TEXT", "PREVIEW_PICTURE", "DETAIL_PICTURE"),
+ "DETAIL_PROPERTY_CODE" => array("COUNTRY", "REGION", "REGION_FULL", "FOUNDED", "GRAPE"),
+ "USE_SEARCH" => "N",
+ "USE_RSS" => "N",
+ "USE_RATING" => "N",
+ "USE_CATEGORIES" => "N",
+ "USE_FILTER" => "N",
+ "USE_REVIEW" => "N",
+ "USE_PERMISSIONS" => "N",
+ "AJAX_MODE" => "N",
+ "CACHE_TYPE" => "A",
+ "CACHE_TIME" => "36000000",
+ "CACHE_FILTER" => "N",
+ "CACHE_GROUPS" => "Y",
+ "SET_TITLE" => "Y",
+ "SET_LAST_MODIFIED" => "N",
+ "INCLUDE_IBLOCK_INTO_CHAIN" => "N",
+ "ADD_SECTIONS_CHAIN" => "N",
+ "ADD_ELEMENT_CHAIN" => "Y",
+ "DISPLAY_TOP_PAGER" => "N",
+ "DISPLAY_BOTTOM_PAGER" => "N",
+ "SET_STATUS_404" => "Y",
+ "SHOW_404" => "Y",
+ "FILE_404" => "",
+ "MESSAGE_404" => "",
+), false);
+require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php");
diff --git a/catalog/.section.php b/catalog/.section.php
new file mode 100644
index 0000000..5133e22
--- /dev/null
+++ b/catalog/.section.php
@@ -0,0 +1,2 @@
+
+?>
\ No newline at end of file
diff --git a/catalog/index.php b/catalog/index.php
new file mode 100644
index 0000000..85ed34d
--- /dev/null
+++ b/catalog/index.php
@@ -0,0 +1,8 @@
+addCss(SITE_TEMPLATE_PATH . "/catalog-styles.css");
+\Bitrix\Main\Localization\Loc::loadMessages(__FILE__);
+$APPLICATION->SetTitle(\Bitrix\Main\Localization\Loc::getMessage("VINO_CATALOG_PAGE_TITLE"));
+$APPLICATION->SetPageProperty("description", \Bitrix\Main\Localization\Loc::getMessage("VINO_CATALOG_PAGE_DESCRIPTION"));
+$APPLICATION->IncludeComponent("bitrix:catalog", "vinoteca", \Jinove\Vinoteca\Catalog\Listing::catalogParams(), false);
+require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php");
diff --git a/catalog/lang/en/index.php b/catalog/lang/en/index.php
new file mode 100644
index 0000000..9da0cf7
--- /dev/null
+++ b/catalog/lang/en/index.php
@@ -0,0 +1,3 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/compare/index.php b/compare/index.php
new file mode 100644
index 0000000..124a38b
--- /dev/null
+++ b/compare/index.php
@@ -0,0 +1,27 @@
+
+
+
+ GetTitle()))); ?>
+
ShowTitle(false); ?>
+
+
+
+
+
+
+
+
+
= \Bitrix\Main\Localization\Loc::getMessage("VINO_COMPARE_EMPTY_TITLE") ?>
+
= \Bitrix\Main\Localization\Loc::getMessage("VINO_COMPARE_EMPTY_HINT", array("#N#" => \Jinove\Vinoteca\Catalog\Comparison::MAX)) ?>
+
+
+
+
+
+IncludeComponent("bitrix:catalog.compare.result", "vinoteca", \Jinove\Vinoteca\Catalog\Comparison::params(), false);
+endif;
+require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php");
diff --git a/consent/index.php b/consent/index.php
new file mode 100644
index 0000000..74a53f3
--- /dev/null
+++ b/consent/index.php
@@ -0,0 +1,41 @@
+addCss(SITE_TEMPLATE_PATH . "/legal-styles.css");
+$email = \Jinove\Vinoteca\Config::contacts()["email"];
+$mail = '' . htmlspecialcharsbx($email) . ' ';
+$host = htmlspecialcharsbx((string)parse_url(\Jinove\Vinoteca\Config::host(), PHP_URL_HOST));
+$version = \Jinove\Vinoteca\Consent::VERSION;
+$date = \Jinove\Vinoteca\DateFormat::long(\Jinove\Vinoteca\Consent::timestamp($version), LANGUAGE_ID);
+$APPLICATION->SetTitle(Loc::getMessage("VINO_CONSENT_H1"));
+$APPLICATION->SetPageProperty("title", Loc::getMessage("VINO_CONSENT_TITLE"));
+$APPLICATION->SetPageProperty("description", Loc::getMessage("VINO_CONSENT_DESCRIPTION"));
+$APPLICATION->SetPageProperty("og_image", VINO_HOST . SITE_TEMPLATE_PATH . "/assets/media/og-home.jpg");
+?>
+
+
+
+
= Loc::getMessage("VINO_CONSENT_H1") ?>
+
= Loc::getMessage("VINO_CONSENT_LEAD", array("#DATE#" => $date)) ?>
+
+
+
+
+
+
+
= Loc::getMessage("VINO_CONSENT_S1_H") ?>
+
= Loc::getMessage("VINO_CONSENT_S1_P", array("#HOST#" => $host, "#LINK#" => '' . Loc::getMessage("VINO_CONSENT_S1_LINK") . ' ')) ?>
+
+
+
= Loc::getMessage("VINO_CONSENT_S" . $n . "_H") ?>
+
= Loc::getMessage("VINO_CONSENT_S" . $n . "_P", array("#EMAIL#" => $mail)) ?>
+
+
+
+
+
+
+IncludeComponent("jinove:auth.forgot", ".default", array());
+require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php");
diff --git a/include/about.php b/include/about.php
new file mode 100644
index 0000000..f48c4e4
--- /dev/null
+++ b/include/about.php
@@ -0,0 +1,14 @@
+
+
Почему Мы?
+
+ Выполнили свыше 150 000 заказов
+ Более 10 лет успешной работы
+ Более 50 000 покупателей
+ Контракты с домами мод
+ Оригинальные модели
+ Круглосуточная поддержка
+ Индивидуальный подход!
+ Всегда низкие цены!
+ Самые свежие игры!
+
+
\ No newline at end of file
diff --git a/include/about_title.php b/include/about_title.php
new file mode 100644
index 0000000..d981e85
--- /dev/null
+++ b/include/about_title.php
@@ -0,0 +1 @@
+О магазине
\ No newline at end of file
diff --git a/include/catalog_title.php b/include/catalog_title.php
new file mode 100644
index 0000000..d7935d0
--- /dev/null
+++ b/include/catalog_title.php
@@ -0,0 +1 @@
+Каталог товаров
\ No newline at end of file
diff --git a/include/company_about.php b/include/company_about.php
new file mode 100644
index 0000000..7030676
--- /dev/null
+++ b/include/company_about.php
@@ -0,0 +1 @@
+Добро пожаловать в интернет-магазин одежды! Мы предлагаем широкий ассортимент качественной одежды по адекватным ценам. Покупая одежду в нашем Интернет-магазине, вы можете быть уверены в её качестве - ведь мы работаем только с крупными и проверенными производителями.
\ No newline at end of file
diff --git a/include/company_logo.php b/include/company_logo.php
new file mode 100644
index 0000000..94cc9be
--- /dev/null
+++ b/include/company_logo.php
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/include/company_logo_mobile.php b/include/company_logo_mobile.php
new file mode 100644
index 0000000..bc1938d
--- /dev/null
+++ b/include/company_logo_mobile.php
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/include/company_name.php b/include/company_name.php
new file mode 100644
index 0000000..882a6ed
--- /dev/null
+++ b/include/company_name.php
@@ -0,0 +1 @@
+Vinoteca
\ No newline at end of file
diff --git a/include/copyright.php b/include/copyright.php
new file mode 100644
index 0000000..c93402c
--- /dev/null
+++ b/include/copyright.php
@@ -0,0 +1 @@
+© Интернет-магазин одежды, 2020
\ No newline at end of file
diff --git a/include/facebook_plugin.php b/include/facebook_plugin.php
new file mode 100644
index 0000000..1cacd51
--- /dev/null
+++ b/include/facebook_plugin.php
@@ -0,0 +1,9 @@
+
+
+$APPLICATION->IncludeComponent("bitrix:eshop.facebook.plugin", "",
+ array(
+ "ESHOP_FACEBOOK_LINK"=>"http://www.facebook.com/1CBitrix"
+ ),
+ false
+);
+?>
\ No newline at end of file
diff --git a/include/home-story.php b/include/home-story.php
new file mode 100644
index 0000000..ad251c1
--- /dev/null
+++ b/include/home-story.php
@@ -0,0 +1,3 @@
+
+A wine cellar, not just a shop
+Our collection spans the Old World and the New: Italian and French classics, sun-soaked wines from Spain and Portugal, California, Argentina, New Zealand and Hungarian Tokaji. Our sommelier will suggest what to pour with steak or fish, which wine makes a good gift and which one is worth cellaring for a few years. You can ask your question right here on the site.
diff --git a/include/info.php b/include/info.php
new file mode 100644
index 0000000..145dc03
--- /dev/null
+++ b/include/info.php
@@ -0,0 +1,51 @@
+
+
Полезная информация
+
+
+
+
+
+
О магазине
+
+
Узнайте больше о нашем магазине: кто мы, наши клиенты и почему они выбрали именно нас. Наши контакты и реквизиты.
Подробнее
+
+
+
+
+
+
+
Доставка
+
+
Доставим ваш заказ в любой регион России, в удобное время и день. Работаем для вас, без выходных.
Подробнее
+
+
+
+
+
+
+
Мы гарантируем
+
+
Мы гордимся безупречной репутацией нашего магазина. Если товар не устроит вас, вы всегда сможете вернуть деньги.
Подробнее
+
+
+
+
+
+
+
Как купить
+
+
Ваш первый заказ в интернет-магазине? Мы с радостью подскажем как сделать покупки в интернете простыми и удобными.
Подробнее
+
+
+
+
+
+
+
Всегда на связи
+
+
Связаться с нами можно любым удобным для вас способом: e-mail, телефон, социальные сети и мессенджеры.
Подробнее
+
+
+
+
+
diff --git a/include/personal.php b/include/personal.php
new file mode 100644
index 0000000..5266b7f
--- /dev/null
+++ b/include/personal.php
@@ -0,0 +1 @@
+Персональный раздел
\ No newline at end of file
diff --git a/include/reg_info.php b/include/reg_info.php
new file mode 100644
index 0000000..db2f747
--- /dev/null
+++ b/include/reg_info.php
@@ -0,0 +1,7 @@
+Использование информации предоставленной Клиентом и получаемой Продавцом.
+Продавец использует предоставленные Клиентом данные в течение всего срока регистрации Клиента на Сайте в целях:
+
+ для регистрации/авторизации Клиента на Сайте;
+ для обработки заказов Клиента и выполнения своих обязательств перед Клиентом;
+ для осуществления деятельности по продвижению товаров и услуг;
+
\ No newline at end of file
diff --git a/include/schedule.php b/include/schedule.php
new file mode 100644
index 0000000..8f80596
--- /dev/null
+++ b/include/schedule.php
@@ -0,0 +1 @@
+Пн-Вс 10-19
\ No newline at end of file
diff --git a/include/sender.php b/include/sender.php
new file mode 100644
index 0000000..2660dba
--- /dev/null
+++ b/include/sender.php
@@ -0,0 +1,7 @@
+
+
+
РАССЫЛКА
+ $APPLICATION->IncludeComponent("bitrix:sender.subscribe", "", array(
+ "SET_TITLE" => "N"
+ ));?>
+
\ No newline at end of file
diff --git a/include/socnet_footer.php b/include/socnet_footer.php
new file mode 100644
index 0000000..7c6c253
--- /dev/null
+++ b/include/socnet_footer.php
@@ -0,0 +1,17 @@
+
+
+$APPLICATION->IncludeComponent(
+ "bitrix:eshop.socnet.links",
+ "big_squares",
+ array(
+ "FACEBOOK" => "https://www.facebook.com/1CBitrix",
+ "VKONTAKTE" => "https://vk.com/bitrix_1c",
+ "TWITTER" => "https://twitter.com/1c_bitrix",
+ "GOOGLE" => "https://plus.google.com/111119180387208976312/",
+ "INSTAGRAM" => "https://instagram.com/1CBitrix/"
+ ),
+ false,
+ array(
+ "HIDE_ICONS" => "N"
+ )
+);?>
\ No newline at end of file
diff --git a/include/socnet_sidebar.php b/include/socnet_sidebar.php
new file mode 100644
index 0000000..7ef9e7e
--- /dev/null
+++ b/include/socnet_sidebar.php
@@ -0,0 +1,18 @@
+
+
+$APPLICATION->IncludeComponent(
+ "bitrix:eshop.socnet.links",
+ "bootstrap_v4",
+ array(
+ "COMPONENT_TEMPLATE" => "bootstrap_v4",
+ "FACEBOOK" => "https://www.facebook.com/1CBitrix",
+ "VKONTAKTE" => "https://vk.com/bitrix_1c",
+ "TWITTER" => "https://twitter.com/1c_bitrix",
+ "GOOGLE" => "https://plus.google.com/111119180387208976312/",
+ "INSTAGRAM" => "https://instagram.com/1CBitrix/"
+ ),
+ false,
+ array(
+ "HIDE_ICONS" => "N"
+ )
+);?>
\ No newline at end of file
diff --git a/include/telephone.php b/include/telephone.php
new file mode 100644
index 0000000..f9ff748
--- /dev/null
+++ b/include/telephone.php
@@ -0,0 +1 @@
+8 (495) 212 85 06
\ No newline at end of file
diff --git a/include/twitter.php b/include/twitter.php
new file mode 100644
index 0000000..65ca8b8
--- /dev/null
+++ b/include/twitter.php
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/include/viewed_product.php b/include/viewed_product.php
new file mode 100644
index 0000000..dee76aa
--- /dev/null
+++ b/include/viewed_product.php
@@ -0,0 +1,38 @@
+
+$APPLICATION->IncludeComponent("bitrix:catalog.viewed.products", "bootstrap_v4", array(
+ "HIDE_NOT_AVAILABLE" => "N",
+ "PAGE_ELEMENT_COUNT" => "5",
+ "SHOW_DISCOUNT_PERCENT" => "Y",
+ "PRODUCT_SUBSCRIPTION" => "N",
+ "SHOW_NAME" => "Y",
+ "SHOW_IMAGE" => "Y",
+ "MESS_BTN_BUY" => "Купить",
+ "MESS_BTN_DETAIL" => "Подробнее",
+ "MESS_BTN_SUBSCRIBE" => "Подписаться",
+ "LINE_ELEMENT_COUNT" => "5",
+ "TEMPLATE_THEME" => "site",
+ "SHOW_OLD_PRICE" => "N",
+ "PRICE_CODE" => array(
+ 0 => "BASE",
+ ),
+ "SHOW_PRICE_COUNT" => "1",
+ "PRICE_VAT_INCLUDE" => "Y",
+ "CONVERT_CURRENCY" => "N",
+ "BASKET_URL" => "/personal/cart/",
+ "ACTION_VARIABLE" => "action_cvp",
+ "PRODUCT_ID_VARIABLE" => "id",
+ "ADD_PROPERTIES_TO_BASKET" => "Y",
+ "PRODUCT_PROPS_VARIABLE" => "prop",
+ "PARTIAL_PRODUCT_PROPERTIES" => "N",
+ "USE_PRODUCT_QUANTITY" => "N",
+ "SHOW_PRODUCTS_2" => "Y",
+ "OFFER_TREE_PROPS_3" => array(
+ 0 => "COLOR_REF",
+ 1 => "SIZES_SHOES",
+ 2 => "SIZES_CLOTHES",
+ ),
+ "PRODUCT_QUANTITY_VARIABLE" => "quantity",
+ "CACHE_GROUPS" => "Y"
+ ),
+ false
+);?>
\ No newline at end of file
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..1eefc23
--- /dev/null
+++ b/index.php
@@ -0,0 +1,184 @@
+SetPageProperty("description", Loc::getMessage("VINO_HOME_DESCRIPTION"));
+$APPLICATION->SetPageProperty("og_image", VINO_HOST . SITE_TEMPLATE_PATH . "/assets/media/og-home.jpg");
+$APPLICATION->SetTitle(Loc::getMessage("VINO_HOME_TITLE"));
+$tpl = SITE_TEMPLATE_PATH;
+Asset::getInstance()->addJs(SITE_TEMPLATE_PATH . "/assets/js/vino-slider.js");
+$wineCount = ServiceLocator::getInstance()->get("jinove.vinoteca.wineStats")->getActiveCount();
+?>
+= Loc::getMessage("VINO_HOME_H1") ?>
+IncludeComponent("bitrix:news.list", "vhero", array(
+ "IBLOCK_TYPE" => "content",
+ "IBLOCK_ID" => VINO_BANNERS_IBLOCK,
+ "NEWS_COUNT" => "4",
+ "SORT_BY1" => "SORT",
+ "SORT_ORDER1" => "ASC",
+ "SORT_BY2" => "ID",
+ "SORT_ORDER2" => "ASC",
+ "FIELD_CODE" => array("PREVIEW_PICTURE", "PREVIEW_TEXT"),
+ "PROPERTY_CODE" => array("KICKER", "LINK", "LINK_TEXT"),
+ "CHECK_DATES" => "Y",
+ "SET_TITLE" => "N",
+ "SET_BROWSER_TITLE" => "N",
+ "SET_META_KEYWORDS" => "N",
+ "SET_META_DESCRIPTION" => "N",
+ "SET_LAST_MODIFIED" => "N",
+ "SET_STATUS_404" => "N",
+ "SHOW_404" => "N",
+ "INCLUDE_IBLOCK_INTO_CHAIN" => "N",
+ "ADD_SECTIONS_CHAIN" => "N",
+ "DISPLAY_TOP_PAGER" => "N",
+ "DISPLAY_BOTTOM_PAGER" => "N",
+ "CACHE_TYPE" => "A",
+ "CACHE_TIME" => "36000000",
+ "CACHE_GROUPS" => "N",
+), false); ?>
+
+IncludeComponent("bitrix:news.list", "vinoteca-brands", array(
+ "IBLOCK_TYPE" => "catalog",
+ "IBLOCK_ID" => VINO_BRANDS_IBLOCK,
+ "NEWS_COUNT" => "8",
+ "DETAIL_URL" => SITE_DIR . "brands/#ELEMENT_CODE#/",
+ "SORT_BY1" => "SORT",
+ "SORT_ORDER1" => "ASC",
+ "SORT_BY2" => "NAME",
+ "SORT_ORDER2" => "ASC",
+ "FIELD_CODE" => array("PREVIEW_PICTURE"),
+ "PROPERTY_CODE" => array("COUNTRY", "REGION"),
+ "CHECK_DATES" => "Y",
+ "SET_TITLE" => "N",
+ "SET_BROWSER_TITLE" => "N",
+ "SET_META_KEYWORDS" => "N",
+ "SET_META_DESCRIPTION" => "N",
+ "SET_LAST_MODIFIED" => "N",
+ "SET_STATUS_404" => "N",
+ "SHOW_404" => "N",
+ "INCLUDE_IBLOCK_INTO_CHAIN" => "N",
+ "ADD_SECTIONS_CHAIN" => "N",
+ "DISPLAY_TOP_PAGER" => "N",
+ "DISPLAY_BOTTOM_PAGER" => "N",
+ "CACHE_TYPE" => "A",
+ "CACHE_TIME" => "36000000",
+ "CACHE_GROUPS" => "N",
+), false); ?>
+
+
+
+
+
+
= Loc::getMessage("VINO_HOME_BEST_KICKER") ?>
+
= Loc::getMessage("VINO_HOME_BEST_TITLE") ?>
+
+
+
+
+
+
+ IncludeComponent("bitrix:catalog.top", "vinoteca-row", \Jinove\Vinoteca\Catalog\Listing::prepareBestsellers(), false); ?>
+
+
+
+
+
+
+
+
+
+
+
+
= Loc::getMessage("VINO_HOME_NEW_KICKER") ?>
+
= Loc::getMessage("VINO_HOME_NEW_TITLE") ?>
+
+
+
+
+
+ IncludeComponent("bitrix:catalog.top", "vinoteca-row", array(
+ "IBLOCK_TYPE" => "catalog",
+ "IBLOCK_ID" => VINO_CATALOG_IBLOCK,
+ "ELEMENT_COUNT" => "8",
+ "ELEMENT_SORT_FIELD" => "PROPERTY_VINTAGE",
+ "ELEMENT_SORT_ORDER" => "desc",
+ "ELEMENT_SORT_FIELD2" => "ID",
+ "ELEMENT_SORT_ORDER2" => "desc",
+ "PROPERTY_CODE" => array("WINE_COLOR", "SUGAR", "VOLUME", "REGION", "COUNTRY"),
+ "PRICE_CODE" => array("BASE"),
+ "PRICE_VAT_INCLUDE" => "Y",
+ "USE_PRICE_COUNT" => "N",
+ "SHOW_PRICE_COUNT" => "1",
+ "CONVERT_CURRENCY" => "N",
+ "HIDE_NOT_AVAILABLE" => "N",
+ "DETAIL_URL" => SITE_DIR . "catalog/#SECTION_CODE#/#ELEMENT_CODE#/",
+ "SECTION_URL" => SITE_DIR . "catalog/#SECTION_CODE#/",
+ "CACHE_TYPE" => "A",
+ "CACHE_TIME" => "3600",
+ "CACHE_GROUPS" => "N",
+ "CACHE_FILTER" => "N",
+ ), false); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+
+
+
+ IncludeComponent("bitrix:main.include", "", array("AREA_FILE_SHOW" => "file", "PATH" => SITE_DIR . "include/home-story.php"), false); ?>
+
= Loc::getMessage("VINO_HOME_ABOUT") ?>
+
+
+
+
+
+
+
+
+
+ IncludeComponent("bitrix:news.list", "vinoteca-news", \Jinove\Vinoteca\News::homeParams(), false); ?>
+
+
+
+
+SetTitle($title);
+ $APPLICATION->SetPageProperty("title", (string)Loc::getMessage("VINO_ABOUT_BROWSER_TITLE"));
+ $APPLICATION->SetPageProperty("description", (string)Loc::getMessage("VINO_ABOUT_DESCRIPTION"));
+ $contacts = Config::contacts();
+ $counts = $this->counts();
+ $this->arResult = [
+ "TITLE" => $title,
+ "WINES" => $counts["wines"],
+ "BRANDS" => $counts["brands"],
+ "TYPES" => $counts["types"],
+ "PHONE" => (string)($contacts["phone"] ?? ""),
+ "PHONE_LABEL" => (string)($contacts["phoneLabel"] ?? ""),
+ "EMAIL" => (string)($contacts["email"] ?? ""),
+ "MAP_URL" => "https://yandex.ru/maps/?text=" . rawurlencode(self::MAP_ADDRESS),
+ "CATALOG_URL" => SITE_DIR . "catalog/",
+ "BRANDS_URL" => SITE_DIR . "brands/",
+ "DESCRIPTION" => (string)Loc::getMessage("VINO_ABOUT_DESCRIPTION"),
+ "SCHEMA" => PageSchema::aboutPage(SITE_DIR . "about/", $title, (string)Loc::getMessage("VINO_ABOUT_DESCRIPTION"), PageSchema::image(Config::host() . SITE_DIR . "about/#image", Config::host() . SITE_TEMPLATE_PATH . "/assets/media/about-intro-1400.webp", 1400, 933)),
+ "MAP" => ["LAT" => self::MAP_LAT, "LON" => self::MAP_LON, "ZOOM" => self::MAP_ZOOM, "STYLE" => SITE_TEMPLATE_PATH . "/assets/map/vinoteca-dark.json"],
+ ];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+
+ private function counts(): array
+ {
+ $cache = Cache::createInstance();
+ if ($cache->initCache(self::CACHE_TTL, "counts-" . LANGUAGE_ID, self::CACHE_DIR)) {
+ return (array)$cache->getVars();
+ }
+ $cache->startDataCache();
+ $taggedCache = Application::getInstance()->getTaggedCache();
+ $taggedCache->startTagCache(self::CACHE_DIR);
+ try {
+ $brandsId = Config::iblockId("brands");
+ $taggedCache->registerTag("iblock_id_" . Config::iblockId("catalog"));
+ $taggedCache->registerTag("iblock_id_" . $brandsId);
+ $counts = [
+ "wines" => ServiceLocator::getInstance()->get("jinove.vinoteca.wineStats")->getActiveCount(),
+ "brands" => Loader::includeModule("iblock") ? ElementTable::getCount(["=IBLOCK_ID" => $brandsId, "=ACTIVE" => "Y"]) : 0,
+ "types" => MegaMenu::types(Config::iblockId("catalog")),
+ ];
+ } catch (\Throwable $e) {
+ $taggedCache->abortTagCache();
+ $cache->abortDataCache();
+
+ return ["wines" => 0, "brands" => 0, "types" => []];
+ }
+ $taggedCache->endTagCache();
+ $cache->endDataCache($counts);
+
+ return $counts;
+ }
+}
diff --git a/local/components/jinove/about/lang/en/class.php b/local/components/jinove/about/lang/en/class.php
new file mode 100644
index 0000000..0341bfa
--- /dev/null
+++ b/local/components/jinove/about/lang/en/class.php
@@ -0,0 +1,4 @@
+ htmlspecialcharsbx((string)Loc::getMessage($key));
+$stats = [
+ ["value" => $arResult["WINES"], "label" => Loc::getMessagePlural("VINO_ABOUT_WINES", $arResult["WINES"]), "url" => $arResult["CATALOG_URL"]],
+ ["value" => $arResult["BRANDS"], "label" => Loc::getMessagePlural("VINO_ABOUT_BRANDS", $arResult["BRANDS"]), "url" => $arResult["BRANDS_URL"]],
+];
+$steps = ["ASK", "PAY", "PICKUP"];
+$note = static function (string $step): string {
+ $line = htmlspecialcharsbx((string)Loc::getMessage("VINO_ABOUT_" . $step . "_D"));
+ $label = htmlspecialcharsbx((string)Loc::getMessage("VINO_ABOUT_" . $step . "_LINK"));
+ if ($step === "ASK") {
+ $link = '' . $label . ' ';
+ } elseif ($step === "PICKUP") {
+ $link = '' . $label . ' ';
+ } else {
+ return $line;
+ }
+
+ return str_replace("#LINK#", $link, $line);
+};
+?>
+
+
+
+
+
+
= htmlspecialcharsbx($arResult["TITLE"]) ?>
+
= str_replace("#ACCENT#", '' . $text("VINO_ABOUT_ACCENT") . ' ', $text("VINO_ABOUT_LEAD")) ?>
+
= $text("VINO_ABOUT_LEAD_2") ?>
+
+
" fetchpriority="high" decoding="async">
+
+
+ 0): ?>
+
+
+
= $text("VINO_ABOUT_FACTS_TITLE") ?>
+
+
+
+
+
+
+
+
+
+
= $text("VINO_ABOUT_HOW_TITLE") ?>
+
+ $step): ?>
+ 0): ?>→
+
+ = $text("VINO_ABOUT_" . $step . "_T") ?>
+ = $note($step) ?>
+
+
+
+
+
+
+
+
+
+
" data-lon="= (float)$arResult["MAP"]["LON"] ?>" data-zoom="= (int)$arResult["MAP"]["ZOOM"] ?>" data-style="= htmlspecialcharsbx($arResult["MAP"]["STYLE"]) ?>" data-lang="= LANGUAGE_ID ?>" data-lib-js="= SITE_TEMPLATE_PATH ?>/assets/vendor/maplibre/maplibre-gl.js" data-lib-css="= SITE_TEMPLATE_PATH ?>/assets/vendor/maplibre/maplibre-gl.css" data-text-windows="= $text("VINO_ABOUT_MAP_WINDOWS") ?>" data-text-mac="= $text("VINO_ABOUT_MAP_MAC") ?>" data-text-mobile="= $text("VINO_ABOUT_MAP_MOBILE") ?>" data-text-zoom-in="= $text("VINO_ABOUT_MAP_ZOOM_IN") ?>" data-text-zoom-out="= $text("VINO_ABOUT_MAP_ZOOM_OUT") ?>" data-text-stub="= $text("VINO_ABOUT_MAP_STUB") ?>" data-text-fail="= $text("VINO_ABOUT_MAP_FAIL") ?>" role="region" aria-label="= $text("VINO_ABOUT_MAP_LABEL") ?>">
+
+
+
= $text("VINO_ABOUT_MAP_STUB") ?>
+
= $text("VINO_ABOUT_MAP_ALLOW") ?>
+
+
+
+
+
+
+
diff --git a/local/components/jinove/auth.forgot/class.php b/local/components/jinove/auth.forgot/class.php
new file mode 100644
index 0000000..c747d2d
--- /dev/null
+++ b/local/components/jinove/auth.forgot/class.php
@@ -0,0 +1,30 @@
+getId() > 0) {
+ LocalRedirect(SITE_DIR);
+ }
+ $GLOBALS["APPLICATION"]->SetTitle(Loc::getMessage("VINO_FORGOT_PAGE_TITLE"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("description", Loc::getMessage("VINO_FORGOT_PAGE_DESCRIPTION"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_alternates", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_schema", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("robots", "noindex, nofollow");
+ $this->arResult = ["LOGIN_URL" => SITE_DIR . "login/"];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+}
diff --git a/local/components/jinove/auth.forgot/lang/en/class.php b/local/components/jinove/auth.forgot/lang/en/class.php
new file mode 100644
index 0000000..eac149e
--- /dev/null
+++ b/local/components/jinove/auth.forgot/lang/en/class.php
@@ -0,0 +1,3 @@
+personal data on the terms and for the purposes set out in the Privacy Policy .';
+$MESS["VINO_FORGOT_DONE"] = "If an account with this e-mail exists, a password reset link has been sent to it.";
+$MESS["VINO_FORGOT_ERR_ALTCHA"] = "Verification failed. Please try again.";
+$MESS["VINO_FORGOT_ERR_TOO_OFTEN"] = "Too many attempts, try again later";
+$MESS["VINO_FORGOT_ERR_RETRY"] = "Please submit again";
+$MESS["VINO_FORGOT_ERR_COMMON"] = "Failed. Please try again later";
diff --git a/local/components/jinove/auth.forgot/templates/.default/lang/pl/template.php b/local/components/jinove/auth.forgot/templates/.default/lang/pl/template.php
new file mode 100644
index 0000000..ae1759b
--- /dev/null
+++ b/local/components/jinove/auth.forgot/templates/.default/lang/pl/template.php
@@ -0,0 +1,16 @@
+danych osobowych na warunkach i w celach określonych w Polityce prywatności .';
+$MESS["VINO_FORGOT_DONE"] = "Jeśli konto z tym adresem e-mail istnieje, link do zmiany hasła został wysłany na ten adres.";
+$MESS["VINO_FORGOT_ERR_ALTCHA"] = "Weryfikacja nieudana. Spróbuj ponownie.";
+$MESS["VINO_FORGOT_ERR_TOO_OFTEN"] = "Zbyt wiele prób, spróbuj ponownie później";
+$MESS["VINO_FORGOT_ERR_RETRY"] = "Wyślij ponownie";
+$MESS["VINO_FORGOT_ERR_COMMON"] = "Błąd. Spróbuj ponownie później";
diff --git a/local/components/jinove/auth.forgot/templates/.default/lang/ru/template.php b/local/components/jinove/auth.forgot/templates/.default/lang/ru/template.php
new file mode 100644
index 0000000..bd1fd82
--- /dev/null
+++ b/local/components/jinove/auth.forgot/templates/.default/lang/ru/template.php
@@ -0,0 +1,16 @@
+персональных данных на условиях и для целей, определённых Политикой конфиденциальности .';
+$MESS["VINO_FORGOT_DONE"] = "Если аккаунт с таким e-mail есть, на него отправлена ссылка для смены пароля.";
+$MESS["VINO_FORGOT_ERR_ALTCHA"] = "Проверка не пройдена. Повторите попытку.";
+$MESS["VINO_FORGOT_ERR_TOO_OFTEN"] = "Слишком много попыток, повторите позже";
+$MESS["VINO_FORGOT_ERR_RETRY"] = "Повторите отправку";
+$MESS["VINO_FORGOT_ERR_COMMON"] = "Не удалось. Повторите позже";
diff --git a/local/components/jinove/auth.forgot/templates/.default/script.js b/local/components/jinove/auth.forgot/templates/.default/script.js
new file mode 100644
index 0000000..cf38596
--- /dev/null
+++ b/local/components/jinove/auth.forgot/templates/.default/script.js
@@ -0,0 +1,83 @@
+(function () {
+ function init() {
+ var form = document.querySelector('[data-auth-forgot]');
+ if (!form) return;
+ if (!window.BX || !BX.ajax || !BX.ajax.runAction) {
+ form.addEventListener('submit', function (event) {
+ event.preventDefault();
+ });
+ return;
+ }
+ var email = form.elements.email;
+ var consent = form.elements.consent;
+ var submit = form.querySelector('[type="submit"]');
+ var err = form.querySelector('[data-auth-err]');
+ var done = document.querySelector('[data-auth-done]');
+ var consentBox = form.querySelector('.vino-auth__consent');
+ var guard = form.querySelector('altcha-widget');
+ var started = Date.now();
+ var codes = { too_often: 'tooOften', altcha: 'altcha', retry: 'retry', email: 'email' };
+
+ function message(code) {
+ var key = codes[code] || 'error';
+ return form.dataset['msg' + key.charAt(0).toUpperCase() + key.slice(1)] || form.dataset.msgError;
+ }
+
+ function mark(field, bad) {
+ field.classList.toggle('vino-inp--invalid', bad);
+ field.setAttribute('aria-invalid', bad ? 'true' : 'false');
+ }
+
+ VinoAltcha.arm(guard);
+
+ form.addEventListener('input', function (event) {
+ if (event.target.classList.contains('vino-inp--invalid')) mark(event.target, false);
+ });
+ consent.addEventListener('change', function () {
+ consentBox.classList.remove('vino-consent--invalid');
+ });
+
+ form.addEventListener('submit', function (event) {
+ event.preventDefault();
+ var emailValue = email.value.trim();
+ var badEmail = !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(emailValue);
+ var badConsent = !consent.checked;
+ mark(email, badEmail);
+ consentBox.classList.toggle('vino-consent--invalid', badConsent);
+ consent.setAttribute('aria-invalid', badConsent ? 'true' : 'false');
+ if (badEmail || badConsent) {
+ err.textContent = badEmail ? form.dataset.msgEmail : form.dataset.msgConsent;
+ (badEmail ? email : consent).focus();
+ return;
+ }
+ err.textContent = '';
+ submit.disabled = true;
+ VinoAltcha.armed(guard).then(function (ok) {
+ if (!ok) return Promise.reject({ errors: [{ code: 'altcha' }] });
+ return BX.ajax.runAction('jinove:vinoteca.password.request', {
+ data: {
+ email: emailValue,
+ website: form.elements.website.value,
+ elapsed: String(Date.now() - started),
+ altcha: form.elements.altcha ? form.elements.altcha.value : ''
+ }
+ });
+ }).then(function () {
+ form.hidden = true;
+ done.hidden = false;
+ done.focus();
+ }, function (response) {
+ submit.disabled = false;
+ VinoAltcha.reset(guard);
+ var code = response && response.errors && response.errors[0] ? response.errors[0].code : '';
+ err.textContent = message(code);
+ });
+ });
+ }
+
+ if (document.readyState === 'loading') {
+ document.addEventListener('DOMContentLoaded', init);
+ } else {
+ init();
+ }
+})();
diff --git a/local/components/jinove/auth.forgot/templates/.default/template.php b/local/components/jinove/auth.forgot/templates/.default/template.php
new file mode 100644
index 0000000..ff3abef
--- /dev/null
+++ b/local/components/jinove/auth.forgot/templates/.default/template.php
@@ -0,0 +1,40 @@
+addExternalCss("/local/components/jinove/auth.login/templates/.default/style.css");
+$uid = "vino-forgot";
+?>
+
+
+
= Loc::getMessage("VINO_FORGOT_KICKER") ?>
+
= Loc::getMessage("VINO_FORGOT_TITLE") ?>
+
= Loc::getMessage("VINO_FORGOT_LEAD") ?>
+
= Loc::getMessage("VINO_FORGOT_DEMO") ?>
+
= Loc::getMessage("VINO_FORGOT_DONE") ?>
+
+
+
diff --git a/local/components/jinove/auth.login/class.php b/local/components/jinove/auth.login/class.php
new file mode 100644
index 0000000..2de855b
--- /dev/null
+++ b/local/components/jinove/auth.login/class.php
@@ -0,0 +1,44 @@
+getContext()->getRequest();
+ $embed = ($this->arParams["EMBED"] ?? "") === "Y";
+ $back = $embed ? (string)$GLOBALS["APPLICATION"]->GetCurPageParam("", array(), false) : (string)$request->getQuery("back");
+ $safeBack = \Jinove\Vinoteca\Redirect::safe($back);
+ if (!$embed) {
+ if ((int)CurrentUser::get()->getId() > 0) {
+ LocalRedirect($safeBack !== "" ? $safeBack : SITE_DIR);
+ }
+ $GLOBALS["APPLICATION"]->SetTitle(Loc::getMessage("VINO_AUTH_PAGE_TITLE"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("description", Loc::getMessage("VINO_AUTH_PAGE_DESCRIPTION"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_alternates", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_schema", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("robots", "noindex, nofollow");
+ }
+ $this->arResult = [
+ "EMBED" => $embed,
+ "TITLE" => (string)($this->arParams["TITLE"] ?? ""),
+ "LEAD" => (string)($this->arParams["LEAD"] ?? ""),
+ "BACK" => $safeBack,
+ "REGISTER_URL" => SITE_DIR . "register/" . ($safeBack !== "" ? "?back=" . rawurlencode($safeBack) : ""),
+ "FORGOT_URL" => SITE_DIR . "forgot-password/",
+ ];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+}
diff --git a/local/components/jinove/auth.login/lang/en/class.php b/local/components/jinove/auth.login/lang/en/class.php
new file mode 100644
index 0000000..dd72ee8
--- /dev/null
+++ b/local/components/jinove/auth.login/lang/en/class.php
@@ -0,0 +1,3 @@
+personal data on the terms and for the purposes set out in the Privacy Policy .';
+$MESS["VINO_AUTH_ERR_INVALID"] = "Wrong e-mail or password";
+$MESS["VINO_AUTH_ERR_TOO_OFTEN"] = "Too many attempts, try again later";
+$MESS["VINO_AUTH_ERR_COMMON"] = "Could not sign in. Please try again";
+$MESS["VINO_AUTH_ASIDE_TITLE"] = "After signing in you will be able to";
+$MESS["VINO_AUTH_ERR_ALTCHA"] = "Verification failed. Please try again.";
+$MESS["VINO_AUTH_PERK_PROFILE"] = "Edit your profile and contact details";
+$MESS["VINO_AUTH_PERK_ORDERS"] = "View the history and status of orders";
+$MESS["VINO_AUTH_PERK_REVIEW"] = "Leave wine reviews";
diff --git a/local/components/jinove/auth.login/templates/.default/lang/pl/template.php b/local/components/jinove/auth.login/templates/.default/lang/pl/template.php
new file mode 100644
index 0000000..faab42c
--- /dev/null
+++ b/local/components/jinove/auth.login/templates/.default/lang/pl/template.php
@@ -0,0 +1,24 @@
+danych osobowych na warunkach i w celach określonych w Polityce prywatności .';
+$MESS["VINO_AUTH_ERR_INVALID"] = "Nieprawidłowy e-mail lub hasło";
+$MESS["VINO_AUTH_ERR_TOO_OFTEN"] = "Zbyt wiele prób, spróbuj ponownie później";
+$MESS["VINO_AUTH_ERR_COMMON"] = "Nie udało się zalogować. Spróbuj ponownie";
+$MESS["VINO_AUTH_ASIDE_TITLE"] = "Po zalogowaniu możesz";
+$MESS["VINO_AUTH_ERR_ALTCHA"] = "Weryfikacja nieudana. Spróbuj ponownie.";
+$MESS["VINO_AUTH_PERK_PROFILE"] = "Edytować profil i dane kontaktowe";
+$MESS["VINO_AUTH_PERK_ORDERS"] = "Przeglądać historię i status zamówień";
+$MESS["VINO_AUTH_PERK_REVIEW"] = "Dodawać opinie o winach";
diff --git a/local/components/jinove/auth.login/templates/.default/lang/ru/template.php b/local/components/jinove/auth.login/templates/.default/lang/ru/template.php
new file mode 100644
index 0000000..33458fa
--- /dev/null
+++ b/local/components/jinove/auth.login/templates/.default/lang/ru/template.php
@@ -0,0 +1,24 @@
+персональных данных на условиях и для целей, определённых Политикой конфиденциальности .';
+$MESS["VINO_AUTH_ERR_INVALID"] = "Неверный e-mail или пароль";
+$MESS["VINO_AUTH_ERR_TOO_OFTEN"] = "Слишком много попыток, повторите позже";
+$MESS["VINO_AUTH_ERR_COMMON"] = "Не удалось войти. Повторите попытку";
+$MESS["VINO_AUTH_ASIDE_TITLE"] = "После входа вы сможете";
+$MESS["VINO_AUTH_ERR_ALTCHA"] = "Проверка не пройдена. Повторите попытку.";
+$MESS["VINO_AUTH_PERK_PROFILE"] = "Редактировать профиль и контактные данные";
+$MESS["VINO_AUTH_PERK_ORDERS"] = "Просматривать историю и статус заказов";
+$MESS["VINO_AUTH_PERK_REVIEW"] = "Оставлять отзывы о винах";
diff --git a/local/components/jinove/auth.login/templates/.default/script.js b/local/components/jinove/auth.login/templates/.default/script.js
new file mode 100644
index 0000000..5f1b3ce
--- /dev/null
+++ b/local/components/jinove/auth.login/templates/.default/script.js
@@ -0,0 +1,94 @@
+(function () {
+ function init() {
+ var form = document.querySelector('[data-auth-login]');
+ if (!form || !window.BX || !BX.ajax || !BX.ajax.runAction) return;
+ var email = form.elements.email;
+ var password = form.elements.password;
+ var submit = form.querySelector('[type="submit"]');
+ var err = form.querySelector('[data-auth-err]');
+ var started = Date.now();
+ var codes = { invalid: 'invalid', too_often: 'tooOften', altcha: 'altcha' };
+ var guard = form.querySelector('altcha-widget');
+
+ function say(text) {
+ err.textContent = text;
+ }
+
+ function mark(field, bad) {
+ field.classList.toggle('vino-inp--invalid', bad);
+ field.setAttribute('aria-invalid', bad ? 'true' : 'false');
+ }
+
+ function message(code) {
+ var key = codes[code] || 'error';
+ return form.dataset['msg' + key.charAt(0).toUpperCase() + key.slice(1)] || form.dataset.msgError;
+ }
+
+ VinoAltcha.arm(guard);
+
+
+ form.addEventListener('input', function (event) {
+ if (event.target.classList.contains('vino-inp--invalid')) mark(event.target, false);
+ });
+ form.elements.consent.addEventListener('change', function () {
+ form.querySelector('.vino-auth__consent').classList.remove('vino-consent--invalid');
+ });
+
+ form.addEventListener('submit', function (event) {
+ event.preventDefault();
+ var value = email.value.trim();
+ var badEmail = !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
+ var badPassword = password.value === '';
+ var badConsent = !form.elements.consent.checked;
+ mark(email, badEmail);
+ mark(password, badPassword);
+ form.querySelector('.vino-auth__consent').classList.toggle('vino-consent--invalid', badConsent);
+ form.elements.consent.setAttribute('aria-invalid', badConsent ? 'true' : 'false');
+ if (badEmail || badPassword || badConsent) {
+ say(badEmail ? form.dataset.msgEmail : badPassword ? form.dataset.msgPassword : form.dataset.msgConsent);
+ (badEmail ? email : badPassword ? password : form.elements.consent).focus();
+ return;
+ }
+ say('');
+ submit.disabled = true;
+ VinoAltcha.armed(guard).then(function (ok) {
+ if (!ok) return Promise.reject({ errors: [{ code: 'altcha' }] });
+ return BX.ajax.runAction('jinove:vinoteca.auth.login', {
+ data: {
+ email: value,
+ password: password.value,
+ remember: form.elements.remember.checked ? '1' : '',
+ consent: '1',
+ back: form.dataset.back || '',
+ lang: document.documentElement.lang || 'en',
+ website: form.elements.website.value,
+ elapsed: String(Date.now() - started),
+ altcha: form.elements.altcha ? form.elements.altcha.value : ''
+ }
+ });
+ }).then(function (response) {
+ if (form.dataset.embed === '1') {
+ try { sessionStorage.setItem('vinoOpenReview', '1'); } catch (e) {}
+ window.location.reload();
+ return;
+ }
+ window.location.href = (response.data && response.data.redirect) || '/';
+ }, function (response) {
+ submit.disabled = false;
+ VinoAltcha.reset(guard);
+ var code = response && response.errors && response.errors[0] ? response.errors[0].code : '';
+ if (code === 'invalid') {
+ mark(email, true);
+ mark(password, true);
+ }
+ say(message(code));
+ });
+ });
+ }
+
+ if (document.readyState === 'loading') {
+ document.addEventListener('DOMContentLoaded', init);
+ } else {
+ init();
+ }
+})();
diff --git a/local/components/jinove/auth.login/templates/.default/style.css b/local/components/jinove/auth.login/templates/.default/style.css
new file mode 100644
index 0000000..a2a1da6
--- /dev/null
+++ b/local/components/jinove/auth.login/templates/.default/style.css
@@ -0,0 +1,234 @@
+.vino-auth {
+ display: grid;
+ grid-template-columns: minmax(0, 360px) minmax(0, 440px);
+ gap: clamp(var(--space-10), 7vw, 112px);
+ align-items: center;
+ justify-content: center;
+ min-height: 62vh;
+ padding: var(--space-head) var(--gutter) var(--space-section);
+}
+.vino-auth__aside-title {
+ margin: 0 0 var(--space-6);
+ font-family: var(--font-serif);
+ font-weight: 500;
+ font-size: clamp(1.6rem, 2.4vw, 2.1rem);
+}
+.vino-auth__perks {
+ display: grid;
+ gap: var(--space-6);
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.vino-auth__perk {
+ display: flex;
+ align-items: center;
+ gap: var(--space-3);
+}
+.vino-auth__perk-icon {
+ flex: 0 0 auto;
+ width: 23px;
+ height: 23px;
+ color: var(--color-accent);
+}
+.vino-auth__perk-title {
+ color: var(--color-text);
+ font-size: var(--text-base);
+ line-height: 1.4;
+}
+.vino-auth--embed {
+ display: block;
+ min-height: 0;
+ padding: 0;
+}
+.vino-auth--embed .vino-auth__card {
+ max-width: none;
+ padding: 0;
+ border: 0;
+ background: transparent;
+}
+.vino-auth__card {
+ width: 100%;
+ max-width: 440px;
+ padding: clamp(var(--space-6), 4vw, var(--space-10));
+ background: var(--color-surface);
+ border: 1px solid var(--color-line);
+ border-top: 2px solid var(--color-accent);
+}
+.vino-auth__kicker {
+ margin: 0 0 var(--space-3);
+ color: var(--color-accent);
+ font-size: var(--text-13);
+ letter-spacing: var(--tracking-wide);
+ text-transform: uppercase;
+}
+.vino-auth__title {
+ margin: 0 0 var(--space-3);
+ font-family: var(--font-serif);
+ font-weight: 500;
+ font-size: clamp(2rem, 4vw, 2.6rem);
+ line-height: 1.08;
+}
+.vino-auth__lead {
+ margin: 0 0 var(--space-6);
+ color: var(--color-text-muted);
+ font-size: var(--text-15);
+ line-height: 1.5;
+}
+.vino-auth--single {
+ grid-template-columns: minmax(0, 560px);
+}
+.vino-auth--single .vino-auth__card {
+ max-width: 560px;
+}
+.vino-auth__demo {
+ margin: 0 0 var(--space-6);
+ padding: var(--space-3) var(--space-4);
+ background: color-mix(in srgb, var(--color-danger) 26%, transparent);
+ border: 1px solid color-mix(in srgb, var(--color-danger-soft) 50%, transparent);
+ color: var(--color-text);
+ font-size: var(--text-15);
+ line-height: 1.5;
+}
+.vino-auth__done {
+ margin: 0 0 var(--space-6);
+ color: var(--color-text);
+ font-size: var(--text-base);
+ line-height: 1.5;
+}
+.vino-auth__err--static {
+ min-height: 0;
+ margin-bottom: var(--space-4);
+}
+.vino-auth__form[hidden] {
+ display: none;
+}
+.vino-auth__form {
+ display: grid;
+ gap: var(--space-4);
+}
+.vino-auth__field {
+ display: grid;
+ gap: var(--space-2);
+}
+.vino-auth__label {
+ color: var(--color-accent);
+ font-size: var(--text-13);
+ letter-spacing: .14em;
+ text-transform: uppercase;
+}
+.vino-auth__hint {
+ color: var(--color-text-faint);
+ font-size: var(--text-13);
+ line-height: 1.5;
+}
+.vino-auth__input.vino-inp {
+ margin: 0;
+ padding: var(--space-3-5) var(--space-4);
+}
+.vino-auth__input.vino-inp--invalid {
+ border-color: var(--color-danger-soft);
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger-soft) 20%, transparent);
+}
+.vino-auth__password {
+ position: relative;
+ display: block;
+}
+.vino-auth__password .vino-auth__input {
+ padding-right: 112px;
+}
+.vino-auth__toggle {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ padding: 0 var(--space-4);
+ border: 0;
+ background: transparent;
+ color: var(--color-text-muted);
+ font: inherit;
+ font-size: var(--text-13);
+ letter-spacing: .08em;
+ text-transform: uppercase;
+ cursor: pointer;
+ transition: color var(--duration-fast) var(--ease-base);
+}
+.vino-auth__toggle[hidden] {
+ display: none;
+}
+.vino-auth__toggle:focus-visible {
+ outline: 2px solid var(--color-accent);
+ outline-offset: -4px;
+}
+.vino-auth__consent.vino-consent--invalid .vino-consent__checkbox {
+ border-color: var(--color-danger-soft);
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger-soft) 20%, transparent);
+}
+.vino-auth__link {
+ color: var(--color-accent);
+ font-size: var(--text-15);
+ text-decoration: none;
+ border-bottom: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
+ transition: color var(--duration-fast) var(--ease-base), border-color var(--duration-fast) var(--ease-base);
+}
+.vino-auth__err {
+ min-height: calc(1em * var(--leading-ui));
+ margin: 0;
+ color: var(--color-danger-soft);
+ font-size: var(--text-13);
+ line-height: var(--leading-ui);
+}
+.vino-auth__form .vino-auth__submit {
+ justify-content: center;
+ width: 100%;
+ min-height: 52px;
+ text-align: center;
+}
+.vino-auth__form .vino-consent {
+ margin: 0;
+}
+.vino-auth__form .vino-consent--sm .vino-consent__text {
+ font-size: var(--text-13);
+ line-height: 1.5;
+}
+.vino-auth__links {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ gap: var(--space-2) var(--space-6);
+}
+.vino-auth__input.vino-inp:-webkit-autofill,
+.vino-auth__input.vino-inp:-webkit-autofill:focus {
+ border-color: var(--color-line-field);
+}
+@media (hover: hover) {
+ .vino-auth__toggle:hover {
+ color: var(--color-text);
+ }
+ .vino-auth__link:hover {
+ color: var(--color-accent-hover);
+ border-color: var(--color-accent-hover);
+ }
+}
+@media (max-width: 980px) {
+ .vino-auth:not(.vino-auth--embed):not(.vino-auth--single) {
+ grid-template-columns: minmax(0, 440px);
+ }
+ .vino-auth__aside {
+ display: none;
+ }
+}
+@media (max-width: 760px) {
+ .vino-auth__link {
+ position: relative;
+ }
+ .vino-auth__link::before {
+ content: "";
+ position: absolute;
+ inset: -12px -6px;
+ }
+ .vino-auth__form .vino-consent {
+ padding-block: var(--space-3);
+ margin-block: -12px;
+ }
+}
diff --git a/local/components/jinove/auth.login/templates/.default/template.php b/local/components/jinove/auth.login/templates/.default/template.php
new file mode 100644
index 0000000..4da77a5
--- /dev/null
+++ b/local/components/jinove/auth.login/templates/.default/template.php
@@ -0,0 +1,59 @@
+
+
+">
+
+
+
= Loc::getMessage("VINO_AUTH_ASIDE_TITLE") ?>
+
+ = Loc::getMessage("VINO_AUTH_PERK_PROFILE") ?>
+ = Loc::getMessage("VINO_AUTH_PERK_ORDERS") ?>
+ = Loc::getMessage("VINO_AUTH_PERK_REVIEW") ?>
+
+
+
+
+
= Loc::getMessage("VINO_AUTH_KICKER") ?>
+ <= $titleTag ?> class="vino-auth__title">= htmlspecialcharsbx($arResult["TITLE"] !== "" ? $arResult["TITLE"] : Loc::getMessage("VINO_AUTH_TITLE")) ?>= $titleTag ?>>
+
= htmlspecialcharsbx($arResult["LEAD"] !== "" ? $arResult["LEAD"] : Loc::getMessage("VINO_AUTH_LEAD")) ?>
+
+
+
diff --git a/local/components/jinove/auth.register/class.php b/local/components/jinove/auth.register/class.php
new file mode 100644
index 0000000..72db1aa
--- /dev/null
+++ b/local/components/jinove/auth.register/class.php
@@ -0,0 +1,37 @@
+getContext()->getRequest();
+ $safeBack = Redirect::safe((string)$request->getQuery("back"));
+ if ((int)CurrentUser::get()->getId() > 0) {
+ LocalRedirect($safeBack !== "" ? $safeBack : SITE_DIR);
+ }
+ $GLOBALS["APPLICATION"]->SetTitle(Loc::getMessage("VINO_REG_PAGE_TITLE"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("description", Loc::getMessage("VINO_REG_PAGE_DESCRIPTION"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_alternates", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_schema", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("robots", "noindex, nofollow");
+ $this->arResult = [
+ "BACK" => $safeBack,
+ "LOGIN_URL" => SITE_DIR . "login/" . ($safeBack !== "" ? "?back=" . rawurlencode($safeBack) : ""),
+ ];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+}
diff --git a/local/components/jinove/auth.register/lang/en/class.php b/local/components/jinove/auth.register/lang/en/class.php
new file mode 100644
index 0000000..52d6592
--- /dev/null
+++ b/local/components/jinove/auth.register/lang/en/class.php
@@ -0,0 +1,3 @@
+personal data on the terms and for the purposes set out in the Privacy Policy .';
+$MESS["VINO_REG_ASIDE_TITLE"] = "After registering you will be able to";
+$MESS["VINO_REG_PERK_PROFILE"] = "Edit your profile and contact details";
+$MESS["VINO_REG_PERK_ORDERS"] = "View the history and status of orders";
+$MESS["VINO_REG_PERK_REVIEW"] = "Leave wine reviews";
+$MESS["VINO_REG_ERR_RETRY"] = "Please submit again";
+$MESS["VINO_REG_DEMO"] = "Registration is disabled on this demonstration site";
diff --git a/local/components/jinove/auth.register/templates/.default/lang/pl/template.php b/local/components/jinove/auth.register/templates/.default/lang/pl/template.php
new file mode 100644
index 0000000..315b060
--- /dev/null
+++ b/local/components/jinove/auth.register/templates/.default/lang/pl/template.php
@@ -0,0 +1,26 @@
+danych osobowych na warunkach i w celach określonych w Polityce prywatności .';
+$MESS["VINO_REG_ASIDE_TITLE"] = "Po rejestracji możesz";
+$MESS["VINO_REG_PERK_PROFILE"] = "Edytować profil i dane kontaktowe";
+$MESS["VINO_REG_PERK_ORDERS"] = "Przeglądać historię i status zamówień";
+$MESS["VINO_REG_PERK_REVIEW"] = "Dodawać opinie o winach";
+$MESS["VINO_REG_ERR_RETRY"] = "Wyślij ponownie";
+$MESS["VINO_REG_DEMO"] = "Na stronie demonstracyjnej rejestracja jest wyłączona";
diff --git a/local/components/jinove/auth.register/templates/.default/lang/ru/template.php b/local/components/jinove/auth.register/templates/.default/lang/ru/template.php
new file mode 100644
index 0000000..59d1c01
--- /dev/null
+++ b/local/components/jinove/auth.register/templates/.default/lang/ru/template.php
@@ -0,0 +1,26 @@
+персональных данных на условиях и для целей, определённых Политикой конфиденциальности .';
+$MESS["VINO_REG_ASIDE_TITLE"] = "После регистрации вы сможете";
+$MESS["VINO_REG_PERK_PROFILE"] = "Редактировать профиль и контактные данные";
+$MESS["VINO_REG_PERK_ORDERS"] = "Просматривать историю и статус заказов";
+$MESS["VINO_REG_PERK_REVIEW"] = "Оставлять отзывы о винах";
+$MESS["VINO_REG_ERR_RETRY"] = "Повторите отправку";
+$MESS["VINO_REG_DEMO"] = "На демонстрационном сайте регистрация отключена";
diff --git a/local/components/jinove/auth.register/templates/.default/script.js b/local/components/jinove/auth.register/templates/.default/script.js
new file mode 100644
index 0000000..686cdbb
--- /dev/null
+++ b/local/components/jinove/auth.register/templates/.default/script.js
@@ -0,0 +1,89 @@
+(function () {
+ function init() {
+ var form = document.querySelector('[data-auth-register]');
+ if (!form || !window.BX || !BX.ajax || !BX.ajax.runAction) return;
+ var name = form.elements.name;
+ var email = form.elements.email;
+ var password = form.elements.password;
+ var submit = form.querySelector('[type="submit"]');
+ var err = form.querySelector('[data-auth-err]');
+ var started = Date.now();
+ var codes = { too_often: 'tooOften', altcha: 'altcha', retry: 'retry' };
+ var guard = form.querySelector('altcha-widget');
+
+ function say(text) {
+ err.textContent = text;
+ }
+
+ function mark(field, bad) {
+ field.classList.toggle('vino-inp--invalid', bad);
+ field.setAttribute('aria-invalid', bad ? 'true' : 'false');
+ }
+
+ function message(code) {
+ var key = codes[code] || 'error';
+ return form.dataset['msg' + key.charAt(0).toUpperCase() + key.slice(1)] || form.dataset.msgError;
+ }
+
+ VinoAltcha.arm(guard);
+
+
+ form.addEventListener('input', function (event) {
+ if (event.target.classList.contains('vino-inp--invalid')) mark(event.target, false);
+ });
+ form.elements.consent.addEventListener('change', function () {
+ form.querySelector('.vino-auth__consent').classList.remove('vino-consent--invalid');
+ });
+
+ form.addEventListener('submit', function (event) {
+ event.preventDefault();
+ var nameValue = name.value.trim();
+ var emailValue = email.value.trim();
+ var badName = nameValue === '';
+ var badEmail = !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(emailValue);
+ var badPassword = password.value.length < 8;
+ var badConsent = !form.elements.consent.checked;
+ mark(name, badName);
+ mark(email, badEmail);
+ mark(password, badPassword);
+ form.querySelector('.vino-auth__consent').classList.toggle('vino-consent--invalid', badConsent);
+ form.elements.consent.setAttribute('aria-invalid', badConsent ? 'true' : 'false');
+ if (badName || badEmail || badPassword || badConsent) {
+ say(badName ? form.dataset.msgName : badEmail ? form.dataset.msgEmail : badPassword ? form.dataset.msgPassword : form.dataset.msgConsent);
+ (badName ? name : badEmail ? email : badPassword ? password : form.elements.consent).focus();
+ return;
+ }
+ say('');
+ submit.disabled = true;
+ VinoAltcha.armed(guard).then(function (ok) {
+ if (!ok) return Promise.reject({ errors: [{ code: 'altcha' }] });
+ return BX.ajax.runAction('jinove:vinoteca.register.create', {
+ data: {
+ name: nameValue,
+ email: emailValue,
+ password: password.value,
+ consent: '1',
+ back: form.dataset.back || '',
+ lang: document.documentElement.lang || 'en',
+ website: form.elements.website.value,
+ elapsed: String(Date.now() - started),
+ altcha: form.elements.altcha ? form.elements.altcha.value : ''
+ }
+ });
+ }).then(function (response) {
+ window.location.href = (response.data && response.data.redirect) || '/';
+ }, function (response) {
+ submit.disabled = false;
+ VinoAltcha.reset(guard);
+ var code = response && response.errors && response.errors[0] ? response.errors[0].code : '';
+ say(message(code));
+ });
+ });
+ }
+
+ if (document.readyState === 'loading') {
+ document.addEventListener('DOMContentLoaded', init);
+ } else {
+ init();
+ }
+})();
diff --git a/local/components/jinove/auth.register/templates/.default/template.php b/local/components/jinove/auth.register/templates/.default/template.php
new file mode 100644
index 0000000..69e27b2
--- /dev/null
+++ b/local/components/jinove/auth.register/templates/.default/template.php
@@ -0,0 +1,63 @@
+addExternalCss("/local/components/jinove/auth.login/templates/.default/style.css");
+$uid = "vino-reg";
+?>
+
+
+
= Loc::getMessage("VINO_REG_ASIDE_TITLE") ?>
+
+ = Loc::getMessage("VINO_REG_PERK_PROFILE") ?>
+ = Loc::getMessage("VINO_REG_PERK_ORDERS") ?>
+ = Loc::getMessage("VINO_REG_PERK_REVIEW") ?>
+
+
+
+
= Loc::getMessage("VINO_REG_KICKER") ?>
+
= Loc::getMessage("VINO_REG_TITLE") ?>
+
= Loc::getMessage("VINO_REG_LEAD") ?>
+
= Loc::getMessage("VINO_REG_DEMO") ?>
+
+
+
diff --git a/local/components/jinove/auth.reset/class.php b/local/components/jinove/auth.reset/class.php
new file mode 100644
index 0000000..3f04562
--- /dev/null
+++ b/local/components/jinove/auth.reset/class.php
@@ -0,0 +1,42 @@
+getId() > 0) {
+ LocalRedirect(SITE_DIR);
+ }
+ $request = Application::getInstance()->getContext()->getRequest();
+ $rawLogin = $request->getQuery("login");
+ $rawCheckword = $request->getQuery("checkword");
+ $login = is_string($rawLogin) ? $rawLogin : "";
+ $checkword = is_string($rawCheckword) ? $rawCheckword : "";
+ $GLOBALS["APPLICATION"]->SetTitle(Loc::getMessage("VINO_RESET_PAGE_TITLE"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("description", Loc::getMessage("VINO_RESET_PAGE_DESCRIPTION"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_alternates", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_schema", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("robots", "noindex, nofollow");
+ $GLOBALS["APPLICATION"]->AddHeadString(' ');
+ $this->arResult = [
+ "LOGIN" => mb_strlen($login) <= 254 ? $login : "",
+ "CHECKWORD" => preg_match('/^[A-Za-z0-9]{32}$/', $checkword) ? $checkword : "",
+ "LOGIN_URL" => SITE_DIR . "login/",
+ "FORGOT_URL" => SITE_DIR . "forgot-password/",
+ ];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+}
diff --git a/local/components/jinove/auth.reset/lang/en/class.php b/local/components/jinove/auth.reset/lang/en/class.php
new file mode 100644
index 0000000..ef197b7
--- /dev/null
+++ b/local/components/jinove/auth.reset/lang/en/class.php
@@ -0,0 +1,3 @@
+addExternalCss("/local/components/jinove/auth.login/templates/.default/style.css");
+$uid = "vino-reset";
+$valid = $arResult["LOGIN"] !== "" && $arResult["CHECKWORD"] !== "";
+?>
+
+
+
= Loc::getMessage("VINO_RESET_KICKER") ?>
+
= Loc::getMessage("VINO_RESET_TITLE") ?>
+
+ = Loc::getMessage("VINO_RESET_DONE") ?>
+ ">= Loc::getMessage("VINO_RESET_LOGIN") ?>
+
+
+
= Loc::getMessage("VINO_RESET_ERR_LINK") ?>
+
+
+
= Loc::getMessage("VINO_RESET_LEAD") ?>
+
+
+
+
diff --git a/local/components/jinove/cart/class.php b/local/components/jinove/cart/class.php
new file mode 100644
index 0000000..42dc343
--- /dev/null
+++ b/local/components/jinove/cart/class.php
@@ -0,0 +1,42 @@
+SetTitle(Loc::getMessage("VINO_CART_PAGE_TITLE"));
+ $APPLICATION->SetPageProperty("title", Loc::getMessage("VINO_CART_BROWSER_TITLE"));
+ $APPLICATION->SetPageProperty("description", Loc::getMessage("VINO_CART_PAGE_DESCRIPTION"));
+ $APPLICATION->SetPageProperty("vino_alternates", "N");
+ $APPLICATION->SetPageProperty("vino_schema", "N");
+ $APPLICATION->SetPageProperty("robots", "noindex, nofollow");
+ $basket = Cart::load();
+ $shareCode = (string)Context::getCurrent()->getRequest()->getQuery("share");
+ $shareItems = $basket !== null && $shareCode !== "" ? Cart::parseShare($shareCode) : [];
+ $this->arResult = [
+ "TITLE" => (string)Loc::getMessage("VINO_CART_PAGE_TITLE"),
+ "SHARED" => $shareItems ? Cart::shared($shareItems) : null,
+ "SHARE_REQUESTED" => $shareCode !== "",
+ "CART_URL" => SITE_DIR . "personal/cart/",
+ "CART" => $basket !== null ? Cart::view($basket) : ["count" => 0, "summary" => "", "items" => [], "base" => "", "discount" => "", "total" => "", "coupons" => []],
+ "CATALOG_URL" => SITE_DIR . "catalog/",
+ "CHECKOUT_URL" => SITE_DIR . "personal/order/",
+ "MAX_QUANTITY" => Cart::MAX_QUANTITY,
+ ];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+}
diff --git a/local/components/jinove/cart/lang/en/class.php b/local/components/jinove/cart/lang/en/class.php
new file mode 100644
index 0000000..69cad2e
--- /dev/null
+++ b/local/components/jinove/cart/lang/en/class.php
@@ -0,0 +1,4 @@
+ ';
+ li.appendChild(span);
+ li.appendChild(button);
+ return li;
+ }
+
+ function lock(li, on) {
+ var removed = field(li, 'removed');
+ Array.prototype.forEach.call(li.children, function (child) {
+ if (child !== removed) child.inert = on;
+ });
+ li.classList.toggle('vino-cart__item--removed', on);
+ removed.hidden = !on;
+ }
+
+ function patch(cart) {
+ var seen = {};
+ cart.items.forEach(function (data) {
+ var li = item(data.id);
+ if (!li) return;
+ seen[data.id] = true;
+ if (!timers[data.id]) {
+ if (li.classList.contains('vino-cart__item--removed')) lock(li, false);
+ field(li, 'value').textContent = data.quantity;
+ }
+ li.classList.toggle('vino-cart__item--unavailable', !data.available);
+ field(li, 'unavailable').hidden = data.available;
+ field(li, 'price').textContent = data.price;
+ var old = field(li, 'old');
+ old.textContent = data.basePrice;
+ old.hidden = !data.basePrice;
+ field(li, 'sum').textContent = data.sum;
+ });
+ root.querySelectorAll('[data-cart-item]').forEach(function (li) {
+ var id = li.getAttribute('data-cart-item');
+ var removed = li.classList.contains('vino-cart__item--removed');
+ if (!seen[id] && !timers[id] && (clearing || !removed)) li.remove();
+ });
+ root.querySelector('[data-cart-count-text]').textContent = cart.summary;
+ root.querySelector('[data-cart-base]').textContent = cart.base;
+ root.querySelector('[data-cart-total]').textContent = cart.total;
+ root.querySelector('[data-cart-discount]').textContent = cart.discount || '—';
+ root.querySelector('[data-cart-discount-line]').classList.toggle('vino-cart__line--none', !cart.discount);
+ couponList.textContent = '';
+ var applied = 0;
+ cart.coupons.forEach(function (coupon) {
+ if (!coupon.applied) return;
+ couponList.appendChild(couponRow(coupon.code));
+ applied++;
+ });
+ if (!applied) couponExpanded = false;
+ couponRowBox.hidden = applied > 0 && !couponExpanded;
+ couponHint.hidden = couponRowBox.hidden;
+ couponMore.hidden = applied === 0 || couponExpanded;
+ var left = root.querySelectorAll('[data-cart-item]').length;
+ layout.hidden = !left;
+ empty.hidden = !!left;
+ }
+
+ function apply(res, sent) {
+ var data = res && res.data;
+ if (!data || !data.cart || sent !== version) return;
+ if (data.state) document.dispatchEvent(new CustomEvent('vino:basket', { detail: data.state }));
+ showFail(!data.ok);
+ patch(data.cart);
+ }
+
+ function recover(sent) {
+ if (sent !== version) return;
+ showFail(true);
+ BX.ajax.runAction('jinove:vinoteca.basket.cart', { method: 'GET' }).then(function (res) {
+ if (sent === version && res.data && res.data.cart) {
+ if (res.data.state) document.dispatchEvent(new CustomEvent('vino:basket', { detail: res.data.state }));
+ patch(res.data.cart);
+ }
+ }, noop);
+ }
+
+ function busy() {
+ root.classList.toggle('vino-cart--busy', inflight > 0 || Object.keys(timers).length > 0);
+ }
+
+ function request(action, data) {
+ var run = function () {
+ return BX.ajax.runAction('jinove:vinoteca.basket.' + action, { data: data || {} });
+ };
+ inflight++;
+ busy();
+ var result = queue.then(run);
+ queue = result.then(noop, noop);
+ queue.then(function () {
+ inflight--;
+ busy();
+ });
+ return result;
+ }
+
+ function call(action, data) {
+ version++;
+ var sent = version;
+ return request(action, data).then(function (res) {
+ apply(res, sent);
+ return res;
+ }, function (res) {
+ recover(sent);
+ throw res;
+ });
+ }
+
+ function send(id, qty) {
+ clearTimeout(timers[id]);
+ timers[id] = setTimeout(function () {
+ delete timers[id];
+ call('update', { id: id, qty: qty }).then(noop, noop);
+ }, 350);
+ busy();
+ }
+
+ function cancel(id) {
+ clearTimeout(timers[id]);
+ delete timers[id];
+ busy();
+ }
+
+ function step(li, delta) {
+ var id = li.getAttribute('data-cart-item');
+ var value = field(li, 'value');
+ var qty = Math.max(1, Math.min(max, (parseInt(value.textContent, 10) || 1) + delta));
+ if (String(qty) === value.textContent) return;
+ value.textContent = qty;
+ send(id, qty);
+ }
+
+ function remove(li) {
+ var id = li.getAttribute('data-cart-item');
+ li.setAttribute('data-cart-was', field(li, 'value').textContent);
+ cancel(id);
+ lock(li, true);
+ field(li, 'restore').focus();
+ call('update', { id: id, qty: 0 }).then(noop, noop);
+ }
+
+ function restore(li) {
+ var id = li.getAttribute('data-cart-item');
+ var qty = parseInt(li.getAttribute('data-cart-was'), 10) || 1;
+ cancel(id);
+ lock(li, false);
+ field(li, 'value').textContent = qty;
+ field(li, 'remove').focus();
+ call('update', { id: id, qty: qty }).then(noop, noop);
+ }
+
+ function flush() {
+ Object.keys(timers).forEach(function (id) {
+ var li = item(id);
+ cancel(id);
+ if (li) call('update', { id: id, qty: parseInt(field(li, 'value').textContent, 10) || 1 }).then(noop, noop);
+ });
+ }
+
+ function checkout(link, e) {
+ if (!root.classList.contains('vino-cart--busy')) return;
+ e.preventDefault();
+ if (link.getAttribute('aria-busy') === 'true') return;
+ link.setAttribute('aria-busy', 'true');
+ flush();
+ queue.then(function () {
+ link.removeAttribute('aria-busy');
+ if (fail.hidden) location.href = link.href;
+ });
+ }
+
+ function toggleConfirm(on) {
+ confirmBox.hidden = !on;
+ actions.hidden = on;
+ (on ? root.querySelector('[data-cart-clear-no]') : clearButton).focus();
+ }
+
+ function clearCart() {
+ confirmBox.hidden = true;
+ actions.hidden = false;
+ Object.keys(timers).forEach(cancel);
+ clearing = true;
+ layout.hidden = true;
+ empty.hidden = false;
+ emptyTitle.focus();
+ call('clear').then(noop, noop).then(function () { clearing = false; });
+ }
+
+ function shareLink() {
+ var pairs = [];
+ root.querySelectorAll('[data-cart-item]:not(.vino-cart__item--removed)').forEach(function (li) {
+ pairs.push(li.getAttribute('data-cart-item') + '-' + (parseInt(field(li, 'value').textContent, 10) || 1));
+ });
+ return location.origin + location.pathname + '?share=' + pairs.join('.');
+ }
+
+ function copied() {
+ var done = root.querySelector('[data-cart-share-done]').textContent;
+ shareButton.classList.add('vino-cart__share--done');
+ shareStatus.textContent = done;
+ clearTimeout(shareTimer);
+ shareTimer = setTimeout(function () {
+ shareButton.classList.remove('vino-cart__share--done');
+ shareStatus.textContent = '';
+ }, 2500);
+ }
+
+ function showLink(link) {
+ var input = shareFallback.querySelector('[data-cart-share-input]');
+ input.value = link;
+ shareFallback.hidden = false;
+ input.focus();
+ input.select();
+ }
+
+ function share() {
+ var link = shareLink();
+ shareFallback.hidden = true;
+ if (navigator.share && window.matchMedia('(pointer: coarse)').matches) {
+ navigator.share({ title: shareButton.getAttribute('data-title'), url: link }).catch(noop);
+ return;
+ }
+ if (navigator.clipboard && window.isSecureContext) {
+ navigator.clipboard.writeText(link).then(copied, function () { showLink(link); });
+ return;
+ }
+ showLink(link);
+ }
+
+ function addShared(button) {
+ var box = button.closest('[data-cart-shared]');
+ button.disabled = true;
+ BX.ajax.runAction('jinove:vinoteca.basket.addShared', { data: { code: box.getAttribute('data-cart-shared') } }).then(function () {
+ location.replace(box.getAttribute('data-cart-url'));
+ }, function () {
+ button.disabled = false;
+ showFail(true);
+ });
+ }
+
+ function expandCoupon() {
+ couponExpanded = true;
+ couponRowBox.hidden = false;
+ couponMore.hidden = true;
+ couponInput.focus();
+ }
+
+ function couponFail(message) {
+ couponError.textContent = message;
+ couponError.hidden = !message;
+ couponForm.classList.toggle('vino-cart__coupon--error', !!message);
+ couponInput.setAttribute('aria-invalid', message ? 'true' : 'false');
+ }
+
+ root.addEventListener('click', function (e) {
+ var target = e.target.closest('button');
+ if (!target || !root.contains(target)) return;
+ var li = target.closest('[data-cart-item]');
+ if (target.hasAttribute('data-cart-step') && li) step(li, parseInt(target.getAttribute('data-cart-step'), 10));
+ else if (target.hasAttribute('data-cart-remove') && li) remove(li);
+ else if (target.hasAttribute('data-cart-restore') && li) restore(li);
+ else if (target.hasAttribute('data-cart-share')) share();
+ else if (target.hasAttribute('data-cart-shared-add')) addShared(target);
+ else if (target.hasAttribute('data-cart-coupon-more')) expandCoupon();
+ else if (target.hasAttribute('data-cart-clear')) toggleConfirm(true);
+ else if (target.hasAttribute('data-cart-clear-no')) toggleConfirm(false);
+ else if (target.hasAttribute('data-cart-clear-yes')) clearCart();
+ else if (target.hasAttribute('data-cart-coupon-remove')) {
+ call('couponRemove', { code: target.getAttribute('data-cart-coupon-remove') }).then(function () { couponInput.focus(); }, noop);
+ }
+ });
+
+ root.addEventListener('click', function (e) {
+ var link = e.target.closest('[data-cart-checkout]');
+ if (link) checkout(link, e);
+ });
+
+ root.addEventListener('keydown', function (e) {
+ if (e.key !== 'Escape') return;
+ if (!confirmBox.hidden) toggleConfirm(false);
+ else if (!shareFallback.hidden) {
+ shareFallback.hidden = true;
+ shareButton.focus();
+ }
+ });
+
+ couponForm.addEventListener('submit', function (e) {
+ e.preventDefault();
+ var code = couponInput.value.trim();
+ if (!code) {
+ couponFail(text('coupon-empty'));
+ couponInput.focus();
+ return;
+ }
+ couponFail('');
+ var button = couponForm.querySelector('[type="submit"]');
+ button.disabled = true;
+ version++;
+ var sent = version;
+ request('coupon', { code: code }).then(function (res) {
+ button.disabled = false;
+ couponInput.value = '';
+ couponExpanded = false;
+ apply(res, sent);
+ var chip = couponList.querySelector('button');
+ if (chip) chip.focus();
+ }, function (res) {
+ var error = res && res.errors && res.errors[0];
+ button.disabled = false;
+ if (error && error.code === 'coupon') couponFail(text('coupon-error'));
+ else showFail(true);
+ couponInput.focus();
+ });
+ });
+
+ couponHint.addEventListener('click', function (e) {
+ var fill = e.target.closest('[data-cart-coupon-fill]');
+ if (!fill) return;
+ couponInput.value = fill.getAttribute('data-cart-coupon-fill');
+ couponInput.dispatchEvent(new Event('input'));
+ couponInput.focus();
+ });
+
+ couponInput.addEventListener('input', function () {
+ if (!couponError.hidden) couponFail('');
+ });
+})();
diff --git a/local/components/jinove/cart/templates/.default/style.css b/local/components/jinove/cart/templates/.default/style.css
new file mode 100644
index 0000000..ed7b244
--- /dev/null
+++ b/local/components/jinove/cart/templates/.default/style.css
@@ -0,0 +1,659 @@
+.vino-cart {
+ --vino-cart-summary-width: 360px;
+ --vino-cart-field-height: 48px;
+ --vino-cart-qty-width: 120px;
+ --vino-cart-shared-sum-width: 110px;
+ --vino-cart-icon-sm: 14px;
+ --vino-cart-icon: 20px;
+ --vino-cart-disabled-opacity: .45;
+ --vino-cart-shared-pic-width: 72px;
+ --vino-cart-shared-pic-height: 90px;
+ --vino-cart-pic-width: 80px;
+ --vino-cart-pic-height: 100px;
+ padding: var(--space-10) var(--gutter) var(--space-section);
+}
+.vino-cart__layout,
+.vino-cart__empty {
+ max-width: var(--container);
+ margin: 0 auto;
+}
+.vino-cart__layout {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) var(--vino-cart-summary-width);
+ gap: var(--space-grid-wide);
+ align-items: start;
+}
+.vino-cart__layout[hidden],
+.vino-cart__empty[hidden] {
+ display: none;
+}
+.vino-cart__main {
+ min-width: 0;
+ container: vino-cart-main / inline-size;
+}
+.vino-cart__toolbar {
+ position: relative;
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--space-3) var(--space-6);
+ min-height: var(--size-tap);
+ padding-bottom: var(--space-4);
+ border-bottom: 1px solid var(--color-line);
+}
+.vino-cart__count {
+ margin: 0;
+ color: var(--color-text-muted);
+ font-size: var(--text-15);
+}
+.vino-cart__actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0 var(--space-6);
+}
+.vino-cart__actions[hidden] {
+ display: none;
+}
+.vino-cart__share {
+ display: inline-grid;
+ align-items: center;
+}
+.vino-cart__share-label {
+ grid-area: 1 / 1;
+ transition: opacity var(--duration-fast) var(--ease-base);
+}
+.vino-cart__share-label--done,
+.vino-cart__share--done .vino-cart__share-label--idle {
+ opacity: 0;
+}
+.vino-cart__share--done .vino-cart__share-label--done {
+ opacity: 1;
+}
+.vino-cart__share-fallback {
+ position: absolute;
+ top: 100%;
+ right: 0;
+ z-index: 2;
+ display: block;
+ width: min(420px, 100%);
+ margin-top: var(--space-2);
+ padding: var(--space-3);
+ background: var(--color-surface);
+ border: 1px solid var(--color-line);
+ border-radius: var(--radius-sm);
+}
+.vino-cart__share-fallback[hidden] {
+ display: none;
+}
+.vino-cart__share-input.vino-inp {
+ width: 100%;
+ margin: 0;
+}
+.vino-cart__shared {
+ max-width: var(--container);
+ margin: 0 auto var(--space-10);
+ padding: var(--space-card);
+ background: var(--color-surface);
+ border: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
+ border-radius: var(--radius-sm);
+}
+.vino-cart__shared-title {
+ margin: 0;
+ font-family: var(--font-serif);
+ font-size: var(--fs-h4);
+ font-weight: 400;
+ line-height: var(--leading-title);
+}
+.vino-cart__shared-hint {
+ margin: var(--space-2) 0 0;
+ color: var(--color-text-muted);
+ font-size: var(--text-15);
+}
+.vino-cart__shared-list {
+ margin: var(--space-4) 0 0;
+ padding: 0;
+ list-style: none;
+}
+.vino-cart__shared-item {
+ display: grid;
+ grid-template-columns: var(--vino-cart-shared-pic-width) minmax(0, 1fr) auto var(--vino-cart-shared-sum-width);
+ align-items: center;
+ gap: var(--space-4);
+ padding: var(--space-2) 0;
+ border-bottom: 1px solid var(--color-line);
+ font-size: var(--text-15);
+}
+.vino-cart__shared-pic {
+ position: relative;
+ display: flex;
+ width: var(--vino-cart-shared-pic-width);
+ height: var(--vino-cart-shared-pic-height);
+ background: var(--color-bg);
+ border-radius: var(--radius-sm);
+ overflow: hidden;
+}
+.vino-cart__shared-name {
+ color: var(--color-text);
+ text-decoration: none;
+ transition: color var(--duration-fast) var(--ease-base);
+}
+.vino-cart__shared-qty {
+ color: var(--color-text-muted);
+ font-variant-numeric: tabular-nums;
+}
+.vino-cart__shared-sum {
+ font-variant-numeric: tabular-nums;
+ text-align: right;
+ white-space: nowrap;
+}
+.vino-cart__shared-foot {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: var(--space-3);
+ margin-top: var(--space-4);
+}
+.vino-cart__shared-total {
+ margin: 0 auto 0 0;
+ color: var(--color-text-muted);
+ font-size: var(--text-15);
+}
+.vino-cart__shared-total-value {
+ color: var(--color-text);
+ font-weight: 600;
+}
+.vino-cart__link,
+.vino-cart__restore {
+ min-height: var(--size-tap);
+ padding: 0;
+ border: 0;
+ background: none;
+ color: var(--color-accent);
+ font-family: var(--font-sans);
+ font-size: var(--text-13);
+ letter-spacing: var(--tracking-sm);
+ text-transform: uppercase;
+ cursor: pointer;
+}
+.vino-cart__confirm {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: var(--space-3);
+}
+.vino-cart__confirm[hidden] {
+ display: none;
+}
+.vino-cart__confirm-text {
+ margin: 0;
+ font-size: var(--text-15);
+}
+.vino-cart__fail {
+ margin: var(--space-4) 0 0;
+ color: var(--color-danger-soft);
+ font-size: var(--text-15);
+}
+.vino-cart__list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.vino-cart__item {
+ position: relative;
+ display: grid;
+ grid-template-columns: var(--vino-cart-pic-width) minmax(0, 1fr) auto var(--vino-cart-qty-width) var(--size-tap);
+ align-items: center;
+ gap: var(--space-6);
+ padding: var(--space-4) 0;
+ border-bottom: 1px solid var(--color-line);
+}
+.vino-cart__pic {
+ position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: var(--vino-cart-pic-width);
+ height: var(--vino-cart-pic-height);
+ background: var(--color-surface);
+ border-radius: var(--radius-sm);
+ overflow: hidden;
+}
+.vino-cart__img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+.vino-cart__info {
+ min-width: 0;
+}
+.vino-cart__name {
+ display: inline-block;
+ color: var(--color-text);
+ font-family: var(--font-serif);
+ font-size: var(--fs-h4);
+ line-height: var(--leading-title);
+ text-decoration: none;
+ transition: color var(--duration-fast) var(--ease-base);
+}
+.vino-cart__meta {
+ margin: var(--space-1) 0 0;
+ color: var(--color-text-faint);
+ font-size: var(--text-13);
+ line-height: var(--leading-ui);
+}
+.vino-cart__unit {
+ margin: var(--space-2) 0 0;
+ color: var(--color-text-muted);
+ font-size: var(--text-13);
+}
+.vino-cart__old {
+ margin-left: var(--space-2);
+ color: var(--color-text-faint);
+}
+.vino-cart__old[hidden],
+.vino-cart__warning[hidden] {
+ display: none;
+}
+.vino-cart__warning {
+ margin: var(--space-2) 0 0;
+ color: var(--color-danger-soft);
+ font-size: var(--text-13);
+}
+.vino-cart__item--unavailable .vino-cart__pic,
+.vino-cart__item--unavailable .vino-cart__sum {
+ opacity: var(--vino-cart-disabled-opacity);
+}
+.vino-cart__qty {
+ display: inline-flex;
+ align-items: center;
+ height: var(--size-tap);
+ border-bottom: 1px solid color-mix(in srgb, var(--color-accent) 55%, transparent);
+ border-radius: 0;
+}
+.vino-cart__step {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: var(--size-tap);
+ height: calc(var(--size-tap) - 1px);
+ padding: 0;
+ border: 0;
+ border-radius: 0;
+ background: transparent;
+ color: var(--color-accent);
+ cursor: pointer;
+ transition: background var(--duration-fast) var(--ease-base), color var(--duration-fast) var(--ease-base);
+}
+.vino-cart__step-icon {
+ width: var(--vino-cart-icon-sm);
+ height: var(--vino-cart-icon-sm);
+}
+.vino-cart__value {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ align-self: stretch;
+ min-width: 3ch;
+ color: var(--color-text);
+ font-size: var(--text-15);
+ font-weight: 600;
+ font-variant-numeric: tabular-nums;
+ text-align: center;
+}
+.vino-cart__sum {
+ margin: 0;
+ color: var(--color-accent);
+ font-size: var(--text-17);
+ font-weight: 600;
+ font-variant-numeric: tabular-nums;
+ text-align: right;
+ white-space: nowrap;
+}
+.vino-cart__remove,
+.vino-cart__coupon-remove {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: var(--size-tap);
+ height: var(--size-tap);
+ padding: 0;
+ border: 0;
+ background: none;
+ color: var(--color-text-faint);
+ cursor: pointer;
+ transition: color var(--duration-fast) var(--ease-base);
+}
+.vino-cart__remove-icon {
+ width: var(--vino-cart-icon);
+ height: var(--vino-cart-icon);
+}
+.vino-cart__removed {
+ position: absolute;
+ inset: 0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--space-4);
+ padding: 0 var(--space-4);
+ background: var(--color-bg);
+ font-size: var(--text-15);
+}
+.vino-cart__removed[hidden] {
+ display: none;
+}
+.vino-cart__removed-text {
+ color: var(--color-text-muted);
+}
+.vino-cart__summary {
+ position: sticky;
+ top: calc(var(--size-header) + var(--space-6));
+ padding: var(--space-card);
+ background: var(--color-surface);
+ border: 1px solid var(--color-line);
+ border-radius: var(--radius-sm);
+}
+.vino-cart__summary-title {
+ margin: 0 0 var(--space-6);
+ font-family: var(--font-serif);
+ font-size: var(--fs-h4);
+ font-weight: 400;
+ line-height: var(--leading-title);
+}
+.vino-cart__coupon-head {
+ position: relative;
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ gap: var(--space-3);
+ margin-bottom: var(--space-2);
+}
+.vino-cart__coupon-more {
+ position: relative;
+ padding: 0;
+ border: 0;
+ background: none;
+ color: var(--color-accent);
+ font-family: var(--font-sans);
+ font-size: var(--text-13);
+ cursor: pointer;
+ transition: color var(--duration-fast) var(--ease-base);
+}
+.vino-cart__coupon-more[hidden] {
+ display: inline;
+ visibility: hidden;
+}
+.vino-cart__coupon-more::before {
+ content: "";
+ position: absolute;
+ inset: -12px -8px;
+}
+.vino-cart__label {
+ display: block;
+ margin-bottom: var(--space-2);
+ color: var(--color-text-muted);
+ font-size: var(--text-13);
+}
+.vino-cart__coupon-head .vino-cart__label {
+ margin-bottom: 0;
+}
+.vino-cart__coupon-row {
+ display: flex;
+ gap: var(--space-2);
+}
+.vino-cart__coupon-row[hidden] {
+ display: none;
+}
+.vino-cart__coupon-row:not([hidden]) + .vino-cart__coupons:not(:empty) {
+ margin-top: var(--space-3);
+}
+.vino-cart__coupon-hint {
+ margin: var(--space-2) 0 0;
+ color: var(--color-text-muted);
+ font-size: var(--text-13);
+ line-height: var(--leading-ui);
+}
+.vino-cart__coupon-hint-line {
+ display: block;
+}
+.vino-cart__coupon-fill {
+ padding: 0;
+ border: 0;
+ background: none;
+ color: var(--color-accent);
+ font: inherit;
+ font-weight: 600;
+ cursor: pointer;
+ transition: color var(--duration-fast) var(--ease-base), transform var(--duration-fast) var(--ease-base);
+}
+.vino-cart__coupon-fill:active {
+ transform: scale(.97);
+}
+.vino-cart__coupon-hint[hidden] {
+ display: none;
+}
+.vino-cart__coupon-input.vino-inp {
+ flex: 1 1 auto;
+ min-width: 0;
+ min-height: var(--vino-cart-field-height);
+ margin: 0;
+ background: transparent;
+}
+.vino-cart__coupon-apply.vino-btn {
+ flex: 0 0 auto;
+ justify-content: center;
+ padding-top: 0;
+ padding-bottom: 0;
+}
+.vino-cart__coupon--error .vino-cart__coupon-input {
+ border-color: var(--color-danger-soft);
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger-soft) 22%, transparent);
+}
+.vino-cart__error {
+ min-height: calc(var(--text-13) * 1.45);
+ margin: var(--space-2) 0 0;
+ color: var(--color-danger-soft);
+ font-size: var(--text-13);
+ line-height: var(--leading-ui);
+}
+.vino-cart__error[hidden] {
+ display: block;
+ visibility: hidden;
+}
+.vino-cart__coupons {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.vino-cart__coupon-item {
+ display: flex;
+ align-items: center;
+ height: var(--vino-cart-field-height);
+ justify-content: space-between;
+ padding-left: var(--space-3);
+ border: 1px dashed var(--color-line-field);
+ border-radius: var(--radius-sm);
+ font-size: var(--text-15);
+ letter-spacing: var(--tracking-xs);
+}
+.vino-cart__coupon-item + .vino-cart__coupon-item {
+ margin-top: var(--space-2);
+}
+.vino-cart__totals {
+ margin: 0 0 var(--space-6);
+ padding-top: var(--space-4);
+ border-top: 1px solid var(--color-line);
+}
+.vino-cart__sum,
+.vino-cart__count,
+.vino-cart__totals {
+ transition: opacity var(--duration-fast) var(--ease-base);
+}
+.vino-cart__checkout[aria-busy="true"] {
+ opacity: .6;
+ pointer-events: none;
+}
+.vino-cart--busy .vino-cart__sum,
+.vino-cart--busy .vino-cart__count,
+.vino-cart--busy .vino-cart__totals {
+ opacity: .45;
+}
+.vino-cart__line {
+ display: flex;
+ justify-content: space-between;
+ gap: var(--space-4);
+ padding: var(--space-1) 0;
+ color: var(--color-text-muted);
+ font-size: var(--text-15);
+}
+.vino-cart__line[hidden] {
+ display: none;
+}
+.vino-cart__term,
+.vino-cart__value-line {
+ margin: 0;
+}
+.vino-cart__value-line {
+ font-variant-numeric: tabular-nums;
+ white-space: nowrap;
+}
+.vino-cart__line--discount .vino-cart__value-line {
+ color: var(--color-accent);
+}
+.vino-cart__line--none .vino-cart__value-line {
+ color: var(--color-text-faint);
+}
+.vino-cart__line--total {
+ margin-top: var(--space-2);
+ color: var(--color-text);
+ font-size: var(--text-19);
+ font-weight: 600;
+}
+.vino-cart__checkout {
+ justify-content: center;
+ width: 100%;
+ min-height: var(--size-tap);
+}
+.vino-cart__empty {
+ padding: var(--space-16) 0;
+ text-align: center;
+}
+.vino-cart__empty-title {
+ margin: 0;
+ font-family: var(--font-serif);
+ font-size: var(--fs-h3);
+ line-height: var(--leading-title);
+}
+.vino-cart__empty-text {
+ margin: var(--space-3) 0 var(--space-8);
+ color: var(--color-text-muted);
+}
+@media (hover: hover) {
+ .vino-cart__coupon-apply.vino-btn:hover {
+ transform: none;
+ }
+ .vino-cart__coupon-more:hover,
+ .vino-cart__coupon-fill:hover {
+ color: var(--color-accent-hover);
+ }
+ .vino-cart__name:hover,
+ .vino-cart__shared-name:hover {
+ color: var(--color-accent);
+ }
+ .vino-cart__step:hover {
+ color: var(--color-text);
+ }
+ .vino-cart__remove:hover,
+ .vino-cart__coupon-remove:hover {
+ color: var(--color-accent);
+ }
+ .vino-cart__link:hover,
+ .vino-cart__restore:hover {
+ color: var(--color-accent-hover);
+ }
+}
+@media (pointer: coarse) {
+ .vino-cart__name,
+ .vino-cart__shared-name {
+ position: relative;
+ }
+ .vino-cart__name::before,
+ .vino-cart__shared-name::before {
+ content: "";
+ position: absolute;
+ inset: calc((var(--size-tap) - 100%) / -2) 0;
+ }
+}
+@media (max-width: 980px) {
+ .vino-cart__layout {
+ grid-template-columns: minmax(0, 1fr);
+ }
+ .vino-cart__summary {
+ position: static;
+ }
+}
+@media (max-width: 560px) {
+ .vino-cart {
+ --vino-cart-pic-width: 72px;
+ --vino-cart-pic-height: 90px;
+ padding-top: var(--space-6);
+ }
+ .vino-cart__shared-item {
+ grid-template-columns: var(--vino-cart-shared-pic-width) auto minmax(0, 1fr);
+ grid-template-areas:
+ "pic name name"
+ "pic qty sum";
+ gap: var(--space-1) var(--space-4);
+ }
+ .vino-cart__shared-pic {
+ grid-area: pic;
+ }
+ .vino-cart__shared-total {
+ flex: 1 1 100%;
+ }
+ .vino-cart__shared-button.vino-btn {
+ flex: 1 1 100%;
+ justify-content: center;
+ }
+ .vino-cart__shared-name {
+ grid-area: name;
+ }
+ .vino-cart__shared-qty {
+ grid-area: qty;
+ }
+ .vino-cart__shared-sum {
+ grid-area: sum;
+ }
+}
+@container vino-cart-main (max-width: 640px) {
+ .vino-cart__item {
+ grid-template-columns: var(--vino-cart-pic-width) auto minmax(0, 1fr) var(--size-tap);
+ grid-template-areas:
+ "pic info info remove"
+ "pic qty sum sum";
+ gap: var(--space-3) var(--space-4);
+ }
+ .vino-cart__pic {
+ grid-area: pic;
+ align-self: start;
+ }
+ .vino-cart__info {
+ grid-area: info;
+ }
+ .vino-cart__qty {
+ grid-area: qty;
+ justify-self: start;
+ }
+ .vino-cart__sum {
+ grid-area: sum;
+ justify-self: end;
+ }
+ .vino-cart__remove {
+ grid-area: remove;
+ align-self: start;
+ }
+}
+.vino-cart .vino-btn--sm {
+ min-height: var(--size-tap);
+ justify-content: center;
+}
diff --git a/local/components/jinove/cart/templates/.default/template.php b/local/components/jinove/cart/templates/.default/template.php
new file mode 100644
index 0000000..d286a85
--- /dev/null
+++ b/local/components/jinove/cart/templates/.default/template.php
@@ -0,0 +1,139 @@
+ $coupon["applied"]));
+$text = static fn(string $key): string => htmlspecialcharsbx((string)Loc::getMessage($key));
+$title = htmlspecialcharsbx($arResult["TITLE"]);
+?>
+
+
+" data-text-coupon-error="= $text("VINO_CART_COUPON_ERROR") ?>" data-text-coupon-empty="= $text("VINO_CART_COUPON_EMPTY") ?>" data-text-coupon-remove="= $text("VINO_CART_COUPON_REMOVE") ?>" data-text-fail="= $text("VINO_CART_FAIL") ?>">
+
+ " data-cart-url="= htmlspecialcharsbx($arResult["CART_URL"]) ?>" aria-labelledby="vino-cart-shared-title" role="region">
+
= $text("VINO_CART_SHARED_TITLE") ?>
+
+
= $text("VINO_CART_SHARED_HINT") ?>
+
+
+
+
+ " width="72" height="90" alt="" loading="lazy" decoding="async">= htmlspecialcharsbx($item["brand"]) ?>
+
+ ">= htmlspecialcharsbx($item["name"]) ?>
+ × = (int)$item["quantity"] ?>
+ = htmlspecialcharsbx($item["sum"]) ?>
+
+
+
+
+
+
= $text("VINO_CART_SHARED_EMPTY") ?>
+
+
+
+ >
+
+
+ = $text("VINO_CART_SUMMARY") ?>
+
+
+
= $text("VINO_CART_GOODS") ?> = htmlspecialcharsbx($cart["base"]) ?>
+ " data-cart-discount-line>
= $text("VINO_CART_DISCOUNT") ?> = $cart["discount"] === "" ? "—" : htmlspecialcharsbx($cart["discount"]) ?>
+
= $text("VINO_CART_TOTAL") ?> = htmlspecialcharsbx($cart["total"]) ?>
+
+ " data-cart-checkout>= $text("VINO_CART_CHECKOUT") ?>
+
+
+
+
diff --git a/local/components/jinove/catalog.listing/.description.php b/local/components/jinove/catalog.listing/.description.php
new file mode 100644
index 0000000..4dc1ebf
--- /dev/null
+++ b/local/components/jinove/catalog.listing/.description.php
@@ -0,0 +1,10 @@
+ "Vinoteca: список вин раздела",
+ "DESCRIPTION" => "Умный фильтр и список вин раздела каталога, подгружается контроллером модуля",
+ "PATH" => ["ID" => "jinove", "NAME" => "Jinove"],
+];
diff --git a/local/components/jinove/catalog.listing/class.php b/local/components/jinove/catalog.listing/class.php
new file mode 100644
index 0000000..40081ab
--- /dev/null
+++ b/local/components/jinove/catalog.listing/class.php
@@ -0,0 +1,220 @@
+getContext()->getRequest();
+ $sort = (string)$request->getQuery("sort");
+ $params["SECTION_CODE"] = (string)($params["SECTION_CODE"] ?? "");
+ $params["FILTER_PATH"] = (string)($params["FILTER_PATH"] ?? "");
+ $params["COUNTRY_CODE"] = (string)($params["COUNTRY_CODE"] ?? "");
+ $params["SORT"] = in_array($sort, Listing::SORTS, true) ? $sort : "";
+ $params["PAGE"] = max(1, (int)$request->getQuery("PAGEN_1"));
+ $params["VIEW"] = $request->getCookieRaw("vino_view") === "list" ? "list" : "grid";
+ $params["AJAX"] = ($params["AJAX"] ?? "") === "Y" ? "Y" : "N";
+
+ return $params;
+ }
+
+ public function executeComponent(): array
+ {
+ if ($this->arParams["COUNTRY_CODE"] !== "") {
+ return $this->executeCountry();
+ }
+ $catalog = Listing::catalogParams();
+ $sectionCode = $this->arParams["SECTION_CODE"];
+ $filterPath = $this->arParams["FILTER_PATH"];
+ $sort = $this->arParams["SORT"];
+ $basePath = Listing::basePath($sectionCode, $filterPath);
+ $priceCode = (string)(reset($catalog["PRICE_CODE"]) ?: "");
+
+ $this->arResult = [
+ "SECTION_CODE" => $sectionCode,
+ "FILTER_PARAMS" => Listing::filterParams($sectionCode, $filterPath),
+ "SECTION_PARAMS" => $this->sectionParams($catalog, $basePath, $priceCode),
+ ];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+
+ private function executeCountry(): array
+ {
+ $code = $this->arParams["COUNTRY_CODE"];
+ $countries = Countries::names();
+ if (!isset($countries[$code])) {
+ Tools::process404("", true, true, true);
+
+ return [];
+ }
+ $name = EnumNames::name("COUNTRY", $code, $countries[$code]);
+ $GLOBALS["wineFilter"] = ["PROPERTY_COUNTRY_VALUE" => $countries[$code]];
+ global $APPLICATION;
+ $APPLICATION->SetTitle($name);
+ $APPLICATION->SetPageProperty("title", Loc::getMessage("VINO_LISTING_COUNTRY_TITLE", ["#COUNTRY#" => $name]));
+ $APPLICATION->SetPageProperty("description", Loc::getMessage("VINO_LISTING_COUNTRY_DESCRIPTION", ["#COUNTRY#" => $name]));
+ $path = Listing::countryPath($code);
+ $APPLICATION->SetPageProperty("vino_canonical", $this->arParams["PAGE"] > 1 ? $path . "?PAGEN_1=" . $this->arParams["PAGE"] : $path);
+ $APPLICATION->SetPageProperty("og_image", VINO_HOST . SITE_TEMPLATE_PATH . "/assets/media/og-catalog.jpg");
+
+ $catalog = Listing::catalogParams();
+ $this->arResult = [
+ "COUNTRY_NAME" => $name,
+ "SECTION_PARAMS" => [
+ "IBLOCK_TYPE" => $catalog["IBLOCK_TYPE"],
+ "IBLOCK_ID" => $catalog["IBLOCK_ID"],
+ "SECTION_ID" => 0,
+ "FILTER_NAME" => "wineFilter",
+ "PRICE_CODE" => $catalog["PRICE_CODE"],
+ "BASKET_URL" => $catalog["BASKET_URL"],
+ "PAGE_ELEMENT_COUNT" => "24",
+ "LINE_ELEMENT_COUNT" => "3",
+ "INCLUDE_SUBSECTIONS" => "Y",
+ "ELEMENT_SORT_FIELD" => "SORT",
+ "ELEMENT_SORT_ORDER" => "ASC",
+ "ELEMENT_SORT_FIELD2" => "ID",
+ "ELEMENT_SORT_ORDER2" => "DESC",
+ "PROPERTY_CODE" => $catalog["LIST_PROPERTY_CODE"],
+ "CACHE_TYPE" => $catalog["CACHE_TYPE"],
+ "CACHE_TIME" => $catalog["CACHE_TIME"],
+ "CACHE_GROUPS" => $catalog["CACHE_GROUPS"],
+ "SET_TITLE" => "N",
+ "SET_BROWSER_TITLE" => "N",
+ "SET_META_KEYWORDS" => "N",
+ "SET_META_DESCRIPTION" => "N",
+ "SET_STATUS_404" => "N",
+ "ADD_SECTIONS_CHAIN" => "N",
+ "ACTION_VARIABLE" => $catalog["ACTION_VARIABLE"],
+ "PRODUCT_ID_VARIABLE" => $catalog["PRODUCT_ID_VARIABLE"],
+ "USE_PRODUCT_QUANTITY" => "Y",
+ "ADD_TO_BASKET_ACTION" => "ADD",
+ "DISPLAY_TOP_PAGER" => "N",
+ "DISPLAY_BOTTOM_PAGER" => "Y",
+ "PAGER_TEMPLATE" => "vinoteca",
+ "PAGER_SHOW_ALWAYS" => "N",
+ "PAGER_TITLE" => Loc::getMessage("VINO_LISTING_PAGER_TITLE"),
+ "VINO_TITLE_TAG" => "h2",
+ "SECTION_URL" => $catalog["SEF_FOLDER"] . $catalog["SEF_URL_TEMPLATES"]["section"],
+ "HIDE_NOT_AVAILABLE" => "N",
+ ],
+ ];
+ $this->includeComponentTemplate("country");
+
+ return $this->arResult;
+ }
+
+ private function sectionParams(array $catalog, string $basePath, string $priceCode): array
+ {
+ $sectionCode = $this->arParams["SECTION_CODE"];
+ $filterPath = $this->arParams["FILTER_PATH"];
+ $sort = $this->arParams["SORT"];
+ $ajax = $this->arParams["AJAX"] === "Y";
+ $priceField = "CATALOG_PRICE_" . PricePresets::groupId($priceCode);
+ $sorts = [
+ "new" => ["ID", "DESC"],
+ "price_asc" => [$priceField, "ASC"],
+ "price_desc" => [$priceField, "DESC"],
+ "name" => ["NAME", "ASC"],
+ ];
+ $sortUrls = ["" => $basePath];
+ foreach (array_keys($sorts) as $code) {
+ $sortUrls[$code] = $basePath . "?sort=" . $code;
+ }
+ $pagePath = Listing::pagePath($sectionCode, $filterPath, $sort, $this->arParams["PAGE"]);
+
+ return [
+ "IBLOCK_TYPE" => $catalog["IBLOCK_TYPE"],
+ "IBLOCK_ID" => $catalog["IBLOCK_ID"],
+ "SECTION_CODE" => $sectionCode,
+ "FILTER_NAME" => "wineFilter",
+ "PRICE_CODE" => $catalog["PRICE_CODE"],
+ "BASKET_URL" => $catalog["BASKET_URL"],
+ "PAGE_ELEMENT_COUNT" => "12",
+ "LINE_ELEMENT_COUNT" => "3",
+ "INCLUDE_SUBSECTIONS" => "Y",
+ "ELEMENT_SORT_FIELD" => $sort !== "" ? $sorts[$sort][0] : "SORT",
+ "ELEMENT_SORT_ORDER" => $sort !== "" ? $sorts[$sort][1] : "ASC",
+ "ELEMENT_SORT_FIELD2" => "ID",
+ "ELEMENT_SORT_ORDER2" => "DESC",
+ "PROPERTY_CODE" => $catalog["LIST_PROPERTY_CODE"],
+ "CACHE_TYPE" => $catalog["CACHE_TYPE"],
+ "CACHE_TIME" => $catalog["CACHE_TIME"],
+ "CACHE_GROUPS" => $catalog["CACHE_GROUPS"],
+ "SET_TITLE" => "N",
+ "SET_BROWSER_TITLE" => "N",
+ "SET_META_KEYWORDS" => "N",
+ "SET_META_DESCRIPTION" => "N",
+ "SET_STATUS_404" => $ajax ? "N" : $catalog["SET_STATUS_404"],
+ "SHOW_404" => $ajax ? "N" : $catalog["SHOW_404"],
+ "FILE_404" => $catalog["FILE_404"],
+ "MESSAGE_404" => $catalog["MESSAGE_404"],
+ "ADD_SECTIONS_CHAIN" => "N",
+ "ACTION_VARIABLE" => $catalog["ACTION_VARIABLE"],
+ "PRODUCT_ID_VARIABLE" => $catalog["PRODUCT_ID_VARIABLE"],
+ "USE_PRODUCT_QUANTITY" => "Y",
+ "ADD_TO_BASKET_ACTION" => "ADD",
+ "SHOW_OLD_PRICE" => "Y",
+ "SHOW_DISCOUNT_PERCENT" => "Y",
+ "PRODUCT_DISPLAY_MODE" => "Y",
+ "DISPLAY_TOP_PAGER" => "N",
+ "DISPLAY_BOTTOM_PAGER" => "Y",
+ "PAGER_TEMPLATE" => "vinoteca",
+ "PAGER_SHOW_ALWAYS" => "N",
+ "PAGER_TITLE" => Loc::getMessage("VINO_LISTING_PAGER_TITLE"),
+ "PAGER_BASE_LINK_ENABLE" => "Y",
+ "PAGER_BASE_LINK" => $sortUrls[$sort],
+ "SECTION_URL" => $catalog["SEF_FOLDER"] . $catalog["SEF_URL_TEMPLATES"]["section"],
+ "DETAIL_URL" => $catalog["SEF_FOLDER"] . $catalog["SEF_URL_TEMPLATES"]["element"],
+ "HIDE_NOT_AVAILABLE" => "N",
+ "TEMPLATE_THEME" => "",
+ "VINO_AJAX" => $ajax ? "Y" : "N",
+ "VINO_TOOLBAR" => "Y",
+ "VINO_SORT" => $sort,
+ "VINO_SORT_URLS" => $sortUrls,
+ "VINO_PRICE_PRESETS" => $this->pricePresets($priceCode),
+ "VINO_VIEW" => $this->arParams["VIEW"],
+ "VINO_LIST_ID" => VINO_HOST . $pagePath . "#items",
+ "VINO_TITLE_TAG" => "h2",
+ ];
+ }
+
+ private function pricePresets(string $priceCode): array
+ {
+ if ($priceCode === "") {
+ return [];
+ }
+ $sectionCode = $this->arParams["SECTION_CODE"];
+ $filterPath = $this->arParams["FILTER_PATH"];
+ $sectionPath = Listing::sectionPath($sectionCode);
+ $presets = [];
+ foreach (PricePresets::limits(VINO_CATALOG_IBLOCK, $sectionCode, $priceCode) as $limit) {
+ $presetPath = "price-" . strtolower($priceCode) . "-to-" . $limit;
+ $active = $filterPath === $presetPath;
+ $presets[] = [
+ "LIMIT" => $limit,
+ "URL" => $active ? $sectionPath : $sectionPath . "filter/" . $presetPath . "/apply/",
+ "ACTIVE" => $active,
+ ];
+ }
+ if ($filterPath !== "" && !in_array(true, array_column($presets, "ACTIVE"), true)) {
+ return [];
+ }
+
+ return $presets;
+ }
+}
diff --git a/local/components/jinove/catalog.listing/lang/en/class.php b/local/components/jinove/catalog.listing/lang/en/class.php
new file mode 100644
index 0000000..660aa5a
--- /dev/null
+++ b/local/components/jinove/catalog.listing/lang/en/class.php
@@ -0,0 +1,4 @@
+
+
+
+
+
= htmlspecialcharsbx($arResult["COUNTRY_NAME"]) ?>
+
+
+
+
+ IncludeComponent("bitrix:catalog.section", "vinoteca", $arResult["SECTION_PARAMS"], $component); ?>
+
+
diff --git a/local/components/jinove/catalog.listing/templates/.default/lang/en/country.php b/local/components/jinove/catalog.listing/templates/.default/lang/en/country.php
new file mode 100644
index 0000000..e30fd75
--- /dev/null
+++ b/local/components/jinove/catalog.listing/templates/.default/lang/en/country.php
@@ -0,0 +1,2 @@
+
+
+
+
+
+
+
" tabindex="-1" data-chips-label="= htmlspecialcharsbx(Loc::getMessage("VINO_LISTING_CHIPS_LABEL")) ?>" data-chips-reset="= htmlspecialcharsbx(Loc::getMessage("VINO_LISTING_CHIPS_RESET")) ?>" data-chips-remove="= htmlspecialcharsbx(Loc::getMessage("VINO_LISTING_CHIPS_REMOVE")) ?>" data-chips-from="= htmlspecialcharsbx(Loc::getMessage("VINO_LISTING_CHIPS_FROM")) ?>" data-chips-to="= htmlspecialcharsbx(Loc::getMessage("VINO_LISTING_CHIPS_TO")) ?>" data-chips-range="= htmlspecialcharsbx(Loc::getMessage("VINO_LISTING_CHIPS_RANGE")) ?>">
+ IncludeComponent("bitrix:catalog.section", "vinoteca", $arResult["SECTION_PARAMS"], $component); ?>
+
+
diff --git a/local/components/jinove/catalog.megamenu/.description.php b/local/components/jinove/catalog.megamenu/.description.php
new file mode 100644
index 0000000..8c3246a
--- /dev/null
+++ b/local/components/jinove/catalog.megamenu/.description.php
@@ -0,0 +1,11 @@
+ "Vinoteca: мега-меню каталога",
+ "DESCRIPTION" => "Разделы, страны и бренды каталога с числом вин",
+ "PATH" => ["ID" => "jinove", "NAME" => "Jinove"],
+ "CACHE_PATH" => "Y",
+];
diff --git a/local/components/jinove/catalog.megamenu/class.php b/local/components/jinove/catalog.megamenu/class.php
new file mode 100644
index 0000000..2624b17
--- /dev/null
+++ b/local/components/jinove/catalog.megamenu/class.php
@@ -0,0 +1,40 @@
+arParams["IBLOCK_ID"] <= 0) {
+ return;
+ }
+ if ($this->startResultCache()) {
+ $this->arResult = MegaMenu::collect($this->arParams["IBLOCK_ID"], $this->arParams["BRANDS_LIMIT"]);
+ $taggedCache = Application::getInstance()->getTaggedCache();
+ foreach (MegaMenu::tags($this->arParams["IBLOCK_ID"]) as $tag) {
+ $taggedCache->registerTag($tag);
+ }
+ if (empty($this->arResult["TYPES"])) {
+ $this->abortResultCache();
+
+ return;
+ }
+ $this->includeComponentTemplate();
+ }
+ }
+}
diff --git a/local/components/jinove/catalog.megamenu/templates/.default/lang/en/template.php b/local/components/jinove/catalog.megamenu/templates/.default/lang/en/template.php
new file mode 100644
index 0000000..dcfa25b
--- /dev/null
+++ b/local/components/jinove/catalog.megamenu/templates/.default/lang/en/template.php
@@ -0,0 +1,12 @@
+ Loc::getMessage("VINO_MEGA_WINES"), "ITEMS" => $arResult["TYPES"], "MORE" => ["TEXT" => Loc::getMessagePlural("VINO_MEGA_ALL", $total, ["#COUNT#" => $total]), "URL" => SITE_DIR . "catalog/"]],
+ ["TITLE" => Loc::getMessage("VINO_MEGA_COUNTRIES"), "ITEMS" => $arResult["COUNTRIES"], "MORE" => null],
+ ["TITLE" => Loc::getMessage("VINO_MEGA_BRANDS"), "ITEMS" => $arResult["BRANDS"], "MORE" => ["TEXT" => Loc::getMessage("VINO_MEGA_ALL_BRANDS"), "URL" => SITE_DIR . "brands/"]],
+];
+?>
+
+
+
+
+
+
+
+
+ " loading="lazy" decoding="async">
+
+ = Loc::getMessage("VINO_MEGA_CARD_KICKER") ?>
+ = Loc::getMessage("VINO_MEGA_CARD_TITLE") ?>
+ = Loc::getMessage("VINO_MEGA_CARD_LINK") ?>
+
+
+
+
diff --git a/local/components/jinove/order.done/class.php b/local/components/jinove/order.done/class.php
new file mode 100644
index 0000000..cb35852
--- /dev/null
+++ b/local/components/jinove/order.done/class.php
@@ -0,0 +1,69 @@
+SetPageProperty("vino_alternates", "N");
+ $APPLICATION->SetPageProperty("vino_schema", "N");
+ $APPLICATION->SetPageProperty("robots", "noindex, nofollow");
+ $query = Context::getCurrent()->getRequest()->getQueryList()->toArray();
+ $order = Checkout::find((int)($query["id"] ?? 0), (string)($query["hash"] ?? ""));
+ $state = "missing";
+ $data = [];
+ if ($order !== null && !$order->isCanceled()) {
+ $method = Checkout::methodOf($order);
+ if ($method !== "cash" && ($query["cancel"] ?? "") !== "Y") {
+ Checkout::finishPayment($order, $query);
+ $order = \Bitrix\Sale\Order::load($order->getId());
+ }
+ $payment = $order->getPaymentCollection()->current();
+ $state = $method !== "cash" ? ($payment !== null && $payment->isPaid() ? "paid" : "pending") : "cash";
+ $properties = [];
+ foreach ($order->getPropertyCollection() as $property) {
+ $properties[(string)$property->getField("CODE")] = (string)$property->getValue();
+ }
+ $items = [];
+ foreach ($order->getBasket() as $item) {
+ $items[] = [
+ "name" => (string)$item->getField("NAME"),
+ "quantity" => (int)$item->getQuantity(),
+ "sum" => Money::format((float)$item->getFinalPrice(), (string)$item->getCurrency()),
+ ];
+ }
+ $data = [
+ "ID" => (int)$order->getId(),
+ "HASH" => (string)$order->getHash(),
+ "NUMBER" => (string)$order->getField("ACCOUNT_NUMBER"),
+ "TOTAL" => Money::format((float)$order->getPrice(), (string)$order->getCurrency()),
+ "NAME" => $properties["NAME"] ?? "",
+ "PHONE" => $properties["PHONE"] ?? "",
+ "EMAIL" => $properties["EMAIL"] ?? "",
+ "METHOD" => $payment !== null ? (string)Loc::getMessage("VINO_PAY_" . strtoupper($method)) : "",
+ "ITEMS" => $items,
+ "CANCELLED" => ($query["cancel"] ?? "") === "Y",
+ ];
+ }
+ $title = (string)Loc::getMessage("VINO_DONE_TITLE_" . strtoupper($state));
+ $APPLICATION->SetTitle($title);
+ $APPLICATION->SetPageProperty("title", $title . " | Vinoteca");
+ $APPLICATION->SetPageProperty("description", (string)Loc::getMessage("VINO_DONE_DESCRIPTION"));
+ $this->arResult = ["STATE" => $state, "TITLE" => $title, "ORDER" => $data, "CATALOG_URL" => SITE_DIR . "catalog/", "AUTOPAY" => ($query["autopay"] ?? "") === "Y", "PAY_FAILED" => ($query["pay"] ?? "") === "failed"];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+}
diff --git a/local/components/jinove/order.done/lang/en/class.php b/local/components/jinove/order.done/lang/en/class.php
new file mode 100644
index 0000000..f28b970
--- /dev/null
+++ b/local/components/jinove/order.done/lang/en/class.php
@@ -0,0 +1,6 @@
+ htmlspecialcharsbx((string)Loc::getMessage($key));
+$lead = $state === "pending" && !empty($order["CANCELLED"]) ? "VINO_DONE_LEAD_CANCEL" : "VINO_DONE_LEAD_" . strtoupper($state);
+?>
+
+
+
+
= htmlspecialcharsbx($arResult["TITLE"]) ?>
+
+
+
+" data-text-busy="= $text("VINO_DONE_BUSY") ?>"= $state === "pending" && $arResult["AUTOPAY"] ? " data-autopay" : "" ?>= $state !== "missing" ? ' data-id="' . (int)$order["ID"] . '" data-hash="' . htmlspecialcharsbx($order["HASH"]) . '"' : "" ?>>
+
+
= $text($lead) ?>
+
+
">= $text("VINO_DONE_TO_CATALOG") ?>
+
+
= $text("VINO_DONE_NUMBER") ?>: = htmlspecialcharsbx($order["NUMBER"]) ?>
+
+
+
= $text("VINO_DONE_PAY") ?>
+
>= $arResult["PAY_FAILED"] ? $text("VINO_DONE_PAY_FAIL") : "" ?>
+
+
+
+
+
= $text("VINO_DONE_ITEMS") ?>
+
+
+ = htmlspecialcharsbx($item["name"]) ?> × = (int)$item["quantity"] ?> = htmlspecialcharsbx($item["sum"]) ?>
+
+
+
= $text("VINO_DONE_TOTAL") ?> = htmlspecialcharsbx($order["TOTAL"]) ?>
+
+
+
= $text("VINO_DONE_CONTACTS") ?> = htmlspecialcharsbx($order["NAME"]) ?> = htmlspecialcharsbx($order["PHONE"]) ?> = htmlspecialcharsbx($order["EMAIL"]) ?>
+
= $text("VINO_DONE_PICKUP") ?> = $text("VINO_DONE_PICKUP_TEXT") ?>
+
= $text("VINO_DONE_PAYMENT") ?> = htmlspecialcharsbx($order["METHOD"]) ?>
+
+
+
= $text("VINO_DONE_DEMO") ?>
+
">= $text("VINO_DONE_TO_CATALOG") ?>
+
+
+
diff --git a/local/components/jinove/order/class.php b/local/components/jinove/order/class.php
new file mode 100644
index 0000000..bbd96ca
--- /dev/null
+++ b/local/components/jinove/order/class.php
@@ -0,0 +1,39 @@
+SetTitle(Loc::getMessage("VINO_ORDER_PAGE_TITLE"));
+ $APPLICATION->SetPageProperty("title", Loc::getMessage("VINO_ORDER_BROWSER_TITLE"));
+ $APPLICATION->SetPageProperty("description", Loc::getMessage("VINO_ORDER_PAGE_DESCRIPTION"));
+ $APPLICATION->SetPageProperty("vino_alternates", "N");
+ $APPLICATION->SetPageProperty("vino_schema", "N");
+ $APPLICATION->SetPageProperty("robots", "noindex, nofollow");
+ Loc::loadMessages($_SERVER["DOCUMENT_ROOT"] . SITE_TEMPLATE_PATH . "/footer.php");
+ $basket = Cart::load();
+ $cart = $basket !== null ? Cart::view($basket) : null;
+ $this->arResult = [
+ "TITLE" => (string)Loc::getMessage("VINO_ORDER_PAGE_TITLE"),
+ "CART" => $cart !== null && array_filter($cart["items"], static fn(array $item): bool => $item["available"]) ? $cart : null,
+ "METHODS" => Checkout::methods(),
+ "CART_URL" => SITE_DIR . "personal/cart/",
+ "CATALOG_URL" => SITE_DIR . "catalog/",
+ ];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+}
diff --git a/local/components/jinove/order/lang/en/class.php b/local/components/jinove/order/lang/en/class.php
new file mode 100644
index 0000000..0f92486
--- /dev/null
+++ b/local/components/jinove/order/lang/en/class.php
@@ -0,0 +1,4 @@
+ 1) message = text('many');
+ else if (missing === 1) message = !f.name.value.trim() ? text('name') : (phone && !phone.filled() ? text('phone') : text('email'));
+ if (!missing) {
+ if (phone && !phone.complete()) bad(f.phone, text('phone'));
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(email)) bad(f.email, text('email'));
+ }
+ if (!f.consent.checked) bad(f.consent, text('consent'));
+ say(message);
+ if (focus) focus.focus();
+ return !focus;
+ }
+
+ function serverMessage(res) {
+ var code = res && res.errors && res.errors[0] && res.errors[0].code;
+ if (code === 'rate') return text('rate');
+ if (code === 'empty' || code === 'cart') return text('empty');
+ return text('fail');
+ }
+
+ form.addEventListener('input', function (e) { clear(e.target); });
+ form.addEventListener('change', function (e) { clear(e.target); });
+ if (window.VinoAltcha) VinoAltcha.arm(guard);
+
+ window.addEventListener('pageshow', function (e) {
+ if (!e.persisted) return;
+ var submit = form.querySelector('[type="submit"]');
+ submit.disabled = false;
+ submit.classList.remove('vino-btn--loading');
+ });
+
+ form.addEventListener('submit', function (e) {
+ e.preventDefault();
+ if (!check()) return;
+ var button = form.querySelector('[type="submit"]');
+ var payInput = form.querySelector('[name="pay"]:checked');
+ var online = !!payInput && payInput.getAttribute('data-online') === 'Y';
+ button.disabled = true;
+ if (online && window.VinoBusy) VinoBusy.show(text('busy'));
+ else button.classList.add('vino-btn--loading');
+ say('');
+ (window.VinoAltcha ? VinoAltcha.armed(guard) : Promise.resolve(false))
+ .then(function (ok) {
+ if (!ok) throw new Error('guard');
+ var f = form.elements;
+ var pay = form.querySelector('[name="pay"]:checked');
+ return BX.ajax.runAction('jinove:vinoteca.order.create', {
+ data: {
+ name: f.name.value,
+ phone: f.phone.vinoPhone.value(),
+ email: f.email.value,
+ comment: f.comment.value,
+ pay: pay ? pay.value : '',
+ consent: f.consent.checked ? 'Y' : '',
+ website: f.website.value,
+ altcha: f.altcha ? f.altcha.value : '',
+ page: window.location.pathname,
+ base: base
+ }
+ });
+ })
+ .then(function (res) {
+ if (res && res.data && res.data.ok && res.data.redirect) {
+ window.location.href = res.data.redirect;
+ return;
+ }
+ button.disabled = false;
+ button.classList.remove('vino-btn--loading');
+ if (window.VinoBusy) VinoBusy.hide();
+ say(text('fail'));
+ })
+ .catch(function (res) {
+ button.disabled = false;
+ button.classList.remove('vino-btn--loading');
+ if (window.VinoBusy) VinoBusy.hide();
+ if (window.VinoAltcha) VinoAltcha.reset(guard);
+ say(serverMessage(res));
+ });
+ });
+})();
diff --git a/local/components/jinove/order/templates/.default/style.css b/local/components/jinove/order/templates/.default/style.css
new file mode 100644
index 0000000..9f091d6
--- /dev/null
+++ b/local/components/jinove/order/templates/.default/style.css
@@ -0,0 +1,294 @@
+.vino-order {
+ --vino-order-summary-width: 400px;
+ --vino-order-pic-width: 56px;
+ --vino-order-pic-height: 70px;
+ --vino-order-radio: 20px;
+ padding: var(--space-10) var(--gutter) var(--space-section);
+}
+.vino-order__layout,
+.vino-order__empty {
+ max-width: var(--container);
+ margin: 0 auto;
+}
+.vino-order__layout {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) var(--vino-order-summary-width);
+ gap: var(--space-grid-wide);
+ align-items: start;
+}
+.vino-order__form {
+ display: grid;
+ gap: var(--space-8);
+ min-width: 0;
+}
+.vino-order__block {
+ display: grid;
+ gap: var(--space-4);
+ min-width: 0;
+ margin: 0;
+ padding: 0;
+ border: 0;
+}
+.vino-order__legend {
+ margin: 0 0 var(--space-4);
+ padding: 0;
+ font-family: var(--font-serif);
+ font-size: var(--fs-h4);
+ line-height: var(--leading-title);
+}
+.vino-order__field {
+ display: grid;
+ gap: var(--space-2);
+}
+.vino-order__label {
+ color: var(--color-text-muted);
+ font-size: var(--text-13);
+}
+.vino-order__field .vino-inp {
+ width: 100%;
+ margin: 0;
+}
+.vino-order__pickup {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) auto;
+ gap: var(--space-1) var(--space-4);
+ padding: var(--space-card);
+ background: var(--color-surface);
+ border: 1px solid var(--color-line);
+ border-radius: var(--radius-sm);
+}
+.vino-order__pickup-name {
+ margin: 0;
+ font-size: var(--text-17);
+}
+.vino-order__pickup-text {
+ grid-column: 1;
+ margin: 0;
+ color: var(--color-text-muted);
+ font-size: var(--text-15);
+}
+.vino-order__pickup-free {
+ grid-column: 2;
+ grid-row: 1 / span 2;
+ align-self: center;
+ margin: 0;
+ color: var(--color-accent);
+ font-size: var(--text-15);
+ font-weight: 600;
+}
+.vino-order__methods {
+ display: grid;
+ gap: var(--space-3);
+}
+.vino-order__method {
+ position: relative;
+ display: flex;
+ align-items: flex-start;
+ gap: var(--space-4);
+ padding: var(--space-card);
+ background: var(--color-surface);
+ border: 1px solid var(--color-line);
+ border-radius: var(--radius-sm);
+ cursor: pointer;
+ transition: border-color var(--duration-fast) var(--ease-base);
+}
+.vino-order__method:has(.vino-order__radio:checked) {
+ border-color: var(--color-accent);
+}
+.vino-order__method:has(.vino-order__radio:focus-visible) {
+ box-shadow: var(--shadow-focus);
+}
+.vino-order__radio {
+ appearance: none;
+ flex: none;
+ width: var(--vino-order-radio);
+ height: var(--vino-order-radio);
+ margin: 2px 0 0;
+ border: 1px solid var(--color-line-field);
+ border-radius: 50%;
+ background: transparent;
+ cursor: pointer;
+ transition: border-color var(--duration-fast) var(--ease-base), background var(--duration-fast) var(--ease-base);
+}
+.vino-order__radio:checked {
+ border-color: var(--color-accent);
+ background: radial-gradient(circle, var(--color-accent) 0 40%, transparent 45%);
+}
+.vino-order__method-body {
+ display: grid;
+ gap: var(--space-1);
+ min-width: 0;
+}
+.vino-order__method-name {
+ font-size: var(--text-17);
+}
+.vino-order__method-hint {
+ color: var(--color-text-muted);
+ font-size: var(--text-15);
+ line-height: var(--leading-ui);
+}
+.vino-order__error {
+ min-height: calc(var(--text-15) * 1.45);
+ margin: 0;
+ color: var(--color-danger-soft);
+ font-size: var(--text-15);
+ line-height: var(--leading-ui);
+}
+.vino-order__error[hidden] {
+ display: block;
+ visibility: hidden;
+}
+.vino-order__submit {
+ justify-content: center;
+ width: 100%;
+ min-height: var(--size-tap);
+}
+.vino-order__summary {
+ position: sticky;
+ top: calc(var(--size-header) + var(--space-6));
+ padding: var(--space-card);
+ background: var(--color-surface);
+ border: 1px solid var(--color-line);
+ border-radius: var(--radius-sm);
+}
+.vino-order__summary-title {
+ margin: 0 0 var(--space-5);
+ font-family: var(--font-serif);
+ font-size: var(--fs-h4);
+ font-weight: 400;
+ line-height: var(--leading-title);
+}
+.vino-order__items {
+ display: grid;
+ gap: var(--space-4);
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.vino-order__item {
+ display: grid;
+ grid-template-columns: var(--vino-order-pic-width) minmax(0, 1fr) auto;
+ grid-template-areas:
+ "pic name sum"
+ "pic qty sum";
+ gap: var(--space-1) var(--space-3);
+ align-items: center;
+}
+.vino-order__pic {
+ position: relative;
+ display: flex;
+ grid-area: pic;
+ width: var(--vino-order-pic-width);
+ height: var(--vino-order-pic-height);
+ background: var(--color-bg);
+ border-radius: var(--radius-sm);
+ overflow: hidden;
+}
+.vino-order__img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+.vino-order__item-name {
+ grid-area: name;
+ align-self: end;
+ font-family: var(--font-serif);
+ font-size: var(--text-17);
+ line-height: var(--leading-title);
+}
+.vino-order__item-qty {
+ grid-area: qty;
+ align-self: start;
+ color: var(--color-text-muted);
+ font-size: var(--text-13);
+}
+.vino-order__item-sum {
+ grid-area: sum;
+ color: var(--color-accent);
+ font-size: var(--text-15);
+ font-weight: 600;
+ font-variant-numeric: tabular-nums;
+ white-space: nowrap;
+}
+.vino-order__totals {
+ margin: var(--space-5) 0 var(--space-4);
+ padding-top: var(--space-4);
+ border-top: 1px solid var(--color-line);
+}
+.vino-order__line {
+ display: flex;
+ justify-content: space-between;
+ gap: var(--space-4);
+ padding: var(--space-1) 0;
+ color: var(--color-text-muted);
+ font-size: var(--text-15);
+}
+.vino-order__term,
+.vino-order__value {
+ margin: 0;
+}
+.vino-order__value {
+ font-variant-numeric: tabular-nums;
+ white-space: nowrap;
+}
+.vino-order__line--discount .vino-order__value {
+ color: var(--color-accent);
+}
+.vino-order__line--total {
+ margin-top: var(--space-2);
+ color: var(--color-text);
+ font-size: var(--text-19);
+ font-weight: 600;
+}
+.vino-order__edit {
+ color: var(--color-accent);
+ font-size: var(--text-13);
+ letter-spacing: var(--tracking-sm);
+ text-transform: uppercase;
+ text-decoration: none;
+ transition: color var(--duration-fast) var(--ease-base);
+}
+.vino-order__empty {
+ padding: var(--space-16) 0;
+ text-align: center;
+}
+.vino-order__empty-title {
+ margin: 0 0 var(--space-8);
+ font-family: var(--font-serif);
+ font-size: var(--fs-h3);
+ line-height: var(--leading-title);
+}
+@media (hover: hover) {
+ .vino-order__method:hover {
+ border-color: color-mix(in srgb, var(--color-accent) 60%, transparent);
+ }
+ .vino-order__edit:hover {
+ color: var(--color-accent-hover);
+ }
+}
+@media (pointer: coarse) {
+ .vino-order__edit {
+ display: inline-block;
+ padding: var(--space-3) 0;
+ }
+}
+@media (max-width: 980px) {
+ .vino-order__layout {
+ grid-template-columns: minmax(0, 1fr);
+ }
+ .vino-order__summary {
+ position: static;
+ }
+}
+@media (max-width: 560px) {
+ .vino-order {
+ padding-top: var(--space-6);
+ }
+ .vino-order__pickup {
+ grid-template-columns: minmax(0, 1fr);
+ }
+ .vino-order__pickup-free {
+ grid-column: 1;
+ grid-row: auto;
+ }
+}
diff --git a/local/components/jinove/order/templates/.default/template.php b/local/components/jinove/order/templates/.default/template.php
new file mode 100644
index 0000000..dd557e0
--- /dev/null
+++ b/local/components/jinove/order/templates/.default/template.php
@@ -0,0 +1,111 @@
+ htmlspecialcharsbx((string)Loc::getMessage($key));
+$title = htmlspecialcharsbx($arResult["TITLE"]);
+$button = (string)Loc::getMessage("VINO_ORDER_SUBMIT");
+?>
+
+
+
+
+
+ " data-text-phone="= $text("VINO_ORDER_ERR_PHONE") ?>" data-text-email="= $text("VINO_ORDER_ERR_EMAIL") ?>" data-text-consent="= $text("VINO_ORDER_ERR_CONSENT") ?>" data-text-many="= $text("VINO_ORDER_ERR_MANY") ?>" data-text-rate="= $text("VINO_ORDER_ERR_RATE") ?>" data-text-empty="= $text("VINO_ORDER_ERR_EMPTY") ?>" data-text-fail="= $text("VINO_ORDER_ERR_FAIL") ?>" data-text-busy="= $text("VINO_ORDER_BUSY") ?>">
+
+
+
+ = $text("VINO_ORDER_SUMMARY") ?>
+
+
+
+
+
+ " width="56" height="70" alt="" loading="lazy" decoding="async">
+
+ = htmlspecialcharsbx($item["brand"]) ?>
+
+
+ = htmlspecialcharsbx($item["name"]) ?>
+ = (int)$item["quantity"] ?> × = htmlspecialcharsbx($item["price"]) ?>
+ = htmlspecialcharsbx($item["sum"]) ?>
+
+
+
+
+
= $text("VINO_ORDER_GOODS") ?> = htmlspecialcharsbx($cart["base"]) ?>
+
+
= $text("VINO_ORDER_DISCOUNT") ?> = htmlspecialcharsbx($cart["discount"]) ?>
+
+
= $text("VINO_ORDER_TOTAL") ?> = htmlspecialcharsbx($cart["total"]) ?>
+
+ ">= $text("VINO_ORDER_EDIT") ?>
+
+
+
+
diff --git a/local/components/jinove/personal.nav/class.php b/local/components/jinove/personal.nav/class.php
new file mode 100644
index 0000000..f368922
--- /dev/null
+++ b/local/components/jinove/personal.nav/class.php
@@ -0,0 +1,31 @@
+ "", "orders" => "orders/", "reviews" => "reviews/"];
+
+ public function executeComponent(): array
+ {
+ $items = [];
+ foreach (self::SECTIONS as $code => $path) {
+ $items[] = [
+ "CODE" => $code,
+ "URL" => SITE_DIR . "personal/" . $path,
+ "ACTIVE" => ($this->arParams["ACTIVE"] ?? "") === $code,
+ ];
+ }
+ $this->arResult = ["ITEMS" => $items];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+}
diff --git a/local/components/jinove/personal.nav/templates/.default/lang/en/template.php b/local/components/jinove/personal.nav/templates/.default/lang/en/template.php
new file mode 100644
index 0000000..e4498de
--- /dev/null
+++ b/local/components/jinove/personal.nav/templates/.default/lang/en/template.php
@@ -0,0 +1,7 @@
+
+">
+ = Loc::getMessage("VINO_NAV_KICKER") ?>
+
+
diff --git a/local/components/jinove/personal.orders/class.php b/local/components/jinove/personal.orders/class.php
new file mode 100644
index 0000000..5932127
--- /dev/null
+++ b/local/components/jinove/personal.orders/class.php
@@ -0,0 +1,43 @@
+getId();
+ if ($userId <= 0) {
+ LocalRedirect(SITE_DIR . "login/?back=" . rawurlencode(Application::getInstance()->getContext()->getRequest()->getRequestUri()));
+ }
+ $request = Application::getInstance()->getContext()->getRequest();
+ $completed = (string)$request->getQuery("status") === "completed";
+ $page = max(1, min(50, (int)$request->getQuery("page")));
+ $result = Orders::forUser($userId, $completed, $page);
+ $GLOBALS["APPLICATION"]->SetTitle(Loc::getMessage("VINO_ORD_PAGE_TITLE"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("description", Loc::getMessage("VINO_ORD_PAGE_DESCRIPTION"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_alternates", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_schema", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("robots", "noindex, nofollow");
+ $this->arResult = [
+ "COMPLETED" => $completed,
+ "ORDERS" => $result["orders"],
+ "MORE_URL" => $result["more"] ? SITE_DIR . "personal/orders/?" . ($completed ? "status=completed&" : "") . "page=" . ($page + 1) : "",
+ "BASE_URL" => SITE_DIR . "personal/orders/",
+ "CATALOG_URL" => SITE_DIR . "catalog/",
+ ];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+}
diff --git a/local/components/jinove/personal.orders/lang/en/class.php b/local/components/jinove/personal.orders/lang/en/class.php
new file mode 100644
index 0000000..7c2ad04
--- /dev/null
+++ b/local/components/jinove/personal.orders/lang/en/class.php
@@ -0,0 +1,3 @@
+addExternalCss("/local/components/jinove/personal.profile/templates/.default/style.css");
+$number = static fn(float $value): string => rtrim(rtrim(number_format($value, 3, ",", ""), "0"), ",");
+?>
+
diff --git a/local/components/jinove/personal.profile/class.php b/local/components/jinove/personal.profile/class.php
new file mode 100644
index 0000000..c32ac05
--- /dev/null
+++ b/local/components/jinove/personal.profile/class.php
@@ -0,0 +1,37 @@
+getId();
+ if ($userId <= 0) {
+ LocalRedirect(SITE_DIR . "login/?back=" . rawurlencode(SITE_DIR . "personal/"));
+ }
+ $row = UserTable::getRow(["select" => ["NAME", "EMAIL", "PERSONAL_PHONE"], "filter" => ["=ID" => $userId]]) ?? [];
+ $GLOBALS["APPLICATION"]->SetTitle(Loc::getMessage("VINO_CAB_PAGE_TITLE"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("description", Loc::getMessage("VINO_CAB_PAGE_DESCRIPTION"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_alternates", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_schema", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("robots", "noindex, nofollow");
+ $this->arResult = [
+ "NAME" => (string)($row["NAME"] ?? ""),
+ "EMAIL" => (string)($row["EMAIL"] ?? ""),
+ "PHONE" => preg_replace('/^\+7(\d{3})(\d{3})(\d{2})(\d{2})$/', '+7 $1 $2 $3 $4', (string)($row["PERSONAL_PHONE"] ?? "")),
+ ];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+}
diff --git a/local/components/jinove/personal.profile/lang/en/class.php b/local/components/jinove/personal.profile/lang/en/class.php
new file mode 100644
index 0000000..78b3daa
--- /dev/null
+++ b/local/components/jinove/personal.profile/lang/en/class.php
@@ -0,0 +1,3 @@
+";
+$MESS["VINO_CAB_ERR_POLICY"] = "The password does not meet the site requirements";
diff --git a/local/components/jinove/personal.profile/templates/.default/lang/pl/template.php b/local/components/jinove/personal.profile/templates/.default/lang/pl/template.php
new file mode 100644
index 0000000..f8ccc80
--- /dev/null
+++ b/local/components/jinove/personal.profile/templates/.default/lang/pl/template.php
@@ -0,0 +1,31 @@
+";
+$MESS["VINO_CAB_ERR_POLICY"] = "Hasło nie spełnia wymagań serwisu";
diff --git a/local/components/jinove/personal.profile/templates/.default/lang/ru/template.php b/local/components/jinove/personal.profile/templates/.default/lang/ru/template.php
new file mode 100644
index 0000000..0c5b970
--- /dev/null
+++ b/local/components/jinove/personal.profile/templates/.default/lang/ru/template.php
@@ -0,0 +1,31 @@
+";
+$MESS["VINO_CAB_ERR_POLICY"] = "Пароль не подходит по требованиям сайта";
diff --git a/local/components/jinove/personal.profile/templates/.default/script.js b/local/components/jinove/personal.profile/templates/.default/script.js
new file mode 100644
index 0000000..1fff5fb
--- /dev/null
+++ b/local/components/jinove/personal.profile/templates/.default/script.js
@@ -0,0 +1,111 @@
+(function () {
+ function init() {
+ if (!window.BX || !BX.ajax || !BX.ajax.runAction) return;
+ var saveForm = document.querySelector('[data-cab-save]');
+ var passwordForm = document.querySelector('[data-cab-password]');
+
+ function key(code) {
+ return code.replace(/_([a-z])/g, function (match, letter) { return letter.toUpperCase(); });
+ }
+
+ function message(form, code) {
+ var name = 'msg' + key(code).charAt(0).toUpperCase() + key(code).slice(1);
+ return form.dataset[name] || form.dataset.msgError;
+ }
+
+ function status(form, text, ok) {
+ var line = form.querySelector('[data-cab-status]');
+ line.textContent = text;
+ line.classList.toggle('vino-cab__status--ok', !!ok);
+ }
+
+ function mark(field, bad) {
+ field.classList.toggle('vino-inp--invalid', bad);
+ field.setAttribute('aria-invalid', bad ? 'true' : 'false');
+ }
+
+ function code(response) {
+ return response && response.errors && response.errors[0] ? response.errors[0].code : '';
+ }
+
+ function phoneValue(input) {
+ var digits = input.value.replace(/\D/g, '');
+ return digits.length > 1 ? '+' + digits : '';
+ }
+
+ [saveForm, passwordForm].forEach(function (form) {
+ if (!form) return;
+ form.addEventListener('input', function (event) {
+ if (event.target.classList.contains('vino-inp--invalid')) mark(event.target, false);
+ status(form, '', false);
+ });
+ });
+
+ if (saveForm) {
+ saveForm.addEventListener('submit', function (event) {
+ event.preventDefault();
+ var name = saveForm.elements.name;
+ var phone = saveForm.elements.phone;
+ var submit = saveForm.querySelector('[type="submit"]');
+ var badName = name.value.trim() === '' || /[<>\x00-\x1f]/.test(name.value);
+ var badPhone = !phone.checkValidity();
+ mark(name, badName);
+ mark(phone, badPhone);
+ if (badName || badPhone) {
+ status(saveForm, badName ? (name.value.trim() === '' ? saveForm.dataset.msgName : saveForm.dataset.msgNameChars) : saveForm.dataset.msgPhone, false);
+ (badName ? name : phone).focus();
+ return;
+ }
+ status(saveForm, '', false);
+ if (submit.getAttribute('aria-disabled') === 'true') return;
+ submit.setAttribute('aria-disabled', 'true');
+ BX.ajax.runAction('jinove:vinoteca.profile.save', { data: { name: name.value.trim(), phone: phoneValue(phone) } }).then(function () {
+ submit.removeAttribute('aria-disabled');
+ status(saveForm, saveForm.dataset.msgDone, true);
+ }, function (response) {
+ submit.removeAttribute('aria-disabled');
+ status(saveForm, message(saveForm, code(response)), false);
+ });
+ });
+ }
+
+ if (passwordForm) {
+ passwordForm.addEventListener('submit', function (event) {
+ event.preventDefault();
+ var current = passwordForm.elements.current;
+ var next = passwordForm.elements.password;
+ var submit = passwordForm.querySelector('[type="submit"]');
+ var badCurrent = current.value === '';
+ var badNext = next.value.length < 8;
+ mark(current, badCurrent);
+ mark(next, badNext);
+ if (badCurrent || badNext) {
+ status(passwordForm, badCurrent ? passwordForm.dataset.msgCurrent : passwordForm.dataset.msgPassword, false);
+ (badCurrent ? current : next).focus();
+ return;
+ }
+ status(passwordForm, '', false);
+ if (submit.getAttribute('aria-disabled') === 'true') return;
+ submit.setAttribute('aria-disabled', 'true');
+ BX.ajax.runAction('jinove:vinoteca.profile.password', { data: { current: current.value, password: next.value } }).then(function () {
+ submit.removeAttribute('aria-disabled');
+ current.value = '';
+ next.value = '';
+ status(passwordForm, passwordForm.dataset.msgDone, true);
+ }, function (response) {
+ submit.removeAttribute('aria-disabled');
+ var errorCode = code(response);
+ if (errorCode === 'current') mark(current, true);
+ if (errorCode === 'password' || errorCode === 'same') mark(next, true);
+ status(passwordForm, message(passwordForm, errorCode), false);
+ });
+ });
+ }
+ }
+
+ if (document.readyState === 'loading') {
+ document.addEventListener('DOMContentLoaded', init);
+ } else {
+ init();
+ }
+})();
diff --git a/local/components/jinove/personal.profile/templates/.default/style.css b/local/components/jinove/personal.profile/templates/.default/style.css
new file mode 100644
index 0000000..beff3b0
--- /dev/null
+++ b/local/components/jinove/personal.profile/templates/.default/style.css
@@ -0,0 +1,171 @@
+.vino-cab {
+ display: grid;
+ grid-template-columns: minmax(0, 240px) minmax(0, 860px);
+ gap: clamp(var(--space-8), 5vw, var(--space-16));
+ align-items: start;
+ justify-content: center;
+ min-height: 62vh;
+ padding: var(--space-head) var(--gutter) var(--space-section);
+}
+.vino-cab__kicker {
+ margin: 0 0 var(--space-4);
+ color: var(--color-accent);
+ font-size: var(--text-13);
+ letter-spacing: var(--tracking-wide);
+ text-transform: uppercase;
+}
+.vino-cab__list {
+ display: grid;
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.vino-cab__link {
+ display: block;
+ width: 100%;
+ padding: var(--space-3) var(--space-6);
+ border: 0;
+ background: transparent;
+ color: var(--color-text);
+ font: inherit;
+ font-size: var(--text-15);
+ font-weight: 500;
+ text-align: left;
+ text-decoration: none;
+ cursor: pointer;
+ transition: color var(--duration-fast) var(--ease-base), background-color var(--duration-fast) var(--ease-base), transform var(--duration-fast) var(--ease-base);
+}
+.vino-cab__link--active {
+ background: var(--color-accent);
+ color: var(--color-bg);
+}
+.vino-cab__link:active {
+ transform: scale(.97);
+}
+.vino-cab__link:focus-visible {
+ outline: 2px solid var(--color-accent);
+ outline-offset: -2px;
+}
+.vino-cab__title {
+ margin: 0 0 var(--space-6);
+ font-family: var(--font-serif);
+ font-weight: 500;
+ font-size: clamp(1.75rem, 3.4vw, 2.25rem);
+ line-height: 1.1;
+}
+.vino-cab__panel {
+ margin: 0 0 var(--space-8);
+}
+.vino-cab__panel + .vino-cab__panel {
+ padding-top: var(--space-8);
+ border-top: 1px solid var(--color-line);
+}
+.vino-cab__panel.vino-cab__empty {
+ padding: 0;
+ border: 0;
+}
+.vino-cab__heading {
+ margin: 0 0 var(--space-4);
+ font-family: var(--font-serif);
+ font-weight: 500;
+ font-size: clamp(1.25rem, 2.2vw, 1.5rem);
+}
+.vino-auth__form.vino-cab__form {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: var(--space-5) var(--space-4);
+ align-items: start;
+ max-width: 640px;
+}
+.vino-cab__form .vino-auth__label {
+ color: var(--color-text);
+ font-size: var(--text-15);
+ font-weight: 500;
+ letter-spacing: 0;
+ text-transform: none;
+}
+.vino-cab__form .vino-auth__err {
+ grid-column: 1 / -1;
+}
+.vino-auth__form.vino-cab__form .vino-auth__submit {
+ grid-column: 1 / -1;
+ justify-self: start;
+ width: auto;
+ min-width: 220px;
+}
+.vino-auth__err.vino-cab__status--ok {
+ color: var(--color-accent);
+}
+.vino-cab-list {
+ display: grid;
+ gap: var(--space-6);
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.vino-cab-card {
+ padding: clamp(var(--space-5), 3vw, var(--space-8));
+ background: var(--color-surface);
+ border: 1px solid var(--color-line);
+}
+.vino-cab-card__head {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ gap: var(--space-2) var(--space-6);
+ margin: 0 0 var(--space-4);
+}
+.vino-cab-card__title {
+ margin: 0;
+ color: var(--color-text);
+ font-size: var(--text-19);
+ font-weight: 500;
+}
+.vino-cab-card__name {
+ color: var(--color-text);
+ text-decoration: none;
+ overflow-wrap: anywhere;
+}
+.vino-cab-card__title .vino-cab-card__name {
+ font: inherit;
+}
+.vino-cab-card__status {
+ margin: 0;
+ color: var(--color-accent);
+ font-size: var(--text-15);
+ letter-spacing: .08em;
+ text-transform: uppercase;
+}
+.vino-cab-card__status--canceled {
+ color: var(--color-danger-soft);
+}
+@media (hover: hover) {
+ .vino-cab-card__name:hover {
+ color: var(--color-accent-hover);
+ }
+ .vino-cab__link:not(.vino-cab__link--active):hover {
+ background: color-mix(in srgb, var(--color-accent) 14%, transparent);
+ }
+}
+@media (max-width: 760px) {
+ .vino-cab {
+ grid-template-columns: minmax(0, 1fr);
+ gap: var(--space-6);
+ }
+ .vino-cab__list {
+ display: flex;
+ flex-wrap: wrap;
+ gap: var(--space-2);
+ }
+ .vino-cab__link {
+ min-height: 44px;
+ padding: var(--space-3) var(--space-4);
+ width: auto;
+ }
+ .vino-auth__form.vino-cab__form {
+ grid-template-columns: minmax(0, 1fr);
+ }
+ .vino-auth__form.vino-cab__form .vino-auth__submit {
+ justify-self: stretch;
+ width: 100%;
+ }
+}
diff --git a/local/components/jinove/personal.profile/templates/.default/template.php b/local/components/jinove/personal.profile/templates/.default/template.php
new file mode 100644
index 0000000..01759f4
--- /dev/null
+++ b/local/components/jinove/personal.profile/templates/.default/template.php
@@ -0,0 +1,75 @@
+addExternalCss("/local/components/jinove/auth.login/templates/.default/style.css");
+$e = static fn(string $code): string => htmlspecialcharsbx((string)Loc::getMessage($code));
+?>
+
+ IncludeComponent("jinove:personal.nav", ".default", ["ACTIVE" => "profile"]); ?>
+
+
= Loc::getMessage("VINO_CAB_TITLE") ?>
+
+
+
= Loc::getMessage("VINO_CAB_PASSWORD_TITLE") ?>
+
"
+ data-msg-password="= $e("VINO_CAB_ERR_PASSWORD") ?>"
+ data-msg-same="= $e("VINO_CAB_ERR_SAME") ?>"
+ data-msg-policy="= $e("VINO_CAB_ERR_POLICY") ?>"
+ data-msg-too-often="= $e("VINO_CAB_ERR_TOO_OFTEN") ?>"
+ data-msg-auth="= $e("VINO_CAB_ERR_AUTH") ?>"
+ data-msg-error="= $e("VINO_CAB_ERR_COMMON") ?>"
+ data-msg-done="= $e("VINO_CAB_PASSWORD_DONE") ?>"
+ data-label-show="= $e("VINO_CAB_SHOW") ?>"
+ data-label-hide="= $e("VINO_CAB_HIDE") ?>">
+
+ = Loc::getMessage("VINO_CAB_CURRENT") ?>
+
+
+ = Loc::getMessage("VINO_CAB_SHOW") ?>
+
+
+
+ = Loc::getMessage("VINO_CAB_NEW") ?>
+
+
+ = Loc::getMessage("VINO_CAB_SHOW") ?>
+
+ = Loc::getMessage("VINO_CAB_HINT") ?>
+
+
+ = Loc::getMessage("VINO_CAB_PASSWORD_SAVE") ?>
+
+
+
+
diff --git a/local/components/jinove/personal.reviews/class.php b/local/components/jinove/personal.reviews/class.php
new file mode 100644
index 0000000..d61e36e
--- /dev/null
+++ b/local/components/jinove/personal.reviews/class.php
@@ -0,0 +1,35 @@
+getId();
+ if ($userId <= 0) {
+ LocalRedirect(SITE_DIR . "login/?back=" . rawurlencode(SITE_DIR . "personal/reviews/"));
+ }
+ $GLOBALS["APPLICATION"]->SetTitle(Loc::getMessage("VINO_REV_PAGE_TITLE"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("description", Loc::getMessage("VINO_REV_PAGE_DESCRIPTION"));
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_alternates", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_schema", "N");
+ $GLOBALS["APPLICATION"]->SetPageProperty("robots", "noindex, nofollow");
+ $this->arResult = [
+ "REVIEWS" => Reviews::forUser($userId),
+ "CATALOG_URL" => SITE_DIR . "catalog/",
+ ];
+ $this->includeComponentTemplate();
+
+ return $this->arResult;
+ }
+}
diff --git a/local/components/jinove/personal.reviews/lang/en/class.php b/local/components/jinove/personal.reviews/lang/en/class.php
new file mode 100644
index 0000000..c682f53
--- /dev/null
+++ b/local/components/jinove/personal.reviews/lang/en/class.php
@@ -0,0 +1,3 @@
+addExternalCss("/local/components/jinove/personal.profile/templates/.default/style.css");
+$stars = static function (int $filled): string {
+ $out = "";
+ for ($i = 1; $i <= 5; $i++) {
+ $out .= ' ';
+ }
+
+ return $out;
+};
+?>
+
+ IncludeComponent("jinove:personal.nav", ".default", ["ACTIVE" => "reviews"]); ?>
+
+
= Loc::getMessage("VINO_REV_TITLE") ?>
+
+
+
+
+
+
+
+
">= htmlspecialcharsbx($review["name"]) ?> = $review["name"] !== "" ? htmlspecialcharsbx($review["name"]) : Loc::getMessage("VINO_REV_NO_PRODUCT") ?>
+
">= Loc::getMessage($review["published"] ? "VINO_REV_PUBLISHED" : "VINO_REV_PENDING") ?>
+
+
+ $review["rating"]])) ?>">= $stars($review["rating"]) ?>
+ 0): ?>">= \Jinove\Vinoteca\DateFormat::long($review["date"], LANGUAGE_ID) ?>
+
+ = htmlspecialcharsbx($review["text"]) ?>
+
+
+
+
+
+
diff --git a/local/modules/jinove.vinoteca/.settings.php b/local/modules/jinove.vinoteca/.settings.php
new file mode 100644
index 0000000..3913938
--- /dev/null
+++ b/local/modules/jinove.vinoteca/.settings.php
@@ -0,0 +1,54 @@
+ [
+ "value" => [
+ "host" => "https://vinoteca.jimagie.com",
+ "ageExitUrl" => "https://www.google.com/",
+ "languages" => [
+ "en" => ["dir" => "/", "label" => "EN", "locale" => "en_US"],
+ "pl" => ["dir" => "/pl/", "label" => "PL", "locale" => "pl_PL"],
+ "ru" => ["dir" => "/ru/", "label" => "RU", "locale" => "ru_RU"],
+ ],
+ "iblocks" => [
+ "catalog" => 2,
+ "brands" => 6,
+ "news" => 1,
+ "banners" => 5,
+ "offers" => 10,
+ ],
+ ],
+ "readonly" => true,
+ ],
+ "controllers" => [
+ "value" => [
+ "defaultNamespace" => "\\Jinove\\Vinoteca\\Controller",
+ ],
+ "readonly" => true,
+ ],
+ "contacts" => [
+ "value" => [
+ "phone" => "+70123456789",
+ "phoneLabel" => "+7 (012) 345-67-89",
+ "email" => "info@vinoteca.jimagie.com",
+ "telegram" => "https://t.me/jimagie_vinoteca",
+ "demoMail" => "siema@jimagie.com",
+ ],
+ "readonly" => true,
+ ],
+ "basket" => [
+ "value" => [
+ "siteId" => "s1",
+ ],
+ "readonly" => true,
+ ],
+ "services" => [
+ "value" => [
+ "jinove.vinoteca.wineStats" => [
+ "className" => \Jinove\Vinoteca\Catalog\WineStats::class,
+ "constructorParams" => ["catalog", "wine"],
+ ],
+ ],
+ "readonly" => true,
+ ],
+];
diff --git a/local/modules/jinove.vinoteca/include.php b/local/modules/jinove.vinoteca/include.php
new file mode 100644
index 0000000..074c853
--- /dev/null
+++ b/local/modules/jinove.vinoteca/include.php
@@ -0,0 +1,12 @@
+MODULE_VERSION = $arModuleVersion["VERSION"];
+ $this->MODULE_VERSION_DATE = $arModuleVersion["VERSION_DATE"];
+ $this->MODULE_NAME = Loc::getMessage("JINOVE_VINOTECA_MODULE_NAME");
+ $this->MODULE_DESCRIPTION = Loc::getMessage("JINOVE_VINOTECA_MODULE_DESCRIPTION");
+ $this->PARTNER_NAME = Loc::getMessage("JINOVE_VINOTECA_PARTNER_NAME");
+ $this->PARTNER_URI = "https://vinoteca.jimagie.com";
+ }
+
+ public function DoInstall(): void
+ {
+ ModuleManager::registerModule($this->MODULE_ID);
+ $this->InstallDB();
+ }
+
+ public function DoUninstall(): void
+ {
+ $this->UnInstallDB();
+ ModuleManager::unRegisterModule($this->MODULE_ID);
+ }
+
+ public function InstallDB(): bool
+ {
+ Loader::includeModule($this->MODULE_ID);
+ $connection = Application::getConnection();
+ $table = FavoriteTable::getTableName();
+ if (!$connection->isTableExists($table)) {
+ FavoriteTable::getEntity()->createDbTable();
+ $connection->createIndex($table, "ux_" . $table, ["FUSER_ID", "PRODUCT_ID"], null, $connection::INDEX_UNIQUE);
+ }
+
+ return true;
+ }
+
+ public function UnInstallDB(): bool
+ {
+ Loader::includeModule($this->MODULE_ID);
+ $connection = Application::getConnection();
+ $table = FavoriteTable::getTableName();
+ if ($connection->isTableExists($table)) {
+ $connection->dropTable($table);
+ }
+
+ return true;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/install/version.php b/local/modules/jinove.vinoteca/install/version.php
new file mode 100644
index 0000000..6d8c2ad
--- /dev/null
+++ b/local/modules/jinove.vinoteca/install/version.php
@@ -0,0 +1,6 @@
+ "1.0.0",
+ "VERSION_DATE" => "2026-10-02 00:00:00",
+];
diff --git a/local/modules/jinove.vinoteca/lang/en/install/index.php b/local/modules/jinove.vinoteca/lang/en/install/index.php
new file mode 100644
index 0000000..1bb7faa
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lang/en/install/index.php
@@ -0,0 +1,5 @@
+getId() > 0;
+ }
+
+ public static function url(): string
+ {
+ return SITE_DIR . (self::isAuthorized() ? "personal/" : "login/");
+ }
+
+ public static function label(string $accountCode, string $loginCode): string
+ {
+ $code = self::isAuthorized() ? $accountCode : $loginCode;
+ $text = (string)Loc::getMessage($code);
+
+ return $text !== "" ? $text : (string)Loc::getMessage($accountCode);
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/altcha.php b/local/modules/jinove.vinoteca/lib/altcha.php
new file mode 100644
index 0000000..bae5a7a
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/altcha.php
@@ -0,0 +1,85 @@
+createChallenge(new CreateChallengeOptions(
+ algorithm: new Pbkdf2(),
+ cost: self::COST,
+ counter: random_int(self::COUNTER_MIN, self::COUNTER_MAX),
+ expiresAt: time() + self::TTL,
+ ))->toArray();
+ }
+
+ public static function verify(string $raw): bool
+ {
+ $library = self::library();
+ if ($library === null || $raw === "" || strlen($raw) > self::MAX_PAYLOAD) {
+ return false;
+ }
+ try {
+ $payload = Payload::fromBase64($raw);
+ $result = $library->verifySolution(new VerifySolutionOptions(algorithm: new Pbkdf2(), payload: $payload));
+ } catch (\Throwable) {
+ return false;
+ }
+ if (!$result->verified || $payload->challenge->signature === null) {
+ return false;
+ }
+
+ return self::markUsed($payload->challenge->signature);
+ }
+
+ private static function markUsed(string $signature): bool
+ {
+ $handle = @fopen(self::dir() . "/altcha-used/" . hash("sha256", $signature), "x");
+ if (!$handle) {
+ return false;
+ }
+ fclose($handle);
+ if (random_int(1, 50) === 1) {
+ foreach (glob(self::dir() . "/altcha-used/*") ?: [] as $old) {
+ if (filemtime($old) < time() - 3600) {
+ @unlink($old);
+ }
+ }
+ }
+
+ return true;
+ }
+
+ private static function library(): ?Library
+ {
+ $key = trim((string)@file_get_contents(self::dir() . "/altcha.key"));
+
+ return $key === "" ? null : new Library(hmacSignatureSecret: $key);
+ }
+
+ private static function dir(): string
+ {
+ return dirname(Application::getDocumentRoot()) . "/data";
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/articleschema.php b/local/modules/jinove.vinoteca/lib/articleschema.php
new file mode 100644
index 0000000..79f0d4a
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/articleschema.php
@@ -0,0 +1,81 @@
+ $item) {
+ $list[] = ["@type" => "ListItem", "position" => $index + 1, "url" => $item["url"], "name" => $item["name"]];
+ }
+
+ return [
+ "@context" => self::CONTEXT,
+ "@graph" => [
+ [
+ "@type" => "CollectionPage",
+ "@id" => $url . "#webpage",
+ "url" => $url,
+ "name" => $name,
+ "description" => $description,
+ "inLanguage" => LANGUAGE_ID,
+ "about" => ["@id" => Config::host() . "/#store"],
+ "mainEntity" => ["@id" => $url . "#items"],
+ "workTranslation" => PageSchema::translations($path, "CollectionPage"),
+ ],
+ [
+ "@type" => "ItemList",
+ "@id" => $url . "#items",
+ "url" => $url,
+ "numberOfItems" => count($list),
+ "itemListElement" => $list,
+ ],
+ ],
+ ];
+ }
+
+ public static function detail(array $article): array
+ {
+ $url = Config::host() . $article["path"];
+ $store = ["@id" => Config::host() . "/#store"];
+ $node = [
+ "@type" => "Article",
+ "@id" => $url . "#article",
+ "url" => $url,
+ "headline" => $article["name"],
+ "description" => $article["description"],
+ "inLanguage" => LANGUAGE_ID,
+ "datePublished" => $article["published"],
+ "dateModified" => $article["modified"],
+ "author" => $store,
+ "publisher" => $store,
+ "wordCount" => $article["words"],
+ ];
+ $page = [
+ "@type" => "WebPage",
+ "@id" => $url . "#webpage",
+ "url" => $url,
+ "name" => $article["name"],
+ "description" => $article["description"],
+ "inLanguage" => LANGUAGE_ID,
+ "mainEntity" => ["@id" => $url . "#article"],
+ "datePublished" => $article["published"],
+ "dateModified" => $article["modified"],
+ "workTranslation" => PageSchema::translations($article["path"], "WebPage"),
+ ];
+ if ($article["image"]) {
+ $image = PageSchema::image($url . "#image", $article["image"]["url"], $article["image"]["width"], $article["image"]["height"]);
+ $node["image"] = $image;
+ $page["primaryImageOfPage"] = ["@id" => $url . "#image"];
+ }
+
+ return ["@context" => self::CONTEXT, "@graph" => [$page, $node]];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/breadcrumbs.php b/local/modules/jinove.vinoteca/lib/breadcrumbs.php
new file mode 100644
index 0000000..4c99919
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/breadcrumbs.php
@@ -0,0 +1,53 @@
+AddChainItem((string)Loc::getMessage("VINO_BREADCRUMBS_HOME"), SITE_DIR);
+ foreach ($items as $item) {
+ $link = (string)($item[1] ?? "");
+ if ($link !== "" && str_starts_with($link, "/") && !str_starts_with($link, SITE_DIR)) {
+ $link = SITE_DIR . ltrim($link, "/");
+ }
+ $APPLICATION->AddChainItem((string)$item[0], $link);
+ }
+ $APPLICATION->IncludeComponent("bitrix:breadcrumb", "vinoteca", [
+ "START_FROM" => "0",
+ "PATH" => "",
+ "SITE_ID" => SITE_ID,
+ ], false, ["HIDE_ICONS" => "Y"]);
+ }
+
+ public static function schema(array $chain, string $self): array
+ {
+ $last = count($chain) - 1;
+ $items = [];
+ foreach ($chain as $i => $item) {
+ $link = (string)$item["LINK"];
+ $items[] = [
+ "@type" => "ListItem",
+ "position" => $i + 1,
+ "name" => $item["TITLE"],
+ "item" => $i < $last && $link !== "" ? Config::host() . $link : $self,
+ ];
+ }
+
+ return [
+ "@context" => "https://schema.org",
+ "@type" => "BreadcrumbList",
+ "@id" => $self . "#breadcrumb",
+ "itemListElement" => $items,
+ ];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/cached.php b/local/modules/jinove.vinoteca/lib/cached.php
new file mode 100644
index 0000000..4ee89bc
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/cached.php
@@ -0,0 +1,37 @@
+initCache($ttl, $id, $dir)) {
+ return $cache->getVars();
+ }
+
+ $cache->startDataCache();
+ $taggedCache = Application::getInstance()->getTaggedCache();
+ $taggedCache->startTagCache($dir);
+ try {
+ foreach ($tags as $tag) {
+ $taggedCache->registerTag($tag);
+ }
+ $value = $load();
+ } catch (\Throwable $e) {
+ $taggedCache->abortTagCache();
+ $cache->abortDataCache();
+ throw $e;
+ }
+ $taggedCache->endTagCache();
+ $cache->endDataCache($value);
+
+ return $value;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/cart.php b/local/modules/jinove.vinoteca/lib/cart.php
new file mode 100644
index 0000000..46b0e4a
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/cart.php
@@ -0,0 +1,273 @@
+ $productId, "QUANTITY" => $quantity], ["LID" => Config::basketSiteId()])->isSuccess();
+ }
+ if ($quantity === 0) {
+ $item->delete();
+ } elseif (!$item->setField("QUANTITY", $quantity)->isSuccess()) {
+ return false;
+ }
+
+ return $basket->save()->isSuccess();
+ }
+
+ public static function addMany(BasketBase $basket, array $items): bool
+ {
+ $ok = true;
+ foreach ($items as $productId => $quantity) {
+ $item = self::findItem($basket, (int)$productId);
+ $current = $item === null ? 0 : (int)$item->getQuantity();
+ $ok = self::setQuantity($basket, (int)$productId, $current + (int)$quantity) && $ok;
+ }
+
+ return $ok;
+ }
+
+ public static function parseShare(string $code): array
+ {
+ if (!preg_match('/^\d{1,9}-\d{1,2}(\.\d{1,9}-\d{1,2}){0,' . (self::SHARE_MAX_ITEMS - 1) . '}$/', $code)) {
+ return [];
+ }
+ $items = [];
+ foreach (explode(".", $code) as $pair) {
+ [$productId, $quantity] = array_map("intval", explode("-", $pair));
+ if ($productId > 0 && $quantity > 0) {
+ $items[$productId] = min(self::MAX_QUANTITY, ($items[$productId] ?? 0) + $quantity);
+ }
+ }
+
+ return $items;
+ }
+
+ public static function shared(array $items): array
+ {
+ $productIds = array_keys($items);
+ $products = Related::summariesById($productIds);
+ $prices = Prices::optimal(array_keys($products), Config::basketSiteId());
+ $meta = SearchMeta::get($productIds);
+ $images = Media::thumbs($productIds, self::THUMB_WIDTH, self::THUMB_HEIGHT);
+ $list = [];
+ $sum = 0.0;
+ $currency = "";
+ foreach ($items as $productId => $quantity) {
+ if (!isset($products[$productId], $prices[$productId])) {
+ continue;
+ }
+ $price = $prices[$productId];
+ $currency = $price["currency"];
+ $sum += $price["price"] * $quantity;
+ $list[] = [
+ "id" => $productId,
+ "name" => $products[$productId]["name"],
+ "url" => $products[$productId]["url"],
+ "brand" => (string)($meta[$productId]["BRAND"] ?? ""),
+ "image" => (string)($images[$productId] ?? ""),
+ "quantity" => $quantity,
+ "sum" => Money::format($price["price"] * $quantity, $currency),
+ ];
+ }
+
+ return [
+ "items" => $list,
+ "code" => implode(".", array_map(static fn(array $row): string => $row["id"] . "-" . $row["quantity"], $list)),
+ "total" => $list ? Money::format($sum, $currency) : "",
+ ];
+ }
+
+ public static function clear(BasketBase $basket): bool
+ {
+ foreach ($basket as $item) {
+ if (!$item->isDelay()) {
+ $item->delete();
+ }
+ }
+
+ return $basket->save()->isSuccess();
+ }
+
+ public static function addCoupon(string $code): bool
+ {
+ DiscountCouponsManager::init();
+
+ return DiscountCouponsManager::add($code);
+ }
+
+ public static function removeCoupon(string $code): bool
+ {
+ DiscountCouponsManager::init();
+
+ return DiscountCouponsManager::delete($code);
+ }
+
+ public static function state(BasketBase $basket): array
+ {
+ $items = [];
+ $count = 0;
+ foreach ($basket as $item) {
+ if (!$item->canBuy() || $item->isDelay()) {
+ continue;
+ }
+ $productId = (int)$item->getProductId();
+ $quantity = (int)$item->getQuantity();
+ $items[$productId] = ($items[$productId] ?? 0) + $quantity;
+ $count += $quantity;
+ }
+
+ return ["count" => $count, "items" => (object)$items];
+ }
+
+ public static function view(BasketBase $basket, bool $refresh = true): array
+ {
+ DiscountCouponsManager::init();
+ if ($refresh) {
+ $basket->refresh(RefreshFactory::create(RefreshFactory::TYPE_FULL));
+ $basket->save();
+ }
+ self::applyDiscounts($basket);
+ $productIds = [];
+ foreach ($basket as $item) {
+ if (!$item->isDelay()) {
+ $productIds[] = (int)$item->getProductId();
+ }
+ }
+ $products = Related::summariesById($productIds);
+ $meta = SearchMeta::get($productIds);
+ $images = Media::thumbs($productIds, self::THUMB_WIDTH, self::THUMB_HEIGHT);
+ $currency = "";
+ $items = [];
+ $count = 0;
+ $lines = 0;
+ $sum = 0.0;
+ $base = 0.0;
+ foreach ($basket as $item) {
+ if ($item->isDelay()) {
+ continue;
+ }
+ $productId = (int)$item->getProductId();
+ $quantity = (int)$item->getQuantity();
+ $price = (float)$item->getPrice();
+ $basePrice = max($price, (float)$item->getBasePrice());
+ $currency = (string)$item->getCurrency();
+ $available = $item->canBuy();
+ if ($available) {
+ $lines++;
+ $count += $quantity;
+ $sum += $price * $quantity;
+ $base += $basePrice * $quantity;
+ }
+ $items[] = [
+ "id" => $productId,
+ "name" => (string)($products[$productId]["name"] ?? $item->getField("NAME")),
+ "url" => (string)($products[$productId]["url"] ?? ""),
+ "meta" => (string)($meta[$productId]["META"] ?? ""),
+ "brand" => (string)($meta[$productId]["BRAND"] ?? ""),
+ "image" => (string)($images[$productId] ?? ""),
+ "quantity" => $quantity,
+ "available" => $available,
+ "price" => Money::format($price, $currency),
+ "basePrice" => $basePrice > $price ? Money::format($basePrice, $currency) : "",
+ "sum" => Money::format($price * $quantity, $currency),
+ ];
+ }
+ if ($currency === "") {
+ $currency = Loader::includeModule("currency") ? (string)CurrencyManager::getBaseCurrency() : "";
+ }
+
+ return [
+ "count" => $count,
+ "summary" => Loc::getMessagePlural("VINO_CART_LINES", $lines, ["#COUNT#" => $lines]) . ", " . Loc::getMessagePlural("VINO_CART_BOTTLES", $count, ["#COUNT#" => $count]),
+ "items" => $items,
+ "base" => Money::format($base, $currency),
+ "discount" => $base > $sum ? "\u{2212}" . Money::format($base - $sum, $currency) : "",
+ "total" => Money::format($sum, $currency),
+ "coupons" => self::coupons(),
+ ];
+ }
+
+ private static function coupons(): array
+ {
+ $coupons = [];
+ foreach ((array)DiscountCouponsManager::get(true, [], true, true) as $coupon) {
+ $coupons[] = [
+ "code" => (string)$coupon["COUPON"],
+ "applied" => (int)$coupon["STATUS"] === DiscountCouponsManager::STATUS_APPLYED,
+ ];
+ }
+
+ return $coupons;
+ }
+
+ private static function applyDiscounts(BasketBase $basket): void
+ {
+ $discount = Discount::buildFromBasket($basket, new FuserContext((int)$basket->getFUserId(true)));
+ if ($discount === null) {
+ return;
+ }
+ $result = $discount->calculate();
+ if ($result->isSuccess()) {
+ $data = $result->getData();
+ if (isset($data["BASKET_ITEMS"])) {
+ $basket->applyDiscount($data["BASKET_ITEMS"]);
+ }
+ }
+ }
+
+ private static function findItem(BasketBase $basket, int $productId): ?BasketItemBase
+ {
+ foreach ($basket as $item) {
+ if ((int)$item->getProductId() === $productId && !$item->isDelay()) {
+ return $item;
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/brandschema.php b/local/modules/jinove.vinoteca/lib/catalog/brandschema.php
new file mode 100644
index 0000000..f7c6e74
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/brandschema.php
@@ -0,0 +1,143 @@
+ $item) {
+ $list[] = ["@type" => "ListItem", "position" => $index + 1, "url" => $item["url"], "name" => $item["name"]];
+ }
+ $page = [
+ "@type" => "CollectionPage",
+ "@id" => $url . "#webpage",
+ "url" => $url,
+ "name" => $name,
+ "description" => $description,
+ "inLanguage" => LANGUAGE_ID,
+ "about" => ["@id" => Config::host() . "/#store"],
+ "mainEntity" => ["@id" => $url . "#items"],
+ "workTranslation" => PageSchema::translations(SITE_DIR . "brands/", "CollectionPage"),
+ ];
+ $itemList = ["@type" => "ItemList", "@id" => $url . "#items", "numberOfItems" => count($list), "itemListElement" => $list];
+
+ return ["@context" => self::CONTEXT, "@graph" => [$page, $itemList]];
+ }
+
+ public static function detail(array $brand, array $wines, int $winesTotal): array
+ {
+ $url = $brand["url"];
+ $node = [
+ "@type" => ["Brand", "Winery"],
+ "@id" => $url . "#brand",
+ "name" => $brand["name"],
+ "url" => $url,
+ ];
+ if ($brand["description"] !== "") {
+ $node["description"] = $brand["description"];
+ }
+ if ($brand["logo"] !== "") {
+ $node["logo"] = PageSchema::image($url . "#logo", $brand["logo"], $brand["logoWidth"], $brand["logoHeight"]);
+ }
+ $address = ["@type" => "PostalAddress"];
+ if ($brand["country"] !== "") {
+ $address["addressCountry"] = $brand["country"];
+ }
+ if ($brand["region"] !== "") {
+ $address["addressRegion"] = $brand["region"];
+ }
+ if (count($address) > 1) {
+ $node["address"] = $address;
+ }
+ if (preg_match('/^\d{4}$/', $brand["founded"])) {
+ $node["foundingDate"] = $brand["founded"];
+ }
+ $list = [];
+ foreach (array_values($wines) as $index => $wine) {
+ $list[] = ["@type" => "ListItem", "position" => $index + 1, "url" => Config::host() . $wine["url"], "name" => $wine["name"]];
+ }
+ $page = [
+ "@type" => "CollectionPage",
+ "@id" => $url . "#webpage",
+ "url" => $url,
+ "name" => $brand["name"],
+ "description" => $brand["pageDescription"],
+ "inLanguage" => LANGUAGE_ID,
+ "mainEntity" => ["@id" => $url . "#brand"],
+ "workTranslation" => PageSchema::translations($brand["path"], "CollectionPage"),
+ ];
+ $graph = [$page, $node];
+ if ($list) {
+ $graph[] = ["@type" => "ItemList", "@id" => $url . "#items", "numberOfItems" => $winesTotal, "itemListElement" => $list];
+ }
+
+ return ["@context" => self::CONTEXT, "@graph" => $graph];
+ }
+
+ public static function countryCode(string $englishName): string
+ {
+ return [
+ "Argentina" => "AR", "Australia" => "AU", "France" => "FR", "Hungary" => "HU", "Italy" => "IT",
+ "New Zealand" => "NZ", "Portugal" => "PT", "Spain" => "ES", "USA" => "US",
+ ][trim($englishName)] ?? "";
+ }
+
+ public static function wines(int $brandId): array
+ {
+ $catalogId = Config::iblockId("catalog");
+ if ($brandId <= 0 || $catalogId <= 0 || !Loader::includeModule("iblock")) {
+ return ["items" => [], "total" => 0];
+ }
+ \CIBlock::registerWithTagCache($catalogId);
+ $property = PropertyTable::getRow(["select" => ["ID"], "filter" => ["=IBLOCK_ID" => $catalogId, "=CODE" => "BRAND"]]);
+ if ($property === null) {
+ return ["items" => [], "total" => 0];
+ }
+ $ids = [];
+ $rows = ElementPropertyTable::getList([
+ "select" => ["IBLOCK_ELEMENT_ID"],
+ "filter" => ["=IBLOCK_PROPERTY_ID" => (int)$property["ID"], "=VALUE_NUM" => $brandId],
+ ]);
+ while ($row = $rows->fetch()) {
+ $ids[] = (int)$row["IBLOCK_ELEMENT_ID"];
+ }
+ if (!$ids) {
+ return ["items" => [], "total" => 0];
+ }
+ $now = new DateTime();
+ $ordered = ElementTable::getList([
+ "select" => ["ID"],
+ "filter" => [
+ "=IBLOCK_ID" => $catalogId,
+ "=ID" => $ids,
+ "=ACTIVE" => "Y",
+ ["LOGIC" => "OR", ["=ACTIVE_FROM" => false], ["<=ACTIVE_FROM" => $now]],
+ ["LOGIC" => "OR", ["=ACTIVE_TO" => false], [">=ACTIVE_TO" => $now]],
+ ],
+ "order" => ["SORT" => "ASC", "ID" => "DESC"],
+ ])->fetchAll();
+ $sortedIds = array_map(static fn(array $row): int => (int)$row["ID"], $ordered);
+ $summaries = Related::summariesById(array_slice($sortedIds, 0, self::WINES_LIMIT));
+
+ return [
+ "items" => array_values(array_filter(array_map(static fn(int $id): ?array => $summaries[$id] ?? null, array_slice($sortedIds, 0, self::WINES_LIMIT)))),
+ "total" => count($sortedIds),
+ ];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/comparison.php b/local/modules/jinove.vinoteca/lib/catalog/comparison.php
new file mode 100644
index 0000000..1923d33
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/comparison.php
@@ -0,0 +1,240 @@
+SetTitle((string)Loc::getMessage("VINO_COMPARE_H1"));
+ $APPLICATION->SetPageProperty("title", (string)Loc::getMessage("VINO_COMPARE_H1"));
+ $APPLICATION->SetPageProperty("robots", "noindex, follow");
+ $APPLICATION->SetPageProperty("vino_alternates", "N");
+ }
+
+ public static function isEmpty(): bool
+ {
+ return !self::read();
+ }
+
+ public static function read(): array
+ {
+ $list = Application::getInstance()->getSession()[self::SESSION_KEY] ?? [];
+
+ return (array)($list[Config::iblockId("catalog")]["ITEMS"] ?? []);
+ }
+
+ public static function write(array $items): void
+ {
+ $session = Application::getInstance()->getSession();
+ $list = (array)($session[self::SESSION_KEY] ?? []);
+ $list[Config::iblockId("catalog")]["ITEMS"] = $items;
+ $session[self::SESSION_KEY] = $list;
+ }
+
+ public static function prune(): array
+ {
+ $items = self::read();
+ if (!$items || !Loader::includeModule("iblock")) {
+ return $items;
+ }
+ $active = array_flip(array_map("intval", array_column(\Bitrix\Iblock\ElementTable::getList([
+ "select" => ["ID"],
+ "filter" => ["=ID" => array_map("intval", array_keys($items)), "=IBLOCK_ID" => Config::iblockId("catalog"), "=ACTIVE" => "Y"],
+ ])->fetchAll(), "ID")));
+ $kept = array_intersect_key($items, $active);
+ if (count($kept) !== count($items)) {
+ self::write($kept);
+ }
+
+ return $kept;
+ }
+
+ public static function params(): array
+ {
+ $catalog = Listing::catalogParams();
+
+ return [
+ "NAME" => self::SESSION_KEY,
+ "IBLOCK_TYPE" => $catalog["IBLOCK_TYPE"],
+ "IBLOCK_ID" => $catalog["IBLOCK_ID"],
+ "FIELD_CODE" => [],
+ "PROPERTY_CODE" => [],
+ "OFFERS_FIELD_CODE" => [],
+ "OFFERS_PROPERTY_CODE" => [],
+ "PRICE_CODE" => $catalog["PRICE_CODE"],
+ "USE_PRICE_COUNT" => "N",
+ "SHOW_PRICE_COUNT" => "1",
+ "PRICE_VAT_INCLUDE" => "Y",
+ "CONVERT_CURRENCY" => "N",
+ "BASKET_URL" => $catalog["BASKET_URL"],
+ "ACTION_VARIABLE" => $catalog["ACTION_VARIABLE"],
+ "PRODUCT_ID_VARIABLE" => $catalog["PRODUCT_ID_VARIABLE"],
+ "SECTION_ID_VARIABLE" => "SECTION_ID",
+ "DETAIL_URL" => $catalog["SEF_FOLDER"] . $catalog["SEF_URL_TEMPLATES"]["element"],
+ "DISPLAY_ELEMENT_SELECT_BOX" => "N",
+ "ELEMENT_SORT_FIELD" => "sort",
+ "ELEMENT_SORT_ORDER" => "asc",
+ "HIDE_NOT_AVAILABLE" => "N",
+ "TEMPLATE_THEME" => "",
+ ];
+ }
+
+ public static function build(array $compareItems): array
+ {
+ $ids = [];
+ foreach ($compareItems as $item) {
+ $ids[] = (int)($item["ID"] ?? 0);
+ }
+ $ids = array_values(array_filter($ids));
+ if (!$ids || !Loader::includeModule("iblock")) {
+ return ["ITEMS" => [], "ROWS" => []];
+ }
+ $summaries = Related::summariesById($ids);
+ $prices = Prices::optimal($ids);
+ $available = self::availability($ids);
+ $catalogId = Config::iblockId("catalog");
+ $elements = [];
+ $rows = \CIBlockElement::GetList([], ["ID" => $ids, "IBLOCK_ID" => $catalogId], false, false, ["ID", "IBLOCK_ID", "NAME", "PREVIEW_PICTURE", "DETAIL_PICTURE"]);
+ while ($row = $rows->Fetch()) {
+ $row["PROPERTIES"] = [];
+ $elements[(int)$row["ID"]] = $row;
+ }
+ if ($elements) {
+ $properties = array_fill_keys(array_keys($elements), []);
+ \CIBlockElement::GetPropertyValuesArray($properties, $catalogId, ["ID" => array_keys($elements)]);
+ foreach ($properties as $id => $values) {
+ $elements[$id]["PROPERTIES"] = $values;
+ }
+ }
+ $brands = self::brandNames($elements);
+ $items = [];
+ $values = [];
+ foreach ($ids as $id) {
+ $element = $elements[$id] ?? null;
+ $summary = $summaries[$id] ?? null;
+ if ($element === null || $summary === null) {
+ continue;
+ }
+ $items[] = self::item($element, $summary, $prices[$id] ?? null, $available[$id] ?? false);
+ foreach (self::ROWS as $code) {
+ $values[$code][] = self::value($code, $element["PROPERTIES"], $brands);
+ }
+ }
+ $table = [];
+ foreach (self::ROWS as $code) {
+ $cells = $values[$code] ?? [];
+ if (!array_filter($cells, static fn(string $cell): bool => $cell !== "")) {
+ continue;
+ }
+ $same = count($cells) > 1 && count(array_unique($cells)) === 1;
+ $table[] = ["LABEL" => (string)Loc::getMessage("VINO_COMPARE_ROW_" . $code), "VALUES" => $cells, "SAME" => $same];
+ }
+
+ return ["ITEMS" => $items, "ROWS" => $table];
+ }
+
+ private static function item(array $element, array $summary, ?array $price, bool $available): array
+ {
+ $pictureId = (int)($element["PREVIEW_PICTURE"] ?: $element["DETAIL_PICTURE"]);
+ $prices = [];
+ if ($price) {
+ $prices[] = [
+ "RATIO_PRICE" => $price["price"],
+ "PRINT_RATIO_PRICE" => htmlspecialcharsbx(Money::format($price["price"], $price["currency"])),
+ "RATIO_BASE_PRICE" => $price["base"],
+ "PRINT_RATIO_BASE_PRICE" => htmlspecialcharsbx(Money::format($price["base"], $price["currency"])),
+ "PERCENT" => $price["base"] > 0 ? round(100 - $price["price"] / $price["base"] * 100) : 0,
+ ];
+ }
+
+ return [
+ "ID" => (int)$element["ID"],
+ "NAME" => htmlspecialcharsbx((string)$summary["name"]),
+ "~NAME" => (string)$summary["name"],
+ "DETAIL_PAGE_URL" => htmlspecialcharsbx((string)$summary["url"]),
+ "~DETAIL_PAGE_URL" => (string)$summary["url"],
+ "PREVIEW_PICTURE" => $pictureId > 0 ? ["ID" => $pictureId] : null,
+ "DETAIL_PICTURE" => null,
+ "PROPERTIES" => $element["PROPERTIES"],
+ "ITEM_PRICES" => $prices,
+ "ITEM_PRICE_SELECTED" => 0,
+ "CAN_BUY" => $available && $prices !== [],
+ ];
+ }
+
+ private static function value(string $code, array $properties, array $brands): string
+ {
+ $raw = $properties[$code]["~VALUE"] ?? $properties[$code]["VALUE"] ?? "";
+ if (is_array($raw) && !isset($raw["TEXT"])) {
+ $raw = implode(", ", array_filter($raw));
+ }
+ $plain = trim(is_array($raw) ? (string)($raw["TEXT"] ?? "") : (string)$raw);
+ $number = static fn(string $value): string => LANGUAGE_ID === "en" ? $value : str_replace(".", ",", $value);
+
+ return match ($code) {
+ "WINE_COLOR", "COUNTRY", "REGION", "GRAPE", "SUGAR" => EnumNames::fromProperty($properties[$code] ?? []),
+ "BRAND" => $brands[(int)$plain] ?? "",
+ "ABV" => $plain !== "" ? $number((string)(float)$plain) . "%" : "",
+ "VOLUME" => $plain !== "" ? (string)Loc::getMessage("VINO_COMPARE_VOLUME", ["#VALUE#" => $number($plain)]) : "",
+ "AGING" => LocalizedText::property($properties, $code),
+ default => $plain,
+ };
+ }
+
+ private static function brandNames(array $elements): array
+ {
+ $ids = [];
+ foreach ($elements as $element) {
+ $value = $element["PROPERTIES"]["BRAND"]["VALUE"] ?? 0;
+ $ids[] = (int)(is_array($value) ? reset($value) : $value);
+ }
+ $ids = array_values(array_unique(array_filter($ids)));
+ if (!$ids) {
+ return [];
+ }
+ $names = [];
+ $rows = \Bitrix\Iblock\ElementTable::getList(["select" => ["ID", "NAME"], "filter" => ["=ID" => $ids]]);
+ while ($row = $rows->fetch()) {
+ $names[(int)$row["ID"]] = (string)$row["NAME"];
+ }
+
+ return $names;
+ }
+
+ private static function availability(array $ids): array
+ {
+ if (!Loader::includeModule("catalog")) {
+ return [];
+ }
+ $available = [];
+ $rows = ProductTable::getList(["select" => ["ID", "AVAILABLE"], "filter" => ["=ID" => $ids]]);
+ while ($row = $rows->fetch()) {
+ $available[(int)$row["ID"]] = $row["AVAILABLE"] === "Y";
+ }
+
+ return $available;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/countries.php b/local/modules/jinove.vinoteca/lib/catalog/countries.php
new file mode 100644
index 0000000..9e83555
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/countries.php
@@ -0,0 +1,33 @@
+ "ASC", "VALUE" => "ASC"], ["IBLOCK_ID" => $catalogId, "CODE" => "COUNTRY"]);
+ while ($row = $rows->Fetch()) {
+ $names[(string)$row["XML_ID"]] = (string)$row["VALUE"];
+ }
+
+ return $names;
+ });
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/enumnames.php b/local/modules/jinove.vinoteca/lib/catalog/enumnames.php
new file mode 100644
index 0000000..b2a5e5a
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/enumnames.php
@@ -0,0 +1,35 @@
+ $xmlId) {
+ if ((string)$xmlId === "") {
+ continue;
+ }
+ $names[] = self::name((string)$property["CODE"], (string)$xmlId, (string)($values[$index] ?? ""));
+ }
+
+ return implode(", ", $names);
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/favorite.php b/local/modules/jinove.vinoteca/lib/catalog/favorite.php
new file mode 100644
index 0000000..0fbd494
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/favorite.php
@@ -0,0 +1,95 @@
+configurePrimary()->configureAutocomplete(),
+ (new IntegerField("FUSER_ID"))->configureRequired(),
+ (new IntegerField("PRODUCT_ID"))->configureRequired(),
+ (new DatetimeField("DATE_CREATE"))->configureDefaultValue(static fn(): DateTime => new DateTime()),
+ ];
+ }
+
+ public static function productIds(int $fuserId): array
+ {
+ if ($fuserId <= 0) {
+ return [];
+ }
+ $ids = array_map("intval", array_column(self::getList([
+ "select" => ["PRODUCT_ID"],
+ "filter" => ["=FUSER_ID" => $fuserId],
+ "order" => ["ID" => "ASC"],
+ ])->fetchAll(), "PRODUCT_ID"));
+ if (!$ids || !Loader::includeModule("iblock")) {
+ return [];
+ }
+ $active = array_flip(array_map("intval", array_column(ElementTable::getList([
+ "select" => ["ID"],
+ "filter" => ["=ID" => $ids, "=IBLOCK_ID" => Config::iblockId("catalog"), "=ACTIVE" => "Y"],
+ ])->fetchAll(), "ID")));
+
+ return array_values(array_filter($ids, static fn(int $id): bool => isset($active[$id])));
+ }
+
+ public static function onElementDelete(array $fields): void
+ {
+ $productId = (int)($fields["ID"] ?? 0);
+ if ($productId <= 0) {
+ return;
+ }
+ $rows = self::getList(["select" => ["ID"], "filter" => ["=PRODUCT_ID" => $productId]]);
+ while ($row = $rows->fetch()) {
+ self::delete((int)$row["ID"]);
+ }
+ }
+
+ public static function rememberGuest(): void
+ {
+ if (Loader::includeModule("sale")) {
+ self::$guestFuser = (int)Fuser::getId(true);
+ }
+ }
+
+ public static function mergeGuest(): void
+ {
+ if (self::$guestFuser <= 0 || !Loader::includeModule("sale")) {
+ return;
+ }
+ $userFuser = (int)Fuser::getId(true);
+ if ($userFuser <= 0 || $userFuser === self::$guestFuser) {
+ return;
+ }
+ $owned = array_flip(array_map("intval", array_column(self::getList(["select" => ["PRODUCT_ID"], "filter" => ["=FUSER_ID" => $userFuser]])->fetchAll(), "PRODUCT_ID")));
+ $rows = self::getList(["select" => ["ID", "PRODUCT_ID"], "filter" => ["=FUSER_ID" => self::$guestFuser]]);
+ while ($row = $rows->fetch()) {
+ if (isset($owned[(int)$row["PRODUCT_ID"]])) {
+ self::delete((int)$row["ID"]);
+ } else {
+ self::update((int)$row["ID"], ["FUSER_ID" => $userFuser]);
+ }
+ }
+ self::$guestFuser = 0;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/favorites.php b/local/modules/jinove.vinoteca/lib/catalog/favorites.php
new file mode 100644
index 0000000..5285543
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/favorites.php
@@ -0,0 +1,88 @@
+SetTitle((string)Loc::getMessage("VINO_FAVORITES_H1"));
+ $APPLICATION->SetPageProperty("title", (string)Loc::getMessage("VINO_FAVORITES_H1"));
+ $APPLICATION->SetPageProperty("robots", "noindex, follow");
+ $APPLICATION->SetPageProperty("vino_alternates", "N");
+ Asset::getInstance()->addCss(SITE_TEMPLATE_PATH . "/catalog-styles.css");
+ Asset::getInstance()->addJs(SITE_TEMPLATE_PATH . "/assets/js/vino-favorites.js");
+ }
+
+ public static function ids(): array
+ {
+ if (!Loader::includeModule("sale")) {
+ return [];
+ }
+
+ return FavoriteTable::productIds((int)Fuser::getId(true));
+ }
+
+ public static function params(array $ids): array
+ {
+ $GLOBALS[self::FILTER] = ["ID" => $ids ?: [0]];
+ $catalog = Listing::catalogParams();
+
+ return [
+ "IBLOCK_TYPE" => $catalog["IBLOCK_TYPE"],
+ "IBLOCK_ID" => $catalog["IBLOCK_ID"],
+ "SECTION_ID" => 0,
+ "SHOW_ALL_WO_SECTION" => "Y",
+ "FILTER_NAME" => self::FILTER,
+ "PRICE_CODE" => $catalog["PRICE_CODE"],
+ "BASKET_URL" => $catalog["BASKET_URL"],
+ "PAGE_ELEMENT_COUNT" => "24",
+ "LINE_ELEMENT_COUNT" => "4",
+ "INCLUDE_SUBSECTIONS" => "Y",
+ "ELEMENT_SORT_FIELD" => "SORT",
+ "ELEMENT_SORT_ORDER" => "ASC",
+ "ELEMENT_SORT_FIELD2" => "ID",
+ "ELEMENT_SORT_ORDER2" => "DESC",
+ "PROPERTY_CODE" => $catalog["LIST_PROPERTY_CODE"],
+ "CACHE_TYPE" => $catalog["CACHE_TYPE"],
+ "CACHE_TIME" => $catalog["CACHE_TIME"],
+ "CACHE_GROUPS" => $catalog["CACHE_GROUPS"],
+ "CACHE_FILTER" => "Y",
+ "SET_TITLE" => "N",
+ "SET_BROWSER_TITLE" => "N",
+ "SET_META_KEYWORDS" => "N",
+ "SET_META_DESCRIPTION" => "N",
+ "SET_STATUS_404" => "N",
+ "SHOW_404" => "N",
+ "ADD_SECTIONS_CHAIN" => "N",
+ "ACTION_VARIABLE" => $catalog["ACTION_VARIABLE"],
+ "PRODUCT_ID_VARIABLE" => $catalog["PRODUCT_ID_VARIABLE"],
+ "USE_PRODUCT_QUANTITY" => "Y",
+ "ADD_TO_BASKET_ACTION" => "ADD",
+ "SHOW_OLD_PRICE" => "Y",
+ "SHOW_DISCOUNT_PERCENT" => "Y",
+ "DISPLAY_TOP_PAGER" => "N",
+ "DISPLAY_BOTTOM_PAGER" => "Y",
+ "PAGER_TEMPLATE" => "vinoteca",
+ "PAGER_SHOW_ALWAYS" => "N",
+ "PAGER_TITLE" => (string)Loc::getMessage("VINO_FAVORITES_PAGER_TITLE"),
+ "SECTION_URL" => $catalog["SEF_FOLDER"] . $catalog["SEF_URL_TEMPLATES"]["section"],
+ "DETAIL_URL" => $catalog["SEF_FOLDER"] . $catalog["SEF_URL_TEMPLATES"]["element"],
+ "HIDE_NOT_AVAILABLE" => "N",
+ "VINO_TITLE_TAG" => "h2",
+ "VINO_GRID_FULL" => "Y",
+ ];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/listing.php b/local/modules/jinove.vinoteca/lib/catalog/listing.php
new file mode 100644
index 0000000..d57c6c1
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/listing.php
@@ -0,0 +1,186 @@
+ "catalog",
+ "IBLOCK_ID" => VINO_CATALOG_IBLOCK,
+ "SEF_MODE" => "Y",
+ "SEF_FOLDER" => SITE_DIR . "catalog/",
+ "SEF_URL_TEMPLATES" => [
+ "sections" => "",
+ "section" => "#SECTION_CODE#/",
+ "element" => "#SECTION_CODE#/#ELEMENT_CODE#/",
+ "smart_filter" => "#SECTION_CODE#/filter/#SMART_FILTER_PATH#/apply/",
+ ],
+ "PRICE_CODE" => ["BASE"],
+ "BASKET_URL" => SITE_DIR . "personal/cart/",
+ "ACTION_VARIABLE" => "action",
+ "PRODUCT_ID_VARIABLE" => "id",
+ "CACHE_TYPE" => "A",
+ "CACHE_TIME" => "3600",
+ "CACHE_GROUPS" => "N",
+ "SET_STATUS_404" => "Y",
+ "SHOW_404" => "Y",
+ "MESSAGE_404" => "",
+ "FILE_404" => "",
+ "LIST_PROPERTY_CODE" => ["WINE_COLOR", "SUGAR", "VOLUME", "REGION", "COUNTRY"],
+ "DETAIL_PROPERTY_CODE" => ["WINE_COLOR", "SUGAR", "GRAPE", "VOLUME", "ABV", "REGION", "COUNTRY", "BRAND", "ARTNUMBER", "VINTAGE", "AGING", "SERVE_TEMP", "FOOD_PAIRING", "TASTE_COLOR", "AROMA", "TASTE", "MORE_PHOTO"],
+ ];
+ }
+
+ public static function sectionTilesParams(): array
+ {
+ $catalog = self::catalogParams();
+
+ return [
+ "IBLOCK_TYPE" => $catalog["IBLOCK_TYPE"],
+ "IBLOCK_ID" => $catalog["IBLOCK_ID"],
+ "SECTION_ID" => "",
+ "SECTION_CODE" => "",
+ "TOP_DEPTH" => "1",
+ "COUNT_ELEMENTS" => "Y",
+ "COUNT_ELEMENTS_FILTER" => "CNT_ACTIVE",
+ "HIDE_SECTIONS_WITH_ZERO_COUNT_ELEMENTS" => "Y",
+ "SECTION_FIELDS" => ["CODE", "PICTURE"],
+ "SECTION_USER_FIELDS" => [],
+ "ADD_SECTIONS_CHAIN" => "N",
+ "CACHE_TYPE" => $catalog["CACHE_TYPE"],
+ "CACHE_TIME" => $catalog["CACHE_TIME"],
+ "CACHE_GROUPS" => $catalog["CACHE_GROUPS"],
+ ];
+ }
+
+ public static function prepareBestsellers(): array
+ {
+ $GLOBALS["bestsellersFilter"] = ["!PROPERTY_SALELEADER" => false];
+ $catalog = self::catalogParams();
+
+ return [
+ "IBLOCK_TYPE" => $catalog["IBLOCK_TYPE"],
+ "IBLOCK_ID" => $catalog["IBLOCK_ID"],
+ "ELEMENT_COUNT" => "12",
+ "FILTER_NAME" => "bestsellersFilter",
+ "ELEMENT_SORT_FIELD" => "SORT",
+ "ELEMENT_SORT_ORDER" => "asc",
+ "ELEMENT_SORT_FIELD2" => "PROPERTY_RATING",
+ "ELEMENT_SORT_ORDER2" => "desc",
+ "PROPERTY_CODE" => $catalog["LIST_PROPERTY_CODE"],
+ "PRICE_CODE" => $catalog["PRICE_CODE"],
+ "PRICE_VAT_INCLUDE" => "Y",
+ "USE_PRICE_COUNT" => "N",
+ "SHOW_PRICE_COUNT" => "1",
+ "CONVERT_CURRENCY" => "N",
+ "HIDE_NOT_AVAILABLE" => "N",
+ "DETAIL_URL" => SITE_DIR . "catalog/#SECTION_CODE#/#ELEMENT_CODE#/",
+ "SECTION_URL" => SITE_DIR . "catalog/#SECTION_CODE#/",
+ "CACHE_TYPE" => $catalog["CACHE_TYPE"],
+ "CACHE_TIME" => $catalog["CACHE_TIME"],
+ "CACHE_GROUPS" => $catalog["CACHE_GROUPS"],
+ "CACHE_FILTER" => "Y",
+ ];
+ }
+
+ public static function filterParams(string $sectionCode, string $filterPath): array
+ {
+ $catalog = self::catalogParams();
+
+ return [
+ "IBLOCK_TYPE" => $catalog["IBLOCK_TYPE"],
+ "IBLOCK_ID" => $catalog["IBLOCK_ID"],
+ "SECTION_CODE" => $sectionCode,
+ "FILTER_NAME" => "wineFilter",
+ "PRICE_CODE" => $catalog["PRICE_CODE"],
+ "CACHE_TYPE" => $catalog["CACHE_TYPE"],
+ "CACHE_TIME" => $catalog["CACHE_TIME"],
+ "CACHE_GROUPS" => $catalog["CACHE_GROUPS"],
+ "SAVE_IN_SESSION" => "N",
+ "XML_EXPORT" => "N",
+ "SEF_MODE" => "Y",
+ "SEF_RULE" => $catalog["SEF_FOLDER"] . $catalog["SEF_URL_TEMPLATES"]["smart_filter"],
+ "SMART_FILTER_PATH" => $filterPath,
+ "INSTANT_RELOAD" => "N",
+ "TEMPLATE_THEME" => "",
+ "CONVERT_CURRENCY" => "N",
+ ];
+ }
+
+ public static function countryCodeFromRoute(array $variables): ?string
+ {
+ $code = (string)($variables["ELEMENT_CODE"] ?? "");
+
+ return ($variables["SECTION_CODE"] ?? "") === "country" && $code !== "" ? $code : null;
+ }
+
+ public static function countryPath(string $countryCode): string
+ {
+ return self::catalogParams()["SEF_FOLDER"] . "country/" . rawurlencode($countryCode) . "/";
+ }
+
+ public static function sectionPath(string $sectionCode): string
+ {
+ return self::catalogParams()["SEF_FOLDER"] . $sectionCode . "/";
+ }
+
+ public static function basePath(string $sectionCode, string $filterPath): string
+ {
+ $sectionPath = self::sectionPath($sectionCode);
+
+ return $filterPath !== "" ? $sectionPath . "filter/" . $filterPath . "/apply/" : $sectionPath;
+ }
+
+ public static function pagePath(string $sectionCode, string $filterPath, string $sort, int $page): string
+ {
+ $sectionPath = self::sectionPath($sectionCode);
+ if ($filterPath === "" && $sort === "" && $page > 1) {
+ return $sectionPath . "?PAGEN_1=" . $page;
+ }
+
+ return $sectionPath;
+ }
+
+ public static function filterPathIsValid(string $sectionCode, string $filterPath): bool
+ {
+ if ($filterPath === "") {
+ return true;
+ }
+ global $APPLICATION;
+ ob_start();
+ try {
+ $result = $APPLICATION->IncludeComponent("bitrix:catalog.smart.filter", "", self::filterParams($sectionCode, $filterPath), null, [], true);
+ } finally {
+ ob_end_clean();
+ }
+
+ return (string)($result["JS_FILTER_PARAMS"]["SEF_SET_FILTER_URL"] ?? "") === self::basePath($sectionCode, $filterPath);
+ }
+
+ public static function parsePath(string $path): ?array
+ {
+ $catalog = self::catalogParams();
+ $variables = [];
+ $engine = new \CComponentEngine();
+ $engine->addGreedyPart("#SMART_FILTER_PATH#");
+ $page = $engine->guessComponentPath($catalog["SEF_FOLDER"], $catalog["SEF_URL_TEMPLATES"], $variables, str_ends_with($path, "/") ? $path . "index.php" : $path);
+ if ($page !== "section" && $page !== "smart_filter") {
+ return null;
+ }
+ $sectionCode = (string)($variables["SECTION_CODE"] ?? "");
+ if ($sectionCode === "" || $sectionCode !== strtolower($sectionCode) || Sections::byCode($sectionCode) === []) {
+ return null;
+ }
+
+ return [
+ "SECTION_CODE" => $sectionCode,
+ "FILTER_PATH" => (string)($variables["SMART_FILTER_PATH"] ?? ""),
+ ];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/localizedtext.php b/local/modules/jinove.vinoteca/lib/catalog/localizedtext.php
new file mode 100644
index 0000000..8ae22ba
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/localizedtext.php
@@ -0,0 +1,79 @@
+ ["ID", "PREVIEW_PICTURE", "DETAIL_PICTURE"], "filter" => ["=ID" => $productIds]]);
+ while ($row = $rows->fetch()) {
+ $fileId = (int)($row["DETAIL_PICTURE"] ?: $row["PREVIEW_PICTURE"]);
+ if ($fileId > 0) {
+ $resized = \CFile::ResizeImageGet($fileId, ["width" => $width, "height" => $height], BX_RESIZE_IMAGE_PROPORTIONAL, false);
+ if (!empty($resized["src"])) {
+ $images[(int)$row["ID"]] = (string)$resized["src"];
+ }
+ }
+ }
+
+ return $images;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/megamenu.php b/local/modules/jinove.vinoteca/lib/catalog/megamenu.php
new file mode 100644
index 0000000..00e897c
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/megamenu.php
@@ -0,0 +1,130 @@
+ [], "COUNTRIES" => [], "BRANDS" => [], "TOTAL" => 0];
+ if (!Loader::includeModule("iblock")) {
+ return $result;
+ }
+ $result["TYPES"] = self::types($iblockId);
+ $result["COUNTRIES"] = self::countries($iblockId);
+ $result["BRANDS"] = array_slice(self::brands($iblockId), 0, $brandsLimit);
+ $result["TOTAL"] = ServiceLocator::getInstance()->get("jinove.vinoteca.wineStats")->getActiveCount();
+
+ return $result;
+ }
+
+ public static function types(int $iblockId): array
+ {
+ $counts = [];
+ $rows = SectionElementTable::getList([
+ "select" => ["IBLOCK_SECTION_ID", "CNT"],
+ "runtime" => [new ExpressionField("CNT", "COUNT(DISTINCT %s)", "IBLOCK_ELEMENT_ID")],
+ "filter" => ["=IBLOCK_ELEMENT.IBLOCK_ID" => $iblockId, "=IBLOCK_ELEMENT.ACTIVE" => "Y"],
+ "group" => ["IBLOCK_SECTION_ID"],
+ ]);
+ while ($row = $rows->fetch()) {
+ $counts[(int)$row["IBLOCK_SECTION_ID"]] = (int)$row["CNT"];
+ }
+ $types = [];
+ foreach (Sections::all() as $code => $section) {
+ $count = $counts[$section["ID"]] ?? 0;
+ if ($section["ACTIVE"] && $section["DEPTH_LEVEL"] === 1 && $count > 0) {
+ $types[] = ["NAME" => $section["NAME"], "URL" => SITE_DIR . "catalog/" . $code . "/", "COUNT" => $count];
+ }
+ }
+
+ return $types;
+ }
+
+ private static function countries(int $iblockId): array
+ {
+ $propertyId = self::propertyId($iblockId, "COUNTRY");
+ if ($propertyId <= 0) {
+ return [];
+ }
+ $xmlIds = [];
+ $rows = PropertyEnumerationTable::getList(["select" => ["ID", "XML_ID"], "filter" => ["=PROPERTY_ID" => $propertyId]]);
+ while ($row = $rows->fetch()) {
+ $xmlIds[(int)$row["ID"]] = (string)$row["XML_ID"];
+ }
+ $names = Countries::names();
+ $countries = [];
+ foreach (self::counts($iblockId, $propertyId, "VALUE_ENUM") as $enumId => $count) {
+ $code = $xmlIds[$enumId] ?? "";
+ if ($code !== "" && isset($names[$code])) {
+ $countries[] = ["NAME" => EnumNames::name("COUNTRY", $code, $names[$code]), "URL" => Listing::countryPath($code), "COUNT" => $count];
+ }
+ }
+ usort($countries, static fn(array $a, array $b): int => $b["COUNT"] <=> $a["COUNT"]);
+
+ return $countries;
+ }
+
+ private static function brands(int $iblockId): array
+ {
+ $propertyId = self::propertyId($iblockId, "BRAND");
+ if ($propertyId <= 0) {
+ return [];
+ }
+ $counts = self::counts($iblockId, $propertyId, "VALUE_NUM");
+ if (!$counts) {
+ return [];
+ }
+ $brands = [];
+ $rows = ElementTable::getList([
+ "select" => ["ID", "NAME", "CODE"],
+ "filter" => ["=ID" => array_keys($counts), "=ACTIVE" => "Y"],
+ ]);
+ while ($row = $rows->fetch()) {
+ $brands[] = ["NAME" => (string)$row["NAME"], "URL" => SITE_DIR . "brands/" . $row["CODE"] . "/", "COUNT" => $counts[(int)$row["ID"]]];
+ }
+ usort($brands, static fn(array $a, array $b): int => $b["COUNT"] <=> $a["COUNT"]);
+
+ return $brands;
+ }
+
+ private static function counts(int $iblockId, int $propertyId, string $valueField): array
+ {
+ $counts = [];
+ $rows = ElementPropertyTable::getList([
+ "select" => [$valueField, "CNT"],
+ "runtime" => [new ExpressionField("CNT", "COUNT(DISTINCT %s)", "IBLOCK_ELEMENT_ID")],
+ "filter" => ["=IBLOCK_PROPERTY_ID" => $propertyId, "=ELEMENT.IBLOCK_ID" => $iblockId, "=ELEMENT.ACTIVE" => "Y", ">" . $valueField => 0],
+ "group" => [$valueField],
+ ]);
+ while ($row = $rows->fetch()) {
+ $counts[(int)$row[$valueField]] = (int)$row["CNT"];
+ }
+
+ return $counts;
+ }
+
+ private static function propertyId(int $iblockId, string $code): int
+ {
+ $row = PropertyTable::getRow(["select" => ["ID"], "filter" => ["=IBLOCK_ID" => $iblockId, "=CODE" => $code]]);
+
+ return (int)($row["ID"] ?? 0);
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/photosort.php b/local/modules/jinove.vinoteca/lib/catalog/photosort.php
new file mode 100644
index 0000000..49c854b
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/photosort.php
@@ -0,0 +1,44 @@
+ ["DETAIL_PICTURE", "SORT", "IBLOCK_ID"],
+ "filter" => ["=ID" => $id],
+ ]);
+ if (!$row) {
+ return;
+ }
+ $sort = (int)$row["DETAIL_PICTURE"] > 0 ? self::WITH_PHOTO : self::WITHOUT_PHOTO;
+ if ((int)$row["SORT"] === $sort) {
+ return;
+ }
+ self::$busy = true;
+ (new \CIBlockElement())->Update($id, ["SORT" => $sort], false, false, false);
+ self::$busy = false;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/pricepresets.php b/local/modules/jinove.vinoteca/lib/catalog/pricepresets.php
new file mode 100644
index 0000000..2ae7ed7
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/pricepresets.php
@@ -0,0 +1,65 @@
+ self::collect($iblockId, $sectionCode, $priceCode));
+ }
+
+ public static function groupId(string $priceCode): int
+ {
+ if (!Loader::includeModule("catalog")) {
+ return 0;
+ }
+ $group = GroupTable::getRow([
+ "select" => ["ID"],
+ "filter" => ["=NAME" => $priceCode],
+ "cache" => ["ttl" => self::CACHE_TTL],
+ ]);
+
+ return $group === null ? 0 : (int)$group["ID"];
+ }
+
+ private static function collect(int $iblockId, string $sectionCode, string $priceCode): array
+ {
+ if (!Loader::includeModule("iblock")) {
+ return [];
+ }
+ $groupId = self::groupId($priceCode);
+ if ($groupId === 0) {
+ return [];
+ }
+
+ $filter = [
+ "IBLOCK_ID" => $iblockId,
+ "ACTIVE" => "Y",
+ "SECTION_CODE" => $sectionCode,
+ "INCLUDE_SUBSECTIONS" => "Y",
+ ];
+ $total = (int)\CIBlockElement::GetList([], $filter, []);
+ $limits = [];
+ $previous = 0;
+ foreach (self::LIMITS as $limit) {
+ $count = (int)\CIBlockElement::GetList([], $filter + ["<=CATALOG_PRICE_" . $groupId => $limit], []);
+ if ($count > $previous && $count < $total) {
+ $limits[] = $limit;
+ $previous = $count;
+ }
+ }
+
+ return $limits;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/pricerange.php b/local/modules/jinove.vinoteca/lib/catalog/pricerange.php
new file mode 100644
index 0000000..9b1e9d0
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/pricerange.php
@@ -0,0 +1,48 @@
+ self::collect($priceCode));
+ }
+
+ private static function collect(string $priceCode): string
+ {
+ if (!Loader::includeModule("catalog") || !Loader::includeModule("currency")) {
+ return "";
+ }
+ $groupId = PricePresets::groupId($priceCode);
+ if ($groupId === 0) {
+ return "";
+ }
+ $row = PriceTable::getList([
+ "select" => ["MIN_PRICE", "MAX_PRICE"],
+ "filter" => ["=CATALOG_GROUP_ID" => $groupId, ">PRICE" => 0],
+ "runtime" => [
+ new ExpressionField("MIN_PRICE", "MIN(%s)", "PRICE"),
+ new ExpressionField("MAX_PRICE", "MAX(%s)", "PRICE"),
+ ],
+ ])->fetch();
+ if (!$row || $row["MIN_PRICE"] <= 0) {
+ return "";
+ }
+
+ return (int)round((float)$row["MIN_PRICE"]) . "-" . (int)round((float)$row["MAX_PRICE"]) . " " . CurrencyManager::getBaseCurrency();
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/prices.php b/local/modules/jinove.vinoteca/lib/catalog/prices.php
new file mode 100644
index 0000000..8a54fb4
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/prices.php
@@ -0,0 +1,35 @@
+getUserGroups();
+ $prices = [];
+ foreach ($productIds as $productId) {
+ $optimal = \CCatalogProduct::GetOptimalPrice($productId, 1, $groups, "N", [], $siteId);
+ $price = $optimal["RESULT_PRICE"] ?? null;
+ if (!$price || (float)$price["DISCOUNT_PRICE"] <= 0) {
+ continue;
+ }
+ $prices[$productId] = [
+ "price" => (float)$price["DISCOUNT_PRICE"],
+ "base" => max((float)$price["DISCOUNT_PRICE"], (float)$price["BASE_PRICE"]),
+ "currency" => (string)$price["CURRENCY"],
+ ];
+ }
+
+ return $prices;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/related.php b/local/modules/jinove.vinoteca/lib/catalog/related.php
new file mode 100644
index 0000000..74b2f67
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/related.php
@@ -0,0 +1,110 @@
+ ["ID"], "filter" => ["=IBLOCK_ID" => $iblockId, "=CODE" => "RECOMMEND"]]);
+ if ($property === null) {
+ return [];
+ }
+ $linked = [];
+ $rows = ElementPropertyTable::getList([
+ "select" => ["VALUE"],
+ "filter" => ["=IBLOCK_ELEMENT_ID" => $elementId, "=IBLOCK_PROPERTY_ID" => (int)$property["ID"]],
+ "order" => ["ID" => "ASC"],
+ ]);
+ while ($row = $rows->fetch()) {
+ $linked[] = (int)$row["VALUE"];
+ }
+ $linked = array_values(array_filter(array_unique($linked)));
+ if (!$linked) {
+ return [];
+ }
+ $active = [];
+ $items = ElementTable::getList(["select" => ["ID"], "filter" => ["=ID" => $linked, "=IBLOCK_ID" => $iblockId, "=ACTIVE" => "Y"]]);
+ while ($item = $items->fetch()) {
+ $active[(int)$item["ID"]] = true;
+ }
+
+ return array_values(array_filter($linked, fn(int $id): bool => isset($active[$id])));
+ }
+
+ public static function summaries(array $ids): array
+ {
+ $found = self::summariesById($ids);
+
+ return array_values(array_filter(array_map(static fn(int $id): ?array => $found[$id] ?? null, $ids)));
+ }
+
+ public static function summariesById(array $ids): array
+ {
+ $ids = array_values(array_unique(array_filter(array_map("intval", $ids))));
+ if (!$ids) {
+ return [];
+ }
+
+ return array_intersect_key(self::all(), array_flip($ids));
+ }
+
+ private static function all(): array
+ {
+ $iblockId = Config::iblockId("catalog");
+ if ($iblockId <= 0 || !Loader::includeModule("iblock")) {
+ return [];
+ }
+ return (array)Cached::remember(self::CACHE_DIR, "summaries-" . $iblockId . "-" . SITE_DIR, self::CACHE_TTL, ["iblock_id_" . $iblockId], static fn(): array => self::collect($iblockId));
+ }
+
+ private static function collect(int $iblockId): array
+ {
+ $template = (string)(IblockTable::getRowById($iblockId)["DETAIL_PAGE_URL"] ?? "");
+ $elements = ElementTable::getList([
+ "select" => ["ID", "NAME", "CODE", "IBLOCK_SECTION_ID"],
+ "filter" => ["=IBLOCK_ID" => $iblockId, "=ACTIVE" => "Y"],
+ ])->fetchAll();
+ $sectionIds = array_values(array_unique(array_filter(array_map(static fn(array $row): int => (int)$row["IBLOCK_SECTION_ID"], $elements))));
+ $sectionCodes = [];
+ if ($sectionIds) {
+ $sections = SectionTable::getList(["select" => ["ID", "CODE"], "filter" => ["=ID" => $sectionIds]]);
+ while ($section = $sections->fetch()) {
+ $sectionCodes[(int)$section["ID"]] = (string)$section["CODE"];
+ }
+ }
+ $found = [];
+ foreach ($elements as $row) {
+ $found[(int)$row["ID"]] = [
+ "name" => (string)$row["NAME"],
+ "url" => (string)preg_replace('#/{2,}#', "/", strtr($template, [
+ "#SITE_DIR#" => SITE_DIR,
+ "#SECTION_CODE#" => $sectionCodes[(int)$row["IBLOCK_SECTION_ID"]] ?? "",
+ "#ELEMENT_CODE#" => (string)$row["CODE"],
+ "#CODE#" => (string)$row["CODE"],
+ "#ID#" => (string)$row["ID"],
+ "#ELEMENT_ID#" => (string)$row["ID"],
+ ])),
+ ];
+ }
+
+ return $found;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/reviewstats.php b/local/modules/jinove.vinoteca/lib/catalog/reviewstats.php
new file mode 100644
index 0000000..ce022cc
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/reviewstats.php
@@ -0,0 +1,150 @@
+ ["ID"],
+ "filter" => ["=IBLOCK_TYPE_ID" => self::IBLOCK_TYPE, "=CODE" => $code],
+ ]);
+ self::$iblockIds[$code] = (int)($row["ID"] ?? 0);
+ }
+
+ return self::$iblockIds[$code];
+ }
+
+ public static function onElementChange(array &$fields): void
+ {
+ $id = (int)($fields["ID"] ?? 0);
+ if ($id <= 0 || (int)($fields["IBLOCK_ID"] ?? 0) !== self::iblockId(self::REVIEWS_CODE)) {
+ return;
+ }
+ self::recalc(self::productOf($id));
+ }
+
+ public static function onBeforeDelete(int $id): void
+ {
+ $row = ElementTable::getRow(["select" => ["IBLOCK_ID"], "filter" => ["=ID" => $id]]);
+ if ((int)($row["IBLOCK_ID"] ?? 0) === self::iblockId(self::REVIEWS_CODE)) {
+ self::$deleting[$id] = self::productOf($id);
+ }
+ }
+
+ public static function onAfterDelete(array $fields): void
+ {
+ $id = (int)($fields["ID"] ?? 0);
+ if (isset(self::$deleting[$id])) {
+ self::recalc(self::$deleting[$id]);
+ unset(self::$deleting[$id]);
+ }
+ }
+
+ public static function summary(int $productId): ?array
+ {
+ $catalogId = self::iblockId(self::CATALOG_CODE);
+ if ($productId <= 0 || $catalogId <= 0) {
+ return null;
+ }
+ $values = [];
+ foreach (["REVIEW_COUNT", "REVIEW_RATING"] as $code) {
+ $property = PropertyTable::getRow(["select" => ["ID"], "filter" => ["=IBLOCK_ID" => $catalogId, "=CODE" => $code]]);
+ $row = $property === null ? null : ElementPropertyTable::getRow([
+ "select" => ["VALUE"],
+ "filter" => ["=IBLOCK_ELEMENT_ID" => $productId, "=IBLOCK_PROPERTY_ID" => (int)$property["ID"]],
+ ]);
+ $values[$code] = $row === null ? 0.0 : (float)$row["VALUE"];
+ }
+
+ return ["count" => (int)$values["REVIEW_COUNT"], "avg" => round($values["REVIEW_RATING"], 1)];
+ }
+
+ public static function items(int $productId, int $limit = 50): array
+ {
+ $reviewsId = self::iblockId(self::REVIEWS_CODE);
+ if ($productId <= 0 || $reviewsId <= 0) {
+ return [];
+ }
+ $items = [];
+ $rows = \CIBlockElement::GetList(
+ ["ACTIVE_FROM" => "DESC", "ID" => "DESC"],
+ ["IBLOCK_ID" => $reviewsId, "ACTIVE" => "Y", "PROPERTY_PRODUCT" => $productId],
+ false,
+ ["nTopCount" => $limit],
+ ["ID", "PREVIEW_TEXT", "ACTIVE_FROM", "DATE_CREATE", "PROPERTY_AUTHOR", "PROPERTY_RATING"]
+ );
+ while ($row = $rows->Fetch()) {
+ $rating = (int)$row["PROPERTY_RATING_VALUE"];
+ $author = trim((string)$row["PROPERTY_AUTHOR_VALUE"]);
+ $text = trim((string)preg_replace('/\s+/u', " ", strip_tags((string)$row["PREVIEW_TEXT"])));
+ if ($rating < 1 || $rating > 5 || $author === "" || $text === "") {
+ continue;
+ }
+ $items[] = [
+ "author" => $author,
+ "rating" => $rating,
+ "text" => $text,
+ "date" => date("Y-m-d", MakeTimeStamp((string)($row["ACTIVE_FROM"] ?: $row["DATE_CREATE"]))),
+ ];
+ }
+
+ return $items;
+ }
+
+ public static function recalc(int $productId): void
+ {
+ $catalogId = self::iblockId(self::CATALOG_CODE);
+ if ($productId <= 0 || $catalogId <= 0) {
+ return;
+ }
+ $sum = 0;
+ $count = 0;
+ $rows = \CIBlockElement::GetList(
+ [],
+ ["IBLOCK_ID" => self::iblockId(self::REVIEWS_CODE), "ACTIVE" => "Y", "PROPERTY_PRODUCT" => $productId],
+ false,
+ false,
+ ["ID", "PROPERTY_RATING"]
+ );
+ while ($row = $rows->Fetch()) {
+ $rating = (int)$row["PROPERTY_RATING_VALUE"];
+ if ($rating >= 1 && $rating <= 5) {
+ $sum += $rating;
+ $count++;
+ }
+ }
+ \CIBlockElement::SetPropertyValuesEx($productId, $catalogId, [
+ "REVIEW_COUNT" => $count,
+ "REVIEW_RATING" => $count > 0 ? round($sum / $count, 1) : false,
+ ]);
+ \CIBlock::clearIblockTagCache($catalogId);
+ }
+
+ private static function productOf(int $reviewId): int
+ {
+ $value = \CIBlockElement::GetProperty(self::iblockId(self::REVIEWS_CODE), $reviewId, [], ["CODE" => "PRODUCT"])->Fetch();
+
+ return (int)($value["VALUE"] ?? 0);
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/searchmeta.php b/local/modules/jinove.vinoteca/lib/catalog/searchmeta.php
new file mode 100644
index 0000000..3fa5a49
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/searchmeta.php
@@ -0,0 +1,105 @@
+ self::collect($catalogId));
+ }
+
+ private static function collect(int $catalogId): array
+ {
+ if ($catalogId <= 0 || !Loader::includeModule("iblock")) {
+ return [];
+ }
+ $propertyCodes = [];
+ $rows = PropertyTable::getList(["select" => ["ID", "CODE"], "filter" => ["=IBLOCK_ID" => $catalogId, "=CODE" => self::PROPERTIES]]);
+ while ($row = $rows->fetch()) {
+ $propertyCodes[(int)$row["ID"]] = (string)$row["CODE"];
+ }
+ $enums = [];
+ if ($propertyCodes) {
+ $rows = PropertyEnumerationTable::getList(["select" => ["ID", "XML_ID", "VALUE"], "filter" => ["@PROPERTY_ID" => array_keys($propertyCodes)]]);
+ while ($row = $rows->fetch()) {
+ $enums[(int)$row["ID"]] = ["XML_ID" => (string)$row["XML_ID"], "VALUE" => (string)$row["VALUE"]];
+ }
+ }
+ $parts = [];
+ if ($propertyCodes) {
+ $rows = ElementPropertyTable::getList([
+ "select" => ["IBLOCK_ELEMENT_ID", "IBLOCK_PROPERTY_ID", "VALUE_ENUM"],
+ "filter" => ["@IBLOCK_PROPERTY_ID" => array_keys($propertyCodes), ">VALUE_ENUM" => 0],
+ ]);
+ while ($row = $rows->fetch()) {
+ $enum = $enums[(int)$row["VALUE_ENUM"]] ?? null;
+ if ($enum !== null) {
+ $code = $propertyCodes[(int)$row["IBLOCK_PROPERTY_ID"]];
+ $parts[(int)$row["IBLOCK_ELEMENT_ID"]][$code] = EnumNames::name($code, $enum["XML_ID"], $enum["VALUE"]);
+ }
+ }
+ }
+ $brands = self::brands($catalogId);
+ $meta = [];
+ $rows = ElementTable::getList(["select" => ["ID", "NAME"], "filter" => ["=IBLOCK_ID" => $catalogId]]);
+ while ($row = $rows->fetch()) {
+ $id = (int)$row["ID"];
+ $meta[$id] = [
+ "NAME" => (string)$row["NAME"],
+ "META" => implode(", ", array_filter([$parts[$id]["REGION"] ?? "", $parts[$id]["COUNTRY"] ?? ""])),
+ "BRAND" => $brands[$id] ?? "",
+ ];
+ }
+
+ return $meta;
+ }
+
+ private static function brands(int $catalogId): array
+ {
+ $property = PropertyTable::getRow(["select" => ["ID"], "filter" => ["=IBLOCK_ID" => $catalogId, "=CODE" => "BRAND"]]);
+ if ($property === null) {
+ return [];
+ }
+ $links = [];
+ $rows = ElementPropertyTable::getList([
+ "select" => ["IBLOCK_ELEMENT_ID", "VALUE"],
+ "filter" => ["=IBLOCK_PROPERTY_ID" => (int)$property["ID"]],
+ ]);
+ while ($row = $rows->fetch()) {
+ if ((int)$row["VALUE"] > 0) {
+ $links[(int)$row["IBLOCK_ELEMENT_ID"]] = (int)$row["VALUE"];
+ }
+ }
+ if (!$links) {
+ return [];
+ }
+ $names = [];
+ $rows = ElementTable::getList(["select" => ["ID", "NAME"], "filter" => ["=ID" => array_values(array_unique($links))]]);
+ while ($row = $rows->fetch()) {
+ $names[(int)$row["ID"]] = (string)$row["NAME"];
+ }
+
+ return array_filter(array_map(static fn(int $brandId): string => $names[$brandId] ?? "", $links));
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/sections.php b/local/modules/jinove.vinoteca/lib/catalog/sections.php
new file mode 100644
index 0000000..af357c0
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/sections.php
@@ -0,0 +1,89 @@
+ $section) {
+ if (!$section["ACTIVE"] || $section["DEPTH_LEVEL"] !== 1) {
+ continue;
+ }
+ $links[] = [$section["NAME"], SITE_DIR . "catalog/" . $code . "/", [], [], ""];
+ }
+
+ return $links;
+ }
+
+ public static function all(): array
+ {
+ $catalogId = Config::iblockId("catalog");
+ $language = LANGUAGE_ID;
+ return (array)Cached::remember(self::CACHE_DIR, "sections-" . $catalogId . "-" . $language, self::CACHE_TTL, ["iblock_id_" . $catalogId], static fn(): array => self::collect($catalogId, $language));
+ }
+
+ private static function collect(int $catalogId, string $language): array
+ {
+ if (!Loader::includeModule("iblock")) {
+ return [];
+ }
+ $suffix = "_" . strtoupper($language);
+ $select = ["ID", "CODE", "NAME", "DESCRIPTION", "ACTIVE", "DEPTH_LEVEL"];
+ if ($language !== self::BASE_LANGUAGE) {
+ foreach (self::FIELDS as $field) {
+ $select[] = "UF_" . $field . $suffix;
+ }
+ }
+ $sections = [];
+ $rows = \CIBlockSection::GetList(["SORT" => "ASC"], ["IBLOCK_ID" => $catalogId], false, $select);
+ while ($row = $rows->Fetch()) {
+ $seo = (new SectionValues($catalogId, (int)$row["ID"]))->getValues();
+ $base = [
+ "NAME" => (string)$row["NAME"],
+ "DESCRIPTION" => (string)$row["DESCRIPTION"],
+ "META_TITLE" => (string)($seo["SECTION_META_TITLE"] ?? ""),
+ "META_DESCRIPTION" => (string)($seo["SECTION_META_DESCRIPTION"] ?? ""),
+ "PAGE_TITLE" => (string)($seo["SECTION_PAGE_TITLE"] ?? ""),
+ ];
+ if ($language !== self::BASE_LANGUAGE) {
+ foreach (self::FIELDS as $field) {
+ $value = trim((string)($row["UF_" . $field . $suffix] ?? ""));
+ if ($value !== "") {
+ $base[$field] = $value;
+ }
+ }
+ }
+ $sections[(string)$row["CODE"]] = [
+ "ID" => (int)$row["ID"],
+ "ACTIVE" => $row["ACTIVE"] === "Y",
+ "DEPTH_LEVEL" => (int)$row["DEPTH_LEVEL"],
+ ] + $base;
+ }
+
+ return $sections;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/wineschema.php b/local/modules/jinove.vinoteca/lib/catalog/wineschema.php
new file mode 100644
index 0000000..c2f6d94
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/wineschema.php
@@ -0,0 +1,151 @@
+ (string)$in["host"] . "/#store"];
+ $images = [];
+ foreach ((array)$in["images"] as $index => $image) {
+ $node = [
+ "@type" => "ImageObject",
+ "@id" => $url . "#image-" . ($index + 1),
+ "url" => $image["src"],
+ "contentUrl" => $image["src"],
+ "caption" => $image["alt"],
+ "inLanguage" => $in["language"],
+ ];
+ if ($image["width"] > 0 && $image["height"] > 0) {
+ $node["width"] = ["@type" => "QuantitativeValue", "value" => $image["width"], "unitCode" => "E37"];
+ $node["height"] = ["@type" => "QuantitativeValue", "value" => $image["height"], "unitCode" => "E37"];
+ }
+ $images[] = $node;
+ }
+
+ $product = [
+ "@type" => "Product",
+ "@id" => $url . "#product",
+ "name" => $in["name"],
+ "url" => $url,
+ ];
+ if ($in["description"] !== "") {
+ $product["description"] = $in["description"];
+ }
+ if ($images) {
+ $product["image"] = $images;
+ }
+ if ($in["sku"] !== "") {
+ $product["sku"] = $in["sku"];
+ }
+ if ($in["category"] !== "") {
+ $product["category"] = $in["category"];
+ }
+ if ($in["country"] !== "") {
+ $product["countryOfOrigin"] = ["@type" => "Country", "name" => $in["country"]];
+ }
+ if ($in["vintage"] !== "") {
+ $product["productionDate"] = $in["vintage"];
+ }
+ if (!empty($in["brand"]["name"])) {
+ $brand = ["@type" => "Brand", "name" => $in["brand"]["name"]];
+ if ($in["brand"]["url"] !== "") {
+ $brand["@id"] = $in["brand"]["url"] . "#brand";
+ $brand["url"] = $in["brand"]["url"];
+ }
+ $product["brand"] = $brand;
+ }
+ $properties = [];
+ foreach ((array)$in["properties"] as $row) {
+ $node = ["@type" => "PropertyValue", "name" => $row["name"], "value" => $row["value"]];
+ if (!empty($row["unitCode"])) {
+ $node["unitCode"] = $row["unitCode"];
+ }
+ $properties[] = $node;
+ }
+ if ($properties) {
+ $product["additionalProperty"] = $properties;
+ }
+ if ($in["price"] > 0 && $in["currency"] !== "") {
+ $offer = [
+ "@type" => "Offer",
+ "@id" => $url . "#offer",
+ "url" => $url,
+ "price" => $in["price"],
+ "priceCurrency" => $in["currency"],
+ "availability" => $in["canBuy"] ? "https://schema.org/InStock" : "https://schema.org/OutOfStock",
+ "itemCondition" => "https://schema.org/NewCondition",
+ "seller" => $store,
+ ];
+ if ($in["listPrice"] > $in["price"]) {
+ $offer["priceSpecification"] = [
+ "@type" => "UnitPriceSpecification",
+ "priceType" => "https://schema.org/ListPrice",
+ "price" => $in["listPrice"],
+ "priceCurrency" => $in["currency"],
+ ];
+ }
+ $product["offers"] = $offer;
+ }
+ if ($in["reviewCount"] > 0 && $in["reviewRating"] > 0) {
+ $product["aggregateRating"] = [
+ "@type" => "AggregateRating",
+ "ratingValue" => $in["reviewRating"],
+ "reviewCount" => $in["reviewCount"],
+ "bestRating" => 5,
+ "worstRating" => 1,
+ ];
+ }
+ $reviews = [];
+ foreach ((array)$in["reviews"] as $review) {
+ $reviews[] = [
+ "@type" => "Review",
+ "author" => ["@type" => "Person", "name" => $review["author"]],
+ "datePublished" => $review["date"],
+ "reviewRating" => ["@type" => "Rating", "ratingValue" => $review["rating"], "bestRating" => 5, "worstRating" => 1],
+ "reviewBody" => $review["text"],
+ "inLanguage" => $review["language"],
+ ];
+ }
+ if ($reviews) {
+ $product["review"] = $reviews;
+ }
+ $related = [];
+ foreach ((array)$in["related"] as $item) {
+ $related[] = ["@type" => "Product", "@id" => $item["url"] . "#product", "name" => $item["name"], "url" => $item["url"]];
+ }
+ if ($related) {
+ $product["isRelatedTo"] = $related;
+ }
+
+ $page = [
+ "@type" => "ItemPage",
+ "@id" => $url . "#webpage",
+ "url" => $url,
+ "name" => $in["name"],
+ "description" => $in["pageDescription"],
+ "inLanguage" => $in["language"],
+ "mainEntity" => ["@id" => $url . "#product"],
+ "datePublished" => $in["created"],
+ "dateModified" => $in["modified"],
+ ];
+ if ($images) {
+ $page["primaryImageOfPage"] = ["@id" => $images[0]["@id"]];
+ }
+ $translations = [];
+ foreach ((array)$in["translations"] as $language => $translationUrl) {
+ $translations[] = ["@type" => "ItemPage", "@id" => $translationUrl . "#webpage", "url" => $translationUrl, "inLanguage" => $language];
+ }
+ if ($translations) {
+ $page["workTranslation"] = $translations;
+ }
+
+ return ["@context" => self::CONTEXT, "@graph" => [$page, $product]];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/catalog/winestats.php b/local/modules/jinove.vinoteca/lib/catalog/winestats.php
new file mode 100644
index 0000000..368234c
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/catalog/winestats.php
@@ -0,0 +1,75 @@
+activeCount !== null) {
+ return $this->activeCount;
+ }
+
+ $cache = Cache::createInstance();
+ $cacheId = "active-count-" . $this->iblockType . "-" . $this->iblockCode;
+ if ($cache->initCache(self::CACHE_TTL, $cacheId, self::CACHE_DIR)) {
+ return $this->activeCount = (int)$cache->getVars()["count"];
+ }
+
+ $cache->startDataCache();
+ $taggedCache = Application::getInstance()->getTaggedCache();
+ $taggedCache->startTagCache(self::CACHE_DIR);
+ try {
+ $iblockId = $this->getIblockId();
+ $count = ElementTable::getCount([
+ "=IBLOCK_ID" => $iblockId,
+ "=ACTIVE" => "Y",
+ ]);
+ $taggedCache->registerTag("iblock_id_" . $iblockId);
+ } catch (\Throwable $e) {
+ $taggedCache->abortTagCache();
+ $cache->abortDataCache();
+ throw $e;
+ }
+ $taggedCache->endTagCache();
+ $cache->endDataCache(["count" => $count]);
+
+ return $this->activeCount = $count;
+ }
+
+ private function getIblockId(): int
+ {
+ if (!Loader::includeModule("iblock")) {
+ throw new SystemException("Module iblock is not installed");
+ }
+ $iblock = IblockTable::getRow([
+ "select" => ["ID"],
+ "filter" => ["=IBLOCK_TYPE_ID" => $this->iblockType, "=CODE" => $this->iblockCode],
+ ]);
+ if ($iblock === null) {
+ throw new SystemException("Iblock " . $this->iblockType . "/" . $this->iblockCode . " not found");
+ }
+
+ return (int)$iblock["ID"];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/checkout.php b/local/modules/jinove.vinoteca/lib/checkout.php
new file mode 100644
index 0000000..a0524a8
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/checkout.php
@@ -0,0 +1,351 @@
+ ["=ACTIVE" => "Y", "=ENTITY_REGISTRY_TYPE" => "ORDER"], "order" => ["SORT" => "ASC", "ID" => "ASC"]]);
+ while ($row = $rows->fetch()) {
+ $code = self::methodCode((string)$row["ACTION_FILE"]);
+ if ($code === "") {
+ continue;
+ }
+ $methods[] = [
+ "id" => (int)$row["ID"],
+ "code" => $code,
+ "name" => (string)Loc::getMessage("VINO_PAY_" . strtoupper($code)),
+ "hint" => (string)Loc::getMessage("VINO_PAY_" . strtoupper($code) . "_HINT"),
+ ];
+ }
+
+ return $methods;
+ }
+
+ public static function create(BasketBase $basket, array $contacts, int $paySystemId, string $consentProof): array
+ {
+ $methods = array_column(self::methods(), null, "id");
+ if (!isset($methods[$paySystemId])) {
+ return ["error" => "pay"];
+ }
+ $person = PersonTypeTable::getRow(["filter" => ["=CODE" => self::PERSON_CODE, "=ACTIVE" => "Y"], "select" => ["ID"]]);
+ $delivery = \Bitrix\Sale\Delivery\Services\Table::getRow(["filter" => ["=CODE" => self::DELIVERY_CODE, "=ACTIVE" => "Y"], "select" => ["ID"]]);
+ if ($person === null || $delivery === null) {
+ return ["error" => "shop"];
+ }
+ $basket->refresh(RefreshFactory::create(RefreshFactory::TYPE_FULL));
+ $items = $basket->getOrderableItems();
+ if ($items->isEmpty()) {
+ return ["error" => "empty"];
+ }
+ $siteId = Config::basketSiteId();
+ $userId = (int)CurrentUser::get()->getId();
+ $order = Order::create($siteId, $userId > 0 ? $userId : (int)\CSaleUser::GetAnonymousUserID());
+ $order->setPersonTypeId((int)$person["ID"]);
+ $order->setBasket($items);
+
+ $shipments = $order->getShipmentCollection();
+ $shipment = $shipments->createItem(DeliveryManager::getObjectById((int)$delivery["ID"]));
+ $shipment->setField("CURRENCY", $order->getCurrency());
+ $shipmentItems = $shipment->getShipmentItemCollection();
+ foreach ($order->getBasket() as $basketItem) {
+ $shipmentItems->createItem($basketItem)->setQuantity($basketItem->getQuantity());
+ }
+ $shipments->calculateDelivery();
+
+ $properties = $order->getPropertyCollection();
+ $proof = $properties->getItemByOrderPropertyCode("CONSENT_PROOF");
+ if ($proof === null) {
+ return ["error" => "shop"];
+ }
+ $proof->setValue($consentProof);
+ foreach (self::PROPERTIES as $code) {
+ $property = $properties->getItemByOrderPropertyCode($code);
+ if ($property !== null) {
+ $property->setValue((string)($contacts[strtolower($code)] ?? ""));
+ }
+ }
+ $comment = (string)($contacts["comment"] ?? "");
+ if ($comment !== "") {
+ $order->setField("USER_DESCRIPTION", $comment);
+ }
+
+ $payment = $order->getPaymentCollection()->createItem(PaySystemManager::getObjectById($paySystemId));
+ $order->doFinalAction(true);
+ $payment->setField("SUM", $order->getPrice());
+ $payment->setField("CURRENCY", $order->getCurrency());
+ $result = $order->save();
+ if (!$result->isSuccess()) {
+ return ["error" => "save", "messages" => $result->getErrorMessages()];
+ }
+
+ return [
+ "order" => $order,
+ "payment" => $order->getPaymentCollection()->current(),
+ "method" => $methods[$paySystemId],
+ ];
+ }
+
+ public static function token(Order $order): string
+ {
+ return (new Signer())->getSignature($order->getId() . ":" . $order->getField("ACCOUNT_NUMBER"), self::TOKEN_SALT);
+ }
+
+ public static function find(int $orderId, string $hash): ?Order
+ {
+ if ($orderId <= 0 || $hash === "" || !Loader::includeModule("sale")) {
+ return null;
+ }
+ $order = Order::load($orderId);
+ if ($order === null || !hash_equals(self::token($order), $hash)) {
+ return null;
+ }
+
+ return $order;
+ }
+
+ public static function doneUrl(Order $order, string $dir, array $extra = []): string
+ {
+ return Config::host() . $dir . "personal/order/done/?" . http_build_query(["id" => $order->getId(), "hash" => self::token($order)] + $extra);
+ }
+
+ public static function startPayment(Order $order, string $dir): array
+ {
+ $payment = $order->getPaymentCollection()->current();
+ if ($payment === null || $payment->isPaid()) {
+ return ["url" => ""];
+ }
+ $service = $payment->getPaySystem();
+ $code = $service !== null ? self::methodCode((string)$service->getField("ACTION_FILE")) : "";
+ if ($code === "" || $code === "cash") {
+ return ["url" => ""];
+ }
+ if ((string)$payment->getField("PS_INVOICE_ID") !== "" && self::finishPayment($order, [])) {
+ return ["url" => self::doneUrl($order, $dir)];
+ }
+ $order = Order::load($order->getId());
+ $payment = $order->getPaymentCollection()->current();
+ $service = $payment->getPaySystem();
+ $returnUrl = self::doneUrl($order, $dir, ["payment" => $payment->getId()]);
+ if ($code === "yookassa") {
+ $service->getContext()->setUrl($returnUrl);
+ }
+ $request = new HttpRequest(
+ Context::getCurrent()->getServer(),
+ ["return_url" => $returnUrl, "cancel_url" => self::doneUrl($order, $dir, ["payment" => $payment->getId(), "cancel" => "Y"])],
+ [],
+ [],
+ []
+ );
+ $result = $service->initiatePay($payment, $request, BaseServiceHandler::STRING);
+ $widget = $result->getData()["widget"] ?? null;
+ if (!$result->isSuccess() || ($result->getPaymentUrl() === "" && !is_array($widget))) {
+ return ["url" => ""];
+ }
+ if (!$order->save()->isSuccess()) {
+ return ["url" => ""];
+ }
+
+ return ["url" => $result->getPaymentUrl(), "widget" => is_array($widget) ? $widget : null];
+ }
+
+ public static function finishPayment(Order $order, array $query): bool
+ {
+ $connection = Application::getConnection();
+ $key = "vino_pay_" . $order->getId();
+ if (!$connection->lock($key, self::LOCK_SECONDS)) {
+ return false;
+ }
+ try {
+ $fresh = Order::load($order->getId());
+
+ return $fresh !== null && self::verify($fresh, $query);
+ } finally {
+ $connection->unlock($key);
+ }
+ }
+
+ public static function methodOf(Order $order): string
+ {
+ $payment = $order->getPaymentCollection()->current();
+ $service = $payment !== null ? $payment->getPaySystem() : null;
+
+ return $service !== null ? self::methodCode((string)$service->getField("ACTION_FILE")) : "";
+ }
+
+ public static function cancelUnpaid(): string
+ {
+ if (!Loader::includeModule("sale")) {
+ return __METHOD__ . "();";
+ }
+ $online = [];
+ foreach (self::methods() as $method) {
+ if ($method["code"] !== "cash") {
+ $online[] = $method["id"];
+ }
+ }
+ if (!$online) {
+ return __METHOD__ . "();";
+ }
+ $border = new DateTime();
+ $border->add("-" . self::UNPAID_HOURS . " hours");
+ $rows = PaymentTable::getList([
+ "filter" => ["=PAID" => "N", "@PAY_SYSTEM_ID" => $online, "=ORDER.CANCELED" => "N", " $border],
+ "select" => ["ORDER_ID"],
+ "order" => ["ID" => "ASC"],
+ "limit" => 200,
+ ]);
+ while ($row = $rows->fetch()) {
+ $order = Order::load((int)$row["ORDER_ID"]);
+ if ($order === null || $order->isPaid() || $order->isCanceled()) {
+ continue;
+ }
+ $payment = $order->getPaymentCollection()->current();
+ if ($payment !== null && (string)$payment->getField("PS_INVOICE_ID") !== "" && self::finishPayment($order, [])) {
+ continue;
+ }
+ $order = Order::load($order->getId());
+ $order->setField("CANCELED", "Y");
+ $order->setField("REASON_CANCELED", self::UNPAID_REASON);
+ $order->save();
+ }
+
+ return __METHOD__ . "();";
+ }
+
+ public static function consentProof(string $page): string
+ {
+ return "consent=Y; version=" . Consent::VERSION . "; policy=" . Consent::POLICY_VERSION . "; page=" . $page . "; at=" . new DateTime();
+ }
+
+ public static function dir(string $requested): string
+ {
+ foreach (Config::languages() as $language) {
+ if ((string)($language["dir"] ?? "") === $requested) {
+ return $requested;
+ }
+ }
+
+ return "/";
+ }
+
+ private static function verify(Order $order, array $query): bool
+ {
+ $payment = $order->getPaymentCollection()->current();
+ if ($payment === null) {
+ return false;
+ }
+ if ($payment->isPaid()) {
+ return true;
+ }
+ $service = $payment->getPaySystem();
+ $code = $service !== null ? self::methodCode((string)$service->getField("ACTION_FILE")) : "";
+ if ($code === "yookassa") {
+ return self::finishYookassa($order, $payment, $service);
+ }
+ $token = (string)($query["token"] ?? "");
+ if ($code === "paypal" && $token === "") {
+ $token = (string)$payment->getField("PS_INVOICE_ID");
+ }
+ if ($code !== "halyk" && ($code !== "paypal" || $token === "")) {
+ return false;
+ }
+ $request = new HttpRequest(Context::getCurrent()->getServer(), ["payment" => $payment->getId(), "token" => $token], [], [], []);
+ $result = $service->processRequest($request);
+
+ return $result->isSuccess() && Order::load($order->getId())->getPaymentCollection()->current()->isPaid();
+ }
+
+ private static function finishYookassa(Order $order, Payment $payment, Service $service): bool
+ {
+ $invoice = (string)$payment->getField("PS_INVOICE_ID");
+ if ($invoice === "") {
+ return false;
+ }
+ $consumer = "PAYSYSTEM_" . (int)$service->getField("ID");
+ $client = new HttpClient(["socketTimeout" => 10, "streamTimeout" => 10]);
+ $client->setHeader("Authorization", "Basic " . base64_encode(trim((string)BusinessValue::get("YANDEX_CHECKOUT_SHOP_ID", $consumer)) . ":" . trim((string)BusinessValue::get("YANDEX_CHECKOUT_SECRET_KEY", $consumer))));
+ $body = $client->get(self::YOOKASSA_API . rawurlencode($invoice));
+ if ($body === false || $client->getStatus() !== 200) {
+ Logger::addError(__METHOD__ . ": status request failed, HTTP " . $client->getStatus());
+
+ return false;
+ }
+ try {
+ $data = Json::decode((string)$body);
+ } catch (\Throwable $exception) {
+ return false;
+ }
+ $amount = (float)($data["amount"]["value"] ?? 0);
+ $currency = (string)($data["amount"]["currency"] ?? "");
+ if (($data["status"] ?? "") !== "succeeded" || empty($data["paid"]) || $currency !== $payment->getCurrency() || abs($amount - (float)$payment->getSum()) > 0.01) {
+ return false;
+ }
+ $paid = $payment->setPaid("Y");
+ if (!$paid->isSuccess()) {
+ return false;
+ }
+ $payment->setFields(["PS_STATUS" => "Y", "PS_STATUS_CODE" => "succeeded", "PS_SUM" => $amount, "PS_CURRENCY" => $currency, "PS_RESPONSE_DATE" => new DateTime()]);
+
+ return $order->save()->isSuccess();
+ }
+
+ private static function methodCode(string $action): string
+ {
+ if ($action === self::PAYPAL_ACTION) {
+ return "paypal";
+ }
+ if ($action === self::YOOKASSA_ACTION) {
+ return "yookassa";
+ }
+ if ($action === self::HALYK_ACTION) {
+ return "halyk";
+ }
+
+ return $action === "cashondelivery" ? "cash" : "";
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/config.php b/local/modules/jinove.vinoteca/lib/config.php
new file mode 100644
index 0000000..4551c34
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/config.php
@@ -0,0 +1,53 @@
+get($name);
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/consent.php b/local/modules/jinove.vinoteca/lib/consent.php
new file mode 100644
index 0000000..f4d7b37
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/consent.php
@@ -0,0 +1,18 @@
+getTimestamp() : 0;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/auth.php b/local/modules/jinove.vinoteca/lib/controller/auth.php
new file mode 100644
index 0000000..25f5401
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/auth.php
@@ -0,0 +1,82 @@
+ [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf(), new FormGuard(FormGuard::TIMING_ELAPSED)],
+ ],
+ ];
+ }
+
+ public function loginAction(
+ string $email,
+ string $password,
+ string $remember = "",
+ string $consent = "",
+ string $back = "",
+ string $lang = "en",
+ string $website = "",
+ int $elapsed = 0,
+ string $altcha = ""
+ ): ?array {
+ $lang = Redirect::language($lang);
+ if ($website !== "") {
+ return ["ok" => true, "redirect" => Redirect::home($lang)];
+ }
+ $session = Application::getInstance()->getSession();
+ if ((int)($session->get("vino_login_block") ?? 0) > time()) {
+ $this->addError(new Error("Too many attempts", "too_often"));
+
+ return null;
+ }
+ $email = mb_strtolower(trim($email));
+ if ($consent !== "1" || !check_email($email) || $password === "" || mb_strlen($password) > 200) {
+ $this->addError(new Error("Invalid credentials", "invalid"));
+
+ return null;
+ }
+ $user = UserTable::getRow([
+ "select" => ["LOGIN"],
+ "filter" => ["=EMAIL" => $email, "=ACTIVE" => "Y"],
+ ]);
+ $logged = false;
+ if ($user !== null) {
+ global $USER;
+ $logged = $USER->Login((string)$user["LOGIN"], $password, $remember === "1" ? "Y" : "N") === true;
+ }
+ if (!$logged) {
+ $fails = (int)($session->get("vino_login_fails") ?? 0) + 1;
+ if ($fails >= self::MAX_FAILS) {
+ $session->set("vino_login_block", time() + self::BLOCK_SECONDS);
+ $fails = 0;
+ }
+ $session->set("vino_login_fails", $fails);
+ $this->addError(new Error("Invalid credentials", "invalid"));
+
+ return null;
+ }
+ $session->remove("vino_login_fails");
+ $session->remove("vino_login_block");
+
+ return ["ok" => true, "redirect" => Redirect::back($back, $lang)];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/basket.php b/local/modules/jinove.vinoteca/lib/controller/basket.php
new file mode 100644
index 0000000..bc63a6d
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/basket.php
@@ -0,0 +1,168 @@
+ [new HttpMethod([HttpMethod::METHOD_GET])]];
+ $write = ["prefilters" => [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf()]];
+
+ return [
+ "state" => $read,
+ "cart" => $read,
+ "set" => $write,
+ "update" => $write,
+ "clear" => $write,
+ "coupon" => $write,
+ "couponRemove" => $write,
+ "addShared" => $write,
+ ];
+ }
+
+ public function addSharedAction(string $code): ?array
+ {
+ $items = Cart::parseShare(trim($code));
+ if (!$items) {
+ $this->addError(new Error("Wrong share code", "share"));
+
+ return null;
+ }
+ $basket = $this->loadBasket();
+ if ($basket === null) {
+ return null;
+ }
+ $ok = Cart::addMany($basket, $items);
+ $basket = $this->loadBasket();
+
+ return $basket === null ? null : ["ok" => $ok] + Cart::state($basket);
+ }
+
+ public function stateAction(): ?array
+ {
+ $basket = $this->loadBasket();
+
+ return $basket === null ? null : ["ok" => true] + Cart::state($basket);
+ }
+
+ public function setAction(int $id, int $qty): ?array
+ {
+ $basket = $this->loadBasket();
+ if ($basket === null || !$this->validId($id)) {
+ return null;
+ }
+ $ok = Cart::setQuantity($basket, $id, $qty);
+ $basket = $this->loadBasket();
+
+ return $basket === null ? null : ["ok" => $ok] + Cart::state($basket);
+ }
+
+ public function cartAction(): ?array
+ {
+ $basket = $this->loadBasket();
+
+ return $basket === null ? null : $this->full($basket, true, true);
+ }
+
+ public function updateAction(int $id, int $qty): ?array
+ {
+ $basket = $this->loadBasket();
+ if ($basket === null || !$this->validId($id)) {
+ return null;
+ }
+ $ok = Cart::setQuantity($basket, $id, $qty);
+ $basket = $this->loadBasket();
+
+ return $basket === null ? null : $this->full($basket, $ok);
+ }
+
+ public function clearAction(): ?array
+ {
+ $basket = $this->loadBasket();
+ if ($basket === null) {
+ return null;
+ }
+ $ok = Cart::clear($basket);
+ $basket = $this->loadBasket();
+
+ return $basket === null ? null : $this->full($basket, $ok);
+ }
+
+ public function couponAction(string $code): ?array
+ {
+ $code = trim($code);
+ if ($code === "" || mb_strlen($code) > self::COUPON_MAX_LENGTH) {
+ $this->addError(new Error("Wrong coupon", "coupon"));
+
+ return null;
+ }
+ $basket = $this->loadBasket();
+ if ($basket === null) {
+ return null;
+ }
+ if (!Cart::addCoupon($code)) {
+ Cart::removeCoupon($code);
+ $this->addError(new Error("Coupon is not applicable", "coupon"));
+
+ return null;
+ }
+ $result = $this->full($basket, true);
+ foreach ($result["cart"]["coupons"] as $coupon) {
+ if (mb_strtolower($coupon["code"]) === mb_strtolower($code) && $coupon["applied"]) {
+ return $result;
+ }
+ }
+ Cart::removeCoupon($code);
+ $this->addError(new Error("Coupon is not applicable", "coupon"));
+
+ return null;
+ }
+
+ public function couponRemoveAction(string $code): ?array
+ {
+ $basket = $this->loadBasket();
+ if ($basket === null) {
+ return null;
+ }
+ Cart::removeCoupon(trim($code));
+
+ return $this->full($basket, true);
+ }
+
+ private function full(BasketBase $basket, bool $ok, bool $refresh = false): array
+ {
+ return ["ok" => $ok, "cart" => Cart::view($basket, $refresh), "state" => Cart::state($basket)];
+ }
+
+ private function loadBasket(): ?BasketBase
+ {
+ $basket = Cart::load();
+ if ($basket === null) {
+ $this->addError(new Error("Modules sale and catalog are required"));
+ }
+
+ return $basket;
+ }
+
+ private function validId(int $id): bool
+ {
+ if ($id > 0) {
+ return true;
+ }
+ $this->addError(new Error("Wrong product id"));
+
+ return false;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/catalog.php b/local/modules/jinove.vinoteca/lib/controller/catalog.php
new file mode 100644
index 0000000..19e2247
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/catalog.php
@@ -0,0 +1,94 @@
+ [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_GET])],
+ ],
+ "filter" => [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_GET])],
+ ],
+ ];
+ }
+
+ public function listingAction(string $path): ?Component
+ {
+ $route = Listing::parsePath($path);
+ if ($route === null) {
+ $this->addError(new Error("Wrong path"));
+
+ return null;
+ }
+ if (!Listing::filterPathIsValid($route["SECTION_CODE"], $route["FILTER_PATH"])) {
+ $this->addError(new Error("Wrong filter"));
+
+ return null;
+ }
+
+ return new Component(
+ "jinove:catalog.listing",
+ "",
+ [
+ "SECTION_CODE" => $route["SECTION_CODE"],
+ "FILTER_PATH" => $route["FILTER_PATH"],
+ "AJAX" => "Y",
+ ],
+ [],
+ static function (): array {
+ global $APPLICATION;
+
+ return ["title" => (string)($APPLICATION->GetPageProperty("title") ?: $APPLICATION->GetTitle())];
+ }
+ );
+ }
+
+ public function filterAction(string $section): ?array
+ {
+ $route = Listing::parsePath(Listing::sectionPath($section));
+ if ($route === null) {
+ $this->addError(new Error("Wrong section"));
+
+ return null;
+ }
+
+ global $APPLICATION;
+ ob_start();
+ $result = $APPLICATION->IncludeComponent(
+ "bitrix:catalog.smart.filter",
+ "",
+ Listing::filterParams($route["SECTION_CODE"], ""),
+ null,
+ [],
+ true
+ );
+ ob_end_clean();
+
+ $disabled = [];
+ foreach ((array)($result["ITEMS"] ?? []) as $item) {
+ if (!empty($item["PRICE"])) {
+ continue;
+ }
+ foreach ((array)($item["VALUES"] ?? []) as $value) {
+ $disabled[$value["CONTROL_NAME"]] = !empty($value["DISABLED"]);
+ }
+ }
+
+ return [
+ "url" => (string)($result["JS_FILTER_PARAMS"]["SEF_SET_FILTER_URL"] ?? Listing::sectionPath($route["SECTION_CODE"])),
+ "disabled" => $disabled,
+ ];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/compare.php b/local/modules/jinove.vinoteca/lib/controller/compare.php
new file mode 100644
index 0000000..0108c0d
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/compare.php
@@ -0,0 +1,118 @@
+ [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_GET])],
+ ],
+ "set" => [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf()],
+ ],
+ "clear" => [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf()],
+ ],
+ ];
+ }
+
+ public function stateAction(): array
+ {
+ return $this->describe(Comparison::prune(), false);
+ }
+
+ public function clearAction(): array
+ {
+ Comparison::write([]);
+
+ return $this->describe([], false);
+ }
+
+ public function setAction(int $id, string $on): ?array
+ {
+ $items = Comparison::read();
+ if ($on !== "Y") {
+ unset($items[$id]);
+ Comparison::write($items);
+
+ return $this->describe($items, false);
+ }
+ if (isset($items[$id])) {
+ return $this->describe($items, false);
+ }
+ if (count($items) >= Comparison::MAX) {
+ return $this->describe($items, true);
+ }
+
+ $item = $this->loadItem($id);
+ if ($item === null) {
+ $this->addError(new Error("Wrong product id"));
+
+ return null;
+ }
+ $items[$id] = $item;
+ Comparison::write($items);
+
+ return $this->describe($items, false);
+ }
+
+ private function describe(array $items, bool $full): array
+ {
+ return ["items" => array_map("intval", array_keys($items)), "full" => $full];
+ }
+
+ private function loadItem(int $id): ?array
+ {
+ if ($id <= 0 || !Loader::includeModule("iblock")) {
+ return null;
+ }
+ $element = ElementTable::getRow([
+ "select" => ["ID", "IBLOCK_ID", "IBLOCK_SECTION_ID", "NAME", "CODE", "SECTION_CODE" => "IBLOCK_SECTION.CODE", "DETAIL_PAGE_URL" => "IBLOCK.DETAIL_PAGE_URL"],
+ "filter" => ["=ID" => $id, "=IBLOCK_ID" => Config::iblockId("catalog"), "=ACTIVE" => "Y"],
+ ]);
+ if ($element === null) {
+ return null;
+ }
+ $url = \CIBlock::ReplaceDetailUrl((string)$element["DETAIL_PAGE_URL"], [
+ "ID" => $element["ID"],
+ "CODE" => $element["CODE"],
+ "IBLOCK_ID" => $element["IBLOCK_ID"],
+ "IBLOCK_SECTION_ID" => $element["IBLOCK_SECTION_ID"],
+ "SECTION_CODE" => $element["SECTION_CODE"],
+ ], false, "E");
+ $sections = array_map("intval", array_column(SectionElementTable::getList([
+ "select" => ["IBLOCK_SECTION_ID"],
+ "filter" => ["=IBLOCK_ELEMENT_ID" => $id, "=ADDITIONAL_PROPERTY_ID" => null],
+ ])->fetchAll(), "IBLOCK_SECTION_ID"));
+
+ return [
+ "ID" => (int)$element["ID"],
+ "~ID" => (int)$element["ID"],
+ "IBLOCK_ID" => (int)$element["IBLOCK_ID"],
+ "~IBLOCK_ID" => (int)$element["IBLOCK_ID"],
+ "IBLOCK_SECTION_ID" => (int)$element["IBLOCK_SECTION_ID"],
+ "~IBLOCK_SECTION_ID" => (int)$element["IBLOCK_SECTION_ID"],
+ "NAME" => htmlspecialcharsbx($element["NAME"]),
+ "~NAME" => $element["NAME"],
+ "DETAIL_PAGE_URL" => htmlspecialcharsbx($url),
+ "~DETAIL_PAGE_URL" => $url,
+ "SECTIONS_LIST" => array_combine($sections, $sections),
+ "PARENT_ID" => (int)$element["ID"],
+ ];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/favorite.php b/local/modules/jinove.vinoteca/lib/controller/favorite.php
new file mode 100644
index 0000000..cff6a90
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/favorite.php
@@ -0,0 +1,94 @@
+ [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_GET])],
+ ],
+ "set" => [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf()],
+ ],
+ ];
+ }
+
+ public function stateAction(): ?array
+ {
+ if (!$this->loadModules()) {
+ return null;
+ }
+
+ return ["items" => FavoriteTable::productIds((int)Fuser::getId(true))];
+ }
+
+ public function setAction(int $id, string $on): ?array
+ {
+ if (!$this->loadModules()) {
+ return null;
+ }
+ if ($on === "Y" && !$this->isProduct($id)) {
+ $this->addError(new Error("Wrong product id"));
+
+ return null;
+ }
+
+ $fuserId = (int)Fuser::getId();
+ $row = FavoriteTable::getRow([
+ "select" => ["ID"],
+ "filter" => ["=FUSER_ID" => $fuserId, "=PRODUCT_ID" => $id],
+ ]);
+ $result = null;
+ if ($on === "Y" && !$row) {
+ try {
+ $result = FavoriteTable::add(["FUSER_ID" => $fuserId, "PRODUCT_ID" => $id]);
+ } catch (SqlQueryException $exception) {
+ $result = null;
+ }
+ } elseif ($on !== "Y" && $row) {
+ $result = FavoriteTable::delete($row["ID"]);
+ }
+ if ($result !== null && !$result->isSuccess()) {
+ $this->addErrors($result->getErrors());
+
+ return null;
+ }
+
+ return ["items" => FavoriteTable::productIds($fuserId)];
+ }
+
+ private function loadModules(): bool
+ {
+ if (!Loader::includeModule("sale") || !Loader::includeModule("iblock")) {
+ $this->addError(new Error("Modules sale and iblock are required"));
+
+ return false;
+ }
+
+ return true;
+ }
+
+ private function isProduct(int $id): bool
+ {
+ return $id > 0 && ElementTable::getCount([
+ "=ID" => $id,
+ "=IBLOCK_ID" => VINO_CATALOG_IBLOCK,
+ "=ACTIVE" => "Y",
+ ]) > 0;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/filter/formguard.php b/local/modules/jinove.vinoteca/lib/controller/filter/formguard.php
new file mode 100644
index 0000000..d8e6c60
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/filter/formguard.php
@@ -0,0 +1,66 @@
+getAction()->getArguments();
+ } catch (\Throwable) {
+ return null;
+ }
+ if ((string)($arguments["website"] ?? "") !== "") {
+ return null;
+ }
+ if ($this->timing === self::TIMING_STARTED && self::startedTooEarly((int)($arguments["started"] ?? 0), $this->minFillMs)) {
+ return null;
+ }
+ if ($this->timing === self::TIMING_ELAPSED && (int)($arguments["elapsed"] ?? 0) < $this->minFillMs) {
+ return $this->reject("Too fast", "retry");
+ }
+ if (!Origin::allowed($this->getAction()->getController()->getRequest())) {
+ return $this->reject("Wrong origin", "origin");
+ }
+ if ($this->altcha && !Altcha::verify((string)($arguments["altcha"] ?? ""))) {
+ return $this->reject("Verification failed", "altcha");
+ }
+
+ return null;
+ }
+
+ private function reject(string $message, string $code): EventResult
+ {
+ $this->addError(new Error($message, $code));
+
+ return new EventResult(EventResult::ERROR, null, null, $this);
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/lead.php b/local/modules/jinove.vinoteca/lib/controller/lead.php
new file mode 100644
index 0000000..f25ca12
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/lead.php
@@ -0,0 +1,208 @@
+ [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_GET])],
+ ],
+ "question" => [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf(), new FormGuard()],
+ ],
+ "subscribe" => [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf(), new FormGuard()],
+ ],
+ ];
+ }
+
+ public function challengeAction(): ?Json
+ {
+ $challenge = Altcha::challenge();
+ if ($challenge === null) {
+ $this->addError(new Error("Challenge is not available", "altcha"));
+
+ return null;
+ }
+ $response = new Json($challenge);
+ $response->addHeader("Cache-Control", "no-store");
+
+ return $response;
+ }
+
+ public function questionAction(string $name, string $phone, string $message, string $consent = "", string $website = "", string $altcha = "", string $page = ""): ?array
+ {
+ if ($website !== "") {
+ return ["ok" => true];
+ }
+ $name = trim((string)preg_replace('/\s+/u', " ", $name));
+ $message = trim($message);
+ $phone = Phone::format($phone);
+ if ($consent === "" || $name === "" || $message === "" || $phone === "" || mb_strlen($name) > 100 || mb_strlen($message) > 2000) {
+ $this->addError(new Error("Invalid fields", "fields"));
+
+ return null;
+ }
+ $pageUrl = $this->pageUrl($page);
+ $consentUrl = $this->siteUrl() . "consent/";
+ $sentAt = (string)new DateTime();
+ $leadId = $this->save(self::QUESTIONS_CODE, $name . ", " . $phone, $message, [
+ "PERSON_NAME" => $name,
+ "PHONE" => $phone,
+ "LANG" => LANGUAGE_ID,
+ "PAGE" => $pageUrl,
+ "CONSENT" => "Y",
+ "CONSENT_VERSION" => Consent::VERSION,
+ "CONSENT_URL" => $consentUrl,
+ "SENT_AT" => $sentAt,
+ ], $sentAt);
+ if ($leadId <= 0) {
+ $this->addError(new Error("Save failed", "save"));
+
+ return null;
+ }
+ Event::send([
+ "EVENT_NAME" => "VINO_SOMMELIER_QUESTION",
+ "LID" => SITE_ID,
+ "C_FIELDS" => [
+ "LEAD_ID" => $leadId,
+ "NAME" => $name,
+ "PHONE" => $phone,
+ "MESSAGE" => $message,
+ "PAGE" => $pageUrl,
+ "SENT_AT" => $sentAt,
+ "CONSENT_VERSION" => Consent::VERSION,
+ "CONSENT_URL" => $consentUrl,
+ ],
+ ]);
+
+ return ["ok" => true];
+ }
+
+ public function subscribeAction(string $email, string $consent = "", string $website = "", string $altcha = "", string $page = ""): ?array
+ {
+ if ($website !== "") {
+ return ["ok" => true];
+ }
+ $email = mb_strtolower(trim($email));
+ if (!check_email($email) || mb_strlen($email) > 254) {
+ $this->addError(new Error("Invalid e-mail", "email"));
+
+ return null;
+ }
+ if ($consent === "") {
+ $this->addError(new Error("Consent is required", "consent"));
+
+ return null;
+ }
+ $session = Application::getInstance()->getSession();
+ if (time() - (int)$session->get("vino_subscribe_last") < self::SUBSCRIBE_RETRY_SECONDS) {
+ return ["ok" => true];
+ }
+ $session->set("vino_subscribe_last", time());
+ if ($this->exists(self::SUBSCRIBERS_CODE, $email)) {
+ return ["ok" => true];
+ }
+ $sentAt = (string)new DateTime();
+ $consentUrl = $this->siteUrl() . "consent/";
+ $id = $this->save(self::SUBSCRIBERS_CODE, $email, "", [
+ "LANG" => LANGUAGE_ID,
+ "PAGE" => $this->pageUrl($page),
+ "CONSENT" => "Y",
+ "CONSENT_VERSION" => Consent::VERSION,
+ "CONSENT_URL" => $consentUrl,
+ "SENT_AT" => $sentAt,
+ ], $sentAt);
+ if ($id <= 0) {
+ $this->addError(new Error("Save failed", "save"));
+
+ return null;
+ }
+ Event::send([
+ "EVENT_NAME" => "VINO_SUBSCRIBE",
+ "LID" => SITE_ID,
+ "C_FIELDS" => [
+ "EMAIL" => $email,
+ "CONSENT_VERSION" => Consent::VERSION,
+ "CONSENT_URL" => $consentUrl,
+ ],
+ ]);
+
+ return ["ok" => true];
+ }
+
+ private function iblockId(string $code): int
+ {
+ if (!Loader::includeModule("iblock")) {
+ return 0;
+ }
+ $iblock = \CIBlock::GetList([], ["CODE" => $code, "CHECK_PERMISSIONS" => "N"])->Fetch();
+
+ return $iblock ? (int)$iblock["ID"] : 0;
+ }
+
+ private function exists(string $code, string $name): bool
+ {
+ $iblockId = $this->iblockId($code);
+ if ($iblockId <= 0) {
+ return false;
+ }
+
+ return (bool)\CIBlockElement::GetList([], ["IBLOCK_ID" => $iblockId, "=NAME" => $name], false, ["nTopCount" => 1], ["ID"])->Fetch();
+ }
+
+ private function save(string $code, string $name, string $text, array $properties, string $sentAt): int
+ {
+ $iblockId = $this->iblockId($code);
+ if ($iblockId <= 0) {
+ return 0;
+ }
+ $element = new \CIBlockElement();
+
+ return (int)$element->Add([
+ "IBLOCK_ID" => $iblockId,
+ "NAME" => $name,
+ "ACTIVE" => "Y",
+ "DATE_ACTIVE_FROM" => $sentAt,
+ "DETAIL_TEXT" => $text,
+ "DETAIL_TEXT_TYPE" => "text",
+ "PROPERTY_VALUES" => $properties,
+ ], false, false, false);
+ }
+
+ private function siteUrl(): string
+ {
+ return Config::host() . SITE_DIR;
+ }
+
+ private function pageUrl(string $page): string
+ {
+ $path = (string)parse_url($page, PHP_URL_PATH);
+
+ return Config::host() . ($path !== "" && str_starts_with($path, "/") ? $path : SITE_DIR);
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/news.php b/local/modules/jinove.vinoteca/lib/controller/news.php
new file mode 100644
index 0000000..2844ba6
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/news.php
@@ -0,0 +1,42 @@
+ [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_GET])],
+ ],
+ ];
+ }
+
+ public function pageAction(): ?Component
+ {
+ $page = (string)$this->getRequest()->getQuery("PAGEN_1");
+ if (!ctype_digit($page) || (int)$page < 1 || (int)$page > NewsList::pageCount()) {
+ $this->addError(new Error("Wrong page"));
+
+ return null;
+ }
+ $meta = NewsList::pageMeta((int)$page);
+
+ return new Component(
+ "bitrix:news.list",
+ NewsList::LIST_TEMPLATE,
+ NewsList::listParams(true),
+ [],
+ static fn(): array => ["title" => $meta["title"]]
+ );
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/order.php b/local/modules/jinove.vinoteca/lib/controller/order.php
new file mode 100644
index 0000000..e805463
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/order.php
@@ -0,0 +1,97 @@
+ ["prefilters" => [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf(), new FormGuard()]],
+ "pay" => ["prefilters" => [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf(), new FormGuard(FormGuard::TIMING_NONE, FormGuard::MIN_FILL_MS, false)]],
+ ];
+ }
+
+ public function createAction(string $name, string $phone, string $email, string $pay, string $consent = "", string $comment = "", string $website = "", string $altcha = "", string $page = "", string $base = "/"): ?array
+ {
+ if ($website !== "") {
+ return ["ok" => true, "redirect" => ""];
+ }
+ $name = trim((string)preg_replace('/\s+/u', " ", $name));
+ $email = mb_strtolower(trim($email));
+ $comment = trim($comment);
+ $phone = Phone::format($phone);
+ if ($consent !== "Y" || preg_match('/^\/[\w\-\/]{0,198}$/', $page) !== 1 || mb_strlen($name) < 2 || mb_strlen($name) > 100 || $phone === "" || !check_email($email) || mb_strlen($email) > 254 || mb_strlen($comment) > 500 || (int)$pay <= 0) {
+ return $this->fail("Invalid fields", "fields");
+ }
+ $session = Application::getInstance()->getSession();
+ if (time() - (int)$session->get("vino_order_last") < self::RETRY_SECONDS) {
+ return $this->fail("Too many orders", "rate");
+ }
+ $session->set("vino_order_last", time());
+ $basket = Cart::load();
+ if ($basket === null) {
+ $session->set("vino_order_last", 0);
+
+ return $this->fail("Cart is unavailable", "cart");
+ }
+ DiscountCouponsManager::init();
+ $created = Checkout::create($basket, ["name" => $name, "phone" => $phone, "email" => $email, "comment" => $comment], (int)$pay, Checkout::consentProof($page));
+ if (isset($created["error"])) {
+ $session->set("vino_order_last", 0);
+
+ return $this->fail("Order was not created", (string)$created["error"]);
+ }
+ $dir = Checkout::dir($base);
+ $order = $created["order"];
+ $redirect = Checkout::doneUrl($order, $dir);
+ if ($created["method"]["code"] === "halyk") {
+ $redirect = Checkout::doneUrl($order, $dir, ["autopay" => "Y"]);
+ } elseif ($created["method"]["code"] !== "cash") {
+ $started = Checkout::startPayment($order, $dir);
+ $redirect = $started["url"] !== "" ? $started["url"] : Checkout::doneUrl($order, $dir, ["pay" => "failed"]);
+ }
+
+ return ["ok" => true, "redirect" => $redirect];
+ }
+
+ public function payAction(int $id, string $hash, string $base = "/"): ?array
+ {
+ $order = Checkout::find($id, $hash);
+ if ($order === null || $order->isCanceled()) {
+ return $this->fail("Order not found", "order");
+ }
+ $dir = Checkout::dir($base);
+ $started = Checkout::startPayment($order, $dir);
+ if (is_array($started["widget"] ?? null)) {
+ return ["ok" => true, "widget" => $started["widget"]];
+ }
+ if ($started["url"] === "") {
+ return $this->fail("Payment is unavailable", "pay");
+ }
+
+ return ["ok" => true, "redirect" => $started["url"]];
+ }
+
+ private function fail(string $message, string $code): ?array
+ {
+ $this->addError(new Error($message, $code));
+
+ return null;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/password.php b/local/modules/jinove.vinoteca/lib/controller/password.php
new file mode 100644
index 0000000..64b57af
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/password.php
@@ -0,0 +1,125 @@
+ [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf(), new FormGuard(FormGuard::TIMING_ELAPSED)]];
+
+ return ["request" => $filters, "reset" => $filters];
+ }
+
+ public function requestAction(string $email, string $website = "", int $elapsed = 0, string $altcha = ""): ?array
+ {
+ $started = microtime(true);
+ if ($website !== "") {
+ return ["ok" => true];
+ }
+ if (!$this->limit("vino_password_request_log")) {
+ return null;
+ }
+ $email = mb_strtolower(trim($email));
+ if (!check_email($email) || mb_strlen($email) > 254) {
+ $this->addError(new Error("Invalid e-mail", "email"));
+
+ return null;
+ }
+ $row = UserTable::getRow([
+ "select" => ["ID"],
+ "filter" => ["=EMAIL" => $email, "=ACTIVE" => "Y"],
+ ]);
+ if ($row !== null && $this->mayMail((int)$row["ID"])) {
+ \CUser::SendUserInfo((int)$row["ID"], SITE_ID, "", false, self::EVENT);
+ }
+ $left = self::RESPONSE_MS * 1000 - (int)((microtime(true) - $started) * 1000000);
+ if ($left > 0) {
+ usleep($left);
+ }
+
+ return ["ok" => true];
+ }
+
+ public function resetAction(string $login, string $checkword, string $password, string $website = "", int $elapsed = 0, string $altcha = ""): ?array
+ {
+ if ($website !== "") {
+ $this->addError(new Error("Reset failed", "failed"));
+
+ return null;
+ }
+ if (!$this->limit("vino_password_reset_log")) {
+ return null;
+ }
+ $length = mb_strlen($password);
+ if (
+ $login === ""
+ || mb_strlen($login) > 254
+ || !preg_match('/^[A-Za-z0-9]{32}$/', $checkword)
+ ) {
+ $this->addError(new Error("Invalid link", "link"));
+
+ return null;
+ }
+ if ($length < self::PASSWORD_MIN || $length > self::PASSWORD_MAX || mb_strtolower($password) === mb_strtolower($login)) {
+ $this->addError(new Error("Weak password", "password"));
+
+ return null;
+ }
+ $result = (new \CUser())->ChangePassword($login, $checkword, $password, $password, SITE_ID, "", 0, false);
+ if (($result["TYPE"] ?? "") !== "OK") {
+ $this->addError(new Error("Reset failed", (string)($result["FIELD"] ?? "") === "PASSWORD" ? "password" : "link"));
+
+ return null;
+ }
+
+ return ["ok" => true];
+ }
+
+ private function limit(string $sessionKey): bool
+ {
+ $session = Application::getInstance()->getSession();
+ $now = time();
+ $log = array_values(array_filter((array)($session->get($sessionKey) ?? []), static fn($at): bool => (int)$at > $now - self::WINDOW_SECONDS));
+ if (count($log) >= self::MAX_PER_WINDOW) {
+ $this->addError(new Error("Too many attempts", "too_often"));
+
+ return false;
+ }
+ $log[] = $now;
+ $session->set($sessionKey, $log);
+
+ return true;
+ }
+
+ private function mayMail(int $userId): bool
+ {
+ $cache = Cache::createInstance();
+ if ($cache->initCache(self::MAIL_PAUSE_SECONDS, "vino_pass_mail_" . $userId, "/vino/password")) {
+ return false;
+ }
+ $cache->startDataCache();
+ $cache->endDataCache(["sent" => true]);
+
+ return true;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/profile.php b/local/modules/jinove.vinoteca/lib/controller/profile.php
new file mode 100644
index 0000000..9d581bb
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/profile.php
@@ -0,0 +1,152 @@
+ [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf()]];
+
+ return ["save" => $filters, "password" => $filters, "logout" => $filters];
+ }
+
+ public function saveAction(string $name, string $phone = ""): ?array
+ {
+ $userId = $this->userId();
+ if ($userId <= 0) {
+ $this->addError(new Error("Not authorized", "auth"));
+
+ return null;
+ }
+ $name = trim((string)preg_replace('/\s+/u', " ", $name));
+ if ($name === "" || mb_strlen($name) > self::NAME_MAX) {
+ $this->addError(new Error("Invalid name", "name"));
+
+ return null;
+ }
+ if (!mb_check_encoding($name, "UTF-8") || preg_match('/[<>\x00-\x1f\x7f]/', $name)) {
+ $this->addError(new Error("Invalid name characters", "name_chars"));
+
+ return null;
+ }
+ $phone = trim($phone);
+ if ($phone !== "" && !preg_match('/^\+\d{8,15}$/', $phone)) {
+ $this->addError(new Error("Invalid phone", "phone"));
+
+ return null;
+ }
+ $user = new \CUser();
+ if (!$user->Update($userId, ["NAME" => $name, "PERSONAL_PHONE" => $phone])) {
+ $this->addError(new Error("Save failed", "failed"));
+
+ return null;
+ }
+
+ return ["ok" => true];
+ }
+
+ public function passwordAction(string $current, string $password): ?array
+ {
+ $userId = $this->userId();
+ if ($userId <= 0) {
+ $this->addError(new Error("Not authorized", "auth"));
+
+ return null;
+ }
+ $session = Application::getInstance()->getSession();
+ $now = time();
+ $log = array_values(array_filter((array)($session->get("vino_profile_password_log") ?? []), static fn($at): bool => (int)$at > $now - self::WINDOW_SECONDS));
+ if (count($log) >= self::MAX_PER_WINDOW) {
+ $this->addError(new Error("Too many attempts", "too_often"));
+
+ return null;
+ }
+ $log[] = $now;
+ $session->set("vino_profile_password_log", $log);
+ if (!$this->mayTryPassword($userId)) {
+ $this->addError(new Error("Too many attempts", "too_often"));
+
+ return null;
+ }
+
+ $row = UserTable::query()->setSelect(["PASSWORD", "EMAIL"])->setFilter(["=ID" => $userId])->enablePrivateFields()->fetch() ?: null;
+ if ($row === null || $current === "" || !Password::equals((string)$row["PASSWORD"], $current)) {
+ $this->addError(new Error("Wrong current password", "current"));
+
+ return null;
+ }
+ $length = mb_strlen($password);
+ if ($length < self::PASSWORD_MIN || $length > self::PASSWORD_MAX || mb_strtolower($password) === mb_strtolower((string)$row["EMAIL"])) {
+ $this->addError(new Error("Weak password", "password"));
+
+ return null;
+ }
+ if ($password === $current) {
+ $this->addError(new Error("Same password", "same"));
+
+ return null;
+ }
+ $user = new \CUser();
+ if (!$user->Update($userId, ["PASSWORD" => $password, "CONFIRM_PASSWORD" => $password])) {
+ $this->addError(new Error("Password rejected", "policy"));
+
+ return null;
+ }
+
+ return ["ok" => true];
+ }
+
+ public function logoutAction(string $lang = "en"): array
+ {
+ global $USER;
+ $USER->Logout();
+
+ return ["ok" => true, "redirect" => Redirect::home($lang)];
+ }
+
+ private function mayTryPassword(int $userId): bool
+ {
+ $cache = Cache::createInstance();
+ $key = "vino_profile_password_" . $userId;
+ $attempts = [];
+ if ($cache->initCache(self::WINDOW_SECONDS, $key, "/vino/profile")) {
+ $attempts = (array)($cache->getVars()["attempts"] ?? []);
+ }
+ $now = time();
+ $attempts = array_values(array_filter($attempts, static fn($at): bool => (int)$at > $now - self::WINDOW_SECONDS));
+ if (count($attempts) >= self::MAX_PER_WINDOW) {
+ return false;
+ }
+ $attempts[] = $now;
+ $cache->clean($key, "/vino/profile");
+ $cache->startDataCache(self::WINDOW_SECONDS, $key, "/vino/profile");
+ $cache->endDataCache(["attempts" => $attempts]);
+
+ return true;
+ }
+
+ private function userId(): int
+ {
+ return (int)CurrentUser::get()->getId();
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/register.php b/local/modules/jinove.vinoteca/lib/controller/register.php
new file mode 100644
index 0000000..ee50fdd
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/register.php
@@ -0,0 +1,124 @@
+ [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_POST]), new Csrf(), new FormGuard(FormGuard::TIMING_ELAPSED)],
+ ],
+ ];
+ }
+
+ public function createAction(
+ string $name,
+ string $email,
+ string $password,
+ string $consent = "",
+ string $back = "",
+ string $lang = "en",
+ string $website = "",
+ int $elapsed = 0,
+ string $altcha = ""
+ ): ?array {
+ $lang = Redirect::language($lang);
+ if ($website !== "") {
+ return ["ok" => true, "redirect" => Redirect::home($lang)];
+ }
+ $session = Application::getInstance()->getSession();
+ $now = time();
+ $log = array_values(array_filter((array)($session->get("vino_register_log") ?? []), static fn($at): bool => (int)$at > $now - self::WINDOW_SECONDS));
+ if (count($log) >= self::MAX_PER_WINDOW) {
+ $this->addError(new Error("Too many attempts", "too_often"));
+
+ return null;
+ }
+ $log[] = $now;
+ $session->set("vino_register_log", $log);
+
+ $name = trim((string)preg_replace('/\s+/u', " ", $name));
+ $email = mb_strtolower(trim($email));
+ $length = mb_strlen($password);
+ if (
+ $consent !== "1"
+ || $name === ""
+ || mb_strlen($name) > self::NAME_MAX
+ || !mb_check_encoding($name, "UTF-8")
+ || preg_match('/[<>\x00-\x1f\x7f]/', $name)
+ || !check_email($email)
+ || mb_strlen($email) > 254
+ || $length < self::PASSWORD_MIN
+ || $length > self::PASSWORD_MAX
+ || mb_strtolower($password) === $email
+ ) {
+ $this->addError(new Error("Registration failed", "failed"));
+
+ return null;
+ }
+ $exists = UserTable::getRow([
+ "select" => ["ID"],
+ "filter" => ["LOGIC" => "OR", "=EMAIL" => $email, "=LOGIN" => $email],
+ ]);
+ if ($exists !== null) {
+ $this->addError(new Error("Registration failed", "failed"));
+
+ return null;
+ }
+ $groups = array_values(array_filter(array_map("intval", explode(",", (string)Option::get("main", "new_user_registration_def_group", "")))));
+ $user = new \CUser();
+ $id = (int)$user->Add([
+ "LOGIN" => $email,
+ "EMAIL" => $email,
+ "NAME" => $name,
+ "PASSWORD" => $password,
+ "CONFIRM_PASSWORD" => $password,
+ "ACTIVE" => "Y",
+ "LID" => SITE_ID,
+ "GROUP_ID" => $groups,
+ "UF_CONSENT_TIME" => (string)new DateTime(),
+ "UF_CONSENT_VERSION" => Consent::VERSION,
+ "UF_CONSENT_PAGE" => $this->consentPage(),
+ "UF_CONSENT_URL" => Config::host() . SITE_DIR . "consent/",
+ ]);
+ if ($id <= 0) {
+ $this->addError(new Error("Registration failed", "failed"));
+
+ return null;
+ }
+ global $USER;
+ $USER->Authorize($id);
+
+ return ["ok" => true, "redirect" => Redirect::back($back, $lang)];
+ }
+
+ private function consentPage(): string
+ {
+ $path = (string)parse_url((string)($this->getRequest()->getHeader("Referer") ?? ""), PHP_URL_PATH);
+
+ return mb_check_encoding($path, "UTF-8") && !preg_match('/[\x00-\x1f\x7f]/', $path) ? mb_substr($path, 0, 200) : "";
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/review.php b/local/modules/jinove.vinoteca/lib/controller/review.php
new file mode 100644
index 0000000..b7acf8a
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/review.php
@@ -0,0 +1,130 @@
+ "", "ru" => "/ru", "pl" => "/pl"];
+
+ public function configureActions(): array
+ {
+ return [
+ "add" => [
+ "prefilters" => [new Authentication(), new HttpMethod([HttpMethod::METHOD_POST]), new Csrf(), new FormGuard(FormGuard::TIMING_STARTED, self::MIN_FILL_MS)],
+ ],
+ ];
+ }
+
+ public function addAction(
+ int $productId,
+ int $rating,
+ string $text,
+ string $consent = "",
+ string $website = "",
+ int $started = 0,
+ string $altcha = "",
+ string $lang = "en",
+ string $page = ""
+ ): ?array {
+ if ($website !== "" || FormGuard::startedTooEarly($started, self::MIN_FILL_MS)) {
+ return ["ok" => true];
+ }
+ $user = CurrentUser::get();
+ $author = trim((string)$user->getFullName());
+ if ($author === "") {
+ $author = trim((string)$user->getLogin());
+ }
+ $author = mb_substr($author, 0, 60);
+ if (!mb_check_encoding($author, "UTF-8") || !mb_check_encoding($text, "UTF-8")) {
+ $this->addError(new Error("Wrong encoding", "text"));
+
+ return null;
+ }
+ $author = trim((string)preg_replace('/\s+/u', " ", $author));
+ $text = trim($text);
+ $lang = isset(self::LANGS[$lang]) ? $lang : "en";
+ if ($rating < 1 || $rating > 5) {
+ $this->addError(new Error("Rating is required", "rating"));
+ }
+ if (mb_strlen($text) < 10 || mb_strlen($text) > 2000) {
+ $this->addError(new Error("Text is required", "text"));
+ }
+ if ($consent !== "1") {
+ $this->addError(new Error("Consent is required", "consent"));
+ }
+ if ($this->getErrors()) {
+ return null;
+ }
+
+ $session = Application::getInstance()->getSession();
+ if (time() - (int)($session->get("vino_review_last") ?? 0) < self::RETRY_SECONDS) {
+ $this->addError(new Error("Too often", "too_often"));
+
+ return null;
+ }
+
+ if (!Loader::includeModule("iblock")) {
+ $this->addError(new Error("Iblock module is required", "internal"));
+
+ return null;
+ }
+ $product = ElementTable::getRow([
+ "select" => ["ID", "NAME"],
+ "filter" => ["=ID" => $productId, "=IBLOCK_ID" => Config::iblockId("catalog"), "=ACTIVE" => "Y"],
+ ]);
+ if ($product === null) {
+ $this->addError(new Error("Wine not found", "not_found"));
+
+ return null;
+ }
+
+ $pagePath = (string)parse_url($page, PHP_URL_PATH);
+ $element = new \CIBlockElement();
+ $id = $element->Add([
+ "IBLOCK_ID" => ReviewStats::iblockId(ReviewStats::REVIEWS_CODE),
+ "ACTIVE" => "N",
+ "NAME" => mb_substr($author . ": " . $product["NAME"], 0, 255),
+ "ACTIVE_FROM" => ConvertTimeStamp(time(), "FULL"),
+ "PREVIEW_TEXT" => $text,
+ "PREVIEW_TEXT_TYPE" => "text",
+ "PROPERTY_VALUES" => [
+ "PRODUCT" => (int)$product["ID"],
+ "RATING" => $rating,
+ "AUTHOR" => $author,
+ "USER_ID" => (int)$user->getId(),
+ "LANG" => $lang,
+ "PAGE" => self::SITE_URL . ($pagePath !== "" ? $pagePath : "/"),
+ "CONSENT" => "Y",
+ "CONSENT_VERSION" => Consent::VERSION,
+ "CONSENT_URL" => self::SITE_URL . self::LANGS[$lang] . "/consent/",
+ ],
+ ]);
+ if (!$id) {
+ $this->addError(new Error("Review was not saved", "internal"));
+
+ return null;
+ }
+ $session->set("vino_review_last", time());
+
+ return ["ok" => true];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/controller/state.php b/local/modules/jinove.vinoteca/lib/controller/state.php
new file mode 100644
index 0000000..6cb17e3
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/controller/state.php
@@ -0,0 +1,29 @@
+ [
+ "prefilters" => [new HttpMethod([HttpMethod::METHOD_GET])],
+ ],
+ ];
+ }
+
+ public function allAction(): array
+ {
+ return [
+ "favorite" => (new Favorite())->stateAction(),
+ "basket" => (new Basket())->stateAction(),
+ "compare" => (new Compare())->stateAction(),
+ ];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/dateformat.php b/local/modules/jinove.vinoteca/lib/dateformat.php
new file mode 100644
index 0000000..474c8cd
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/dateformat.php
@@ -0,0 +1,19 @@
+ date("j", $timestamp),
+ "#MONTH#" => Loc::getMessage("JINOVE_VINOTECA_MONTH_" . date("n", $timestamp), null, $languageId),
+ "#YEAR#" => date("Y", $timestamp),
+ ], $languageId);
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/language.php b/local/modules/jinove.vinoteca/lib/language.php
new file mode 100644
index 0000000..99fd783
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/language.php
@@ -0,0 +1,21 @@
+GetCurPage(false);
+ if (SITE_DIR !== "/" && str_starts_with($path, SITE_DIR)) {
+ $path = "/" . substr($path, strlen(SITE_DIR));
+ }
+
+ return Config::host() . rtrim((string)($languages[$language]["dir"] ?? "/"), "/") . $path;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/money.php b/local/modules/jinove.vinoteca/lib/money.php
new file mode 100644
index 0000000..9980f62
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/money.php
@@ -0,0 +1,19 @@
+getContext()->getRequest()->getRequestUri();
+ $path = (string)parse_url($uri, PHP_URL_PATH);
+ if (SITE_DIR !== "/" && str_starts_with($path, SITE_DIR)) {
+ $path = "/" . substr($path, strlen(SITE_DIR));
+ }
+ if (str_ends_with($path, "index.php")) {
+ $path = substr($path, 0, -9);
+ }
+
+ return $path === "" ? "/" : $path;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/news.php b/local/modules/jinove.vinoteca/lib/news.php
new file mode 100644
index 0000000..cb07521
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/news.php
@@ -0,0 +1,162 @@
+ "Y",
+ "PAGER_TEMPLATE" => "vinoteca",
+ "PAGER_TITLE" => (string)Loc::getMessage("VINO_NEWS_PAGER_TITLE"),
+ "PAGER_SHOW_ALWAYS" => "N",
+ "PAGER_SHOW_ALL" => "N",
+ "PAGER_DESC_NUMBERING" => "N",
+ "PAGER_BASE_LINK_ENABLE" => "Y",
+ "PAGER_BASE_LINK" => self::folder(),
+ "VINO_AJAX" => $ajax ? "Y" : "N",
+ ]);
+ }
+
+ public static function homeParams(): array
+ {
+ return self::baseParams(3);
+ }
+
+ public static function otherParams(int $excludeId): array
+ {
+ $GLOBALS[self::FILTER_OTHER] = ["!ID" => $excludeId];
+
+ return array_merge(self::baseParams(3), [
+ "FILTER_NAME" => self::FILTER_OTHER,
+ "CACHE_FILTER" => "Y",
+ ]);
+ }
+
+ public static function pageCount(): int
+ {
+ $iblockId = self::iblockId();
+ if ($iblockId <= 0) {
+ return 1;
+ }
+ return (int)Cached::remember("/jinove/vinoteca/news", "pages_" . $iblockId, 3600, ["iblock_id_" . $iblockId], static function () use ($iblockId): int {
+ $now = new DateTime();
+ $count = ElementTable::getCount([
+ "=IBLOCK_ID" => $iblockId,
+ "=ACTIVE" => "Y",
+ ["LOGIC" => "OR", ["=ACTIVE_FROM" => false], ["<=ACTIVE_FROM" => $now]],
+ ["LOGIC" => "OR", ["=ACTIVE_TO" => false], [">=ACTIVE_TO" => $now]],
+ ]);
+
+ return max(1, (int)ceil($count / self::PAGE_SIZE));
+ });
+ }
+
+ public static function pageMeta(int $page): array
+ {
+ if ($page > 1) {
+ return [
+ "title" => (string)Loc::getMessage("VINO_NEWS_PAGE_TITLE_N", ["#PAGE#" => $page]),
+ "description" => (string)Loc::getMessage("VINO_NEWS_DESCRIPTION_N", ["#PAGE#" => $page]),
+ "canonical" => self::folder() . "?PAGEN_1=" . $page,
+ ];
+ }
+
+ return [
+ "title" => (string)Loc::getMessage("VINO_NEWS_PAGE_TITLE"),
+ "description" => (string)Loc::getMessage("VINO_NEWS_DESCRIPTION"),
+ "canonical" => self::folder(),
+ ];
+ }
+
+ public static function card(array $item, array $widths = [480, 800]): array
+ {
+ $item = LocalizedText::localizeItem($item, ["NAME", "PREVIEW_TEXT", "DETAIL_TEXT"], []);
+ $picture = $item["DETAIL_PICTURE"] ?? null;
+ $picture = $item["PREVIEW_PICTURE"] ?: $picture;
+ $item["VINO_PICTURE"] = [];
+ if (!empty($picture["ID"])) {
+ $srcset = [];
+ foreach ($widths as $width) {
+ if ((int)$picture["WIDTH"] > $width) {
+ $resized = \CFile::ResizeImageGet((int)$picture["ID"], ["width" => $width, "height" => 9999], BX_RESIZE_IMAGE_PROPORTIONAL, false);
+ if (!empty($resized["src"])) {
+ $srcset[] = $resized["src"] . " " . $width . "w";
+ }
+ }
+ }
+ $srcset[] = $picture["SRC"] . " " . (int)$picture["WIDTH"] . "w";
+ $item["VINO_PICTURE"] = [
+ "ID" => (int)$picture["ID"],
+ "SRC" => (string)$picture["SRC"],
+ "SRCSET" => implode(", ", $srcset),
+ "WIDTH" => (int)$picture["WIDTH"],
+ "HEIGHT" => (int)$picture["HEIGHT"],
+ "ALT" => (string)$item["~NAME"],
+ ];
+ }
+ $published = $item["ACTIVE_FROM"] ? DateTime::createFromUserTime((string)$item["ACTIVE_FROM"])->getTimestamp() : 0;
+ $item["VINO_TIMESTAMP"] = $published;
+ $item["VINO_DATE"] = $published ? ["ISO" => date("Y-m-d", $published), "TEXT" => DateFormat::long($published, LANGUAGE_ID)] : [];
+
+ return $item;
+ }
+
+ private static function baseParams(int $count): array
+ {
+ return [
+ "IBLOCK_TYPE" => "news",
+ "IBLOCK_ID" => self::iblockId(),
+ "NEWS_COUNT" => (string)$count,
+ "SORT_BY1" => "ACTIVE_FROM",
+ "SORT_ORDER1" => "DESC",
+ "SORT_BY2" => "ID",
+ "SORT_ORDER2" => "DESC",
+ "FIELD_CODE" => self::LIST_FIELDS,
+ "PROPERTY_CODE" => self::LIST_PROPERTIES,
+ "DETAIL_URL" => self::folder() . "#ELEMENT_CODE#/",
+ "CHECK_DATES" => "Y",
+ "CACHE_TYPE" => "A",
+ "CACHE_TIME" => "36000000",
+ "CACHE_GROUPS" => "N",
+ "CACHE_FILTER" => "N",
+ "SET_TITLE" => "N",
+ "SET_BROWSER_TITLE" => "N",
+ "SET_META_KEYWORDS" => "N",
+ "SET_META_DESCRIPTION" => "N",
+ "SET_LAST_MODIFIED" => "N",
+ "SET_STATUS_404" => "N",
+ "SHOW_404" => "N",
+ "INCLUDE_IBLOCK_INTO_CHAIN" => "N",
+ "ADD_SECTIONS_CHAIN" => "N",
+ "DISPLAY_TOP_PAGER" => "N",
+ "DISPLAY_BOTTOM_PAGER" => "N",
+ ];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/offers.php b/local/modules/jinove.vinoteca/lib/offers.php
new file mode 100644
index 0000000..335da1e
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/offers.php
@@ -0,0 +1,339 @@
+initCache(3600, $cacheId, self::CACHE_DIR)) {
+ $vars = (array)$cache->getVars();
+ if ((int)($vars["expires"] ?? 0) === 0 || (int)$vars["expires"] > time()) {
+ return (array)($vars["rules"] ?? []);
+ }
+ $cache->clean($cacheId, self::CACHE_DIR);
+ }
+ self::clearCache();
+ $cache->startDataCache();
+ $taggedCache = Application::getInstance()->getTaggedCache();
+ $taggedCache->startTagCache(self::CACHE_DIR);
+ try {
+ $taggedCache->registerTag(self::CACHE_TAG);
+ $vars = self::loadDiscounts();
+ } catch (\Throwable $exception) {
+ $taggedCache->abortTagCache();
+ $cache->abortDataCache();
+ throw $exception;
+ }
+ $taggedCache->endTagCache();
+ $cache->endDataCache($vars);
+
+ return $vars["rules"];
+ }
+
+ private static function loadDiscounts(): array
+ {
+ $time = time();
+ $expires = 0;
+ $boundary = static function ($date) use ($time, &$expires): void {
+ if ($date instanceof DateTime && $date->getTimestamp() > $time) {
+ $expires = $expires === 0 ? $date->getTimestamp() : min($expires, $date->getTimestamp());
+ }
+ };
+ $current = static function ($from, $to) use ($time): bool {
+ return !($from instanceof DateTime && $from->getTimestamp() > $time) && !($to instanceof DateTime && $to->getTimestamp() < $time);
+ };
+ $public = [];
+ $groups = DiscountGroupTable::getList([
+ "select" => ["DISCOUNT_ID"],
+ "filter" => ["=GROUP_ID" => 2, "=ACTIVE" => "Y"],
+ ]);
+ while ($group = $groups->fetch()) {
+ $public[(int)$group["DISCOUNT_ID"]] = true;
+ }
+ $rules = [];
+ $rows = DiscountTable::getList([
+ "select" => ["ID", "USE_COUPONS", "ACTIVE_FROM", "ACTIVE_TO", "CONDITIONS_LIST", "ACTIONS_LIST"],
+ "filter" => ["=ACTIVE" => "Y", "=LID" => Config::basketSiteId()],
+ ]);
+ while ($row = $rows->fetch()) {
+ $boundary($row["ACTIVE_FROM"]);
+ $boundary($row["ACTIVE_TO"]);
+ if (!$current($row["ACTIVE_FROM"], $row["ACTIVE_TO"]) || !isset($public[(int)$row["ID"]]) || !empty($row["CONDITIONS_LIST"]["CHILDREN"])) {
+ continue;
+ }
+ $rule = self::parseActions((array)$row["ACTIONS_LIST"]);
+ if ($rule === null) {
+ continue;
+ }
+ if ($row["USE_COUPONS"] === "Y") {
+ $coupons = DiscountCouponTable::getList([
+ "select" => ["COUPON", "ACTIVE_FROM", "ACTIVE_TO"],
+ "filter" => [
+ "=DISCOUNT_ID" => (int)$row["ID"],
+ "=ACTIVE" => "Y",
+ "=TYPE" => DiscountCouponTable::TYPE_MULTI_ORDER,
+ "=MAX_USE" => 0,
+ ],
+ ]);
+ while ($coupon = $coupons->fetch()) {
+ $boundary($coupon["ACTIVE_FROM"]);
+ $boundary($coupon["ACTIVE_TO"]);
+ if ($current($coupon["ACTIVE_FROM"], $coupon["ACTIVE_TO"])) {
+ $rule["coupons"][] = (string)$coupon["COUPON"];
+ }
+ }
+ if (!$rule["coupons"]) {
+ continue;
+ }
+ }
+ $rules[(int)$row["ID"]] = $rule;
+ }
+
+ return ["rules" => $rules, "expires" => $expires];
+ }
+
+ private static function parseActions(array $actions): ?array
+ {
+ $rule = ["percent" => 0, "products" => [], "sections" => [], "coupons" => []];
+ foreach ((array)($actions["CHILDREN"] ?? []) as $action) {
+ $data = (array)($action["DATA"] ?? []);
+ if (($action["CLASS_ID"] ?? "") !== "ActSaleBsktGrp" || ($data["Type"] ?? "") !== "Discount" || ($data["Unit"] ?? "") !== "Perc" || ($data["True"] ?? "True") !== "True") {
+ return null;
+ }
+ $conditions = (array)($action["CHILDREN"] ?? []);
+ if (!$conditions || (count($conditions) > 1 && ($data["All"] ?? "") !== "OR")) {
+ return null;
+ }
+ foreach ($conditions as $condition) {
+ $class = (string)($condition["CLASS_ID"] ?? "");
+ if (!in_array($class, ["CondIBElement", "CondIBSection"], true) || ($condition["DATA"]["logic"] ?? "") !== "Equal" || !empty($condition["CHILDREN"])) {
+ return null;
+ }
+ $key = $class === "CondIBElement" ? "products" : "sections";
+ $rule[$key] = array_merge($rule[$key], array_map("intval", (array)($condition["DATA"]["value"] ?? [])));
+ }
+ $rule["percent"] = max($rule["percent"], (int)$data["Value"]);
+ }
+
+ return $rule["percent"] > 0 && ($rule["products"] || $rule["sections"]) ? $rule : null;
+ }
+
+ public static function summary(array $discountIds): array
+ {
+ $rules = array_intersect_key(self::discounts(), array_flip(array_map("intval", $discountIds)));
+ $percents = array_column($rules, "percent");
+ $coupons = array_merge([], ...array_column($rules, "coupons"));
+ $products = array_values(array_unique(array_merge([], ...array_column($rules, "products"))));
+ $sections = array_values(array_unique(array_merge([], ...array_column($rules, "sections"))));
+ $badge = "";
+ if ($percents) {
+ $max = max($percents);
+ $badge = (string)Loc::getMessage(count(array_unique($percents)) > 1 ? "VINO_OFFERS_BADGE_UPTO" : "VINO_OFFERS_BADGE", ["#PERCENT#" => $max]);
+ }
+
+ return [
+ "active" => (bool)$rules,
+ "badge" => $badge,
+ "coupons" => array_values(array_unique($coupons)),
+ "products" => $products,
+ "sections" => $sections,
+ ];
+ }
+
+ public static function automatic(): array
+ {
+ $products = [];
+ $sections = [];
+ foreach (self::discounts() as $rule) {
+ if (!$rule["coupons"]) {
+ $products = array_merge($products, $rule["products"]);
+ $sections = array_merge($sections, $rule["sections"]);
+ }
+ }
+
+ return ["products" => array_values(array_unique($products)), "sections" => array_values(array_unique($sections))];
+ }
+
+ public static function wineParams(array $products, array $sections, string $baseLink, string $listId): array
+ {
+ $filter = [];
+ if ($products && $sections) {
+ $filter[] = ["LOGIC" => "OR", ["ID" => $products], ["SECTION_ID" => $sections, "INCLUDE_SUBSECTIONS" => "Y"]];
+ } elseif ($products) {
+ $filter["ID"] = $products;
+ } elseif ($sections) {
+ $filter["SECTION_ID"] = $sections;
+ $filter["INCLUDE_SUBSECTIONS"] = "Y";
+ } else {
+ $filter["ID"] = [0];
+ }
+ $GLOBALS[self::FILTER] = $filter;
+ $catalog = Listing::catalogParams();
+
+ return [
+ "IBLOCK_TYPE" => $catalog["IBLOCK_TYPE"],
+ "IBLOCK_ID" => $catalog["IBLOCK_ID"],
+ "SECTION_ID" => 0,
+ "SHOW_ALL_WO_SECTION" => "Y",
+ "FILTER_NAME" => self::FILTER,
+ "PRICE_CODE" => $catalog["PRICE_CODE"],
+ "BASKET_URL" => $catalog["BASKET_URL"],
+ "PAGE_ELEMENT_COUNT" => "12",
+ "LINE_ELEMENT_COUNT" => "3",
+ "INCLUDE_SUBSECTIONS" => "Y",
+ "ELEMENT_SORT_FIELD" => "SORT",
+ "ELEMENT_SORT_ORDER" => "ASC",
+ "ELEMENT_SORT_FIELD2" => "ID",
+ "ELEMENT_SORT_ORDER2" => "DESC",
+ "PROPERTY_CODE" => $catalog["LIST_PROPERTY_CODE"],
+ "CACHE_TYPE" => $catalog["CACHE_TYPE"],
+ "CACHE_TIME" => $catalog["CACHE_TIME"],
+ "CACHE_GROUPS" => $catalog["CACHE_GROUPS"],
+ "CACHE_FILTER" => "Y",
+ "SET_TITLE" => "N",
+ "SET_BROWSER_TITLE" => "N",
+ "SET_META_KEYWORDS" => "N",
+ "SET_META_DESCRIPTION" => "N",
+ "SET_STATUS_404" => "N",
+ "SHOW_404" => "N",
+ "ADD_SECTIONS_CHAIN" => "N",
+ "ACTION_VARIABLE" => $catalog["ACTION_VARIABLE"],
+ "PRODUCT_ID_VARIABLE" => $catalog["PRODUCT_ID_VARIABLE"],
+ "USE_PRODUCT_QUANTITY" => "Y",
+ "ADD_TO_BASKET_ACTION" => "ADD",
+ "SHOW_OLD_PRICE" => "Y",
+ "SHOW_DISCOUNT_PERCENT" => "Y",
+ "DISPLAY_TOP_PAGER" => "N",
+ "DISPLAY_BOTTOM_PAGER" => "Y",
+ "PAGER_TEMPLATE" => "vinoteca",
+ "PAGER_SHOW_ALWAYS" => "N",
+ "PAGER_TITLE" => (string)Loc::getMessage("VINO_OFFERS_PAGER_TITLE"),
+ "PAGER_BASE_LINK_ENABLE" => "Y",
+ "PAGER_BASE_LINK" => $baseLink,
+ "SECTION_URL" => $catalog["SEF_FOLDER"] . $catalog["SEF_URL_TEMPLATES"]["section"],
+ "DETAIL_URL" => $catalog["SEF_FOLDER"] . $catalog["SEF_URL_TEMPLATES"]["element"],
+ "HIDE_NOT_AVAILABLE" => "N",
+ "VINO_TITLE_TAG" => "h3",
+ "VINO_GRID_FULL" => "Y",
+ "VINO_LIST_ID" => VINO_HOST . $listId . "#items",
+ ];
+ }
+
+ public static function card(array $item): array
+ {
+ $item = News::card($item, [480, 800, 1200]);
+ $ids = array_map("intval", (array)($item["PROPERTIES"]["DISCOUNT_ID"]["VALUE"] ?? []));
+ $item["VINO_OFFER"] = self::summary($ids);
+ Application::getInstance()->getTaggedCache()->registerTag(self::CACHE_TAG);
+ $until = (string)($item["DATE_ACTIVE_TO"] ?? $item["ACTIVE_TO"] ?? "");
+ $item["VINO_UNTIL"] = $until !== "" ? (string)Loc::getMessage("VINO_OFFERS_UNTIL", ["#DATE#" => DateFormat::long(DateTime::createFromUserTime($until)->getTimestamp(), LANGUAGE_ID)]) : (string)Loc::getMessage("VINO_OFFERS_ALWAYS");
+
+ return $item;
+ }
+
+ public static function listParams(): array
+ {
+ return [
+ "IBLOCK_TYPE" => "content",
+ "IBLOCK_ID" => self::iblockId(),
+ "NEWS_COUNT" => "20",
+ "SORT_BY1" => "SORT",
+ "SORT_ORDER1" => "ASC",
+ "SORT_BY2" => "ACTIVE_FROM",
+ "SORT_ORDER2" => "DESC",
+ "FIELD_CODE" => ["PREVIEW_PICTURE", "PREVIEW_TEXT", "ACTIVE_FROM", "DATE_ACTIVE_TO"],
+ "PROPERTY_CODE" => ["DISCOUNT_ID", "NAME_EN", "NAME_PL", "PREVIEW_TEXT_EN", "PREVIEW_TEXT_PL"],
+ "DETAIL_URL" => self::folder() . "#ELEMENT_CODE#/",
+ "CHECK_DATES" => "Y",
+ "CACHE_TYPE" => "A",
+ "CACHE_TIME" => "3600",
+ "CACHE_GROUPS" => "N",
+ "SET_TITLE" => "N",
+ "SET_BROWSER_TITLE" => "N",
+ "SET_META_KEYWORDS" => "N",
+ "SET_META_DESCRIPTION" => "N",
+ "SET_LAST_MODIFIED" => "N",
+ "SET_STATUS_404" => "N",
+ "SHOW_404" => "N",
+ "INCLUDE_IBLOCK_INTO_CHAIN" => "N",
+ "ADD_SECTIONS_CHAIN" => "N",
+ "DISPLAY_TOP_PAGER" => "N",
+ "DISPLAY_BOTTOM_PAGER" => "N",
+ ];
+ }
+
+ public static function discountIdsOf(int $elementId): array
+ {
+ $iblockId = self::iblockId();
+ if ($elementId <= 0 || $iblockId <= 0 || !Loader::includeModule("iblock")) {
+ return [];
+ }
+ return (array)Cached::remember(self::CACHE_DIR, "discount_ids_" . $elementId, 86400, ["iblock_id_" . $iblockId], static function () use ($iblockId, $elementId): array {
+ $ids = [];
+ $element = Iblock::wakeUp($iblockId)->getEntityDataClass()::getByPrimary($elementId, ["select" => ["ID", "DISCOUNT_ID"]])->fetchObject();
+ if ($element) {
+ foreach ($element->getDiscountId()->getAll() as $value) {
+ if ((int)$value->getValue() > 0) {
+ $ids[] = (int)$value->getValue();
+ }
+ }
+ }
+
+ return $ids;
+ });
+ }
+
+ public static function refresh(): void
+ {
+ self::discounts();
+ }
+
+ public static function canonical(string $path): void
+ {
+ $navNum = (int)($GLOBALS["NavNum"] ?? 0);
+ $page = $navNum > 0 ? Application::getInstance()->getContext()->getRequest()->getQuery("PAGEN_" . $navNum) : null;
+ if ($page !== null && (int)$page > 1) {
+ $GLOBALS["APPLICATION"]->SetPageProperty("vino_canonical", $path . "?PAGEN_" . $navNum . "=" . (int)$page);
+ }
+ }
+
+ public static function clearCache(): void
+ {
+ Application::getInstance()->getTaggedCache()->clearByTag(self::CACHE_TAG);
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/offerschema.php b/local/modules/jinove.vinoteca/lib/offerschema.php
new file mode 100644
index 0000000..229de5f
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/offerschema.php
@@ -0,0 +1,89 @@
+ $item) {
+ $list[] = ["@type" => "ListItem", "position" => $index + 1, "url" => $item["url"], "name" => $item["name"]];
+ }
+
+ return [
+ "@context" => self::CONTEXT,
+ "@graph" => [
+ [
+ "@type" => "CollectionPage",
+ "@id" => $url . "#webpage",
+ "url" => $url,
+ "name" => $name,
+ "description" => $description,
+ "inLanguage" => LANGUAGE_ID,
+ "about" => ["@id" => Config::host() . "/#store"],
+ "mainEntity" => ["@id" => $url . "#offers"],
+ "workTranslation" => PageSchema::translations($path, "CollectionPage"),
+ ],
+ [
+ "@type" => "ItemList",
+ "@id" => $url . "#offers",
+ "url" => $url,
+ "numberOfItems" => count($list),
+ "itemListElement" => $list,
+ ],
+ ],
+ ];
+ }
+
+ public static function detail(array $offer): array
+ {
+ $url = Config::host() . $offer["path"];
+ $store = ["@id" => Config::host() . "/#store"];
+ $event = [
+ "@type" => "SaleEvent",
+ "@id" => $url . "#event",
+ "url" => $url,
+ "name" => $offer["name"],
+ "description" => $offer["description"],
+ "inLanguage" => LANGUAGE_ID,
+ "eventStatus" => "https://schema.org/EventScheduled",
+ "eventAttendanceMode" => "https://schema.org/MixedEventAttendanceMode",
+ "location" => $store,
+ "organizer" => $store,
+ ];
+ foreach (["startDate" => "start", "endDate" => "end"] as $property => $key) {
+ if ($offer[$key] !== "") {
+ $event[$property] = $offer[$key];
+ }
+ }
+ $page = [
+ "@type" => "WebPage",
+ "@id" => $url . "#webpage",
+ "url" => $url,
+ "name" => $offer["name"],
+ "description" => $offer["description"],
+ "inLanguage" => LANGUAGE_ID,
+ "mainEntity" => ["@id" => $url . "#event"],
+ "workTranslation" => PageSchema::translations($offer["path"], "WebPage"),
+ ];
+ if ($offer["image"]) {
+ $event["image"] = PageSchema::image($url . "#image", $offer["image"]["url"], $offer["image"]["width"], $offer["image"]["height"]);
+ $page["primaryImageOfPage"] = ["@id" => $url . "#image"];
+ }
+
+ return ["@context" => self::CONTEXT, "@graph" => [$page, $event]];
+ }
+
+ public static function date(string $value): string
+ {
+ return $value !== "" ? date(DATE_ATOM, DateTime::createFromUserTime($value)->getTimestamp()) : "";
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/origin.php b/local/modules/jinove.vinoteca/lib/origin.php
new file mode 100644
index 0000000..feaa0a5
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/origin.php
@@ -0,0 +1,17 @@
+getHeader("Origin") ?? "");
+
+ return $origin === "" || $origin === Config::host();
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/pageschema.php b/local/modules/jinove.vinoteca/lib/pageschema.php
new file mode 100644
index 0000000..0fcfd3c
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/pageschema.php
@@ -0,0 +1,70 @@
+ $settings) {
+ if ($language === LANGUAGE_ID) {
+ continue;
+ }
+ $url = Config::host() . rtrim((string)$settings["dir"], "/") . $relative;
+ $nodes[] = ["@type" => $pageType, "@id" => $url . "#webpage", "url" => $url, "inLanguage" => $language];
+ }
+
+ return $nodes;
+ }
+
+ public static function legalPage(string $path, string $name, string $description, string $modified): array
+ {
+ $url = Config::host() . $path;
+
+ return [
+ "@context" => "https://schema.org",
+ "@type" => "WebPage",
+ "@id" => $url . "#webpage",
+ "url" => $url,
+ "name" => $name,
+ "description" => $description,
+ "inLanguage" => LANGUAGE_ID,
+ "dateModified" => $modified,
+ "workTranslation" => self::translations($path, "WebPage"),
+ ];
+ }
+
+ public static function aboutPage(string $path, string $name, string $description, array $image): array
+ {
+ $url = Config::host() . $path;
+
+ return [
+ "@context" => "https://schema.org",
+ "@type" => "AboutPage",
+ "@id" => $url . "#webpage",
+ "url" => $url,
+ "name" => $name,
+ "description" => $description,
+ "inLanguage" => LANGUAGE_ID,
+ "mainEntity" => ["@id" => Config::host() . "/#store"],
+ "primaryImageOfPage" => $image,
+ "workTranslation" => self::translations($path, "AboutPage"),
+ ];
+ }
+
+ public static function image(string $id, string $url, int $width, int $height): array
+ {
+ return [
+ "@type" => "ImageObject",
+ "@id" => $id,
+ "url" => $url,
+ "contentUrl" => $url,
+ "width" => ["@type" => "QuantitativeValue", "value" => $width, "unitCode" => "E37"],
+ "height" => ["@type" => "QuantitativeValue", "value" => $height, "unitCode" => "E37"],
+ ];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/personal/orders.php b/local/modules/jinove.vinoteca/lib/personal/orders.php
new file mode 100644
index 0000000..848ba67
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/personal/orders.php
@@ -0,0 +1,73 @@
+ [], "more" => false];
+ }
+ $statuses = OrderStatus::getAllStatusesNames(LANGUAGE_ID);
+ $filter = $completed
+ ? ["=USER_ID" => $userId, ["LOGIC" => "OR", ["=STATUS_ID" => self::FINAL_STATUS], ["=CANCELED" => "Y"]]]
+ : ["=USER_ID" => $userId, "!=STATUS_ID" => self::FINAL_STATUS, "=CANCELED" => "N"];
+ $orders = [];
+ $rows = Order::getList([
+ "select" => ["ID", "ACCOUNT_NUMBER", "DATE_INSERT", "STATUS_ID", "PRICE", "CURRENCY", "CANCELED"],
+ "filter" => $filter,
+ "order" => ["ID" => "DESC"],
+ "limit" => self::PER_PAGE + 1,
+ "offset" => (max(1, $page) - 1) * self::PER_PAGE,
+ ]);
+ while ($row = $rows->fetch()) {
+ $orders[(int)$row["ID"]] = [
+ "number" => (string)$row["ACCOUNT_NUMBER"],
+ "date" => $row["DATE_INSERT"]->getTimestamp(),
+ "statusId" => (string)$row["STATUS_ID"],
+ "status" => $row["CANCELED"] === "Y" ? "" : (string)($statuses[$row["STATUS_ID"]] ?? ""),
+ "canceled" => $row["CANCELED"] === "Y",
+ "total" => Money::format((float)$row["PRICE"], (string)$row["CURRENCY"]),
+ "items" => [],
+ ];
+ }
+ $more = count($orders) > self::PER_PAGE;
+ $orders = array_slice($orders, 0, self::PER_PAGE, true);
+ if (!$orders) {
+ return ["orders" => [], "more" => false];
+ }
+ $lines = BasketTable::getList([
+ "select" => ["ORDER_ID", "PRODUCT_ID", "NAME", "QUANTITY", "PRICE", "CURRENCY"],
+ "filter" => ["@ORDER_ID" => array_keys($orders)],
+ "order" => ["ID" => "ASC"],
+ ])->fetchAll();
+ $productIds = array_map(static fn(array $line): int => (int)$line["PRODUCT_ID"], $lines);
+ $images = Media::thumbs($productIds, 120, 120);
+ $products = Related::summariesById($productIds);
+ foreach ($lines as $line) {
+ $orders[(int)$line["ORDER_ID"]]["items"][] = [
+ "name" => (string)$line["NAME"],
+ "url" => (string)($products[(int)$line["PRODUCT_ID"]]["url"] ?? ""),
+ "quantity" => (float)$line["QUANTITY"],
+ "price" => Money::format((float)$line["PRICE"], (string)$line["CURRENCY"]),
+ "image" => $images[(int)$line["PRODUCT_ID"]] ?? "",
+ ];
+ }
+
+ return ["orders" => array_values($orders), "more" => $more];
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/personal/reviews.php b/local/modules/jinove.vinoteca/lib/personal/reviews.php
new file mode 100644
index 0000000..3068f5f
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/personal/reviews.php
@@ -0,0 +1,51 @@
+getEntityDataClass();
+ if ($table === null) {
+ return [];
+ }
+ $rows = $table::getList([
+ "select" => ["ID", "ACTIVE", "PREVIEW_TEXT", "ACTIVE_FROM", "DATE_CREATE", "PRODUCT_" => "PRODUCT", "RATING_" => "RATING"],
+ "filter" => ["=USER_ID.VALUE" => $userId],
+ "order" => ["ACTIVE_FROM" => "DESC", "ID" => "DESC"],
+ "limit" => self::LIMIT,
+ ])->fetchAll();
+ $items = [];
+ foreach ($rows as $row) {
+ $date = $row["ACTIVE_FROM"] ?: $row["DATE_CREATE"];
+ $items[] = [
+ "product" => (int)$row["PRODUCT_VALUE"],
+ "rating" => max(0, min(5, (int)$row["RATING_VALUE"])),
+ "text" => trim((string)preg_replace('/\s+/u', " ", strip_tags((string)$row["PREVIEW_TEXT"]))),
+ "date" => $date instanceof \Bitrix\Main\Type\DateTime ? $date->getTimestamp() : 0,
+ "published" => $row["ACTIVE"] === "Y",
+ ];
+ }
+ $products = Related::summariesById(array_column($items, "product"));
+ foreach ($items as $key => $item) {
+ $items[$key]["name"] = $products[$item["product"]]["name"] ?? "";
+ $items[$key]["url"] = $products[$item["product"]]["url"] ?? "";
+ }
+
+ return $items;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/phone.php b/local/modules/jinove.vinoteca/lib/phone.php
new file mode 100644
index 0000000..9f43600
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/phone.php
@@ -0,0 +1,21 @@
+ "/", "ru" => "/ru/", "pl" => "/pl/"];
+
+ public static function safe(string $back): string
+ {
+ $path = (string)parse_url($back, PHP_URL_PATH);
+ if (
+ $path === ""
+ || preg_match('/[\x00-\x1f\x7f\\\\]/', $back)
+ || strlen($back) > 300
+ || $path[0] !== "/"
+ || str_starts_with($path, "//")
+ || preg_match('#(^|/)\.\.?(/|$)#', $path)
+ || preg_match('#^(/(ru|pl))?/(bitrix|upload|local|login|register|forgot-password|reset-password)(/|$)#', $path)
+ ) {
+ return "";
+ }
+ $query = (string)parse_url($back, PHP_URL_QUERY);
+
+ return $path . ($query !== "" ? "?" . $query : "");
+ }
+
+ public static function language(string $language): string
+ {
+ return isset(self::HOMES[$language]) ? $language : "en";
+ }
+
+ public static function home(string $language): string
+ {
+ return self::HOMES[self::language($language)];
+ }
+
+ public static function back(string $back, string $language): string
+ {
+ $safe = self::safe($back);
+
+ return $safe !== "" ? $safe : self::home($language);
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/retention.php b/local/modules/jinove.vinoteca/lib/retention.php
new file mode 100644
index 0000000..1b02faa
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/retention.php
@@ -0,0 +1,38 @@
+ ["ID"], "filter" => ["=CODE" => self::QUESTIONS_CODE]]);
+ if ($iblock !== null) {
+ $before = new DateTime();
+ $before->add("-" . self::MONTHS . " months");
+ $rows = ElementTable::getList([
+ "select" => ["ID"],
+ "filter" => ["=IBLOCK_ID" => (int)$iblock["ID"], " $before],
+ "limit" => self::BATCH,
+ ]);
+ while ($row = $rows->fetch()) {
+ \CIBlockElement::Delete((int)$row["ID"]);
+ }
+ }
+ }
+
+ return __METHOD__ . "();";
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/routing.php b/local/modules/jinove.vinoteca/lib/routing.php
new file mode 100644
index 0000000..d0f92c7
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/routing.php
@@ -0,0 +1,36 @@
+ "articles"];
+
+ public static function onPageStart(): void
+ {
+ if (defined("ADMIN_SECTION") || PHP_SAPI === "cli" || !in_array($_SERVER["REQUEST_METHOD"] ?? "", ["GET", "HEAD"], true)) {
+ return;
+ }
+ $uri = (string)($_SERVER["REQUEST_URI"] ?? "");
+ $path = (string)parse_url($uri, PHP_URL_PATH);
+ $query = (string)parse_url($uri, PHP_URL_QUERY);
+ if ($path === "" || preg_match('#^/(bitrix|upload|local|include)/#', $path)) {
+ return;
+ }
+ if (str_contains(basename($path), ".")) {
+ return;
+ }
+ $target = str_contains($path, "%") ? $path : mb_strtolower($path);
+ if (preg_match('#^(/(?:ru|pl))?/(' . implode("|", array_keys(self::MOVED)) . ')(/.*)?$#', $target, $match)) {
+ $target = $match[1] . "/" . self::MOVED[$match[2]] . ($match[3] ?? "/");
+ }
+ if (!str_ends_with($target, "/")) {
+ $target .= "/";
+ }
+ if ($target !== $path) {
+ LocalRedirect(Config::host() . $target . ($query !== "" ? "?" . $query : ""), true, "301 Moved permanently");
+ }
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/search.php b/local/modules/jinove.vinoteca/lib/search.php
new file mode 100644
index 0000000..a6b5671
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/search.php
@@ -0,0 +1,320 @@
+Fetch()) {
+ $code = (string)$property["CODE"];
+ if (preg_match('/_(EN|PL)$/', $code)) {
+ $value = is_array($property["VALUE"]) ? (string)($property["VALUE"]["TEXT"] ?? "") : (string)$property["VALUE"];
+ $words[] = strip_tags($value);
+ if (str_starts_with($code, "NAME_")) {
+ $titles[] = $value;
+ }
+ } elseif (in_array($code, self::ENUMS, true) && (string)$property["VALUE_XML_ID"] !== "") {
+ $names = [];
+ foreach (self::LANGUAGES as $language) {
+ $names[] = EnumNames::name($code, (string)$property["VALUE_XML_ID"], "", $language);
+ }
+ $words = array_merge($words, $names);
+ if (in_array($code, self::TITLE_ENUMS, true)) {
+ $titles = array_merge($titles, $names, [(string)$property["VALUE_ENUM"]]);
+ }
+ }
+ }
+ $words = array_filter(array_map("trim", $words));
+ if ($words) {
+ $fields["BODY"] = trim((string)($fields["BODY"] ?? "") . " " . implode(" ", array_unique($words)));
+ }
+ $titles = array_diff(array_unique(array_filter(array_map("trim", $titles))), [trim((string)($fields["TITLE"] ?? ""))]);
+ if ($titles) {
+ $fields["TITLE"] = trim((string)($fields["TITLE"] ?? "") . " " . implode(" ", $titles));
+ }
+
+ return $fields;
+ }
+
+ public static function folder(): string
+ {
+ return SITE_DIR . "search/";
+ }
+
+ public static function preparePage(): void
+ {
+ global $APPLICATION;
+ $query = trim((string)Context::getCurrent()->getRequest()->getQuery("q"));
+ $APPLICATION->SetTitle((string)Loc::getMessage("VINO_SEARCH_PAGE_H1"));
+ $APPLICATION->SetPageProperty("title", $query !== "" ? (string)Loc::getMessage("VINO_SEARCH_PAGE_TITLE_QUERY", ["#QUERY#" => htmlspecialcharsbx(mb_substr($query, 0, 60))]) : (string)Loc::getMessage("VINO_SEARCH_PAGE_H1"));
+ $APPLICATION->SetPageProperty("robots", "noindex, follow");
+ $APPLICATION->SetPageProperty("vino_alternates", "N");
+ }
+
+ public static function titleParams(): array
+ {
+ $kinds = self::kinds();
+ $params = [
+ "NUM_CATEGORIES" => "3",
+ "TOP_COUNT" => "6",
+ "ORDER" => "rank",
+ "USE_LANGUAGE_GUESS" => "N",
+ "CHECK_DATES" => "Y",
+ "SHOW_OTHERS" => "N",
+ "SHOW_INPUT" => "Y",
+ "PAGE" => "#SITE_DIR#search/",
+ "INPUT_ID" => self::INPUT_ID,
+ "CONTAINER_ID" => "vino-search-field",
+ ];
+ $groups = [["wine"], ["brand"], ["article", "offer"]];
+ foreach ($groups as $index => $group) {
+ $types = [];
+ foreach ($group as $kind) {
+ $types[self::iblockType($kind)][] = (string)$kinds[$kind];
+ }
+ $params["CATEGORY_" . $index] = array_map(static fn(string $type): string => "iblock_" . $type, array_keys($types));
+ foreach ($types as $type => $ids) {
+ $params["CATEGORY_" . $index . "_iblock_" . $type] = $ids;
+ }
+ }
+
+ return $params;
+ }
+
+ public static function pageParams(): array
+ {
+ $params = [
+ "RESTART" => "Y",
+ "NO_WORD_LOGIC" => "N",
+ "CHECK_DATES" => "Y",
+ "USE_TITLE_RANK" => "Y",
+ "DEFAULT_SORT" => "rank",
+ "FILTER_NAME" => "",
+ "SHOW_WHERE" => "N",
+ "SHOW_WHEN" => "N",
+ "PAGE_RESULT_COUNT" => "12",
+ "AJAX_MODE" => "N",
+ "CACHE_TYPE" => "A",
+ "CACHE_TIME" => "3600",
+ "DISPLAY_TOP_PAGER" => "N",
+ "DISPLAY_BOTTOM_PAGER" => "Y",
+ "PAGER_TITLE" => (string)Loc::getMessage("VINO_SEARCH_PAGER_TITLE"),
+ "PAGER_SHOW_ALWAYS" => "N",
+ "PAGER_TEMPLATE" => "vinoteca",
+ "USE_LANGUAGE_GUESS" => "N",
+ "USE_SUGGEST" => "N",
+ "arrFILTER" => ["main"],
+ "arrFILTER_main" => [SITE_DIR . "about/", SITE_DIR . "privacy/", SITE_DIR . "consent/"],
+ ];
+ foreach (self::kinds() as $kind => $iblockId) {
+ $type = self::iblockType($kind);
+ if (!in_array("iblock_" . $type, $params["arrFILTER"], true)) {
+ $params["arrFILTER"][] = "iblock_" . $type;
+ }
+ $params["arrFILTER_iblock_" . $type][] = (string)$iblockId;
+ }
+
+ return $params;
+ }
+
+ public static function suggest(array $categories): array
+ {
+ $hits = [];
+ foreach ($categories as $code => $category) {
+ if ($code === "all") {
+ continue;
+ }
+ foreach ((array)($category["ITEMS"] ?? []) as $item) {
+ if (($item["MODULE_ID"] ?? "") !== "") {
+ $hits[] = $item;
+ }
+ }
+ }
+
+ return self::describe($hits);
+ }
+
+ public static function describe(array $hits): array
+ {
+ $keys = [];
+ foreach ($hits as $index => $hit) {
+ $hits[$index]["URL"] = rtrim((string)preg_replace('/([?&])sphrase_id=[^&]*&?/', '$1', (string)($hit["URL"] ?? "")), "?&");
+ $keys[] = [$hit["MODULE_ID"] ?? "", $hit["PARAM2"] ?? "", $hit["ITEM_ID"] ?? "", $hits[$index]["URL"], $hit["TITLE"] ?? "", $hit["BODY"] ?? ""];
+ }
+ return (array)Cached::remember(self::CACHE_DIR, "describe_" . SITE_ID . "_" . md5(serialize($keys)), 3600, array_merge(array_map(static fn(int $iblockId): string => "iblock_id_" . $iblockId, self::kinds()), [Offers::CACHE_TAG]), static fn(): array => self::build($hits));
+ }
+
+ private static function build(array $hits): array
+ {
+ $kindsById = array_flip(self::kinds());
+ $elementIds = [];
+ $sectionIds = [];
+ foreach ($hits as $hit) {
+ if (($hit["MODULE_ID"] ?? "") !== "iblock") {
+ continue;
+ }
+ $itemId = (string)($hit["ITEM_ID"] ?? "");
+ if (ctype_digit($itemId) && isset($kindsById[(int)($hit["PARAM2"] ?? 0)])) {
+ $elementIds[] = (int)$itemId;
+ } elseif (preg_match('/^S(\d+)$/', $itemId, $match)) {
+ $sectionIds[] = (int)$match[1];
+ }
+ }
+ $elements = self::elements($elementIds);
+ $wineIds = array_keys(array_filter($elements, static fn(array $element): bool => $element["kind"] === "wine"));
+ $wines = Related::summariesById($wineIds);
+ $meta = SearchMeta::get($wineIds);
+ $prices = Prices::optimal($wineIds);
+ $sections = [];
+ if ($sectionIds) {
+ foreach (Sections::all() as $code => $section) {
+ if (in_array($section["ID"], $sectionIds, true)) {
+ $sections[$section["ID"]] = ["name" => (string)$section["NAME"], "url" => SITE_DIR . "catalog/" . $code . "/", "text" => (string)$section["DESCRIPTION"]];
+ }
+ }
+ }
+ $items = [];
+ foreach ($hits as $hit) {
+ $itemId = (string)($hit["ITEM_ID"] ?? "");
+ if (($hit["MODULE_ID"] ?? "") === "main") {
+ $items[] = self::item("page", (string)$hit["TITLE"], (string)$hit["URL"], self::snippet((string)($hit["BODY"] ?? "")));
+ continue;
+ }
+ if (preg_match('/^S(\d+)$/', $itemId, $match)) {
+ $section = $sections[(int)$match[1]] ?? null;
+ if ($section) {
+ $items[] = self::item("section", $section["name"], $section["url"], self::snippet($section["text"]));
+ }
+ continue;
+ }
+ $element = $elements[(int)$itemId] ?? null;
+ if ($element === null) {
+ continue;
+ }
+ if ($element["kind"] === "wine") {
+ $wine = $wines[(int)$itemId] ?? null;
+ if ($wine === null) {
+ continue;
+ }
+ $item = self::item("wine", (string)$wine["name"], (string)$wine["url"], (string)($meta[(int)$itemId]["META"] ?? ""));
+ $price = $prices[(int)$itemId] ?? null;
+ $item["price"] = $price ? Money::format((float)$price["price"], (string)$price["currency"]) : "";
+ } else {
+ $item = self::item($element["kind"], $element["name"], (string)$hit["URL"], self::snippet($element["text"]));
+ }
+ $item["image"] = $element["image"];
+ $items[] = $item;
+ }
+
+ return $items;
+ }
+
+ private static function item(string $kind, string $name, string $url, string $text): array
+ {
+ return [
+ "kind" => $kind,
+ "label" => (string)Loc::getMessage("VINO_SEARCH_KIND_" . strtoupper($kind)),
+ "name" => $name,
+ "url" => $url,
+ "meta" => $text,
+ "image" => "",
+ "price" => "",
+ ];
+ }
+
+ private static function elements(array $ids): array
+ {
+ if (!$ids || !Loader::includeModule("iblock")) {
+ return [];
+ }
+ $kindsById = array_flip(self::kinds());
+ $found = [];
+ $rows = \CIBlockElement::GetList([], ["ID" => array_values(array_unique($ids))], false, false, ["ID", "IBLOCK_ID", "NAME", "PREVIEW_TEXT", "PREVIEW_PICTURE", "DETAIL_PICTURE"]);
+ while ($row = $rows->GetNextElement()) {
+ $element = $row->GetFields();
+ $element["PROPERTIES"] = $row->GetProperties();
+ $kind = $kindsById[(int)$element["IBLOCK_ID"]] ?? "";
+ $found[(int)$element["ID"]] = [
+ "kind" => $kind,
+ "name" => LocalizedText::field($element, "NAME"),
+ "text" => LocalizedText::field($element, "PREVIEW_TEXT"),
+ "image" => self::thumb((int)($element["PREVIEW_PICTURE"] ?: $element["DETAIL_PICTURE"])),
+ ];
+ }
+
+ return $found;
+ }
+
+ private static function thumb(int $fileId): string
+ {
+ if ($fileId <= 0) {
+ return "";
+ }
+ $file = \CFile::ResizeImageGet($fileId, ["width" => self::THUMB_WIDTH, "height" => self::THUMB_HEIGHT], BX_RESIZE_IMAGE_EXACT, false);
+
+ return (string)($file["src"] ?? "");
+ }
+
+ private static function snippet(string $text): string
+ {
+ $text = trim((string)preg_replace('/\s+/u', " ", strip_tags(str_replace([" ", " ", " "], " ", $text))));
+ if (mb_strlen($text) <= self::SNIPPET_LENGTH) {
+ return $text;
+ }
+ $cut = mb_substr($text, 0, self::SNIPPET_LENGTH);
+ $space = mb_strrpos($cut, " ");
+
+ return rtrim(mb_substr($cut, 0, $space ?: self::SNIPPET_LENGTH), " ,.;:") . "…";
+ }
+
+ private static function kinds(): array
+ {
+ return [
+ "wine" => Config::iblockId("catalog"),
+ "brand" => Config::iblockId("brands"),
+ "article" => Config::iblockId("news"),
+ "offer" => Config::iblockId("offers"),
+ ];
+ }
+
+ private static function iblockType(string $kind): string
+ {
+ $iblock = Loader::includeModule("iblock") ? \CIBlock::GetArrayByID(self::kinds()[$kind]) : false;
+
+ return is_array($iblock) ? (string)$iblock["IBLOCK_TYPE_ID"] : "";
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/seo.php b/local/modules/jinove.vinoteca/lib/seo.php
new file mode 100644
index 0000000..240e360
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/seo.php
@@ -0,0 +1,122 @@
+GetCurPage(false);
+ if (substr($path, -9) === "index.php") {
+ $path = substr($path, 0, -9);
+ }
+
+ return $path === "" ? "/" : $path;
+ }
+
+ public static function description(string $text, int $limit = 155): string
+ {
+ $text = trim((string)preg_replace('/\s+/u', " ", $text));
+ if (mb_strlen($text) <= $limit) {
+ return $text;
+ }
+ $cut = mb_substr($text, 0, $limit + 1);
+ $sentence = max((int)mb_strrpos($cut, ". "), (int)mb_strrpos($cut, "! "), (int)mb_strrpos($cut, "? "));
+ if ($sentence >= 60) {
+ return mb_substr($cut, 0, $sentence + 1);
+ }
+ $space = (int)mb_strrpos($cut, " ");
+
+ return rtrim(mb_substr($cut, 0, $space > 0 ? $space : $limit), " ,;:-");
+ }
+
+ public static function fitTitle(array $candidates, int $limit = 60): string
+ {
+ foreach ($candidates as $candidate) {
+ if (mb_strlen($candidate) <= $limit) {
+ return $candidate;
+ }
+ }
+
+ return (string)end($candidates);
+ }
+
+ public static function fitDescription(string $base, array $tails, int $min = 120, int $max = 160): string
+ {
+ $base = trim($base);
+ if (mb_strlen($base) >= $min) {
+ return $base;
+ }
+ foreach ($tails as $tail) {
+ $candidate = $base . " " . $tail;
+ if (mb_strlen($candidate) >= $min && mb_strlen($candidate) <= $max) {
+ return $candidate;
+ }
+ }
+
+ return $base;
+ }
+
+ public static function openGraph(string $canonical): string
+ {
+ global $APPLICATION;
+ if ((string)$APPLICATION->GetPageProperty("vino_alternates") === "N") {
+ return "";
+ }
+ $tag = static fn(string $attribute, string $name, string $value): string => ' ' . "\n";
+ $languages = Config::languages();
+ $html = $tag("property", "og:site_name", "Vinoteca") . $tag("property", "og:locale", (string)$languages[LANGUAGE_ID]["locale"]);
+ foreach ($languages as $code => $language) {
+ if ($code !== LANGUAGE_ID) {
+ $html .= $tag("property", "og:locale:alternate", (string)$language["locale"]);
+ }
+ }
+ $image = (string)$APPLICATION->GetProperty("og_image");
+
+ return $html
+ . $tag("property", "og:type", (string)$APPLICATION->GetProperty("og_type") ?: "website")
+ . $tag("property", "og:url", Config::host() . self::canonicalPath($canonical))
+ . $tag("property", "og:title", (string)$APPLICATION->GetTitle(false))
+ . $tag("property", "og:description", (string)$APPLICATION->GetProperty("description"))
+ . $tag("property", "og:image", $image !== "" ? $image : Config::host() . SITE_TEMPLATE_PATH . "/assets/media/og-home.jpg")
+ . $tag("name", "twitter:card", "summary_large_image");
+ }
+
+ public static function canonicalPath(string $default): string
+ {
+ global $APPLICATION;
+ $path = (string)$APPLICATION->GetPageProperty("vino_canonical");
+
+ return $path !== "" ? $path : $default;
+ }
+
+ public static function headLinks(string $default, string $host, array $languages, string $defaultLanguage): string
+ {
+ if (defined("ERROR_404") && ERROR_404 === "Y") {
+ return "";
+ }
+ $path = self::canonicalPath($default);
+ $relative = $path;
+ if (SITE_DIR !== "/" && strpos($path, SITE_DIR) === 0) {
+ $relative = "/" . substr($path, strlen(SITE_DIR));
+ }
+ $ready = array_values(array_filter(array_map("trim", explode(",", (string)$GLOBALS["APPLICATION"]->GetPageProperty("vino_langs")))));
+ if ($ready) {
+ $languages = array_intersect_key($languages, array_flip($ready));
+ $defaultLanguage = isset($languages[$defaultLanguage]) ? $defaultLanguage : (string)array_key_first($languages);
+ }
+ $html = ' ' . "\n";
+ if ((string)$GLOBALS["APPLICATION"]->GetPageProperty("vino_alternates") === "N") {
+ return $html;
+ }
+ foreach ($languages as $language => $settings) {
+ $html .= ' ' . "\n";
+ }
+ $html .= ' ' . "\n";
+
+ return $html;
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/sitemap.php b/local/modules/jinove.vinoteca/lib/sitemap.php
new file mode 100644
index 0000000..22f843d
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/sitemap.php
@@ -0,0 +1,164 @@
+' . "\n" . '' . "\n";
+ $count = 0;
+ foreach ($pages as $page) {
+ $alternates = "";
+ foreach ($languages as $code => $language) {
+ $alternates .= ' ' . "\n";
+ }
+ $alternates .= ' ' . "\n";
+ foreach ($languages as $language) {
+ if (++$count > self::LIMIT) {
+ break 2;
+ }
+ $xml .= " \n " . self::escape($host . self::url($language["dir"], $page["path"])) . " \n";
+ if ($page["lastmod"] !== "") {
+ $xml .= " " . $page["lastmod"] . " \n";
+ }
+ $xml .= $alternates . " \n";
+ }
+ }
+
+ return $xml . " \n";
+ }
+
+ private static function pages(): array
+ {
+ $catalogId = Config::iblockId("catalog");
+ $pages = [];
+ if ($catalogId <= 0 || !Loader::includeModule("iblock")) {
+ return $pages;
+ }
+ $sectionCodes = [];
+ foreach (Sections::all() as $code => $section) {
+ $sectionCodes[$section["ID"]] = $code;
+ }
+ $now = new DateTime();
+ $wines = [];
+ $latest = 0;
+ $rows = ElementTable::getList([
+ "select" => ["CODE", "IBLOCK_SECTION_ID", "TIMESTAMP_X"],
+ "filter" => [
+ "=IBLOCK_ID" => $catalogId,
+ "=ACTIVE" => "Y",
+ ["LOGIC" => "OR", ["=ACTIVE_FROM" => false], ["<=ACTIVE_FROM" => $now]],
+ ["LOGIC" => "OR", ["=ACTIVE_TO" => false], [">=ACTIVE_TO" => $now]],
+ ],
+ "order" => ["ID" => "ASC"],
+ ]);
+ while ($row = $rows->fetch()) {
+ $section = $sectionCodes[(int)$row["IBLOCK_SECTION_ID"]] ?? "";
+ if ($section === "" || (string)$row["CODE"] === "") {
+ continue;
+ }
+ $time = $row["TIMESTAMP_X"] instanceof DateTime ? $row["TIMESTAMP_X"]->getTimestamp() : 0;
+ $latest = max($latest, $time);
+ $wines[] = ["path" => "catalog/" . $section . "/" . rawurlencode((string)$row["CODE"]) . "/", "lastmod" => self::date($time)];
+ }
+ $menu = MegaMenu::collect($catalogId, 1000);
+ $lastmod = self::date($latest);
+ $pages[] = ["path" => "", "lastmod" => $lastmod];
+ $pages[] = ["path" => "catalog/", "lastmod" => $lastmod];
+ foreach (["TYPES", "COUNTRIES", "BRANDS"] as $group) {
+ foreach ($menu[$group] as $item) {
+ $pages[] = ["path" => ltrim(self::relative((string)$item["URL"]), "/"), "lastmod" => $lastmod];
+ }
+ }
+ $pages[] = ["path" => "brands/", "lastmod" => $lastmod];
+ $pages[] = ["path" => "about/", "lastmod" => $lastmod];
+ $pages = array_merge($pages, self::section("news", "articles/", $now));
+ $pages = array_merge($pages, self::section("offers", "offers/", $now, static fn(int $id): bool => Offers::summary(Offers::discountIdsOf($id))["active"]));
+ $pages = array_merge($pages, $wines);
+ $pages[] = ["path" => "privacy/", "lastmod" => self::date(Consent::timestamp(Consent::POLICY_VERSION))];
+ $pages[] = ["path" => "consent/", "lastmod" => self::date(Consent::timestamp(Consent::VERSION))];
+
+ return $pages;
+ }
+
+ private static function section(string $iblock, string $folder, DateTime $now, ?callable $keep = null): array
+ {
+ $iblockId = Config::iblockId($iblock);
+ if ($iblockId <= 0) {
+ return [];
+ }
+ $items = [];
+ $latest = 0;
+ $rows = ElementTable::getList([
+ "select" => ["ID", "CODE", "TIMESTAMP_X"],
+ "filter" => [
+ "=IBLOCK_ID" => $iblockId,
+ "=ACTIVE" => "Y",
+ ["LOGIC" => "OR", ["=ACTIVE_FROM" => false], ["<=ACTIVE_FROM" => $now]],
+ ["LOGIC" => "OR", ["=ACTIVE_TO" => false], [">=ACTIVE_TO" => $now]],
+ ],
+ "order" => ["ACTIVE_FROM" => "DESC", "ID" => "DESC"],
+ ]);
+ while ($row = $rows->fetch()) {
+ if ((string)$row["CODE"] === "" || ($keep !== null && !$keep((int)$row["ID"]))) {
+ continue;
+ }
+ $time = $row["TIMESTAMP_X"] instanceof DateTime ? $row["TIMESTAMP_X"]->getTimestamp() : 0;
+ $latest = max($latest, $time);
+ $items[] = ["path" => $folder . rawurlencode((string)$row["CODE"]) . "/", "lastmod" => self::date($time)];
+ }
+ return array_merge([["path" => $folder, "lastmod" => self::date($latest)]], $items);
+ }
+
+ private static function write(string $xml): void
+ {
+ $file = Application::getDocumentRoot() . self::FILE;
+ $temporary = $file . ".tmp";
+ if (file_put_contents($temporary, $xml, LOCK_EX) !== false) {
+ rename($temporary, $file);
+ }
+ }
+
+ private static function relative(string $url): string
+ {
+ return SITE_DIR !== "/" && str_starts_with($url, SITE_DIR) ? "/" . substr($url, strlen(SITE_DIR)) : $url;
+ }
+
+ private static function url(string $directory, string $path): string
+ {
+ return rtrim($directory, "/") . "/" . $path;
+ }
+
+ private static function date(int $timestamp): string
+ {
+ return $timestamp > 0 ? date("Y-m-d", $timestamp) : "";
+ }
+
+ private static function escape(string $value): string
+ {
+ return htmlspecialchars($value, ENT_XML1 | ENT_QUOTES, "UTF-8");
+ }
+}
diff --git a/local/modules/jinove.vinoteca/lib/storeschema.php b/local/modules/jinove.vinoteca/lib/storeschema.php
new file mode 100644
index 0000000..345dd6c
--- /dev/null
+++ b/local/modules/jinove.vinoteca/lib/storeschema.php
@@ -0,0 +1,61 @@
+ "https://schema.org",
+ "@graph" => [
+ [
+ "@type" => "LiquorStore",
+ "@id" => $store,
+ "name" => "Vinoteca",
+ "description" => $description,
+ "url" => $host . SITE_DIR,
+ "logo" => $host . SITE_TEMPLATE_PATH . "/assets/brand/vinoteca-icon-512.png",
+ "image" => $host . SITE_TEMPLATE_PATH . "/assets/media/og-home.jpg",
+ "telephone" => $contacts["phone"],
+ "email" => $contacts["email"],
+ "address" => [
+ "@type" => "PostalAddress",
+ "streetAddress" => $street,
+ "addressLocality" => $city,
+ "addressCountry" => self::COUNTRY,
+ ],
+ "openingHoursSpecification" => [[
+ "@type" => "OpeningHoursSpecification",
+ "dayOfWeek" => array_map(static fn(string $day): string => "https://schema.org/" . $day, self::DAYS),
+ "opens" => self::OPENS,
+ "closes" => self::CLOSES,
+ ]],
+ "currenciesAccepted" => self::CURRENCY,
+ "priceRange" => PriceRange::get(),
+ "sameAs" => [$contacts["telegram"]],
+ ],
+ [
+ "@type" => "WebSite",
+ "@id" => $host . SITE_DIR . "#website",
+ "url" => $host . SITE_DIR,
+ "name" => "Vinoteca",
+ "inLanguage" => LANGUAGE_ID,
+ ],
+ ],
+ ];
+ }
+}
diff --git a/local/php_interface/include/sale_payment/jinove_halyk/.description.php b/local/php_interface/include/sale_payment/jinove_halyk/.description.php
new file mode 100644
index 0000000..c50eb39
--- /dev/null
+++ b/local/php_interface/include/sale_payment/jinove_halyk/.description.php
@@ -0,0 +1,45 @@
+ Loc::getMessage("JINOVE_HALYK_NAME"),
+ "SORT" => 500,
+ "CODES" => [
+ "HALYK_CLIENT_ID" => [
+ "NAME" => Loc::getMessage("JINOVE_HALYK_CLIENT_ID"),
+ "SORT" => 100,
+ "GROUP" => "CONNECT_SETTINGS_HALYK",
+ ],
+ "HALYK_SECRET" => [
+ "NAME" => Loc::getMessage("JINOVE_HALYK_SECRET"),
+ "SORT" => 200,
+ "GROUP" => "CONNECT_SETTINGS_HALYK",
+ ],
+ "HALYK_TERMINAL" => [
+ "NAME" => Loc::getMessage("JINOVE_HALYK_TERMINAL"),
+ "SORT" => 300,
+ "GROUP" => "CONNECT_SETTINGS_HALYK",
+ ],
+ "HALYK_TEST" => [
+ "NAME" => Loc::getMessage("JINOVE_HALYK_TEST"),
+ "SORT" => 400,
+ "GROUP" => "CONNECT_SETTINGS_HALYK",
+ "INPUT" => ["TYPE" => "Y/N"],
+ "DEFAULT" => ["PROVIDER_KEY" => "INPUT", "PROVIDER_VALUE" => "Y"],
+ ],
+ "HALYK_RATE" => [
+ "NAME" => Loc::getMessage("JINOVE_HALYK_RATE"),
+ "DESCRIPTION" => Loc::getMessage("JINOVE_HALYK_RATE_DESC"),
+ "SORT" => 500,
+ "GROUP" => "CONNECT_SETTINGS_HALYK",
+ "DEFAULT" => ["PROVIDER_KEY" => "VALUE", "PROVIDER_VALUE" => "6.5"],
+ ],
+ ],
+];
diff --git a/local/php_interface/include/sale_payment/jinove_halyk/handler.php b/local/php_interface/include/sale_payment/jinove_halyk/handler.php
new file mode 100644
index 0000000..a716c0f
--- /dev/null
+++ b/local/php_interface/include/sale_payment/jinove_halyk/handler.php
@@ -0,0 +1,186 @@
+ "https://test-epay-oauth.epayment.kz/oauth2/token",
+ "status" => "https://test-epay-api.epayment.kz/check-status/payment/transaction/",
+ "script" => "https://test-epay.epayment.kz/payform/payment-api.js",
+ ];
+ private const LIVE = [
+ "oauth" => "https://epay-oauth.homebank.kz/oauth2/token",
+ "status" => "https://epay-api.homebank.kz/check-status/payment/transaction/",
+ "script" => "https://epay.homebank.kz/payform/payment-api.js",
+ ];
+ private const LANGUAGES = ["ru" => "rus", "kz" => "kaz"];
+
+ public function getCurrencyList()
+ {
+ return ["RUB", "KZT"];
+ }
+
+ public function getPaymentIdFromRequest(Request $request)
+ {
+ return (int)$request->get("payment");
+ }
+
+ public function initiatePay(Payment $payment, Request $request = null)
+ {
+ $result = new ServiceResult();
+ $returnUrl = (string)($request ? $request->get("return_url") : "");
+ $cancelUrl = (string)($request ? $request->get("cancel_url") : "");
+ if ($returnUrl === "" || $cancelUrl === "") {
+ $result->addError(new Error("Halyk ePay return addresses are missing"));
+
+ return $result;
+ }
+ $invoice = "7" . str_pad((string)$payment->getId(), 5, "0", STR_PAD_LEFT) . str_pad((string)(time() % 1000000), 6, "0", STR_PAD_LEFT);
+ $amount = $this->amount($payment);
+ if ($amount === null) {
+ $result->addError(new Error("Halyk ePay exchange rate is not set"));
+
+ return $result;
+ }
+ $terminal = trim((string)$this->getBusinessValue($payment, "HALYK_TERMINAL"));
+ $secret = trim((string)$this->getBusinessValue($payment, "HALYK_SECRET"));
+ $token = $this->token($payment, [
+ "scope" => "payment",
+ "invoiceID" => $invoice,
+ "secret_hash" => hash_hmac("sha256", $invoice, $secret),
+ "amount" => $amount,
+ "currency" => self::CURRENCY,
+ "terminal" => $terminal,
+ ]);
+ if ($token === null) {
+ $result->addError(new Error("Halyk ePay authorization failed"));
+
+ return $result;
+ }
+ $payment->setField("PS_INVOICE_ID", $invoice);
+ $payment->setField("PS_SUM", $amount);
+ $payment->setField("PS_CURRENCY", self::CURRENCY);
+ $result->setData([
+ "widget" => [
+ "script" => $this->urls($payment)["script"],
+ "payment" => [
+ "invoiceId" => $invoice,
+ "backLink" => $returnUrl,
+ "failureBackLink" => $cancelUrl,
+ "language" => self::LANGUAGES[defined("LANGUAGE_ID") ? LANGUAGE_ID : "en"] ?? "eng",
+ "description" => "Order " . (string)$payment->getOrder()->getField("ACCOUNT_NUMBER"),
+ "terminal" => $terminal,
+ "amount" => $amount,
+ "currency" => self::CURRENCY,
+ "auth" => $token,
+ ],
+ ],
+ ]);
+
+ return $result;
+ }
+
+ public function processRequest(Payment $payment, Request $request)
+ {
+ $result = new ServiceResult();
+ if ($payment->isPaid()) {
+ return $result;
+ }
+ $invoice = (string)$payment->getField("PS_INVOICE_ID");
+ if ($invoice === "") {
+ $result->addError(new Error("Halyk ePay payment was not started"));
+
+ return $result;
+ }
+ $token = $this->token($payment, [
+ "scope" => "webapi usermanagement email_send verification statement statistics payment",
+ "terminal" => trim((string)$this->getBusinessValue($payment, "HALYK_TERMINAL")),
+ ]);
+ if ($token === null) {
+ $result->addError(new Error("Halyk ePay authorization failed"));
+
+ return $result;
+ }
+ $client = new HttpClient(["socketTimeout" => 15, "streamTimeout" => 25]);
+ $client->setHeader("Authorization", "Bearer " . (string)$token["access_token"]);
+ $body = $client->get($this->urls($payment)["status"] . rawurlencode($invoice));
+ $data = is_string($body) && $body !== "" ? json_decode($body, true) : null;
+ $transaction = is_array($data) ? ($data["transaction"] ?? null) : null;
+ if (!is_array($transaction) || (string)($data["resultCode"] ?? "") !== "100") {
+ $result->addError(new Error("Halyk ePay payment is not found yet"));
+
+ return $result;
+ }
+ if (($transaction["statusName"] ?? "") !== "CHARGE") {
+ $result->addError(new Error("Halyk ePay payment is not completed: " . (string)($transaction["statusName"] ?? "")));
+
+ return $result;
+ }
+ $expected = (float)$payment->getField("PS_SUM");
+ if ($expected <= 0 || $payment->getField("PS_CURRENCY") !== self::CURRENCY || (string)($transaction["invoiceID"] ?? "") !== $invoice || ($transaction["currency"] ?? "") !== self::CURRENCY || abs((float)($transaction["amount"] ?? 0) - $expected) > 0.01) {
+ $result->addError(new Error("Halyk ePay amount does not match the order"));
+
+ return $result;
+ }
+ $result->setPsData([
+ "PS_INVOICE_ID" => $invoice,
+ "PS_STATUS" => "Y",
+ "PS_STATUS_CODE" => "CHARGE",
+ "PS_STATUS_DESCRIPTION" => "Halyk ePay " . (string)($transaction["reference"] ?? ""),
+ "PS_SUM" => $expected,
+ "PS_CURRENCY" => self::CURRENCY,
+ "PS_RESPONSE_DATE" => new DateTime(),
+ ]);
+ $result->setOperationType(ServiceResult::MONEY_COMING);
+
+ return $result;
+ }
+
+ private function amount(Payment $payment): ?float
+ {
+ $sum = PriceMaths::roundByFormatCurrency($payment->getSum(), $payment->getCurrency());
+ if ($payment->getCurrency() === self::CURRENCY) {
+ return round($sum);
+ }
+ $rate = (float)str_replace(",", ".", (string)$this->getBusinessValue($payment, "HALYK_RATE"));
+ if ($rate <= 0) {
+ return null;
+ }
+
+ return max(1.0, round($sum * $rate));
+ }
+
+ private function urls(Payment $payment): array
+ {
+ return $this->getBusinessValue($payment, "HALYK_TEST") === "N" ? self::LIVE : self::TEST;
+ }
+
+ private function token(Payment $payment, array $fields): ?array
+ {
+ $client = new HttpClient(["socketTimeout" => 15, "streamTimeout" => 25]);
+ $body = $client->post($this->urls($payment)["oauth"], [
+ "grant_type" => "client_credentials",
+ "client_id" => trim((string)$this->getBusinessValue($payment, "HALYK_CLIENT_ID")),
+ "client_secret" => trim((string)$this->getBusinessValue($payment, "HALYK_SECRET")),
+ ] + $fields);
+ $data = is_string($body) && $body !== "" ? json_decode($body, true) : null;
+ if (!is_array($data) || empty($data["access_token"])) {
+ PaySystem\Logger::addError(__CLASS__ . ": token request failed, HTTP " . $client->getStatus());
+
+ return null;
+ }
+
+ return $data;
+ }
+}
diff --git a/local/php_interface/include/sale_payment/jinove_halyk/lang/en/.description.php b/local/php_interface/include/sale_payment/jinove_halyk/lang/en/.description.php
new file mode 100644
index 0000000..2f61f66
--- /dev/null
+++ b/local/php_interface/include/sale_payment/jinove_halyk/lang/en/.description.php
@@ -0,0 +1,8 @@
+ Loc::getMessage("JINOVE_PAYPAL_NAME"),
+ "SORT" => 500,
+ "CODES" => [
+ "PAYPAL_CLIENT_ID" => [
+ "NAME" => Loc::getMessage("JINOVE_PAYPAL_CLIENT_ID"),
+ "SORT" => 100,
+ "GROUP" => "CONNECT_SETTINGS_PAYPAL",
+ ],
+ "PAYPAL_SECRET" => [
+ "NAME" => Loc::getMessage("JINOVE_PAYPAL_SECRET"),
+ "SORT" => 200,
+ "GROUP" => "CONNECT_SETTINGS_PAYPAL",
+ ],
+ "PAYPAL_TEST" => [
+ "NAME" => Loc::getMessage("JINOVE_PAYPAL_TEST"),
+ "SORT" => 300,
+ "GROUP" => "CONNECT_SETTINGS_PAYPAL",
+ "INPUT" => ["TYPE" => "Y/N"],
+ "DEFAULT" => ["PROVIDER_KEY" => "INPUT", "PROVIDER_VALUE" => "Y"],
+ ],
+ "PAYPAL_CURRENCY" => [
+ "NAME" => Loc::getMessage("JINOVE_PAYPAL_CURRENCY"),
+ "DESCRIPTION" => Loc::getMessage("JINOVE_PAYPAL_CURRENCY_DESC"),
+ "SORT" => 400,
+ "GROUP" => "CONNECT_SETTINGS_PAYPAL",
+ "DEFAULT" => ["PROVIDER_KEY" => "VALUE", "PROVIDER_VALUE" => "RUB"],
+ ],
+ "PAYPAL_RATE" => [
+ "NAME" => Loc::getMessage("JINOVE_PAYPAL_RATE"),
+ "DESCRIPTION" => Loc::getMessage("JINOVE_PAYPAL_RATE_DESC"),
+ "SORT" => 500,
+ "GROUP" => "CONNECT_SETTINGS_PAYPAL",
+ "DEFAULT" => ["PROVIDER_KEY" => "VALUE", "PROVIDER_VALUE" => "1"],
+ ],
+ "PAYPAL_BRAND" => [
+ "NAME" => Loc::getMessage("JINOVE_PAYPAL_BRAND"),
+ "SORT" => 600,
+ "GROUP" => "CONNECT_SETTINGS_PAYPAL",
+ "DEFAULT" => ["PROVIDER_KEY" => "VALUE", "PROVIDER_VALUE" => "Vinoteca"],
+ ],
+ ],
+];
diff --git a/local/php_interface/include/sale_payment/jinove_paypal/handler.php b/local/php_interface/include/sale_payment/jinove_paypal/handler.php
new file mode 100644
index 0000000..2d41b9b
--- /dev/null
+++ b/local/php_interface/include/sale_payment/jinove_paypal/handler.php
@@ -0,0 +1,229 @@
+get("payment");
+ }
+
+ public function initiatePay(Payment $payment, Request $request = null)
+ {
+ $result = new ServiceResult();
+ $returnUrl = (string)($request ? $request->get("return_url") : "");
+ $cancelUrl = (string)($request ? $request->get("cancel_url") : "");
+ if ($returnUrl === "" || $cancelUrl === "") {
+ $result->addError(new Error("PayPal return addresses are missing"));
+
+ return $result;
+ }
+ $amount = $this->amount($payment);
+ if ($amount === null) {
+ $result->addError(new Error("PayPal exchange rate is not set"));
+
+ return $result;
+ }
+ [$currency, $value] = $amount;
+ $order = $payment->getOrder();
+ $response = $this->call(
+ $payment,
+ "POST",
+ "/v2/checkout/orders",
+ [
+ "intent" => "CAPTURE",
+ "purchase_units" => [[
+ "reference_id" => (string)$payment->getId(),
+ "custom_id" => (string)$order->getField("ACCOUNT_NUMBER"),
+ "description" => (string)$order->getField("ACCOUNT_NUMBER"),
+ "amount" => ["currency_code" => $currency, "value" => $value],
+ ]],
+ "payment_source" => ["paypal" => ["experience_context" => [
+ "brand_name" => (string)$this->getBusinessValue($payment, "PAYPAL_BRAND"),
+ "shipping_preference" => "NO_SHIPPING",
+ "user_action" => "PAY_NOW",
+ "return_url" => $returnUrl,
+ "cancel_url" => $cancelUrl,
+ ]]],
+ ],
+ "create-" . $payment->getId() . "-" . $value . "-" . time()
+ );
+ if (isset($response["error"])) {
+ $result->addError(new Error($response["error"]));
+
+ return $result;
+ }
+ $link = "";
+ foreach ((array)($response["links"] ?? []) as $item) {
+ if (in_array($item["rel"] ?? "", ["payer-action", "approve"], true)) {
+ $link = (string)$item["href"];
+ break;
+ }
+ }
+ if ($link === "" || empty($response["id"])) {
+ $result->addError(new Error("PayPal did not return an approval address"));
+
+ return $result;
+ }
+ $payment->setField("PS_INVOICE_ID", (string)$response["id"]);
+ $payment->setField("PS_SUM", (float)$value);
+ $payment->setField("PS_CURRENCY", $currency);
+ $result->setPaymentUrl($link);
+
+ return $result;
+ }
+
+ public function processRequest(Payment $payment, Request $request)
+ {
+ $result = new ServiceResult();
+ if ($payment->isPaid()) {
+ return $result;
+ }
+ $token = (string)$request->get("token");
+ if ($token === "" || $token !== (string)$payment->getField("PS_INVOICE_ID")) {
+ $result->addError(new Error("PayPal order does not match the payment"));
+
+ return $result;
+ }
+ $currency = (string)$payment->getField("PS_CURRENCY");
+ $expected = (float)$payment->getField("PS_SUM");
+ if ($currency === "" || $expected <= 0) {
+ $result->addError(new Error("PayPal payment was not started"));
+
+ return $result;
+ }
+ $response = $this->call($payment, "GET", "/v2/checkout/orders/" . rawurlencode($token));
+ if (isset($response["error"])) {
+ $result->addError(new Error($response["error"]));
+
+ return $result;
+ }
+ if (($response["status"] ?? "") === "APPROVED") {
+ $unit = $response["purchase_units"][0]["amount"] ?? [];
+ if (($unit["currency_code"] ?? "") !== $currency || abs((float)($unit["value"] ?? 0) - $expected) > 0.01) {
+ $result->addError(new Error("PayPal amount does not match the order"));
+
+ return $result;
+ }
+ $response = $this->call($payment, "POST", "/v2/checkout/orders/" . rawurlencode($token) . "/capture", new \stdClass(), "capture-" . $token);
+ if (isset($response["error"]) && ($response["issue"] ?? "") === "ORDER_ALREADY_CAPTURED") {
+ $response = $this->call($payment, "GET", "/v2/checkout/orders/" . rawurlencode($token));
+ }
+ if (isset($response["error"])) {
+ $result->addError(new Error($response["error"]));
+
+ return $result;
+ }
+ }
+ $capture = $response["purchase_units"][0]["payments"]["captures"][0] ?? null;
+ if (($response["status"] ?? "") !== "COMPLETED" || !is_array($capture) || ($capture["status"] ?? "") !== "COMPLETED") {
+ $result->addError(new Error("PayPal payment is not completed: " . (string)($response["status"] ?? "")));
+
+ return $result;
+ }
+ if (($capture["amount"]["currency_code"] ?? "") !== $currency || abs((float)($capture["amount"]["value"] ?? 0) - $expected) > 0.01) {
+ $result->addError(new Error("PayPal amount does not match the order"));
+
+ return $result;
+ }
+ $result->setPsData([
+ "PS_INVOICE_ID" => $token,
+ "PS_STATUS" => "Y",
+ "PS_STATUS_CODE" => (string)$capture["status"],
+ "PS_STATUS_DESCRIPTION" => "PayPal capture " . (string)($capture["id"] ?? ""),
+ "PS_SUM" => $expected,
+ "PS_CURRENCY" => $currency,
+ "PS_RESPONSE_DATE" => new DateTime(),
+ ]);
+ $result->setOperationType(ServiceResult::MONEY_COMING);
+
+ return $result;
+ }
+
+ private function amount(Payment $payment): ?array
+ {
+ $sum = PriceMaths::roundByFormatCurrency($payment->getSum(), $payment->getCurrency());
+ $currency = trim((string)$this->getBusinessValue($payment, "PAYPAL_CURRENCY"));
+ if ($currency === "" || $currency === $payment->getCurrency()) {
+ return [$payment->getCurrency(), number_format($sum, 2, ".", "")];
+ }
+ $rate = (float)str_replace(",", ".", (string)$this->getBusinessValue($payment, "PAYPAL_RATE"));
+ if ($rate <= 0) {
+ return null;
+ }
+
+ return [$currency, number_format($sum / $rate, 2, ".", "")];
+ }
+
+ private function base(Payment $payment): string
+ {
+ return $this->getBusinessValue($payment, "PAYPAL_TEST") === "N" ? self::LIVE : self::SANDBOX;
+ }
+
+ private function token(Payment $payment): ?string
+ {
+ if ($this->accessToken !== null) {
+ return $this->accessToken;
+ }
+ $client = new HttpClient(["socketTimeout" => 15, "streamTimeout" => 25]);
+ $client->setAuthorization((string)$this->getBusinessValue($payment, "PAYPAL_CLIENT_ID"), (string)$this->getBusinessValue($payment, "PAYPAL_SECRET"));
+ $client->setHeader("Content-Type", "application/x-www-form-urlencoded");
+ $body = $client->post($this->base($payment) . "/v1/oauth2/token", "grant_type=client_credentials");
+ $data = is_string($body) && $body !== "" ? json_decode($body, true) : null;
+ if (!is_array($data) || empty($data["access_token"])) {
+ PaySystem\Logger::addError(__CLASS__ . ": token request failed, HTTP " . $client->getStatus());
+
+ return null;
+ }
+
+ return $this->accessToken = (string)$data["access_token"];
+ }
+
+ private function call(Payment $payment, string $method, string $path, mixed $payload = null, string $requestId = ""): array
+ {
+ $token = $this->token($payment);
+ if ($token === null) {
+ return ["error" => "PayPal authorization failed"];
+ }
+ $client = new HttpClient(["socketTimeout" => 15, "streamTimeout" => 30]);
+ $client->setHeader("Authorization", "Bearer " . $token);
+ $client->setHeader("Content-Type", "application/json");
+ if ($requestId !== "") {
+ $client->setHeader("PayPal-Request-Id", $requestId);
+ }
+ $url = $this->base($payment) . $path;
+ $body = $method === "GET" ? $client->get($url) : $client->post($url, Json::encode($payload));
+ $status = $client->getStatus();
+ $data = is_string($body) && $body !== "" ? json_decode($body, true) : [];
+ $data = is_array($data) ? $data : [];
+ if ($status < 200 || $status >= 300) {
+ $issue = (string)($data["details"][0]["issue"] ?? $data["name"] ?? "");
+ PaySystem\Logger::addError(__CLASS__ . ": " . $method . " " . $path . " HTTP " . $status . " " . $issue);
+
+ return ["error" => "PayPal HTTP " . $status . " " . $issue, "issue" => $issue];
+ }
+
+ return $data;
+ }
+}
diff --git a/local/php_interface/include/sale_payment/jinove_paypal/lang/en/.description.php b/local/php_interface/include/sale_payment/jinove_paypal/lang/en/.description.php
new file mode 100644
index 0000000..263ef55
--- /dev/null
+++ b/local/php_interface/include/sale_payment/jinove_paypal/lang/en/.description.php
@@ -0,0 +1,10 @@
+addEventHandler("main", "OnPageStart", array(\Jinove\Vinoteca\Routing::class, "onPageStart"));
+$vinoEvents->addEventHandler("search", "BeforeIndex", array(\Jinove\Vinoteca\Search::class, "beforeIndex"));
+$vinoEvents->addEventHandler("iblock", "OnAfterIBlockElementAdd", array(\Jinove\Vinoteca\Catalog\ReviewStats::class, "onElementChange"));
+$vinoEvents->addEventHandler("iblock", "OnAfterIBlockElementUpdate", array(\Jinove\Vinoteca\Catalog\ReviewStats::class, "onElementChange"));
+$vinoEvents->addEventHandler("iblock", "OnAfterIBlockElementAdd", array(\Jinove\Vinoteca\Catalog\PhotoSort::class, "onElementChange"));
+$vinoEvents->addEventHandler("iblock", "OnAfterIBlockElementUpdate", array(\Jinove\Vinoteca\Catalog\PhotoSort::class, "onElementChange"));
+$vinoEvents->addEventHandler("iblock", "OnBeforeIBlockElementDelete", array(\Jinove\Vinoteca\Catalog\ReviewStats::class, "onBeforeDelete"));
+$vinoEvents->addEventHandler("iblock", "OnAfterIBlockElementDelete", array(\Jinove\Vinoteca\Catalog\ReviewStats::class, "onAfterDelete"));
+$vinoEvents->addEventHandler("iblock", "OnAfterIBlockElementDelete", array(\Jinove\Vinoteca\Catalog\FavoriteTable::class, "onElementDelete"));
+$vinoEvents->addEventHandler("main", "OnBeforeUserLogin", array(\Jinove\Vinoteca\Catalog\FavoriteTable::class, "rememberGuest"));
+$vinoEvents->addEventHandler("main", "OnAfterUserLogin", array(\Jinove\Vinoteca\Catalog\FavoriteTable::class, "mergeGuest"));
+foreach (array("Discount", "DiscountCoupon") as $vinoEntity) {
+ foreach (array("OnAfterAdd", "OnAfterUpdate", "OnAfterDelete") as $vinoEvent) {
+ $vinoEvents->addEventHandler("sale", "\Bitrix\Sale\Internals\\" . $vinoEntity . "::" . $vinoEvent, array(\Jinove\Vinoteca\Offers::class, "clearCache"));
+ }
+}
diff --git a/local/templates/jinove_wine/.description.php b/local/templates/jinove_wine/.description.php
new file mode 100644
index 0000000..ecf49c9
--- /dev/null
+++ b/local/templates/jinove_wine/.description.php
@@ -0,0 +1,8 @@
+ "Vinoteca (jinove_wine)",
+ "DESCRIPTION" => "Тёмная винная тема Vinoteca: бордо + золото, Cormorant Garamond + Manrope.",
+ "SORT" => 1,
+);
diff --git a/local/templates/jinove_wine/assets/brand/vinoteca-icon-512.png b/local/templates/jinove_wine/assets/brand/vinoteca-icon-512.png
new file mode 100644
index 0000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Qh%4B1l*hN!P7{FZbS1<2m1aFm{J
z(gWuOSy*dlVed-<&_1Y#hr8;$VBl8h`1@Z57a%43JxRh)@s7Uj0ptQNJ(-{}%Nve=
z!m4ncFXG|E?JlqIngIl%v{9AK88ZFN4K3OD0|f!<_hw+*V0toMAW=J??rJjb0+~*S
z>K%L|B%A|z%St`C7li|DleL(IGl^2
zzi+h%}qyn`g@wqm(ywiDXbdVSf^F4r3OyzvH0#B&T(!vcysscw)u
z^wC*;A#mcZE2G1h2|cKgUw>9QgW2VaJ^#*J22rQGs+QTqP!~IM3^y^^&yZ(VhI4~$
zH&ZVuQtn(-i!e&A=CU$G?qu|q-;g%$n8_EGZlVR;PL(RGEQj{YvLGt(gt
j4arFU|NNudxktlGzvs%if^dVM7Y9@n)fGzR&ENe$boH-2
literal 0
HcmV?d00001
diff --git a/local/templates/jinove_wine/assets/brand/vinoteca-icon.svg b/local/templates/jinove_wine/assets/brand/vinoteca-icon.svg
new file mode 100644
index 0000000..745c3e1
--- /dev/null
+++ b/local/templates/jinove_wine/assets/brand/vinoteca-icon.svg
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/local/templates/jinove_wine/assets/fonts/f0.woff2 b/local/templates/jinove_wine/assets/fonts/f0.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..3cfa50b430ef22ec529317ff0cfc63c633d45f44
GIT binary patch
literal 14540
zcmV;-I5Wq0Pew8T0RR91065G56aWAK0DFi4061L$0RR9100000000000000000000
z0000QffyT~bQ~x@NLE2oheQToKT}jeR7xir0E7fDLJD0T#TJD@okxT(D
zAgrjD%wIszulfQS3*-{w+NrwDBM}U`-q2ZEXZH7|n(g}=goW}#43Hx=Jj~!SujoMP
zQlgw$IkcYsO$~W=UOuGI3A_$jLTYwAl~3DA&N@OV?F!z
zcs(l+C?~mLDjE?H=p~u%4VmsOneH8#?tMHo5`cV}De_h#z=40WkCIn3q+{E00}{na
zn%Xy;$>j^hQrRF#nV4KYxST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ef6);nsil
zp{qFZIhoQu003W}w9^Lwu&F;R@CC;0(qj4@0EmD906+l#SiuNe*^tU3Wq^Qu-Y=6`
z2;={Gra(JdM4}x~oQ@20t
ze?P^37`R`u2^PWcZQ^;LwM`umUgIx3b7uHJ>)T+U{vke(?rZ%I2-oMJe|5puyCJ+P
z3H@XRge4rcle1CpvFC#YFMT+_}b`uWRfb=z^~S*14gP4>Lp?2MkLHdms3R`mh3EyezBD!VahOHV@tISeLU4b!L{U|RJ5~NhEdTnQyinCD}
z`X6kxY#K&+)N&Nk$`$RTKNO98kQ0x`lFmv^GJf6i-zWhZ{Z~?frd)^w&AAa1QHTmH
z{=_5}VuiLiP{742QdIn+b0;7q>PeIH;K_@)*t|(f$cL0~iOKq|fB2P@zW|d2mRyiv
zAwo+nOt=V<$&2bz(M>6)A52bDtT^%MyaCcnUm^kyEJ?Bysb%_08o4Q%eJ))FMOm^_
zmXnH_hPH3BrlV(IEVoRi3Np)*U12$W-@h!`vdWbwKYIlV+1PV5l|zx@ikqgSX_fY)
zvgp3i+?7#7AfLpf8V0
z94^0(!?nq@(KW0A8hDY4)PoBmAdk6+6lHUHKJOWq-?b=7(Y&ZhuA9}4Pqm<$DLI;K
zjv@+=W{+0MPsb(QOpD&Sh7pZucq6<$-?q2#_WTN8;b;2=$1yNGRZV`9{U7mF9@n|X
qPWX$EI2Ym51rLj-ILQ95{L)IWn6N@HI@S|i)MD%(AB}}O0000ZTpFwZ
literal 0
HcmV?d00001
diff --git a/local/templates/jinove_wine/assets/fonts/f1.woff2 b/local/templates/jinove_wine/assets/fonts/f1.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..a54fd00bf0e964d4d13688d8e8907cf04350e214
GIT binary patch
literal 25904
zcmV)DK*7IvPew8T0RR910A(-$6aWAK0N;E70A#@c0RR9100000000000000000000
z0000Qf_xkOSR8UcNLE2oi7EzQKT}jeR7xir0EBEWLJ4G6#hN3PB4OIGo6hZp83ukN+Jih2HOY
zmEr%6^V*}Rlg_}l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