Integracja z edrone - dostosowanie szablonu
- Ustawiamy swój App ID z edrone w panelu administracyjnym (Ustawienia/Ustawienia Sklepu/Ogólne/Integracja z edrone)
- W głównym folderze szablonu tworzymy folder edrone, w którym umieszczamy pliki, których zawartość znajduje się w kolejnych punktach
- W pliku html, na końcu sekcji head includujemy plik edrone/head.html (dodajemy {% include ‘edrone/head.html’ -%} )
{% if page.PageId != config.DefinedPages.Order.Id -%} _edrone.action_type = 'other'; {% if usr.Authenticated -%} {% if customer.Address.Name != '' -%} {% assign FullName = customer.Address.Name -%} {% if FullName contains ' ' -%} {% assign HalfName = FullName | Split:' ' -%} {% endif %} _edrone.first_name = '{% if HalfName[0] -%}{{ HalfName[0] }}{% else %}{{ FullName }}{% endif %}'; {% if HalfName[1] -%} _edrone.last_name = '{{ HalfName[1] }}'; {% endif %} {% endif -%} {% if customer.Address.Country != '' -%} _edrone.country = '{{ customer.Address.Country }}'; {% endif -%} {% if customer.Address.City != '' -%} _edrone.city = '{{ customer.Address.City }}'; {% endif -%} {% if customer.Address.Phone != '' -%} _edrone.phone = '{{ customer.Address.PhoneNo }}'; {% endif -%} _edrone.email = '{{ customer.Email }}'; {% endif -%} {% endif -%}{% if config.External.Edrone.AppId != '' -%} <script type="text/javascript"> (function (srcjs) { window._edrone = window._edrone || {}; _edrone.app_id = '{{ config.External.Edrone.AppId }}'; _edrone.version = '1.0.0'; _edrone.platform_version = '{{ config.Version }}'; _edrone.platform = 'comarch'; _edrone.shop_lang = '{{ page.Language }}';
var doc = document.createElement('script'); doc.type = 'text/javascript'; doc.async = true; doc.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + srcjs; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(doc, s); })("//d3bo67muzbfgtl.cloudfront.net/edrone_2_0.js"); </script> {% endif -%} - W pliku html, na końcu sekcji body includujemy pliki edrone/product-presentation.html oraz edrone/subscribe.html
- product-presentation.html
{% if page.PageId == config.DefinedPages.ProductDetails.Id and config.External.Edrone.AppId != '' -%} <script type="text/javascript"> {% if productdetails -%} {% assign product-presentation = productdetails -%} {% elseif product-details -%} {% assign product-presentation = product-details -%} {% endif -%}
window._edrone = window._edrone || {}; _edrone.action_type = 'product_view'; _edrone.product_ids = '{{ product-presentation.Product.Id }}'; _edrone.product_titles = '{{ product-presentation.Product.Name }}'; {% if product-presentation.Product.ImageId > 0 -%} _edrone.product_images = 'http:{{ page.BaseHref }}img/large/{{ product-presentation.Product.ImageId }}/{% if product-presentation.Product.Images[0].Name != "" -%}{{ product-presentation.Product.Images[0].Name }}{% else %}.jpg{% endif %}'; {% endif -%} {% if product-presentation.Product.Code != '' -%} _edrone.product_skus = '{{ product-presentation.Product.Code }}'; {% endif -%} _edrone.product_urls = '{{ page.CanonicalLink }}'; _edrone.product_category_ids = '{{ page.GroupId }}'; _edrone.product_category_names = '{{ page.CurrentSiteNode.Name }}'; </script> {% endif %}WskazówkaJeżeli w swoim szablonie obiekt ze szczegółami produktu ma inną nazwę, to należy zmodyfikować warunek.- subscribe.html
{% if config.External.Edrone.AppId != '' -%} {% if page.PageId == config.DefinedPages.Home.Id or page.PageId == config.DefinedPages.CustomerProfile.Id -%} <script type="text/javascript"> $(document).ajaxSuccess(function(a,b,c,d) { if(d && d.action && (d.action.Action == 'Newsletter/Subscribe' || d.action.Action == 'newsletter/subscribe') && d.action.Result){ var queryString = c.data.split('&'); for(i=0; i<queryString.length; i++){ if(queryString[i].indexOf('email') != -1){ var email = queryString[i].split('=')[1].replace('%40','@'); } } _edrone.customer_tags = 'From Newsletter Subscribe'; _edrone.email = email; _edrone.subscriber_status = '1'; _edrone.action_type = 'subscribe'; _edrone.init(); } }); </script> {% endif %} {% if page.PageId == config.DefinedPages.CustomerProfile.Id -%} <script type="text/javascript"> $(document).ajaxSuccess(function(a,b,c,d) { if(d && d.action && (d.action.Action == 'Newsletter/Unsubscribe' || d.action.Action == 'newsletter/unsubscribe') && d.action.Result){ var queryString = c.data.split('&'); for(i=0; i<queryString.length; i++){ if(queryString[i].indexOf('email') != -1){ var email = queryString[i].split('=')[1].replace('%40','@'); } } _edrone.customer_tags = 'From Newsletter Subscribe'; _edrone.email = email; _edrone.subscriber_status = '0'; _edrone.action_type = 'subscribe'; _edrone.init(); } }); </script> {% endif %} {% endif %}
WskazówkaJeżeli w swoim szablonie umożliwiasz zapis do newslettera z innych stron niż strona główna i profil klienta oraz pozwalasz na wypisanie poza profilem klienta, to należy zmodyfikować powyższy plik.UwagaW wersji 2018.7 z domyślnych szablonów Comarch usunięto akcję dotyczącą zapisu i wypisu z newslettera, ponieważ dane przekazywane są przez Comarch e-Sklep w tle.- W szablonach Agat, Bursztyn i Opal, w tym samym miejscu includujemy również plik edrone/add-to-cart.html
{% if page.PageId == config.DefinedPages.ProductDetails.Id and config.External.Edrone.AppId != '' -%} <script type="text/javascript"> $(document).ajaxSuccess(function(a,b,c,d) { if(d && d.action && (d.action.Action == 'Cart/Add' || d.action.Action == 'cart/add') && d.action.Result ){ _edrone.action_type = 'add_to_cart'; _edrone.init(); } }); </script> {% endif %}
WskazówkaPlik należy dodać do wszystkich szablonów, które nie są oparte o najnowszą wersję szablonu Szafir (w tym szablonie dodawanie do koszyka w edrone obsłużone jest bezpośrednio w funkcjach szablonu – spowodowane jest to możliwością dodawania kilku towarów jednocześnie czego inne szablony nie posiadają).- W szablonie Bursztyn, w tym samym miejscu includujemy również plik edrone/add-to-cart-with-data.html
var products = d.collection["customer.Cart"].Products; var size = products.length; var product = products[size-1];{% if config.External.Edrone.AppId != '' -%} {% if page.PageId == config.DefinedPages.Home.Id or page.PageId == config.DefinedPages.ProductList.Id -%} <script type="text/javascript"> $(document).ajaxSuccess(function(a,b,c,d) { if(d && d.action && (d.action.Action == 'Cart/Add' || d.action.Action == 'cart/add') && d.action.Result ){ window._edrone = window._edrone || {};
_edrone.product_ids = product.Id; _edrone.product_titles = product.NameNoHtml; if(product.ImageId > 0){ _edrone.product_images = 'http:{{ page.BaseHref }}img/large/'+product.ImageId+'/.jpg'; } if(product.Code != ''){ _edrone.product_skus = product.Code; } _edrone.product_urls = 'http:{{ page.BaseHref }}'+product.Url; _edrone.product_category_ids = product.DefaultGroup;
_edrone.action_type = 'add_to_cart'; _edrone.init(); } }); </script> {% endif %} {% endif %}WskazówkaKod działa dla dodawania do koszyka ze strony głównej i listy towarów. Jeżeli pozwalasz na dodawanie do koszyka z innych stron, należy go zmodyfikować.- W pliku z podziękowaniami za zakup (Agat – partials/cart/summary.html, Bursztyn i Opal – order/thank-you.html, Szafir – order/thx.html), na końcu pliku (tuż pod includem rich-snippetów), includujemy plik edrone/order.html
{% if cart -%} {% assign order = cart -%} {% endif -%}{% if config.External.Edrone.AppId != '' -%} <script type="text/javascript"> _edrone.action_type = 'order';
{% assign FullName = order.Customer.DeliveryAddress.Name -%} {% if FullName contains ' ' -%} {% assign HalfName = FullName | Split:' ' -%} {% endif %} _edrone.first_name = '{% if HalfName[0] -%}{{ HalfName[0] }}{% else %}{{ FullName }}{% endif %}'; {% if HalfName[1] -%} _edrone.last_name = '{{ HalfName[1] }}'; {% endif %} _edrone.country = '{{ order.Customer.DeliveryAddress.Country }}'; {% if order.Customer.DeliveryAddress.City != '' -%} _edrone.city = '{{ order.Customer.DeliveryAddress.City }}'; {% endif %} {% if order.Customer.DeliveryAddress.PhoneNo != '' -%} _edrone.phone = '{{ order.Customer.DeliveryAddress.PhoneNo }}'; {% endif %} _edrone.email = '{{ order.Customer.Email }}';
{% assign size = order.PlacedOrder.Products | Size -%} var ids = ''; var titles = ''; var images = ''; var skus = ''; var urls = ''; var categoryIds = ''; var counts = ''; {% for product in order.PlacedOrder.Products -%} ids += '{{ product.Id }}{% if forloop.index != size -%}|{% endif -%}'; titles += '{{ product.NameNoHtml }}{% if forloop.index != size -%}|{% endif -%}'; images += '{% if product.ImageId > 0 -%}http:{{ page.BaseHref }}img/large/{{ product.ImageId }}/.jpg{% endif -%}{% if forloop.index != size -%}|{% endif -%}'; skus += '{{ product.Code }}{% if forloop.index != size -%}|{% endif -%}'; urls += 'http:{{ page.BaseHref }}{{ product.Url }}{% if forloop.index != size -%}|{% endif -%}'; categoryIds += '{{ product.DefaultGroup }}{% if forloop.index != size -%}|{% endif -%}'; counts += '{{ product.Quantity | Normalize }}{% if forloop.index != size -%}|{% endif -%}'; {% endfor -%}
_edrone.product_ids = ids; _edrone.product_titles = titles; _edrone.product_images = images; _edrone.product_skus = skus; _edrone.product_urls = urls; _edrone.product_category_ids = categoryIds; _edrone.product_counts = counts;
_edrone.order_id = '{{ order.PlacedOrder.Id }}'; _edrone.base_currency = '{{ order.Currency }}'; _edrone.order_currency = '{{ order.Currency }}'; _edrone.base_payment_value = '{{ order.OrderTotalValue | ToString | Replace:",","." }}'; _edrone.order_payment_value = '{{ order.OrderTotalValue | ToString | Replace:",","." }}'; _edrone.init(); </script> {% endif -%}WskazówkaJeżeli w swoim szablonie używasz dla koszyka innej nazwy obiektu niż cart lub order, to powyższy kod należy zmodyfikować.Edrone i dodawanie towarów w szablonie Szafir:- Plik js/init-ui1.js
- Funkcja serialAddingToCart
if(typeof _edrone !== 'undefined') { var product = form.parents('.product-item-lq'); var base = $('[data-base]').data('base');
if (first) { _edrone.product_ids = productId; _edrone.product_titles = product.find('.product-name-lq').text(); _edrone.product_images = base + product.find('img').data('src'); _edrone.product_skus = product.find('.product-code-lq').text(); _edrone.product_urls = base + product.find('a').attr('href'); _edrone.product_category_ids = $('[data-group-id]').data('group-id'); _edrone.product_category_names = $('[data-group-name]').data('group-name'); first = false; } else { _edrone.product_ids += '|' + productId; _edrone.product_titles += '|' + product.find('.product-name-lq').text(); _edrone.product_images += '|' + base + product.find('img').data('src'); _edrone.product_skus += '|' + product.find('.product-code-lq').text(); _edrone.product_urls += '|' + base + product.find('a').attr('href'); _edrone.product_category_ids += '|' + $('[data-group-id]').data('group-id'); _edrone.product_category_names += '|' + $('[data-group-name]').data('group-name'); } } Kilkanaście linijek niżej (w tej samej funkcji) jest instrukcja warunkowa “if (resGuardian)”. Na początku tej instrukcji warunkowej wklejamy poniższy kod:if(typeof _edrone !== 'undefined') { _edrone.action_type = 'add_to_cart'; _edrone.init(); }
- Funkcja addManyProducts
var first = true;
Następnie, w tej pętli znajduje się instrukcja warunkowa „if(products[i].askForPriceChild == false && products[i].quantity > 0)”. Na samym jej końcu należy dodać poniższy kod:if(parameters && !validationError && products[i].supply != undefined && typeof _edrone !== 'undefined'){ if(first){ _edrone.product_ids = products[i].supply; _edrone.product_images = products[i].img; _edrone.product_skus = products[i].code; var name = _edrone.product_titles; var url = _edrone.product_urls; var categoryId = _edrone.product_category_ids; var categoryName = _edrone.product_category_names; first = false; } else { _edrone.product_ids += '|' + products[i].supply; _edrone.product_images += '|' + products[i].img; _edrone.product_skus += '|' + products[i].code; _edrone.product_titles += '|' + name; _edrone.product_urls += '|' + url; _edrone.product_category_ids += '|' + categoryId; _edrone.product_category_names += '|' + categoryName; } }
Kilkanaście linijek niżej (w tej samej funkcji) jest “$.post”. Na samym jego początku należy dodać poniższy kod:if(typeof _edrone !== 'undefined') { _edrone.action_type = 'add_to_cart'; _edrone.init(); }
- Dodanie funkcji simpleAddToCartSuccess
function simpleAddToCartSuccess(e){ updateClientArea(); if(typeof _edrone !== 'undefined') { if ($('.add-from-presentation-lq').index() == -1) { var product = $(e.currentTarget).parents('.product-item-lq'); var base = product.parents('[data-base]').data('base'); _edrone.product_ids = product.data('product-id'); _edrone.product_titles = product.find('.product-name-lq').text(); _edrone.product_images = base + product.find('img').attr('src'); _edrone.product_skus = product.find('.product-code-lq').text(); _edrone.product_urls = base + product.find('a').attr('href'); _edrone.product_category_ids = product.parents('[data-group-id]').data('group-id'); _edrone.product_category_names = product.parents('[data-group-name]').data('group-name'); } _edrone.action_type = 'add_to_cart'; _edrone.init(); } }
Następnie należy zmodyfikować “event”, który jest wywoływany przy kliknięciu w element z klasą “add-to-cart-update-client-area-lq”. Zmieniamy zawartość tego eventa na:app.post(e, simpleAddToCartSuccess, e);
Cały event powinien wyglądać następująco:$('body').on('click', '.add-to-cart-update-client-area-lq', function(e) { app.post(e, simpleAddToCartSuccess, e); });
- Plik js/init-ui2.js
- Funkcja serialAddingFromWishlist
var first = true;
Następnie, w tej pętli znajduje się instrukcja warunkowa „if (quantity > 0)”. Na samym jej końcu należy dodać poniższy kod:if(typeof _edrone !== 'undefined') { if (first) { _edrone.product_ids = productId; _edrone.product_titles = productContainer.find('.product-name-lq').text(); _edrone.product_images = base + productContainer.find('img').attr('src'); _edrone.product_skus = productContainer.find('.product-code-lq').text(); _edrone.product_urls = base + productContainer.find('a').attr('href'); _edrone.product_category_ids = categoryId; first = false; } else { _edrone.product_ids += '|' + productId; _edrone.product_titles += '|' + productContainer.find('.product-name-lq').text(); _edrone.product_images += '|' + base + productContainer.find('img').attr('src'); _edrone.product_skus += '|' + productContainer.find('.product-code-lq').text(); _edrone.product_urls += '|' + base + productContainer.find('a').attr('href'); _edrone.product_category_ids += '|' + categoryId; } }
Kilkanaście linijek niżej (w tej samej funkcji) jest instrukcja warunkowa “if (resGuardian)”. Na początku tej instrukcji warunkowej wklejamy poniższy kod:if(typeof _edrone !== 'undefined') { _edrone.action_type = 'add_to_cart'; _edrone.init(); }
Nowe Inpost API - aktualizacja paczkomatów i punktów odbioru osobistego w szablonach
WskazówkaOd 1 czerwca 2025 roku zakończyliśmy aktualizację oraz wydawanie nowych wersji szablonów Bursztyn, Agat i Opal, a tym samym ich wsparcie, aby skupić się na nowoczesnych rozwiązaniach, które jeszcze lepiej odpowiadają na potrzeby dynamicznie rozwijającego się rynku e-commerce. Zachęcamy Was do przejścia na nasze nowe, udoskonalone szablony. Dla sklepów B2C polecamy szablony Topaz, One Page Shop oraz Dla Gastronomii, natomiast dla platform B2B idealnym wyborem będą Rubin i Szafir.Szablon Szafir
WskazówkaPliki potrzebne do aktualizacji paczkomatów i punktów odbioru osobistego: Pobierz pliki- Wrzuć pliki „collection-points-scripts.html” i „collection-points-styles.html” do głównego folderu z szablonem (tam gdzie „__layout.html”).
- Wrzuć plik „collection-points.js” do folderu „js”.
- Wrzuć plik “collection-points.css” do folderu “css”.
- Podmień plik “collection-points.html”, który znajduje się w folderze „order/delivery-partials”.
- W pliku „__layout.html”, na końcu sekcji „<head>” dodaj poniższą linijkę:
{% include 'collection-points-styles.html' %}
- W pliku „__layout.html”, na końcu sekcji „<body>” dodaj poniższą linijkę:
{% include 'collection-points-scripts.html' %}
- Dodaj tłumaczenie: - SearchInpostInfo: "Szukaj po mieście, adresie i nazwie paczkomatu”
- (punkt opcjonalny – poprawienie styli – bez niego paczkomaty i POO będą działać ale będzie brzydko wyglądać i każdy to zauważy) W pliku “order/delivery-partials/delivery-section.html”, pod formularzem „<form class="no-message-lq delivery-form-lq">” należy utworzyć nowy kontener “<div class="clear-after-ui"></div>”, a następnie wkleić do niego dwa ostatnie kontenery z klasą “f-left-ui” wraz z ich zawartością.
{% if order.SelectedDelivery.PhoneRequired and deliveryAddress.PhoneNo == '' -%} {% assign lackOfPhone = true -%} {% endif -%}<div class="clear-after-ui"> <div class="f-left-ui half-ui-with-space-ui cart-option-ui delivery-address-lq address-ui delivery-address-ui"> <p> {% if order.SelectedDelivery.CollectionPointTypeId == 0 -%} {{translations.ShippingAddress}} {% else -%} {{translations.MyData}} {% endif -%} </p> <div class="address-template-container-lq" data-address-type="0"> {% assign lackOfPhone = false -%} {% assign countryMismatch = false -%}
{% comment -%} {% if page.Cookies.deliveryAddressId == null or page.Cookies.deliveryAddressId == '' -%} {% for profileAddress in customer.DeliveryAddresses -%} {% if profileAddress.Default and profileAddress.Country != config.DefaultCountry -%} {% assign countryMismatch = true -%} {% break -%} {% endif -%} {% endfor -%} {% if countryMismatch == false and deliveryAddress.Country != config.DefaultCountry -%} {% assign countryMismatch = true -%} {% endif -%} {% elseif page.Cookies.deliveryAddressId == -1 -%} {% assign countryMismatch = true -%} {% else -%} {% for profileAddress in customer.DeliveryAddresses -%} {% if profileAddress.Id == page.Cookies.deliveryAddressId -%} {% if profileAddress.Country != deliveryAddress.Country %} {% assign countryMismatch = true -%} {% endif -%} {% break -%} {% endif -%} {% endfor -%} {% endif -%} {% endcomment -%}
{% if page.Cookies.delivCountryChanged == 'true' -%} {% assign countryMismatch = true -%} {% endif -%}
{% if deliveryAddress.Name == '' or lackOfPhone or countryMismatch -%} {% include 'order/delivery-partials/address-form.html' with 'orderDa' -%} {% else -%} {% include 'order/delivery-partials/address-presentation.html' with 'orderDa' -%} {% endif -%} </div> </div>
<div class="f-left-ui half-ui-with-space-ui cart-option-ui invoice-address-lq address-ui invoice-address-ui"> <p>{{translations.InvoiceData}}</p> <div class="address-template-container-lq" data-address-type="1"> {% if invoiceAddress.Name == '' and order.Customer.CustomerDetailsEditable -%} {% include 'order/delivery-partials/address-form.html' with 'inv-add' -%} {% else -%} {% include 'order/delivery-partials/address-presentation.html' with 'inv-add'-%} {% endif -%} </div> </div> </div>
Szablon Agat
WskazówkaPliki potrzebne do aktualizacji paczkomatów i punktów odbioru osobistego: Pobierz pliki- Podmień plik ‘order.js’, który znajduje się w folderze ‘js’.
- Wrzuć plik ‘collection-points.css’ do folderu ‘css’.
- a) Jeśli kod szablonu nie był modyfikowany, podmień plik ‘delivery-adress.html’, który znajduje się w folderze ‘partials/cart’.
b) Jeśli kod szablonu był modyfikowany, podmień obecny widok mapy z paczkomatami następującym:
{% if cart.SelectedDelivery.CollectionPointTypeId == 2 or cart.SelectedDelivery.CollectionPointTypeId == 1 -%} <div class="geowidget-container" id="map"> {% if settings.googleMapsKey == '' or cart.SelectedDelivery.CollectionPointTypeId == 1 -%} <div id="collection-points-searcher" class="collection-points-search-box {% if cart.SelectedDelivery.CollectionPointTypeId == 1 -%} personal-collection-points {% endif -%}"> <input placeholder="{% if cart.SelectedDelivery.CollectionPointTypeId == 1 -%} {{translations.TypeAdress}} {% else -%}{{translations.AddCodeOrAdress}}{% endif -%}" type="search" id="machines-filter-input" class="collection-point-search-input"> <span class="fa fa-search"></span> <div class="collection-points-result hidden"><ul></ul></div> </div> {% elsif settings.googleMapsKey != '' and cart.SelectedDelivery.CollectionPointTypeId == 2 -%} <div id="easypack-map"></div> {% endif -%} </div> {% endif -%}
- W pliku ‘_layout.html’, na końcu sekcji ‘<head>’ dodaj poniży kod:
{% if page.PageId == config.DefinedPages.Order.Id -%} <link rel="stylesheet" type="text/css" href="https://geowidget.easypack24.net/css/easypack.css"> <link rel="stylesheet" type="text/css" href="css/collection-points.css"> {% endif -%}
- W pliku ‘_layout.html’, na końcu sekcji ‘<body>’ dodaj poniży kod:
{% if page.PageId == config.DefinedPages.Order.Id -%} <script async src="https://geowidget.easypack24.net/js/sdk-for-javascript.js"></script> {% endif -%}
- Dodaj tłumaczenia: - TypeAdress: "Wpisz adres" - AddCodeOrAdress: "Wpisz kod paczkomatu lub adres"
- Aby paczkomaty działały poprawnie również przy przechodzeniu na poprzedni i następny krok koszyka:
a) Jeśli kod szablonu nie był modyfikowany, podmień plik ‘init.js’, który znajduje się w folderze ‘js’.
b) Jeśli kod szablonu był modyfikowany, wywołaj funkcje:
orderCollectionPoints.easyPackAsyncInit();
orderCollectionPoints.getCollectionPoints();
w tych funkcjach, które są wywoływane przy zmianie sekcji na ‘CustomerData’ w koszyku:
Zmienione fragmenty pliku ‘init.js’ to:
orderPrevStep: function (e) { var container = $('.shopping-cart'); var data = { __template: 'partials/cart/cart-template.html', __csrf: __CSRF, __action: 'Order/StepPrev' }; $.post(null, data, function (result) { if (result.action.Result) { $('.shopping-cart').html(result.template); if ($('body').find('#invoice-address-data').index() >= 0) { application.uiSetSwitchNameWidthInInvoice(); } if ($('#easypack-map').length > 0) { orderCollectionPoints.easyPackAsyncInit(); } if($('#collection-points-searcher').length > 0) { orderCollectionPoints.getCollectionPoints(); } if ($('.geowidget-container').length > 0) { $('#main-section .save-delivery-address-data').addClass('order-next-step').removeClass('choose-collection-point'); } application.loadImages(); application.uiScrollToTop(container); application.uiCheckLabels(); } else { if (result.action.Code != 100) { if (result.action.Validation != null) { errorMessage = '<div class="title">' + result.action.Message + '</div>' + '<p>' + result.action.Validation[0].Error + '</p>'; } else { errorMessage = '<div class="title">' + result.action.Message + '</div>'; } application.createMessage(errorMessage); } } }); },
if (validate) { $.post(null, data, function (result) { if (result.action.Result) { var container = $('body'); var data = { __template: 'partials/cart/cart-template.html', __csrf: __CSRF, __action: 'Order/StepNext' }; $.post(null, data, function (result) { if (result.action.Result) { $('.shopping-cart').replaceWith(result.template); if ($('body').find('#invoice-address-data').index() >= 0) { application.uiSetSwitchNameWidthInInvoice(); } application.loadImages(); application.uiSetSwitchNameWidthInSummaryCheckboxes(); application.uiScrollToTop(container); application.uiCheckLabels(); if ($('#easypack-map').length > 0) { orderCollectionPoints.easyPackAsyncInit(); } if($('#collection-points-searcher').length > 0) { orderCollectionPoints.getCollectionPoints(); } } else { if (result.action.Code != 100) { if (result.action.Validation != null) { errorMessage = '<div class="title">' + result.action.Message + '</div>' + '<p>' + result.action.Validation[0].Error + '</p>'; } else { errorMessage = '<div class="title">' + result.action.Message + '</div>'; } application.createMessage(errorMessage, 3000); } } }); } else { if (result.action.Code != 100) { if (result.action.Validation != null) { errorMessage = '<div class="title">' + result.action.Message + '</div>' + '<p>' + result.action.Validation[0].Error + '</p>'; } else { errorMessage = '<div class="title">' + result.action.Message + '</div>'; } application.createMessage(errorMessage, 3000); return; } } }); } } } else { var container = $('body'); var data = { __template: 'partials/cart/cart-template.html', __csrf: __CSRF, __action: 'Order/StepNext' }; $.post(null, data, function (result) { if (result.action.Result) { if ((result.template).indexOf('name="sel-del-met" value="' + 1 + '"') !== -1 || (result.template).indexOf('name="sel-del-met" value="' + 2 + '"') !== -1) { application.orderPrevStep(); } else { $('.shopping-cart').replaceWith(result.template); if ($('body').find('#invoice-address-data').index() >= 0) { application.uiSetSwitchNameWidthInInvoice(); } if ($('#easypack-map').length > 0) { orderCollectionPoints.easyPackAsyncInit(); } if($('#collection-points-searcher').length > 0) { orderCollectionPoints.getCollectionPoints(); } application.loadImages(); application.uiSetSwitchNameWidthInSummaryCheckboxes(); application.uiScrollToTop(container); application.uiCheckLabels(); } } else { if (result.action.Code != 100) { if (result.action.Validation != null) { errorMessage = '<div class="title">' + result.action.Message + '</div>' + '<p>' + result.action.Validation[0].Error + '</p>'; } else { errorMessage = '<div class="title">' + result.action.Message + '</div>'; } application.createMessage(errorMessage); } } }); } },orderNextStep: function (e) { if ($('#delivery-address-data').index() >= 0) { var allEdited = true; $('#delivery-address-data input[required]').each(function () { if (allEdited === false) { return; } else { if ($(this).val() == '') { allEdited = false; } } }); if (allEdited === false) { var errorMessage = $(e.currentTarget).next().next().val(); application.createMessage(errorMessage, 3000); return; } else if ($('input[name="invoice"]').hasClass('company') && $('input[name="tin"]').val() == '' && $('input[name="tin"]').prop('required')) { var message = $('input[name="company"]').attr('data-info'); application.createMessage(message, 2000); } else { var data = $('#delivery-address-data').serializeArray(); var validate = application.uiValidateForm($('#delivery-address-data'));
Szablon Opal
WskazówkaPliki potrzebne do aktualizacji paczkomatów i punktów odbioru osobistego: Pobierz pliki- Wrzuć plik ‘collection-points.js’ do folderu ‘js’.
- Wrzuć plik ‘collection-points.css’ do folderu ‘css’.
- Podmień plik ’delivery-points-partial.html’, który znajduje się w folderze ‘order’.
- a) Jeśli kod szablonu nie był modyfikowany, podmień plik ‘data-form.html’, który znajduje się w folderze ‘order/cst-data’.
b) Jeśli kod szablonu był modyfikowany, podmień obecny widok mapy z paczkomatami linijką:
{% include 'order/delivery-points-partial.html' -%}
- W pliku ‘_layout.html’, na końcu sekcji ‘<head>’ dodaj poniży kod:
{% if page.PageId == config.DefinedPages.Order.Id -%} <link rel="stylesheet" type="text/css" href="https://geowidget.easypack24.net/css/easypack.css"> <link rel="stylesheet" type="text/css" href="css/collection-points.css"> {% endif -%}
- W pliku ‘order-cart.html’, do bloku ‘{% block PageBodyEnd -%}’ dodaj poniży kod:
<script async src="https://geowidget.easypack24.net/js/sdk-for-javascript.js"></script> <script src="js/collection-points.js"></script>
- Dodaj tłumaczenie: - TypeAdress: "Wpisz adres"
- Aby paczkomaty działały poprawnie również przy przechodzeniu na poprzedni i następny krok koszyka:
a) Jeśli kod szablonu nie był modyfikowany, podmień plik ‘order.js’, który znajduje się w folderze ‘js’.
b) Jeśli kod szablonu był modyfikowany, wywołaj funkcje:
orderCollectionPoints.easyPackAsyncInit();
orderCollectionPoints.getCollectionPoints();
w tych funkcjach, które są wywoływane przy zmianie sekcji na ‘customerData’ w koszyku:
Zmienione fragmenty pliku ‘order.js’, to:
orderForm.on('click', '#customer-data-form', function (e) { e.preventDefault(); $.get('', {__template: 'order/cst-data/data-form.html'}, function (res) { orderForm.find('.content').html(res.template); if ($('#easypack-map').length > 0) { orderCollectionPoints.easyPackAsyncInit(); } if($('#collection-points-searcher').length > 0) { orderCollectionPoints.getCollectionPoints(); } window.sessionStorage.setItem('continueWithoutRegistration', true); }); });
if (step && step == 'ThankYou') { $("#order-form").find("script").each(function () { eval($(this).text()); });var initStep = (function f(e, step) { if (!$('.order').hasClass('cart-empty')) { stepsLinks(); }
if (window.sessionStorage.getItem('continueWithoutRegistration')) { window.sessionStorage.removeItem('continueWithoutRegistration'); } }
if (step && step == 'CustomerData') { window.sessionStorage.setItem('toSkip', true);
if (window.sessionStorage.getItem('continueWithoutRegistration')) { $.get('', {__template: 'order/cst-data/data-form.html'}, function (res) { orderForm.find('.content').html(res.template); if ($('#easypack-map').length > 0) { orderCollectionPoints.easyPackAsyncInit(); } if($('#collection-points-searcher').length > 0) { orderCollectionPoints.getCollectionPoints(); } }); } } return f; })();orderForm.on('click', '.recalculate, #remove-points', function (e) { e.preventDefault(); $.post(null, { __collection: 'customer.Cart.Value', __template: 'order/cart.html', __csrf: __CSRF, __action: 'cart/Recalculate' }, function (d) { CreateTooltip(d.action); showTooltip(); $('.order-content').replaceWith(d.template); lazyCheck(); UpdateSmallCrt(d.collection); orderCollectionPoints.checkPointsAvailability(); }); });
Szablon Bursztyn
WskazówkaPliki potrzebne do aktualizacji paczkomatów i punktów odbioru osobistego: Pobierz pliki-
- Wrzuć plik „collectionpoints.js” do folderu „js”.
- Wrzuć plik “collectionpoints.css” do folderu “css” .
- W pliku html w sekcji <head> pod koniec znaczników <link> dodaj poniższy kod:
{% if page.PageId == config.DefinedPages.Order.Id -%} <link rel="stylesheet" type="text/css" href="https://geowidget.easypack24.net/css/easypack.css"> <link rel="stylesheet" type="text/css" href="css/collectionpoints.css"> {% endif -%}
- W pliku ‘order-cart.html’, do bloku ‘{% block PageBodyEnd -%}’ dodaj poniży kod:
<script async src="https://geowidget.easypack24.net/js/sdk-for-javascript.js"></script> <script src="js/collection-points.js"></script>
- Plik cart.html:
a) Jeśli kod szablonu nie był modyfikowany, wystarczy podmienić plik, który znajduje się w katalogu ‘order’.
b) Jeśli kod szablonu był modyfikowany, podmień obecny widok mapy z paczkomatami następującym kodem:
{% if settings.googleMapsKey == '' or cart.SelectedDelivery.CollectionPointTypeId == 1 -%} <div id="collection-points-searcher" class="collection-points-search-box {% if cart.SelectedDelivery.CollectionPointTypeId == 1 -%} personal-collection-points {% endif -%}"> <input placeholder="{% if cart.SelectedDelivery.CollectionPointTypeId == 1 -%} {{transla-tions.TypeAdress}} {% else -%}{{translations.Crt_MachineCodeOrAdress}}{% endif -%}" type="search" id="machines-filter-input" class="collection-point-search-input"> <span class="fa fa-search"></span> <div class="collection-points-result hidden"><ul></ul></div> </div> {% elsif settings.googleMapsKey != '' and cart.SelectedDelivery.CollectionPointTypeId == 2 -%} <div id="easypack-map"></div> {% endif -%} </div> {% endif -%}{% if cart.SelectedDelivery.CollectionPointTypeId == 2 or cart.SelectedDelivery.CollectionPointTypeId == 1 -%} <div class="col-sm-12 geowidget-container" id="map"> <h2> {% if cart.SelectedDelivery.CollectionPointTypeId == 1 -%} {{translations.Crt_ChooseCollectionPoint}} {% else -%} {{translations.Crt_ChooseInpostMachine}} {% endif -%} </h2>
- Plik order-short-info.html :
a) Jeśli kod szablonu nie był modyfikowany, podmień plik znajdujący się w folderze ‘order’
b) Jeśli kod szablonu był modyfikowany, podmień linijkę {% assign displayOptions = include %} (znajdującą się na początku dokumentu), poniższym kodem:
{% if page.POST.__include %} {% assign displayOptions = page.POST.__include %} {% else %} {% assign displayOptions = include %} {% endif %}
- Plik cart-products-partial.html:
a) Jeśli kod szablonu nie był modyfikowany, podmień plik znajdujący się w folderze ‘order’
b) Jeśli kod szablonu był modyfikowany, proszę usunąć poniższy kod znajdujący się pod koniec znacznika <div class=”custom-collection”> :
{% if settings.googleMapsKey != '' and deliveryData.CollectionPoints[deliveryData.CollectionPointId].Latitude <> "" and deliveryData.CollectionPoints[deliveryData.CollectionPointId].Longitude <> "" and step == 'summary' -%} <p class="collection-localization"> <span class="glyphicon glyphicon-map-marker"></span> {{translations.Crt_LocateOnMap}} </p> <div id="map-canvas" data-step="{{step}}" data-type="{{deliveryData.CollectionPointTypeId}}" data-lat="{{deliveryData.CollectionPoints[deliveryData.CollectionPointId].Latitude}}" data-lng="{{deliveryData.CollectionPoints[deliveryData.CollectionPointId].Longitude}}"></div> {% endif -%}
- Aby paczkomaty działały poprawnie podczas przechodzenia na poprzedni oraz następny krok koszyka należy: a) Jeśli kod szablonu nie był modyfikowany, podmień plik ‘order.js’ znajdujący się w folderze ‘js’ b) Jeśli kod szablonu był modyfikowany, należy wywołać orderCollectionPoints.cpCheck() oraz orderCollectionPoints .checkPackage() na końcu funkcji, która przenosi użytkownika do poprzedniego kroku koszyka.Funkcja orderCollectionPoints.cpCheck() jest odpowiedzialna za inicjalizację mapy bądź listy paczkomatów na danej stronie. Z kolei orderCollectionPoints.checkPackage() sprawdza czy paczkomat do którego ma być zrealizowane zamówienie został już wybrany.Funkcja orderCollectionPoints.cpCheck() należałoby również dodać do zdarzenia obsługującego zmianę sposobu dostawy.Ostatnią rzeczą jaką trzeba zrobić na koniec zamówienia, kiedy klient zrealizuje już transakcję, to dodanie linijki sessionStorage.removeItem(‘paczka’). Ma ona na celu usunięcia informacji o wybranym paczkomacie.
WskazówkaPrzeczytaj więcej o nowym API serwisu InPost.Obsługa kanałów do zgody na newsletter w darmowych szablonach graficznych Comarch e-Sklep
WskazówkaOd 1 czerwca 2025 roku zakończyliśmy aktualizację oraz wydawanie nowych wersji szablonów Bursztyn, Agat i Opal, a tym samym ich wsparcie, aby skupić się na nowoczesnych rozwiązaniach, które jeszcze lepiej odpowiadają na potrzeby dynamicznie rozwijającego się rynku e-commerce. Zachęcamy Was do przejścia na nasze nowe, udoskonalone szablony. Dla sklepów B2C polecamy szablony Topaz, One Page Shop oraz Dla Gastronomii, natomiast dla platform B2B idealnym wyborem będą Rubin i Szafir.Listę zgód wyświetlanych w newsletterze możemy znaleźć w tablicy przechowywanej w obiekcie config.TOS.Consents.Newsletter. Poniższa pętla pozwoli nam wyświetlić wszystkie zgody znajdujące się w obiekcie Newsletter:{% for tos in config.TOS.Consents.Newsletter -%}
<label class="statement tos-name">{{tos.Text}}</label> {% endif -%} Jeżeli interesuje nas pokazanie wszystkich kanałów znajdujących się w danej zgodzie to warto najpierw przypisać ich ilość do konkretnej zmiennej liquidowej. W każdej pojedynczej zgodzie kanały możemy znaleźć w obiekcie Channels.{% assign channelsSize = tos.Channels | Size -%} Teraz wystarczy tylko napisać prostą pętle „for” Poniżej przykład wykorzystujący listę.
{% if channelsSize > 0 -%} <ul class="channels disabled"> {% for chn in tos.Channels -%} <li class="channel"> <input id="channel{{ chn.Key }}" type="checkbox" name="channelKey" value="{{ chn.Key }}" disabled/> <div class="channel-switch input-switch "><div class="switch-button"></div></div> <label for="channel{{ chn.Key }}">{{chn.Name}}</label> </li> {% endfor -%} </ul> {% endif -%}
Szablon Agat
1.Zmień pętlę for wyświetlającą checkboxy ze zgodami w pliku 'footer.html', który znajduje się w folderze 'partials/common'{% for tos in config.TOS.Consents.Newsletter -%} <div class="input-group switches"> <label class="switch"> <span class="switch-name summary-tos-switch-name">{% if tos.Required -%}* {% endif -%}{{ tos.Text }}</span> <input class="switch-input" type="checkbox" name="tos" value="{{ tos.Id }}" {% if tos.Required -%} data-required="req" {% endif -%}/> <span class="switch-label"></span> <span class="switch-handle"></span> </label> </div> {% endfor -%}
{% for tos in config.TOS.Consents.Newsletter -%} {% assign channelsSize = tos.Channels | Size -%} <li class="{% if channelsSize > 0 -%}multiple-choice {% endif -%} {% if tos.Required -%} required-consent{% endif -%}"> <div class="input-group switches"> {% if tos.Statement %} <p class="multiple-switch">{% if tos.Required -%}* {% endif -%}{{ tos.Text }}</p> {% else %} <span class="main-consent-warning tos-warning"><span class="fa fa-exclamation-triangle"></span>{{translations.MainConsentWarning}}</span> <label class="switch"> <span class="switch-name summary-tos-switch-name">{% if tos.Required -%}* {% endif -%}{{ tos.Text }}</span> <input class="switch-input" type="checkbox" name="tos" value="{{ tos.Id }}" {% if tos.Required -%} data-required="req" {% endif -%}/> <span class="switch-label"></span> <span class="switch-handle"></span> </label> {% endif -%}
{% if channelsSize > 0 -%} <span class="channel-warning tos-warning"><span class="fa fa-exclamation-triangle"></span>{{translations.ChannelWarning}}</span> {% for chn in tos.Channels -%} <label class="switch channel-switch {% if tos.Statement == false %} unactive-switch{% endif -%}"> <span class="switch-name">{{chn.Name}}</span> <input class="switch-input channel-checkbox" type="checkbox" name="channelKey" value="{{ chn.Key }}" {% if tos.Required -%} data-required="req" {% endif -%} {% if tos.Statement == false %} disabled{% endif -%}/> <span class="switch-label"></span> <span class="switch-handle"></span> </label> {% endfor -%} {% endif -%} </div> </li> {% endfor -%} 2.W pliku 'init.js' uzupełnij funkcję uiValidateForm o walidację pól kanałów. Plik znajduje się w folderze 'js'.uiValidateForm: function (form) { var formRequiredInputs = form.find('input[required], textarea[required]'); var tosInputs = form.find('input[type="checkbox"]'); var formInvalidInfo = form.data('invalid'); var emailInvalidInfo = form.data('email-invalid'); var postCodeInvalidInfo = form.data('pcode-invalid'); var tinInvalidInfo = form.data('tin-invalid'); var tosRequiredInfo = form.data('tos-invalid'); var warningTosInfos = form.find('.tos-warning'); var tosRequiredValid = true; var tinInputValid = true; var emailInputValid = true; var postCodeInputValid = true; var isEmpty = false; var checkedChannels = []; var channelsInputs;
$.each(formRequiredInputs, function (key, value) { $(value).addClass('validationStyles'); if ($(value).val() == '') { isEmpty = true; } if ($(value).attr('name') === 'email') { emailInputValid = application.uiValidateEmail($(value).val()); } if ($(value).attr('name') === 'zipCode') { postCodeInputValid = application.uiValidatePostCode($(value).val(), $(value).attr('pattern')); } if ($(value).attr('name') === 'tin') { tinInputValid = application.uiValidateTinCode($(value).val(), $(value).attr('pattern')); } }); $.each(tosInputs, function (key, value) { if ($(value).data('required') === 'req') { if (!$(value).prop('checked')) { $(value).closest('label').addClass('required-checkbox-warning'); } if ($(value).hasClass('channel-checkbox')) { channelsInputs = $(value).closest('.input-group').find('.channel-checkbox'); $.each(channelsInputs, function (key, value) { if ($(value).prop('checked')) { checkedChannels.push($(value)); } }); if (checkedChannels.length > 0) { tosRequiredValid = true } else { tosRequiredValid = false } if (warningTosInfos.length > 0) { $.each(warningTosInfos, function (key, value) { if ($(value).is(":visible")) { tosRequiredValid = false; } }); } } else if (!$(value).prop('checked')) { tosRequiredValid = false; } } }); if (tosRequiredValid && tinInputValid && postCodeInputValid && emailInputValid && !isEmpty) { return true; } else if (!emailInputValid) { application.createMessage(emailInvalidInfo); } else if (!postCodeInputValid) { application.createMessage(postCodeInvalidInfo); } else if (!tinInputValid) { application.createMessage(tinInvalidInfo); } else if (!tosRequiredValid) { application.createMessage(tosRequiredInfo); } else { application.createMessage(formInvalidInfo); } },uiValidateForm: function (form) { var formRequiredInputs = form.find('input[required], textarea[required]'); var tosInputs = form.find('input[type="checkbox"]'); var formInvalidInfo = form.data('invalid'); var emailInvalidInfo = form.data('email-invalid'); var postCodeInvalidInfo = form.data('pcode-invalid'); var tinInvalidInfo = form.data('tin-invalid'); var tosRequiredInfo = form.data('tos-invalid'); var warningTosInfos = form.find('.tos-warning'); var tosRequiredValid = true; var tinInputValid = true; var emailInputValid = true; var postCodeInputValid = true; var isEmpty = false; var checkedChannels = []; var channelsInputs;
$.each(formRequiredInputs, function (key, value) { $(value).addClass('validationStyles'); if ($(value).val() == '') { isEmpty = true; } if ($(value).attr('name') === 'email') { emailInputValid = application.uiValidateEmail($(value).val()); } if ($(value).attr('name') === 'zipCode') { postCodeInputValid = application.uiValidatePostCode($(value).val(), $(value).attr('pattern')); } if ($(value).attr('name') === 'tin') { tinInputValid = application.uiValidateTinCode($(value).val(), $(value).attr('pattern')); } }); $.each(tosInputs, function (key, value) { if ($(value).data('required') === 'req') { if (!$(value).prop('checked')) { $(value).closest('label').addClass('required-checkbox-warning'); } if ($(value).hasClass('channel-checkbox')) { channelsInputs = $(value).closest('.input-group').find('.channel-checkbox'); $.each(channelsInputs, function (key, value) { if ($(value).prop('checked')) { checkedChannels.push($(value)); } }); if (checkedChannels.length > 0) { tosRequiredValid = true } else { tosRequiredValid = false } if (warningTosInfos.length > 0) { $.each(warningTosInfos, function (key, value) { if ($(value).is(":visible")) { tosRequiredValid = false; } }); } } else if (!$(value).prop('checked')) { tosRequiredValid = false; } } }); if (tosRequiredValid && tinInputValid && postCodeInputValid && emailInputValid && !isEmpty) { return true; } else if (!emailInputValid) { application.createMessage(emailInvalidInfo); } else if (!postCodeInputValid) { application.createMessage(postCodeInvalidInfo); } else if (!tinInputValid) { application.createMessage(tinInvalidInfo); } else if (!tosRequiredValid) { application.createMessage(tosRequiredInfo); } else { application.createMessage(formInvalidInfo); } }, 3.Aby walidacja działała poprawnie, dodaj dodatkowe funkcje w pliku 'init.js', w obiekcie application (uicheckIfParentChecked, uicheckIfTosChannelChecked)uicheckIfParentChecked: function(e) { var parentBox = $(e.currentTarget).closest('.multiple-choice'); var elementParentTos = parentBox.find('input[name=tos]'); var consentWarning = parentBox.find('.main-consent-warning'); var channelWarning = parentBox.find('.channel-warning'); var tosChannels = parentBox.find('.channel-checkbox'); var checkedChannels = []; var elementParentTosChecked, parentTosName;
if (elementParentTos.length > 0) { elementParentTosChecked = $(elementParentTos[0]).prop('checked'); parentTosName = parentBox.find('.input-group > label .switch-name'); consentWarning = $(elementParentTos[0]).closest('.input-group').find('.main-consent-warning'); if (!elementParentTosChecked) { $(parentTosName[0]).css({ 'color': '#ff3a3a', 'transition': '200ms' }); $(consentWarning[0]).show(); } if (!$(e.currentTarget).prop('checked') || elementParentTosChecked) { $(parentTosName[0]).css({ 'color': '', 'transition': '200ms' }); $(consentWarning[0]).hide(); } if (!$(e.currentTarget).prop('checked') && !elementParentTosChecked) { $(parentTosName[0]).css({ 'color': '', 'transition': '200ms' }); $(consentWarning[0]).hide(); $(e.currentTarget).prop('disabled', true); $(e.currentTarget).closest('.channel-switch').addClass('unactive-switch'); } if ($(e.currentTarget).prop('checked')) { $(channelWarning[0]).hide(); } else { $.each(tosChannels, function (key, value) { if ($(value).prop('checked')) { checkedChannels.push($(value)); } }); if (checkedChannels.length === 0 && elementParentTosChecked) { $(channelWarning[0]).show(); } } } }, uicheckIfTosChannelChecked: function (e) { var parentBox = $(e.currentTarget).closest('.multiple-choice'); var tosChannels = parentBox.find('.channel-checkbox'); var checkedChannels = []; var channelWarning = parentBox.find('.channel-warning'); var consentWarning = parentBox.find('.main-consent-warning'); var isChecked = $(e.currentTarget).prop('checked'); var tosName = $(e.currentTarget).closest('label').find('.switch-name'); $.each(tosChannels, function (key, value) { if ($(value).prop('checked')) { checkedChannels.push($(value)); } }); if (checkedChannels.length > 0 && !isChecked) { $(channelWarning[0]).hide(); $.each(tosChannels, function (key, value) { $(value).closest('.channel-switch').addClass('unactive-switch'); $(value).prop('disabled', true); $(value).prop("checked", false); }); } if (checkedChannels.length > 0 && isChecked) { $(channelWarning[0]).hide(); $(tosName[0]).css({ 'color': '', 'transition': '200ms' }); $(consentWarning[0]).hide(); } if (checkedChannels.length === 0 && isChecked) { $(channelWarning[0]).show(); $.each(tosChannels, function (key, value) { $(value).closest('.channel-switch').removeClass('unactive-switch'); $(value).removeAttr('disabled'); }); } if (checkedChannels.length === 0 && !isChecked) { $(channelWarning[0]).hide(); $.each(tosChannels, function (key, value) { $(value).closest('.channel-switch').addClass('unactive-switch'); $(value).prop('disabled', true); }); } }, 4.Wywołaj nowe funkcje w pliku 'init.js', w obiekcie application.events$('body').on('click', '.channel-checkbox', function (e) { self.uicheckIfParentChecked(e); });
$('body').on('click', '.multiple-choice .input-group > label .switch-input[name=tos]', function (e) { self.uicheckIfTosChannelChecked(e); }); 5.Dodaj tłumaczenia: - MainConsentWarning: "Wyraź zgodę" - ChannelWarning: "Wybierz przynajmniej jeden kanał" 6.Uzupełnij plik '480plus.css', który znajduje się w folderze 'css', o style:.multiple-switch { margin: 0 0 20px; }
.multiple-choice .main-consent-warning, .multiple-choice .channel-warning, .input-group.switches .main-consent-warning, .input-group.switches .channel-warning { display: none; position: relative; font-size: 11px; color: #ff3a3a; top: -20px; left: -51px; } .multiple-choice .main-consent-warning .fa, .multiple-choice .channel-warning .fa, .input-group.switches .main-consent-warning .fa, .input-group.switches .channel-warning .fa { margin: 0 5px 0 0; } .input-group label.required-checkbox-warning .switch-name { color: #ff3a3a !important; } .input-group label.required-checkbox-warning .switch-name a.cp_link { color: #ff3a3a; } form .input-group .switch.unactive-switch { opacity: .5; cursor: not-allowed; }Szablon Bursztyn
W pliku homepage.html proszę zastąpić poniższy kod:{% for tos in config.TOS.Consents.Newsletter -%} {% if tos.Statement -%} <label>{{tos.Text}}</label> {% else -%} <input name="tos" id="tos{{ tos.Id }}" type="checkbox" value="{{ tos.Id }}" {% if tos.Required -%} required {% endif -%} /> <div class="input-switch "><div class="switch-button"></div></div> <label for="tos{{ tos.Id }}">{% if tos.Required -%}*{% endif -%} {{tos.Text}}</label> {% endif -%} {% endfor -%}
następującym:{% for tos in config.TOS.Consents.Newsletter -%} {% assign channelsSize = tos.Channels | Size -%} <div class="single-tos {% if channelsSize > 0 -%} channels {% endif %}"> {% if tos.Statement -%} <label class="statement tos-name">{{tos.Text}}</label> {% else -%} <div class="tos-switch"> <input name="tos" id="tos{{ tos.Id }}" type="checkbox" value="{{ tos.Id }}" {% if tos.Required -%} required {% endif -%} /> <div class="input-switch "><div class="switch-button"></div></div> <label for="tos{{ tos.Id }}">{% if tos.Required -%}*{% endif -%} {{tos.Text}}</label> </div> {% endif -%} {% if channelsSize > 0 -%} <ul class="channels disabled"> {% for chn in tos.Channels -%} <li class="channel"> <input id="channel{{ chn.Key }}" type="checkbox" name="channelKey" value="{{ chn.Key }}" disabled/> <div class="channel-switch input-switch "><div class="switch-button"></div></div> <label for="channel{{ chn.Key }}">{{chn.Name}}</label> </li> {% endfor -%} </ul> {% endif -%} </div> {% endfor -%}
Szablon Opal
W pliku homepage.html proszę zastąpić poniższy kod:{% for tos in config.TOS.Consents.Newsletter -%} {% if tos.Statement -%} <label>{{tos.Text}}</label> {% else -%} <input name="tos" id="tos{{ tos.Id }}" type="checkbox" value="{{ tos.Id }}" {% if tos.Required -%} required {% endif -%} /> <div class="input-switch "><div class="switch-button"></div></div> <label for="tos{{ tos.Id }}">{% if tos.Required -%}*{% endif -%} {{tos.Text}}</label> {% endif -%} {% endfor -%}
następującym:{% for tos in config.TOS.Consents.Newsletter -%} {% assign channelsSize = tos.Channels | Size -%} <div class="single-tos"> {% if tos.Statement -%} <label class="statement-reg tos-name">{{tos.Text}}</label> {% else -%} <div class="tos-switch single-switch"> <input name="tos" id="tos{{ tos.Id }}" type="checkbox" value="{{ tos.Id }}" {% if tos.Required -%} required {% endif -%} /> <div class="input-switch "><div class="switch-button"></div></div> <label for="tos{{ tos.Id }}">{% if tos.Required -%}*{% endif -%} {{tos.Text}}</label> </div> {% endif -%} {% if channelsSize > 0 -%} <ul class="channels-list"> {% for chn in tos.Channels -%} <li class="channel single-switch"> <input id="channel{{ chn.Key }}" type="checkbox" name="channelKey" value="{{ chn.Key }}"/> <div class="input-switch "><div class="switch-button"></div></div> <label for="channel{{ chn.Key }}">{{chn.Name}}</label> </li> {% endfor -%} </ul> {% endif -%} </div> {% endfor -%}
Kanał e-mail
Jeśli wprowadziłeś powyższe zmiany, a w swoich zgodach posiadasz tylko kanał e-mail i chcesz zaoszczędzić zbędnego klikania swoim klientom to poniżej znajduje się instrukcja co należy zmienić w kodzie. Te zmiany sprawią, że kanał e-mail będzie zawsze zaznaczony i nie będzie się go dało odznaczyć.Szafir
Plik init-ui2.jsZnajdź funkcję toggleChannels. W niej jest zdeklarowana zmienna var inputs = container.find('[name=channelKey]');. Zmień ją na var inputs = container.find('[name=channelKey]:not([type=hidden])');Pliki home.html, sign-up-no-address.html, common/address-form-register-full.html, customer-profile/your-account/employee-update.html, order/cart.html, __loginconsents.liquidZnajdź w tych plikach taki fragment kodu:{% if channelsSize > 0 -%}
Usuń go, a w jego miejsce wklej ten fragment kodu: {% endif -%} {% for channel in tos.Channels -%} {% endfor -%}{% if channelsSize > 0 -%} {% assign onlyEmail = false -%} {% if channelsSize == 1 and tos.Channels[0].Type == 1 -%} {% assign onlyEmail = true -%} {% endif -%} {% if onlyEmail == false -%}
{% endif -%} {% endif -%} {% for channel in tos.Channels -%} {% endfor -%}Agat
Pliki partials/cart/delivery-and-payment.html, partials/common/footer.html, partials/common/registration-consents.html, __loginconsents.liquidZnajdź w tych plikach taki fragment kodu:{% if channelsSize > 0 -%} {{translations.ChannelWarning}} {% for chn in tos.Channels -%}
{% endfor -%} {% endif -%} Usuń go, a w jego miejsce wklej ten fragment kodu:{% if channelsSize > 0 -%} {% assign onlyEmail = false -%} {% if channelsSize == 1 and tos.Channels[0].Type == 1 -%} {% assign onlyEmail = true -%} {% endif -%} {% if onlyEmail == false -%} {{translations.ChannelWarning}} {% endif -%} {% for chn in tos.Channels -%}
{% endfor -%} {% endif -%}Bursztyn
Plik init.jsWyszukaj frazę channels i zamień wszystkie jej wystąpienia w tym pliku na channels:not(.only-email)Pliki homepage.html, customer/registration.html, order/stepsummary.html, __loginconsents.liquidZnajdź w tych plikach taki fragment kodu:{% if channelsSize > 0 -%}
-
- {% for chn in tos.Channels -%}
-
-
{% if channelsSize > 0 -%} {% assign onlyEmail = false -%} {% if channelsSize == 1 and tos.Channels[0].Type == 1 -%} {% assign onlyEmail = true -%} {% endif -%}
-
- {% for chn in tos.Channels -%}
- {% if onlyEmail == false -%} {% else -%} {% endif -%}
- {% if onlyEmail == false -%} {% else -%} {% endif -%}
Opal
Plik init.jsWyszukaj frazę channels-list i zamień wszystkie jej wystąpienia w tym pliku na channels-list:not(.only-email)Pliki homepage.html, customer/registration.html, order/stepsummary.html, __loginconsents.liquidZnajdź w tych plikach taki fragment kodu:{% if channelsSize > 0 -%}
-
- {% for chn in tos.Channels -%}
-
-
{% if channelsSize > 0 -%} {% assign onlyEmail = false -%} {% if channelsSize == 1 and tos.Channels[0].Type == 1 -%} {% assign onlyEmail = true -%} {% endif -%}
-
- {% for chn in tos.Channels -%}
- {% if onlyEmail == false -%} {% else -%} {% endif -%}
- {% if onlyEmail == false -%} {% else -%} {% endif -%}
Jak dostosować szablony do integracji z Google Tag Manager?
WskazówkaOd 1 czerwca 2025 roku zakończyliśmy aktualizację oraz wydawanie nowych wersji szablonów Bursztyn, Agat i Opal, a tym samym ich wsparcie, aby skupić się na nowoczesnych rozwiązaniach, które jeszcze lepiej odpowiadają na potrzeby dynamicznie rozwijającego się rynku e-commerce. Zachęcamy Was do przejścia na nasze nowe, udoskonalone szablony. Dla sklepów B2C polecamy szablony Topaz, One Page Shop oraz Dla Gastronomii, natomiast dla platform B2B idealnym wyborem będą Rubin i Szafir.1. Wstęp
W związku ze zmianami w Comarch e-Sklep od wersji 2018.6, które poszerzają zakres integracji z Google Tag Manager, szablony w wersji starszej będą wymagały wprowadzenia zmian, które pozwolą na wykorzystanie w pełni funkcjonalności opisanych w artykule Integracja z Google Tag Manager.UwagaPoniższa konfiguracja przeznaczona jest dla użytkowników posiadających e-Sklep w wersji 2018.6 lub wyższej ale z szablonami w starszej wersji. Pliki szablonu, fragmenty ich kodu oraz modyfikacje przedstawione w instrukcji dotyczą darmowych szablonów Comarch. W przypadku szablonów indywidualnych miejsce wklejenia skryptów niezbędnych do dostosowania szablonu powinien wskazać twórca szablonu2. Implementacja skryptów
Jeżeli przed wersją 2018.6 integracja była już konfigurowana to konieczne będzie usunięcie starego skryptu dodanego do ostatniej strony zamówienia. W tym celu w panelu administracyjnym sklepu przejdź do obszaru Wygląd sklepu / Ustawienia / Edytuj ustawienia zaawansowane / Edytuj HTML i usuń z pliku lastpagescripts.html poniższy skrypt:<script> dataLayer.push({{ page.GTMDataLayer }}); dataLayer.push({event:'UaTrack',VirtualPath:null}); </script>
W zależności od szablonu plik lastpagescripts.html będzie zlokalizowany w innym miejscu w strukturze plików:- Szablon Bursztyn, Opal i Szafir - order / lastpagescripts.html
- Szablon Agat - partials / cart / lastpagescripts.html
<script>var dataLayer=[{{ page.GTMDataLayer }}];</script>
na nowy:<script>var dataLayer={{ page.GtmDL }};</script>
Kolejny skrypt należy umieścić w pliku odpowiedzialnym za koszyk<script> (function(){ var i,dl={{ page.GtmDL }}; for(i in dl) dataLayer.push(dl[i]); })(); </script>
W zależności od szablonu będzie to inny plik - nazwa i lokalizacja pliku oraz miejsce wklejenia powyższego skryptu wskazane poniżej:- Szablon Bursztyn, Opal - order-cart-container.html
- Szablon Agat - partials / cart / cart-template.html
- Szablon Szafir - order / cart.html
oraz w pliku order / thx.html
WskazówkaPamiętaj o zapisaniu i publikacji wszystkich zmian wykonanych w szablonie. Po przygotowaniu szablonu zgodnie z powyższymi instrukcjami możesz przejść do konfiguracji integracji Twojego sklepu z Google Tag Manager opisanej w artykule Integracja z Google Tag Manager.3. Przydatne linki
Google Tag Manager: Pomoc Strona serwisu Dokumentacja programistyczna Google Analytics: Strona serwisu Dokumentacja programistycznaDodawanie kanałów do płatności online w szablonach
WskazówkaOd 1 czerwca 2025 roku zakończyliśmy aktualizację oraz wydawanie nowych wersji szablonów Bursztyn, Agat i Opal, a tym samym ich wsparcie, aby skupić się na nowoczesnych rozwiązaniach, które jeszcze lepiej odpowiadają na potrzeby dynamicznie rozwijającego się rynku e-commerce. Zachęcamy Was do przejścia na nasze nowe, udoskonalone szablony. Dla sklepów B2C polecamy szablony Topaz, One Page Shop oraz Dla Gastronomii, natomiast dla platform B2B idealnym wyborem będą Rubin i Szafir.Dodawanie kanałów do płatności online
Kanały w płatnościach online to inaczej sposób zapłaty. W tym artykule dowiesz się, jak je dodać w swoim szablonie.1. Bursztyn i Opal
W pliku order/cart.html dodaj poniższy kod:{% for delivery in cart.DeliveryMethods %} {% for payment in delivery.Payments %} {% if payment.Channels[0] and payment.Id == cart.SelectedDeliveryPaymentId %}
{% for channel in payment.Channels -%} {% endfor -%}{% endif %} {% endfor %} {% endfor %} Następnie konieczne jest również ostylowanie dodanego fragmentu, aby był spójny z resztą szablonu. Na końcu pliku scss/main2.scss dodaj poniższe style:.payment-channels{ background-color: $middleColor; display: flex; flex-wrap: wrap; margin-top: 11px; }
.payment-channel{ display: inline-block; width: calc(100%/6 - 30px); min-width: 100px; height: 50px; margin: 15px; position: relative; [type=radio]{ position: absolute; opacity: 0; width: 0; height: 0; & + img{ cursor: pointer; max-width: 100px; max-height: 50px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } &:checked + img{ outline: 1px solid $primaryColor; } } }WskazówkaO tym jak skompilować i zminifikować pliki scss dowiesz się z artykułu o kompilacji i minifikacji plików.Gdy kanały są już dodane oraz dobrze wyświetlają się w szablonie, kolejny krok to włączenie ich działania. W tym celu na końcu pliku js/order.js należy wkleić poniższy kod:$('body').on('change', '.payment-channels [name=channel]', function (e) { e.preventDefault(); var id = $('.payment-channels').data('id'); var channel = $(e.currentTarget).val(); $.post(null, { __csrf: __CSRF, __action: 'Order/DeliveryChange', id: id, channel: channel }); });
WskazówkaO tym jak zminifikować pliki js dowiesz się z artykułu o kompilacji i minifikacji plików.Na koniec dodaj walidację, dzięki której nie będzie się dało złożyć zamówienia, jeśli żaden kanał nie został wybrany. W pliku js/order.js odnajdź funkcję oznaczoną komentarzem //next i dodaj w niej (w pierwszym warunku if ($(this).hasClass('start'))) w zależności od szablonu: Bursztyn:if($('.payment-channels').index() != -1 && $('.payment-channels [name=channel]:checked').index() == -1){ var tt = $('
'); tt.append(''+$('.payment-channels').data('validation')+''); $('body').append(tt); setTimeout(function(){tt.fadeOut(function(){tt.remove();});},3000); return tt; } Opal:if($('.payment-channels').index() != -1 && $('.payment-channels [name=channel]:checked').index() == -1){ var tt; if (sessionStorage.getItem('tooltip') != null){ tt = $(".tt.err"); } else { tt = $('
'); tt.append(''+$('.payment-channels').data('validation')+''); $('body').append(tt); sessionStorage.setItem('tooltip', 'err'); } showTooltip(); return; } Ostatnim krokiem jest dodanie komunikatu, który będzie wyświetlany w przypadku niezaznaczenia żadnego kanału. W tym celu w panelu administracyjnym (Wygląd sklepu/ Ustawienia/ Tłumaczenia) dodaj tłumaczenie o kluczu ChoosePaymentChannel i treści Wybierz sposób zapłaty (lub jakiejkolwiek innej, którą uważasz za stosowną).2. Agat:
W pliku partials/cart/cart-content.html dodaj poniższy kod:{% for deliveryMethodLvl in cart.DeliveryMethods -%} {% if deliveryMethodLvl.Name == cart.SelectedDelivery.Name %} {% for payment in deliveryMethodLvl.Payments -%} {% if payment.Channels[0] and payment.Id == cart.SelectedDeliveryPaymentId %}
{% for channel in payment.Channels -%} {% endfor -%}{% endif %} {% endfor -%} {% endif %} {% endfor -%} Następnie konieczne jest również ostylowanie dodanego fragmentu, aby był spójny z resztą szablonu. Na końcu pliku scss/main2.scss dodaj poniższe style:.payment-channels{ background-color: $bgColor; border: 1px solid $lighterColor; box-shadow: 2px 2px 1px 0 $bgColorFont; margin: 0 auto 20px; display: inline-flex; flex-wrap: wrap; width: calc(100% - 2px); @media only screen and (min-width: 481px) { width: calc(50% - 22px); min-width: 298px; margin: 0 10px 20px } @media only screen and (min-width: 769px) { width: calc(100% - 22px); } @media only screen and (min-width: 1441px) { width: calc(75% - 22px); } }
.payment-channel{ display: inline-block; width: calc(100%/6 - 30px); min-width: 100px; height: 50px; margin: 15px; position: relative; [type=radio]{ position: absolute; opacity: 0; width: 0; height: 0; & + img{ cursor: pointer; max-width: 100px; max-height: 50px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } &:checked + img{ outline: 1px solid $primaryColor; } } }WskazówkaO tym jak skompilować i zminifikować pliki scss dowiesz się z artykułu o kompilacji i minifikacji plików.Gdy kanały są już dodane oraz dobrze wyświetlają się w szablonie, kolejny krok to włączenie ich działania. W tym celu na końcu pliku js/order.js należy wkleić poniższy kod:$('body').on('change', '.payment-channels [name=channel]', function (e) { e.preventDefault(); var id = $('.payment-channels ').data('id'); var channel = $(e.currentTarget).val(); $.post(null, { __csrf: __CSRF, __action: 'Order/DeliveryChange', id: id, channel: channel }); });
WskazówkaO tym jak zminifikować pliki js dowiesz się z artykułu o kompilacji i minifikacji plików.Na koniec dodaj walidację, dzięki której nie będzie się dało złożyć zamówienia, jeśli żaden kanał nie został wybrany. W pliku js/order.js odnajdź funkcję orderNextStep i dodaj w niej (na początku else'a warunku if ($('#delivery-address-data').index() >= 0)) kolejny warunek do sprawdzenia:if($('.payment-channels').index() != -1 && $('.payment-channels [name=channel]:checked').index() == -1){ application.createMessage($('.payment-channels').data('validation'), 3000); return; }
Ostatnim krokiem jest dodanie komunikatu, który będzie wyświetlany w przypadku niezaznaczenia żadnego kanału. W tym celu w panelu administracyjnym (Wygląd sklepu/ Ustawienia/ Tłumaczenia) dodaj tłumaczenie o kluczu ChoosePaymentChannel i treści Wybierz sposób zapłaty (lub jakiejkolwiek innej, którą uważasz za stosowną).3. Szafir
W pliku order/delivery-partials/delivery-section.html dodaj poniższy kod:{% for indexString in matchedDeliveriesIndexesArray -%} {% assign index = indexString | ToInt -%} {% if order.SelectedDelivery.Name == order.DeliveryMethods[index].Name -%} {% for payment in order.DeliveryMethods[index].Payments -%} {% if payment.Id == order.SelectedDelivery.Payment.Id and payment.Channels[0] -%}
{% for channel in payment.Channels -%} {% endfor -%}{% endif -%} {% endfor -%} {% endif -%} {% endfor -%} Następnie konieczne jest również ostylowanie dodanego fragmentu, aby był spójny z resztą szablonu. Na końcu pliku scss/globals/_globals2.scss dodaj poniższe style:.order-ui .payment-channels-ui{ padding: 0; margin: 0 30px 15px 0; width: calc(100% - 30px); display: flex; flex-wrap: wrap; .message-bar-ui{ width: 100%; margin: 0; } }
.payment-channel-ui:not(.checkbox-ui):not(.radio-ui){ width: calc(100%/6 - 30px); min-width: 100px; height: 50px; margin: 15px; position: relative; [type=radio]{ position: absolute; opacity: 0; width: 0; height: 0; & + img{ cursor: pointer; max-width: 100px; max-height: 50px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } &:checked + img{ outline: 1px solid $primaryColor; } } } oraz w pliku scss/globals/_globals-m.scss:.order-ui .payment-channels-ui { margin-right: 0; width: 100%; }
WskazówkaO tym jak skompilować i zminifikować pliki scss dowiesz się z artykułu o kompilacji i minifikacji plików.Gdy kanały są już dodane oraz dobrze wyświetlają się w szablonie, kolejny krok to włączenie ich działania. W tym celu na końcu pliku js/init-ui2.js należy wkleić poniższy kod:function choosePaymentChannel(e) { var form = $('.delivery-form-lq'); var data = form.serializeArray(); data.push({ name: '__csrf', value: __CSRF }); data.push({ name: 'channel', value: $(e.currentTarget).val() }); $.post('', data); $('.payment-channels-lq .form-error-lq').remove(); };
$('body').on('change', '.payment-channel-lq [name=channel]', function (e) { choosePaymentChannel(e); });WskazówkaO tym jak zminifikować pliki js dowiesz się z artykułu o kompilacji i minifikacji plików.Na koniec dodaj walidację, dzięki której nie będzie się dało złożyć zamówienia, jeśli żaden kanał nie został wybrany. W pliku js/init-ui1.js odnajdź funkcję addOrder i dodaj w niej (zaraz pod pierwszym warunkiem if (ajaxModalSelector && this.hiddingClass)) kolejny warunek do sprawdzenia:if ($('.payment-channels-lq').index() != -1 && $('.payment-channel-lq [name=channel]:checked').index() == -1) { $('.payment-channels-lq').append('
'); guardian = false; } Ostatnim krokiem jest dodanie komunikatu, który będzie wyświetlany w przypadku niezaznaczenia żadnego kanału. W tym celu w pliku _layout.html odnajdź skrypt ze zmienną __translations i dopisz w nim kolejną linijkę: ChoosePaymentMethod: '{{ translations.ChoosePaymentMethod | H }}'. Następnie w panelu administracyjnym (Wygląd sklepu/ Ustawienia/ Tłumaczenia) dodaj tłumaczenie o kluczu ChoosePaymentMethod i treści Wybierz sposób zapłaty (lub jakiejkolwiek innej, którą uważasz za stosowną).Obsługa towaru archiwalnego
WskazówkaOd 1 czerwca 2025 roku zakończyliśmy aktualizację oraz wydawanie nowych wersji szablonów Bursztyn, Agat i Opal, a tym samym ich wsparcie, aby skupić się na nowoczesnych rozwiązaniach, które jeszcze lepiej odpowiadają na potrzeby dynamicznie rozwijającego się rynku e-commerce. Zachęcamy Was do przejścia na nasze nowe, udoskonalone szablony. Dla sklepów B2C polecamy szablony Topaz, One Page Shop oraz Dla Gastronomii, natomiast dla platform B2B idealnym wyborem będą Rubin i Szafir.Obsługa towaru archiwalnego
W tym artykule dowiesz się jak obsłużyć towar archiwalny na stronie ze szczegółami towaru w swoim szablonie.Szafir
W pliku product/product-presentation-data.html wyszukaj frazę header. Jest to element, w którym trzeba dodać warunek, aby ostatecznie wyglądało to tak:{% if product.Archival == false -%} . . . {% endif -%}
Następnie wyszukaj frazę add-to-cart-container-ui. Jest to kontener, w którym na samym początku wyświetlane są punkty lojalnościowe i flagi. Trzeba je uwarunkować, żeby nie pojawiały się przy towarze archiwalnym. Zamiast nich powinna się pojawić informacja o tym, że jest to towar archiwalny. Początek tego kontenera powinien wyglądać następująco:{% if product.Archival -%}
{{ translations.ArchivalProductInfo }}{% else -%} {% if activeProduct.Points != null and usr.Authenticated -%} {% capture quantityUnit -%}1 {{ product.SaleUnit }}{% endcapture -%}{{ translations.EarnLoyaltyPoints | Format:quantityUnit }}: {{ activeProduct.Points }} {{ translations.PointsShortcut }}{% endif -%}-
- {% assign flagsQuantity = product.Flags | Size -%} {% for flag in product.Flags limit: 3 -%}
- {% if flag.Type == "Reward" -%} {{ translations.PointsProduct }}{% if usr.Authenticated and activeProduct.PointsPrice != null -%}: {{ activeProduct.PointsPrice }} {{ translations.PointsShortcut }}/{{ product.SaleUnit }}{% endif -%} {% else -%} {{ flag.Text }} {% endif -%}
. . .Parę linijek niżej znajdują się etykiety {{ translations.ChooseProductVariant }} i {{ translations.Availability }}: {{ activeProduct.Availability.Text }}. Trzeba zmodyfikować ich warunki tak, aby nie wyświetlały się w przypadku towaru archiwalnego. Powinno to wyglądać w ten sposób:{% if tableView and product.Archival == false -%} {{ translations.ChooseProductVariant }} {% endif -%} {% if activeProduct.Availability.Text != '' and product.Archival == false -%}
{{ translations.Availability }}: {{ activeProduct.Availability.Text }}{% endif -%} W podobny sposób należy ukryć całą resztę dotyczącą różnych danych o towarze. Aby to zrobić należy wyszukać taki warunek {% if activeProduct.StockLevel.Control and tableView == false -%} i linijkę wyżej dopisać {% if product.Archival == false -%}. Natomiast zamknięcie tego warunku trzeba będzie dopisać dużo dalej. Aby znaleźć odpowiednie miejsce należy wyszukać taką frazę CheaperInSet. Jest to etykieta przycisku przewijającego do sekcji z zestawami (o ile takowe istnieją dla danego towaru). Pod tym przyciskiem znajduje się {% endif -%}, który zamyka warunek sprawdzający właśnie istnienie owych zestawów. Pod nim trzeba dopisać jeszcze jedno {% endif -%}, aby zamknąć warunek, który dodaliśmy wyżej. Ostatecznie powinno to wyglądać tak:{% if product.Archival == false -%} {% if activeProduct.StockLevel.Control and tableView == false -%} . . . {% if product.Sets != null and product.Sets != empty -%}
{{ translations.CheaperInSet }}{% endif -%} {% endif -%} . . . Na końcu pliku scss/globals/_globals2.scss wklej taki kod:.archival-product-info-ui{ position: absolute; top: -40px; right: 0; text-transform: uppercase; color: $primaryColor; font-style: italic; }
A na końcu pliku scss/globals/_globals-m.scss wklej taki kod:.archival-product-info-ui{ right: 20px; }
WskazówkaZwróć uwagę, aby ten styl znajdował się wewnątrz głównej klamry, która otwiera się w pierwszej linijce pliku i zamyka w ostatniejWskazówkaPamiętaj, że pliki scss należy zminifikować. O tym jak skompilować i zminifikować pliki scss dowiesz się z artykułu o kompilacji i minifikacji plików.Agat
W pliku product-page.html wyszukaj frazę button-container. Jest to klasa kontenera, w którym znajdują się najważniejsze dane związane z towarem. Pod tym kontenerem wklej taki kod:{% if product.Archival -%}
{{translations.ArchivalProductInfo}}{% endif -%} Pozostając w tym samym pliku (product-page.html) wyszukaj frazę config.Reviews.Enabled. Jest to część warunku, odpowiedzialnego za dodawanie opinii o produkcie. Zmodyfikuj go tak, aby wyglądał następująco:{% if product.Archival -%} {% if config.Reviews.Enabled == true and productD.Archival == false -%} {% endif -%}
W pliku partials/product/product-popup.html wyszukaj frazę usr.Authenticated. W tym pliku będą dwa wystąpienia takiej frazy. W obu to część warunku. W obu przypadkach zmodyfikuj te warunki, aby wyglądały tak:{% if usr.Authenticated and product.Archival == false -%}
W tym samym pliku (partials/product/product-popup.html) wyszukaj frazę add-to-cart-popup. Jest to klasa kontenera, który trzeba zmodyfikować, aby wyglądał tak: Dalej w tym samym pliku (partials/product/product-popup.html) wyszukaj frazę AddToCartForm. Jest to ID formularza odpowiedzialnego za dodawanie towaru do koszyka. Linijkę wyżej otwórz taki warunek:{% if product.Archival == false -%}
Będzie on obejmował resztę kodu znajdującego się w tym pliku. Na końcu znajdziesz kontener z klasą ask-for-price-popup. Pod tym kontenerem zamknij wcześniej otworzony warunek dopisując linijkę niżej {% endif -%}. Na końcu pliku scss/main2.scss wklej taki kod:.archival{ padding-bottom: 20px; }
.archival-info{ background: $pageNameColor; color: $primaryColor; padding: 20px; margin-bottom: 20px; text-transform: uppercase; @media only screen and (min-width: 481px) { box-shadow: 2px 2px 1px 0 $bgColorFont; } }WskazówkaPamiętaj, że pliki scss należy zminifikować. O tym jak skompilować i zminifikować pliki scss dowiesz się z artykułu o kompilacji i minifikacji plików.Bursztyn
W pliku productdetails.html wyszukaj frazę itemprop="offers". Jest to jeden z atrybutów kontenera, na którego początku trzeba wkleić taki kod:{% if _pd.Archival -%}
{{ translations.ArchivalProductInfo }}{% endif %} W tym samym pliku (productdetails.html) wyszukaj frazę usr.Authenticated. W tym pliku będą dwa wystąpienia takiej frazy. W obu to część warunku. W obu przypadkach zmodyfikuj te warunki, aby wyglądały tak:{% if usr.Authenticated and _pd.Archival == false -%}
Dalej w tym samym pliku (productdetails.html) wyszukaj frazę class="availability". Linijkę wyżej nad elementem, który ma taką klasę dopisz {% if _pd.Archival == false %}. Będzie to początek warunku, który trzeba zakończyć trochę niżej. Aby znaleźć to miejsce wyszukaj frazę {% if customer.HidePrices %}. Jest to warunek przed, którym trzeba zakończyć ten nasz nowy, który właśnie dodaliśmy. Aby tego dokonać należy linijkę wyżej dopisać {% endif %}. Kolejną frazą w tym pliku (productdetails.html), którą trzeba wyszukać jest add-to-cart. Jest to klasa przycisku dodawania towaru do koszyka. Będą dwa wystąpienia. Interesuje nas tylko pierwsze, które dotyczy danego towaru. Drugie wystąpienie dotyczy zestawów i znajduje się w warunku {% if set.Price <> null %}. To nas nie interesuje więc zostańmy przy tym pierwszym. Linijkę wyżej dopisz {% if _pd.Archival == false %}. Pod tym przyciskiem znajdują się jeszcze dwa przyciski (powiadamiania o dostępności i pytania o cenę). Pod tym drugim należy zamknąć warunek dopisując linijkę niżej {% endif %}. Będąc przy tych przyciskach możemy zauważyć element nav z klasą options. Linijkę wyżej wklej {% if _pd.Archival == false %}, a zaraz za końcem tego elementu dopisz linijkę niżej {% endif %}. Ostatni warunek w tym pliku (productdetails.html), który trzeba zmienić znajdziesz wyszukując frazę productuserreviews.TotalItems. Trzeba ją podmienić, aby wyglądała tak:{% unless productuserreviews.TotalItems == 0 and _pd.Archival %}
Plik productdetails/opinions-partial.html należy zmodyfikować tak, żeby wyglądał w ten sposób:{% if productuserreviews.TotalItems == 0 %} {% if _pd.Archival == false -%} . . . {% endif -%} {% else %} {% for o in productuserreviews.Reviews %} . . . {% endfor %} {% if _pd.Archival == false -%} {% endif -%} {% endif%}
Na końcu pliku scss/main2.scss wklej:.archival-product-info{ padding: 15px 20px; border-radius: 5px 0 0 5px; box-shadow: rgba(0,0,0,.2) -2px 2px 10px; background: #F5F5F5; position: relative; right: -20px; left: -20px; width: calc(100% + 40px); margin: 10px 0 30px; font-style: italic; }
WskazówkaPamiętaj, że pliki scss należy zminifikować. O tym jak skompilować i zminifikować pliki scss dowiesz się z artykułu o kompilacji i minifikacji plików.Opal
W pliku productdetails.html wyszukaj frazę details-section. Jest to klasa kontenera, nad którym trzeba wkleić linijkę wyżej taki kod:{% if _pd.Archival -%}
{{ translations.ArchivalProductInfo }}{% endif %} Następnie wyszukaj frazę usr.Authenticated. W tym pliku będą dwa wystąpienia takiej frazy. W obu to część warunku. W obu przypadkach zmodyfikuj te warunki, aby wyglądały tak:{% if usr.Authenticated and _pd.Archival == false -%}
Kolejna fraza to class="stock". Będzie to klasa elementu, który trzeba "ubrać" w warunek {% if _pd.Archival == false %}. Będzie to początek warunku, który trzeba zakończyć linijkę pod elementem poprzez dopisanie {% endif %}. Teraz wyszukaj frazę class="attributes". Linijkę wyżej nad elementem, który ma taką klasę dopisz {% if _pd.Archival == false %}. Będzie to początek warunku, który trzeba zakończyć trochę niżej. Aby znaleźć to miejsce wyszukaj frazę {% if customer.HidePrices %}. Jest to warunek przed, którym trzeba zakończyć ten nasz nowy, który właśnie dodaliśmy. Aby tego dokonać należy linijkę wyżej dopisać {% endif %}. Następna fraza to add-to-cart. Jest to klasa przycisku dodawania towaru do koszyka. Będą dwa wystąpienia. Interesuje nas tylko pierwsze, które dotyczy danego towaru. Drugie wystąpienie dotyczy zestawów i znajduje się w warunku {% if set.Price <> null %}. To nas nie interesuje więc zostańmy przy tym pierwszym. Linijkę wyżej dopisz {% if _pd.Archival == false %}. Pod tym przyciskiem znajdują się jeszcze dwa przyciski (powiadamiania o dostępności i pytania o cenę). Pod tym drugim należy zamknąć warunek dopisując linijkę niżej {% endif %}. Będąc przy tych przyciskach możemy zauważyć element nav z klasą options. Linijkę wyżej wklej {% if _pd.Archival == false %}, a zaraz za końcem tego elementu dopisz linijkę niżej {% endif %}. Na końcu pliku scss/main2.scss wklej:.archival-product-info{ background: #f7f7f7; color: $placeholderColorFont; padding: 20px; margin-top: 20px; text-align: center; }
WskazówkaPamiętaj, że pliki scss należy zminifikować. O tym jak skompilować i zminifikować pliki scss dowiesz się z artykułu o kompilacji i minifikacji plików.Topaz
Wzależności od wybranego wariantu szczegółów towaru zmiany będą inne. Wersja z miniaturkami zdjęć po lewej W pliku elements/product/product-details-1.html wyszukaj frazę product-details__images. Zastąp kontener z tą klasą poniższym kodem:{% for flag in product.Flags -%} {{ flag.Text }} {% endfor %}{% if product.Images[1] -%}-
- {% for image in product.Images -%}
- {% if image.Id != -1 -%} {{image | Img: 'compact'}} {% else -%} {{'css/img/img-placeholder.jpg' | Img, translations.DefaultImage}} {% endif -%}
{% for image in product.Images -%}{% elseif product.Images[0] -%}{% if image.Id != -1 -%} {{image | Img: 'grande'}} {% else -%} {{'css/img/img-placeholder.jpg' | Img, translations.DefaultImage}} {% endif -%} {% if product.Archival -%}{% endfor -%}{{translations.ArchivalProduct}}{% endif -%}{{product.Images[0] | Img: 'grande'}} {% if product.Archival -%}{{translations.ArchivalProduct}}{% endif -%}{{'css/img/img-placeholder.jpg' | Img, translations.DefaultImage}} {% if product.Archival -%}{{translations.ArchivalProduct}}{% endif -%}{% if product.DeliveryCost != null and product.DeliveryCost > 0 -%}{% endif -%}{{ translations.Crt_Delivery }}: {{ translations.Sea_From | Downcase }} {{ product.DeliveryCost | Round: config.DecimalPlacesPrice | ToPrice }} {{ currency }}| {% endif -%} {% if stockLevel.Control -%}{{ translations.Com_StockLvl }}: {% unless stockLevel.Type == 2 or stockLevel.Type == 4 or stockLevel.Text == null -%} {{ stockLevel.Text }} {% endunless -%} {% if stockLevel.Type == 4 -%} {{ stockLevel.Value | Normalize }} {{ product.SaleUnit }} {% endif -%} {% if stockLevel.Type == 1 or stockLevel.Type == 2 -%} {% unless stockLevel.ImageUrl == null -%} {{stockLevel.ImageUrl | Img: '', stockLevel.Text}} {% endunless -%} {% endif -%}| {% endif -%}{{ translations.Com_Availability }}: {% unless product.Availability.Text == '' or product.Availability.Type == 2 -%} {{ product.Availability.Text }} {% endunless -%} {% if product.Availability.Type == 1 or product.Availability.Type == 2 -%} {{product.Availability.ImageUrl | Img: '', product.Availability.Text}} {% endif -%} {% unless product.Availability.Date == null -%} ({{ product.Availability.Date | Date:'d' }}) {% endunless -%}{% if product.Archival -%}
{{translations.ArchivalProductInfo}}{% endif -%} Kawałek niżej znajdziesz kontener z klasą product-details__reviewsContainer. Podmień go poniższym kodem:{% unless product.Archival and product.RatingCount == 0 -%}
{% include 'partials/common/product-rating.html', rating: product.Rating -%} ({{ product.RatingCount }}){% endunless -%} Teraz wyszukiaj basic-unit-ratio. Podmień wszystko co jest pod tą linijką, aż do linijki, w której znajduje się kontener z klasą product-details__info-container (tej linijki nie podmieniaj) poniższym kodem:{% if product.Archival == false -%} {% if product.Clip or product.Batch -%}
{% for attribute in product.Supplies.AttributeNames -%} {{ attribute.Name | H }} {% endfor -%}{% elseif product.AttributesPolyvalent != empty -%} {% for attribute in product.AttributesPolyvalent -%}{{ attribute.Name }}{% endfor -%} {% endif -%} {% if product.Batch == null or product.Batch == false -%} {% if product.AttributesEditable != empty -%} {% assign i = 0 -%} {% for attribute in product.AttributesEditable -%} {% assign i = i | Plus: 1 -%} {% endfor -%} {% endif -%} {% endif -%} {% if product.Units[1] -%} {% endif -%} {% endif -%} Następnie znajdź kontener z klasą product-details__other-options i podmień go (wraz z jego zawartością) poniższym kodem: <codeclass="lang:ruby decode:true"> {% if product.Archival == false -%} {% endif -%} Teraz znajdź kontener z klasą product-details__prices. Na samym początku w tym kontenerze będzie warunek {% if customer.Authenticated == true -%}. Zmień go na {% if customer.Authenticated == true and product.Archival == false -%}. Następnie znajdź kontener z klasą product-details__button-group i podmień go (wraz z jego zawartością) na poniższy kod:{% if product.Archival == false -%}
{% else -%} {{translations.ArchivalProductCheckInfo}} {% endif -%} Teraz w pliku css/layout.css dodaj poniższy kod:.product-details .product-details__image__archival{position:absolute;bottom:0;left:0;right:0;padding:20px;font-size:18px;background:rgba(204,204,204,0.9);color:#fff;text-align:center}.product-details .product-details__archivalProductInfo{background:{{settings.$breadcrumbsBgColor}};color:{{settings.breadcrumbsFontColor}};padding:30px;margin-bottom:30px;text-align:center}.product-details .parent-category-link{color:{{settings.linkFontColor}};margin-top:50px;display:inline-block}.product-details .parent-category-link svg{fill:{{settings.linkFontColor}};height:19px;width:19px;vertical-align:middle}
Wersja z miniaturkami zdjęć pod głównym zdjęciem W pliku elements/product/product-details-2.html wyszukaj frazę product-details__images. Zastąp kontener z tą klasą poniższym kodem:{% for flag in product.Flags -%} {{ flag.Text }} {% endfor %}{% if product.Images[1] -%}{% for image in product.Images -%}{% if image.Id != -1 -%} {{image | Img: 'grande'}} {% else -%} {{'css/img/img-placeholder.jpg' | Img, translations.DefaultImage}} {% endif -%} {% if product.Archival -%}{% endfor -%}{{translations.ArchivalProduct}}{% endif -%}-
- {% for image in product.Images -%}
- {% if image.Id != -1 -%} {{image | Img: 'compact'}} {% else -%} {{'css/img/img-placeholder.jpg' | Img, translations.DefaultImage}} {% endif -%}
{{product.Images[0] | Img: 'grande'}} {% if product.Archival -%}{{translations.ArchivalProduct}}{% endif -%}{{'css/img/img-placeholder.jpg' | Img, translations.DefaultImage}} {% if product.Archival -%}{{translations.ArchivalProduct}}{% endif -%}{% if product.Archival -%}
{{translations.ArchivalProductInfo}}{% endif -%} Teraz wyszukiaj {% if product.Clip or product.Batch -%}. Podmień wszystko co jest pod tą linijką (łącznie z nią), aż do linijki {% include 'partials/common/after-adding-to-cart-popup.html' %} (jej nie podmieniaj) poniższym kodem:{% if product.Archival == false -%} {% if product.Clip or product.Batch -%}
{% for attribute in product.Supplies.AttributeNames -%} {{ attribute.Name | H }} {% endfor -%}{% elseif product.AttributesPolyvalent != empty -%} {% for attribute in product.AttributesPolyvalent -%}{{ attribute.Name }}{% endfor -%} {% endif -%} {% if product.Batch == null or product.Batch == false -%} {% if product.AttributesEditable != empty -%} {% assign i = 0 -%} {% for attribute in product.AttributesEditable -%} {% assign i = i | Plus: 1 -%} {% endfor -%} {% endif -%} {% endif -%} {% endif -%} {% if product.Units[1] -%} {% endif -%} {% if product.Archival == false -%}{% if stockLevel.Control -%}{% else -%} {{translations.ArchivalProductCheckInfo}} {% endif -%} Teraz w pliku css/layout.css dodaj poniższy kod:{{ translations.Com_StockLvl }}: {% unless stockLevel.Type == 2 or stockLevel.Type == 4 or stockLevel.Text == null -%} {{ stockLevel.Text }} {% endunless -%} {% if stockLevel.Type == 4 -%} {{ stockLevel.Value | Normalize }} {{ product.SaleUnit }} {% endif -%} {% if stockLevel.Type == 1 or stockLevel.Type == 2 -%} {% unless stockLevel.ImageUrl == null -%} {{stockLevel.ImageUrl | Img: '', stockLevel.Text}} {% endunless -%} {% endif -%}{% endif -%}{{ translations.Com_Availability }} {% unless product.Availability.Text == '' or product.Availability.Type == 2 -%} {{ product.Availability.Text }}: {% endunless -%} {% if product.Availability.Type == 1 or product.Availability.Type == 2 -%} {{product.Availability.ImageUrl | Img: '', product.Availability.Text}} {% endif -%} {% unless product.Availability.Date == null -%} ({{ product.Availability.Date | Date:'d' }}) {% endunless -%}{% if product.DeliveryCost != null and product.DeliveryCost > 0 -%}{{ translations.Crt_Delivery }} {{ translations.Sea_From | Downcase }} {{ product.DeliveryCost | Round: config.DecimalPlacesPrice | ToPrice }} {{ currency }}{% endif -%}.product-details .product-details__image__archival{position:absolute;bottom:0;left:0;right:0;padding:20px;font-size:18px;background:rgba(204,204,204,0.9);color:#fff;text-align:center}.product-details .product-details__archivalProductInfo{background:{{settings.$breadcrumbsBgColor}};color:{{settings.breadcrumbsFontColor}};padding:30px;margin-bottom:30px;text-align:center}.product-details .parent-category-link{color:{{settings.linkFontColor}};margin-top:50px;display:inline-block}.product-details .parent-category-link svg{fill:{{settings.linkFontColor}};height:19px;width:19px;vertical-align:middle}
Obsługa funkcji autocomplete w wyszukiwarce szablonu
WskazówkaOd 1 czerwca 2025 roku zakończyliśmy aktualizację oraz wydawanie nowych wersji szablonów Bursztyn, Agat i Opal, a tym samym ich wsparcie, aby skupić się na nowoczesnych rozwiązaniach, które jeszcze lepiej odpowiadają na potrzeby dynamicznie rozwijającego się rynku e-commerce. Zachęcamy Was do przejścia na nasze nowe, udoskonalone szablony. Dla sklepów B2C polecamy szablony Topaz, One Page Shop oraz Dla Gastronomii, natomiast dla platform B2B idealnym wyborem będą Rubin i Szafir.Obsługa funkcji autocomplete w wyszukiwarce szablonu
W tym artykule dowiesz się jak zaimplementować funkcję autocomplete w swoim szablonie. Funkcja ta wyświetli klientowi listę towarów, które będą najlepiej pasowały do wpisanej przez niego frazy w wyszukiwarce.Szafir
W pliku common/header/header.html wyszukaj frazę quick-search-form-lq. Zmodyfikuj element, do którego należy ta klasa, aby wyglądał tak: Na końcu pliku js/init-ui2.js wklej ten kod:<class="lang:ruby decode:true">function autocomplete(e) { var phrase = $(e.currentTarget).val().replace(/[!@#$%^&*()+={}\[\]:;"'<,>.?\~`\\|]*/gi, ''); if (phrase != '' && phrase.length > 1) { $.get(location.pathname, { __action: 'Get/SearchAutocomplete', search: phrase }).then(function (res) { if($(window).width() > 1280){ var right = 'right: 50px'; } else if($(window).width() > 680){ var right = ''; } else { var right = 'right: 61px'; } var loader = ' '; $('.quick-search-form-lq.autocomplete-form-lq').append(loader); var url = res.action.Redirect302; $.get(url, {__csrf:__CSRF, __collection:'products.Products|page.BaseHref|currency|config.Products.ShowCode'}, function(res) { $('.autocomplete-lq').remove(); var list = res.collection['products.Products']; var showCode = res.collection['config.Products.ShowCode']; if (list.length > 0){ if (list.length > 5) { var size = 5; } else { var size = list.length; } var baseHref = res.collection['page.BaseHref']; var currency = res.collection['currency']; var autocompleteList = '
'; var regPhrase = '(' + phrase.split(' ').join('|') + ')'; var reg = new RegExp(regPhrase, 'gi'); for (i = 0; i < size; i++) { var nameNoQuotes = list[i].Name.replace(/"/g, '"'); var name = list[i].Name.replace(reg, function(str) {return ''+str+''}); if(showCode){ var code = list[i].Code.replace(reg, function(str) {return ''+str+''}); } else { var code = ''; } if(list[i].Price){ var price = list[i].Price.toPrice() + ' ' + currency; } else { var price = ''; } if(list[i].ImageId != -1){ var img = ''; $('.quick-search-form-lq.autocomplete-form-lq').append(autocompleteList); } $('.loader-for-autocomplete-lq').remove(); }); }); } else { $('.autocomplete-lq').remove(); $('.loader-for-autocomplete-lq').remove(); } }; $('body').on('input', '.quick-search-form-lq.autocomplete-form-lq [name="search"]', function (e) { if(timeOutAutocomplete!=null){ clearTimeout(timeOutAutocomplete); timeOutAutocomplete=null; } timeOutAutocomplete = setTimeout(function(){ autocomplete(e); }, 300); }); //variable to clearTimeout in autocomplete function var timeOutAutocomplete = null; $('body').on('blur', '.quick-search-form-lq.autocomplete-form-lq [name="search"]', function () { setTimeout(function () { $('.autocomplete-lq').remove(); $('.loader-for-autocomplete-lq').remove(); },200); });'; } else { var img = ''; } var product = ' ' + '
' + img + '' + '' + '' + '' + name + '' + '' + code + '' + '' + price + '' + ''; autocompleteList += product; } autocompleteList += '.autocomplete-ui{ position: absolute; z-index: 1000; width: 100%; box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.2); @media only screen and (max-width: 1280px) { max-width: 550px; left: 50%; transform: translateX(calc(-50% - 25px)); text-align: left; } @media only screen and (max-width: 680px) { left: auto; transform: none; } .product-ui{ display: block; padding: 10px; background: $bgColor; border: 1px solid $lightBorderColor; border-bottom: none; font-size: 16px; color: $primaryColorFont; transition: all ease 300ms; &:last-child{ border-bottom: 1px solid $lightBorderColor; } > div{ display: inline-block; vertical-align: top; margin-right: 10px; &:last-child{ width: 100px; margin-right: 0; text-align: right; } } .img-ui{ width: 50px; height: 50px; position: relative; } img{ max-width: 100%; max-height: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .names-ui{ width: calc(100% - 50px - 100px - 20px); } .name-ui{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: $primaryColor; transition: all ease 300ms; } .code-ui{ font-size: 12px; color: $bgColorFont; transition: all ease 300ms; } &:hover{ background: $btnSolidHoverBgColor; color: $btnSolidHoverTextColor; .name-ui, .code-ui{ color: $btnSolidHoverTextColor; } } } }
WskazówkaPamiętaj, że pliki scss i js należy zminifikować. O tym jak skompilować i zminifikować pliki scss i js dowiesz się z artykułu o kompilacji i minifikacji plików.Agat
W pliku partials/common/header.html wyszukaj frazę id="search-form". Zmodyfikuj element, do którego należy to ID, aby wyglądał tak: W pliku js/init.js wyszukaj frazę events:. Linijkę wyżej wklej kod:<class="lang:ruby decode:true ">autocomplete: function(e){ var phrase = $(e.currentTarget).val().replace(/[!@#$%^&*()+={}\[\]:;"'<,>.?\~`\\|]*/gi, ''); if (phrase != '' && phrase.length > 1) { $.get(location.pathname, { __action: 'Get/SearchAutocomplete', search: phrase }).then(function (result) { if (result.action.Result) { var loader = ' '; $('#search-form').append(loader); var url = result.action.Redirect302; $.get(url, {__csrf:__CSRF, __collection:'products.Products|page.BaseHref|currency'}, function(res) { $('.autocomplete').remove(); var list = res.collection['products.Products']; if (list.length > 0){ if (list.length > 5) { var size = 5; } else { var size = list.length; } var baseHref = res.collection['page.BaseHref']; var currency = res.collection['currency']; var autocompleteList = '
'; var regPhrase = '(' + phrase.split(' ').join('|') + ')'; var reg = new RegExp(regPhrase, 'gi'); for (i = 0; i < size; i++) { var nameNoQuotes = list[i].Name.replace(/"/g, '"'); var name = list[i].Name.replace(reg, function(str) {return ''+str+''}); if(list[i].Price){ var price = list[i].Price.toPrice() + ' ' + currency; } else { var price = ''; } if(list[i].ImageId != -1){ var img = ''; $('#search-form').append(autocompleteList); } $('.loader-for-autocomplete').remove(); }); } else if (result.action.Code != 100) { application.createMessage(result.action); } }); } else { $('.autocomplete').remove(); $('.loader-for-autocomplete').remove(); } },' } else { var img = ''; } var product = '' + '
' + img + '' + '' + '' + ''; autocompleteList += product; } autocompleteList += '' + name + '' + '' + price + '' + '$('body').on('blur', 'input', function () { application.uiCheckLabels(); });
Wklej taki kod:$('body').on('input', '#header-section #search-form.autocomplete-form [name="search"]', function (e) { if(timeOutAutocomplete!=null){ clearTimeout(timeOutAutocomplete); timeOutAutocomplete=null; } timeOutAutocomplete = setTimeout(function(){ self.autocomplete(e); }, 300); });
//variable to clearTimeout in autocomplete function var timeOutAutocomplete = null;$('body').on('blur', '#header-section #search-form.autocomplete-form [name="search"]', function () { setTimeout(function () { $('.autocomplete').remove(); $('.loader-for-autocomplete').remove(); }, 200); }); .autocomplete{ position: absolute; z-index: 101; width: 100%; @media only screen and (max-width: 1024px) { width: calc(100% - 240px); } @media only screen and (max-width: 768px) { width: calc(100% - 20px); } box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.2); .product{ display: block; padding: 10px; background: $bgColor; border: 1px solid $primaryColor; border-bottom: none; font-size: 16px; color: $bgDarkerColorFont; &:last-child{ border-bottom: 1px solid $primaryColor; } > div{ display: inline-block; vertical-align: top; margin-right: 10px; &:last-child{ margin-right: 0; } } .img{ width: 50px; height: 50px; position: relative; } img{ max-width: 100%; max-height: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .names{ width: calc(100% - 50px - 10px); } .name{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .price{ margin-top: 5px; font-size: 12px; color: $primaryColor; opacity: 0.63; } } }
WskazówkaPamiętaj, że pliki scss i js należy zminifikować. O tym jak skompilować i zminifikować pliki scss i js dowiesz się z artykułu o kompilacji i minifikacji plików.Bursztyn
W pliku page/header.html wyszukaj frazę SearchForm. Zmodyfikuj element, do którego należy to ID, aby wyglądał tak: Na końcu pliku js/init2.js wklej ten kod:<class="lang:ruby decode:true ">$('header').on('input', '#SearchForm.autocomplete-form [name="search"]', function (e) { if(timeOutAutocomplete!=null){ clearTimeout(timeOutAutocomplete); timeOutAutocomplete=null; } timeOutAutocomplete = setTimeout(function(){ var phrase = $(e.currentTarget).val().replace(/[!@#$%^&*()+={}\[\]:;"'<,>.?\~`\\|]*/gi, ''); if (phrase != '' && phrase.length > 1) { $.get(location.pathname, { __action: 'Get/SearchAutocomplete', search: phrase }).then(function (d) { var a = d.action; if (!a.Result) CreateTooltip(a); else if (a.Redirect302){ var loader = ' '; $('#SearchForm').append(loader); var url = a.Redirect302; $.get(url, {__csrf:__CSRF, __collection:'productlist.Products|page.BaseHref|currency'}, function(res) { $('.autocomplete').remove(); var list = res.collection['productlist.Products']; if (list.length > 0){ if (list.length > 5) { var size = 5; } else { var size = list.length; } var baseHref = res.collection['page.BaseHref']; var currency = res.collection['currency']; var autocompleteList = '
'; var regPhrase = '(' + phrase.split(' ').join('|') + ')'; var reg = new RegExp(regPhrase, 'gi'); for (i = 0; i < size; i++) { var nameNoQuotes = list[i].Name.replace(/"/g, '"'); var name = list[i].Name.replace(reg, function(str) {return ''+str+''}); if(list[i].Price){ var price = list[i].Price.toPrice() + ' ' + currency; } else { var price = ''; } if(list[i].ImageId != -1){ var img = ''; $('#SearchForm').append(autocompleteList); } $('.loader-for-autocomplete').remove(); }); } }); } else { $('.autocomplete').remove(); $('.loader-for-autocomplete').remove(); } }, 300); }); //variable to clearTimeout in autocomplete function var timeOutAutocomplete = null; $('header').on('blur', '#SearchForm.autocomplete-form [name="search"]', function () { setTimeout(function () { $('.autocomplete').remove(); $('.loader-for-autocomplete').remove(); }, 200); });' } else { var img = ''; } var product = ' ' + '
' + img + '' + '' + '' + ''; autocompleteList += product; } autocompleteList += '' + name + '' + '' + price + '' + '<class="lang:ruby decode:true ">.autocomplete{ position: absolute; top: 43px; left: 0; z-index: 101; width: 100%; box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.2); .product{ display: block; padding: 10px; background: $bgColor; border: 1px solid $primaryColor; border-bottom: none; font-size: 14px; color: $secondaryColorFont; transition: all ease 300ms; &:last-child{ border-bottom: 1px solid $primaryColor; } > div{ display: inline-block; vertical-align: top; margin-right: 10px; &:last-child{ margin-right: 0; } } .img{ width: 50px; height: 50px; position: relative; } img{ max-width: 100%; max-height: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .names{ width: calc(100% - 50px - 10px); } .name{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .price{ margin-top: 5px; font-size: 12px; color: $primaryColor; opacity: 0.63; transition: all ease 300ms; } &:hover{ background: $primaryColor; color: $primaryColorFont; .price{ color: $primaryColorFont; opacity: 1; } } } } WskazówkaPamiętaj, że pliki scss i js należy zminifikować. O tym jak skompilować i zminifikować pliki scss i js dowiesz się z artykułu o kompilacji i minifikacji plików.Opal
W pliku page/header.html wyszukaj frazę SearchForm. Zmodyfikuj element, do którego należy to ID, aby wyglądał tak: Na końcu pliku js/init2.js wklej ten kod:<class="lang:ruby decode:true ">$('header').on('input', '#SearchForm.autocomplete-form [name="search"]', function (e) { if(timeOutAutocomplete!=null){ clearTimeout(timeOutAutocomplete); timeOutAutocomplete=null; } timeOutAutocomplete = setTimeout(function(){ var phrase = $(e.currentTarget).val().replace(/[!@#$%^&*()+={}\[\]:;"'<,>.?\~`\\|]*/gi, ''); if (phrase != '' && phrase.length > 1) { $.get(location.pathname, { __action: 'Get/SearchAutocomplete', search: phrase }).then(function (d) { var a = d.action; if (!a.Result) CreateTooltip(a); else if (a.Redirect302){ var loader = ' '; $('#SearchForm').append(loader); var url = a.Redirect302; $.get(url, {__csrf:__CSRF, __collection:'productlist.Products|page.BaseHref|currency|config.Products.ShowCode'}, function(res) { $('.autocomplete').remove(); var list = res.collection['productlist.Products']; var showCode = res.collection['config.Products.ShowCode']; if (list.length > 0){ if (list.length > 5) { var size = 5; } else { var size = list.length; } var baseHref = res.collection['page.BaseHref']; var currency = res.collection['currency']; var input = $('#SearchForm').find('[name=search]'); var width = input.width(); var top = input.offset().top + input.height() - 16; var autocompleteList = '
'; var regPhrase = '(' + phrase.split(' ').join('|') + ')'; var reg = new RegExp(regPhrase, 'gi'); for (i = 0; i < size; i++) { var nameNoQuotes = list[i].Name.replace(/"/g, '"'); var name = list[i].Name.replace(reg, function(str) {return ''+str+''}); if(showCode){ var code = list[i].Code.replace(reg, function(str) {return ''+str+''}); } else { var code = ''; } if(list[i].Price){ var price = list[i].Price.toPrice() + ' ' + currency; } else { var price = ''; } if(list[i].ImageId != -1){ var img = ''; $('#SearchForm').parent().append(autocompleteList); } $('.loader-for-autocomplete').remove(); }); } }); } else { $('.autocomplete').remove(); $('.loader-for-autocomplete').remove(); } }, 300); }); //variable to clearTimeout in autocomplete function var timeOutAutocomplete = null; $('header').on('blur', '#SearchForm.autocomplete-form [name="search"]', function () { setTimeout(function () { $('.autocomplete').remove(); $('.loader-for-autocomplete').remove(); }, 200); });' } else { var img = ''; } var product = ' ' + '
' + img + '' + '' + '' + '' + name + '' + '' + code + '' + '' + price + '' + ''; autocompleteList += product; } autocompleteList += '<class="lang:ruby decode:true ">.autocomplete{ position: absolute; left: calc(50% - 20px); transform: translateX(-50%); z-index: 1000; box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.2); .product{ display: block; padding: 10px; background: $bgColor; border: 1px solid $primaryColor; border-bottom: none; font-size: 16px; color: $secondaryColorFont; transition: all 300ms ease; &:last-child{ border-bottom: 1px solid $primaryColor; } > div{ display: inline-block; vertical-align: top; margin-right: 10px; &:last-child{ width: 100px; margin-right: 0; text-align: right; } } .img{ width: 50px; height: 50px; position: relative; } img{ max-width: 100%; max-height: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .names{ width: calc(100% - 50px - 100px - 20px); } .name{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .code{ font-size: 12px; opacity: 0.63; } &:hover{ background: $primaryColor; color: $primaryColorFont; } } } WskazówkaPamiętaj, że pliki scss i js należy zminifikować. O tym jak skompilować i zminifikować pliki scss i js dowiesz się z artykułu o kompilacji i minifikacji plików.Obsługa szczegółów zamówienia dla klienta niezalogowanego
WskazówkaOd 1 czerwca 2025 roku zakończyliśmy aktualizację oraz wydawanie nowych wersji szablonów Bursztyn, Agat i Opal, a tym samym ich wsparcie, aby skupić się na nowoczesnych rozwiązaniach, które jeszcze lepiej odpowiadają na potrzeby dynamicznie rozwijającego się rynku e-commerce. Zachęcamy Was do przejścia na nasze nowe, udoskonalone szablony. Dla sklepów B2C polecamy szablony Topaz, One Page Shop oraz Dla Gastronomii, natomiast dla platform B2B idealnym wyborem będą Rubin i Szafir.Obsługa szczegółów zamówienia dla klienta niezalogowanego
W tym artykule dowiesz się jak zmodyfikować szablon, aby klienci niezalogowani mogli w profilu klienta zobaczyć szczegóły zamówienia do którego posiadają link.Szafir
W pliku customer-profile.html w pierwszym warunku dopisz and customer-profile.Order == null tak żeby warunek wyglądał w ten sposób:{% if customer.Authenticated == false and config.DefinedPages.CustomerProfile.Id == page.PageId and customer-profile.Order == null -%}
W pliku customer-profile/orders/order-details.html wyszukaj frazę {{ page.Url }}?{{ pageQueryName }}. Będzie to część atrybutu przypisanego do przycisku powrotu do listy zamówień. Ten przycisk trzeba uwarunkować, aby zamiast niego pojawiał się link prowadzący do strony głównej sklepu. Ostatecznie powinno to wyglądać tak jak poniższy kod:
{{ translations.BackToShopping }}{% if customer.Authenticated -%} {% else -%}
{% endif -%}
Pozostając dalej w tym samym pliku (customer-profile/orders/order-details.html) wyszukaj frazę Order/Cancel. Jest to nazwa jednej z interesujących nas akcji. Kawałek dalej znajdują się pozostałe dwie (Order/Accept i Order/RestorePayment). Pod każdą z nich wklej:Następnie w pliku js/init-ui2.js znajdź funkcję copyToCart i zmodyfikuj jej początek, aby wyglądała tak:
var id = $(e.currentTarget).data('id'); var hash = $(e.currentTarget).data('hash'); var data = { orderId: id, hash: hash, __csrf: __CSRF, __action: 'Order/Copy' };
WskazówkaPamiętaj, że pliki js należy zminifikować. O tym jak skompilować i zminifikować pliki js dowiesz się z artykułu o kompilacji i minifikacji plików.Bursztyn lub Opal
W pliku customerprofile.html podmień warunek, aby wyglądał tak:{% if customer.Authenticated and page.PageId == config.DefinedPages.CustomerProfile.Id %}
{% include 'customer/profile.html' %}{% elseif customer.Authenticated == false and page.PageId == config.DefinedPages.CustomerProfile.Id and customerprofile.Order != null %}{% include 'customer/profile.html' %}{% else %}{% include 'customer/login.html' %}{% endif %} W pliku customer/profile-orders.html wyszukaj frazę Order/RestorePayment. Jest to nazwa jednej z interesujących nas akcji. Kawałek dalej znajdują się pozostałe dwie (Order/Cancel i Order/Accept). Pod każdą z nich wklej:var id = $(e.currentTarget).data('id'); var hash = $(e.currentTarget).data('hash'); var newLocation = $(e.currentTarget).data('url'); var added = $(e.currentTarget).data('added'); var copy = $(e.currentTarget).data('copy'); var notCopied = $(e.currentTarget).data('not-copied'); var data = [ { name: '__action', value: 'Order/Copy' }, { name: 'orderId', value: id }, { name: 'hash', value: hash }, { name: '__csrf', value: __CSRF } ];
WskazówkaPamiętaj, że pliki js należy zminifikować. O tym jak skompilować i zminifikować pliki js dowiesz się z artykułu o kompilacji i minifikacji plików.Agat
W pliku customer-profile.html podmień warunek, aby wyglądał tak:{% if page.PageId == config.DefinedPages.CustomerProfile.Id and customer-profile.Order != null %} {% include 'partials/customer/order-details.html' -%} {% elseif customer.Authenticated and page.PageId == config.DefinedPages.CustomerProfile.Id %}
W pliku partials/customer/order-details.html wyszukaj frazę Order/Accept. Jest to nazwa jednej z interesujących nas akcji. Kawałek dalej znajdują się pozostałe dwie (Order/RestorePayment i Order/Cancel). Pod każdą z nich wklej:{% if customer.Authenticated == false and page.PageId == config.DefinedPages.CustomerProfile.Id and customer-profile.Order != null -%} {% else -%} {% endif -%}
Nadal będąc przy tej akcji (Order/Cancel) zmodyfikuj przycisk odpowiadający za anulowanie zamówienia tak, aby wyglądał jak tu:var copyButton = $(e.currentTarget); var copySection = copyButton.parents('.copy-section'); var id = copyButton.data('id'); var hash = copyButton.data('hash'); var data = [ { name: '__action', value: 'Order/Copy' }, { name: 'orderId', value: id }, { name: 'hash', value: hash }, { name: '__csrf', value: __CSRF } ];
W pliku js/init.js znajdź funkcję cancelOrder i podmień w niej posta, żeby wyglądał tak:$.post(url, data, function (result) { if (result.action.Result) { if($(e.currentTarget).hasClass('not-authenticated')){ application.createMessage(message); $('#main-section').html(result.template); application.loadImages(); } else { window.templateChanged['under-execution'] = true; application.createMessage(message); if (parent.index() != -1) { $('.under-execution').eq(1).replaceWith(result.template); } application.uiPreventScrolling(); } } else if (result.action.Code != 100) { application.createMessage(result.action); } });
W pliku partials/customer/order-details-products.html do kontenera z klasą cart-items dodaj warunek, tak aby ostatecznie kontener wyglądał następująco: Na końcu pliku scss/main2.scss dodaj taki kod:@media only screen and (min-width: 481px) { .cart-items.not-authenticated .cart-item { width: calc(50% - 40px); display: inline-block; } }
@media only screen and (min-width: 769px) { .cart-items.not-authenticated .cart-item { width: calc(50% - 25px); } } @media only screen and (min-width: 1025px) { .cart-items.not-authenticated { width: 66%; } } Na końcu pliku scss/mobile2.scss dodaj taki kod:.cart-items.not-authenticated{ text-align: center; margin: 20px auto; }
WskazówkaPamiętaj, że pliki js i scss należy zminifikować. O tym jak skompilować i zminifikować pliki js i scss dowiesz się z artykułu o kompilacji i minifikacji plików.Obsługa funkcji przypomnienia o wystawieniu opinii za zakupiony towar
WskazówkaOd 1 czerwca 2025 roku zakończyliśmy aktualizację oraz wydawanie nowych wersji szablonów Bursztyn, Agat i Opal, a tym samym ich wsparcie, aby skupić się na nowoczesnych rozwiązaniach, które jeszcze lepiej odpowiadają na potrzeby dynamicznie rozwijającego się rynku e-commerce. Zachęcamy Was do przejścia na nasze nowe, udoskonalone szablony. Dla sklepów B2C polecamy szablony Topaz, One Page Shop oraz Dla Gastronomii, natomiast dla platform B2B idealnym wyborem będą Rubin i Szafir.Obsługa funkcji przypomnienia o wystawieniu opinii za zakupiony towar
W wersji sklepu oznaczonej numerkiem 2019.5 w Panelu Administracyjnym doszła funkcja przypomnienia o wystawieniu opinii za zakupiony towar. Ta funkcja będzie wysyłać maila z owym przypomnieniem. W tym mailu będzie również link do szczegółów danego towaru. W tym artykule dowiesz się jak zmodyfikować swój szablon, aby po kliknięciu w ten link otworzyła się strona ze szczegółami danego towaru, a w niej był już otwarty i gotowy do uzupełnienia formularz wystawienia opinii.Agat
W pliku js/init.js znajdź funkcję addReview i w niej zaraz pod zmienną validate dodaj taki kod:if(window.location.hash.includes('#rate')){ var hash = window.location.hash.split('&')[1].split('=')[1]; data.push({ name: 'orderHash', value: hash }); }
A następnie w pliku js/init2.js na samym końcu dodaj taki kod:function autoOpenReviewsForm(){ $('.new-review-label').trigger('click'); $('html, body').animate({ scrollTop: $('.new-review-label').offset().top - 81 }, 500); } $(document).ready(function () { if(window.location.hash.includes('#rate')){ autoOpenReviewsForm(); } });
WskazówkaZ tego artykułu dowiesz się jak zminifikować swoje pliki jsBursztyn
W pliku js/init.js wyszukaj frazę #opinion-form .primary-action. Będzie to trigger funkcji do wystawiania opinii. W tej funkcji pod zmienną data dodaj taki kod:if(window.location.hash.includes('#rate')){ var hash = window.location.hash.split('&')[1].split('=')[1]; data.push({ name: 'orderHash', value: hash }); }
A następnie w pliku js/details.js na samym końcu dodaj taki kod:$(document).ready(function () { if(window.location.hash.includes('#rate')){ $('#add-first-review').trigger('click'); } });
WskazówkaZ tego artykułu dowiesz się jak zminifikować swoje pliki jsOpal
W pliku js/init.js wyszukaj frazę #opinion-form .primary-action. Będzie to trigger funkcji do wystawiania opinii. W tej funkcji pod zmienną data dodaj taki kod:if(window.location.hash.includes('#rate')){ var hash = window.location.hash.split('&')[1].split('=')[1]; data.push({ name: 'orderHash', value: hash }); }
A następnie w pliku js/details.js na samym końcu dodaj taki kod:$(document).ready(function () { if(window.location.hash.includes('#rate')){ $('#main-rating > .glyphicon').trigger('click'); } });
WskazówkaZ tego artykułu dowiesz się jak zminifikować swoje pliki jsObsługa załączników do zamówienia
Obsługa załączników do zamówienia
W tym artykule dowiesz się jak zmodyfikować swój szablon, aby było możliwe dodanie załączników do składanego zamówienia.WskazówkaW tym artykule trzeba będzie wprowadzać zmiany w plikach js oraz scss. Z tego artykułu dowiesz się jak je kompilować i minifikować.Szafir
Na potrzeby tej funkcji zdecydowaliśmy się na drobne zmiany w wyglądzie elementów związanych z dodawaniem notatki do zamówienia. Poniższe fragmenty kodu uwzględniają owe zmiany. Na początku dodaj w swoim szablonie nowe frazy w zakładce Tłumaczenia: AddAttachement - Dodaj załącznik AddMessage - Dodaj wiadomość YourMessage - Twoja wiadomość AttachementsNotAdded - Nie dodano wszystkich załączników Attachements - Załączniki W pliku _layout.html w elemencie head znajduje się skrypt, który dodaje do zmiennej __translations różne tłumaczenia. Dodaj tam taką linijkę: AttachementsNotAdded: "{{ translations.AttachementsNotAdded | H }}", Jeśli miałeś w swoim szablonie funkcję do importowania koszyka z pliku to w pliku common/navigation-bars/main-navigation-bar-partial.html wyszukaj frazę id="file", a następnie w tym inpucie, w którym występuje to ID dodaj klasę import-cart-input-lq. Następnie w pliku js/init.js wyszukaj frazę [name="file"] i zamień ją na .import-cart-input-lq. W pliku order/cart.html wyszukaj frazę note-lq. Jest to klasa kontenera, w którym znajdują się wszystkie elementy związane z dodawaniem notatki do zamówienia. Wytnij cały ten kontener czyli taki kod:{% if usr.Authenticated -%}
i wklej go pod taką linijką: {% include 'common/order-summary.html' -%} Następnie trzeba w całości podmienić zawartość plików order/note-partials/note-form.html oraz order/note-partials/note-presentation.html. Poniżej właściwa zawartość obu plików: order/note-partials/note-form.html{% if order.Note == '' -%} {% include 'order/note-partials/note-form.html' -%} {% else -%} {% include 'order/note-partials/note-presentation.html' -%} {% endif -%}{% endif -%}{% assign isExpanded = include -%}
Kolejnym krokiem będzie dodanie nowego pliku HTML o nazwie attachements. Należy go dodać do folderu order. Poniżej zawartość tego pliku: {% if config.Orders.AttachmentsEnabled -%}{% include 'order/attachements.html' -%}{% endif -%} order/note-partials/note-presentation.html {% if config.Orders.AttachmentsEnabled -%}{% endif -%} {% if config.Orders.AttachmentsEnabled -%}{{order.Note}}{% if config.Orders.AttachmentsEnabled -%}{% include 'order/attachements.html' -%}{% endif -%}order/attachements.html {% for file in order.Attachments -%} {% assign type = file.Name | Split: '.' | Last -%} {% if type == "jfif" or type == "jpe" or type == "jpeg" or type == "jpg" -%} {% assign icon = 'ti-image' -%} {% elseif type == "csv" or type == "txt" -%} {% assign icon = 'ti-receipt' -%} {% elseif type == "docx" or type == "odt" -%} {% assign icon = 'ti-write' -%} {% elseif type == "xlsx" or type == "ods" -%} {% assign icon = 'ti-bar-chart' -%} {% elseif type == "pdf" -%} {% assign icon = 'ti-agenda' -%} {% else -%} {% assign icon = 'ti-file' -%} {% endif -%}
Następnie w pliku customer-profile/orders/order-details.html wyszukaj frazę {% if order.Note != "" -%}. W tym warunku znajdują się dodane notatki do zamówienia. Pod tym warunkiem wklej poniższy kod:{{ file.Name }}{% endfor -%}{% if config.Orders.AttachmentsEnabled -%}
Na samym końcu pliku js/init-ui2.js dodaj poniższy kod:{% for file in order.Attachments -%} {% assign type = file.Name | Split: '.' | Last -%} {% if type == "jfif" or type == "jpe" or type == "jpeg" or type == "jpg" -%} {% assign icon = 'ti-image' -%} {% elseif type == "csv" or type == "txt" -%} {% assign icon = 'ti-receipt' -%} {% elseif type == "docx" or type == "odt" -%} {% assign icon = 'ti-write' -%} {% elseif type == "xlsx" or type == "ods" -%} {% assign icon = 'ti-bar-chart' -%} {% elseif type == "pdf" -%} {% assign icon = 'ti-agenda' -%} {% else -%} {% assign icon = 'ti-file' -%} {% endif -%} {% endfor -%}{% endif -%}function processFilesList(fileInput, fileList) { var file = fileList.pop(); if (file) { var fd = new FormData(); fd.append('__CSRF',__CSRF); fd.append('__action','Order/AttachmentAdd'); fd.append('__template','order/attachements.html'); fd.append('file', file); $.ajax({data: fd, processData: false, contentType: false, type: 'POST', success: function(data){ fileInput.val(''); if(data.action.Result){ $('.attachements-lq').html(data.template); } else { if(window.AttachementsNotAdded == undefined){ window.AttachementsNotAdded = []; } var attachement = ' '+file.name+': '+data.action.Message+' '; window.AttachementsNotAdded.push(attachement); } processFilesList(fileInput, fileList); } }); } else { $('.during-ajax-modal-lq').addClass('hidden-lq'); fileInput.removeClass('prevent-double-change-lq'); if(window.AttachementsNotAdded){ var popup = ' '+ ' '+ ' '+ __translations.AttachementsNotAdded+ ''+ ' '+ window.AttachementsNotAdded.join('')+ ' '+ ' '; $('body').append(popup); $('body').addClass('modal-opened-ui'); window.AttachementsNotAdded = undefined; } } }; function addAttachementInOrder(e) { $('.during-ajax-modal-lq').removeClass('hidden-lq'); var fileInput = $(e.currentTarget); fileInput.addClass('prevent-double-change-lq'); var fileList = Object.values(e.currentTarget.files); processFilesList(fileInput, fileList); }; $('body').on('change', '.add-attachement-in-order-lq:not(.prevent-double-change-lq)', function (e) { addAttachementInOrder(e); }); function removeAttachementInOrder(e) { $.post('', {__csrf: __CSRF, __action: 'Order/AttachmentDelete', id: $(e.currentTarget).data('id')}, function(result) { $(e.currentTarget).parents('.file-container-lq').remove(); }); }; $('body').on('click', '.remove-attachement-in-order-lq', function (e) { removeAttachementInOrder(e); });
W pliku scss/globals/_globals-m.scss wyszukaj frazę &.confirm-in-cart-ui. Zmień tam top: 93px na top: 70px. Usuń też right: 20px. W pliku scss/globals/_globals2.scss wyszukaj frazę .add-note-in-cart-ui. Dopisz do niej po spacji w tej samej linijce .ti-notepad a następnie usuń margin-top: -10px i dodaj font-size: 20px. W pliku scss/globals/partials/_order.scss wyszukaj frazę .note-ui. Nadpisz wszystkie style znajdujące się w tej klasie poniższym kodem:margin-top: 20px; border-top: 1px solid $lightBorderColor; border-bottom: 1px solid $lightBorderColor; padding: 15px; .half-ui{ padding: 10px; float: left; &:first-child{ border-right: 1px solid $lightBorderColor; } } button { padding: 0; line-height: 1; } .note-in-order-ui{ margin-top: 20px; position: relative; .edit-ui{ margin-left: 15px; vertical-align: baseline; } } .label-note-in-cart-ui{ color: $labelsColor; cursor: default; } .form-to-confirm-in-cart-ui{ resize: none; } .confirm-in-cart-ui{ top: -20px; } .file-container-ui{ background: $bgColor; border: 1px solid $lightBorderColor; border-radius: 20px; margin: 0 10px 10px 0; padding: 5px 15px 10px; display: inline-block; &:first-child{ margin-top: 20px; } .icon-ui{ font-size: 20px; vertical-align: middle; } .remove-attachement-in-order-ui{ vertical-align: middle; margin-left: 10px; cursor: pointer !important; } }
Dodawanie wyboru działu na formularzu kontaktowym
WskazówkaOd 1 czerwca 2025 roku zakończyliśmy aktualizację oraz wydawanie nowych wersji szablonów Bursztyn, Agat i Opal, a tym samym ich wsparcie, aby skupić się na nowoczesnych rozwiązaniach, które jeszcze lepiej odpowiadają na potrzeby dynamicznie rozwijającego się rynku e-commerce. Zachęcamy Was do przejścia na nasze nowe, udoskonalone szablony. Dla sklepów B2C polecamy szablony Topaz, One Page Shop oraz Dla Gastronomii, natomiast dla platform B2B idealnym wyborem będą Rubin i Szafir.Ta instrukcja przeznaczona jest dla standardowych szablonów Comarch starszych niż wersja 2019.6. Jeśli posiadasz w sklepie kilka adresów do kontaktu, możesz umożliwić swoim klientom wybór jednego z nich na formularzu kontaktowym. Aby to zrobić, skorzystaj z poniższych instrukcji. Poszczególne pliki, które należy zmodyfikować znajdują się w Panelu administracyjnym w sekcji: Wygląd sklepu/ Ustawienia/ Więcej/ Edytuj ustawienia zaawansowane następnie Więcej/ Edytuj HTML.WskazówkaPamiętaj, aby wprowadzone zmiany w szablonie Zapisać i Opublikować.1. Bursztyn i Opal
1.1. W pliku contact.html odnajdź element z id "ContactSendForm" i powyżej pola e-mail dodaj poniższy kod:{% if config.Contact.Contacts[0] -%} <select name="contactId" class="department" required> {% for contact in config.Contact.Contacts -%} <option value="{{ contact.Id }}">{{ contact.Name }}</option> {% endfor -%} </select> {% endif -%}
1.2. Aby wygląd nowego pola był spójny z resztą formularza, w pliku scss/contact.scss odnajdź selektor ".contact-info .contact-form input, .contact-info .contact-form textarea" i zamień go na: .contact-info .contact-form input, .contact-info .contact-form textarea, .contact-info .contact-form select 1.3. Skompiluj i zminifikuj pliki scss.WskazówkaO tym jak skompilować i zminifikować pliki scss dowiesz się z artykułu o kompilacji i minifikacji plików.1.4. Aby walidacja działała poprawnie, w pliku js/init.js, odnajdź funkcję resetForm(form) i podmień ją na:function resetForm(form) { var inputs = form.find('input:not([disabled]):not([type=hidden]), select:not([disabled]):not(".department"), textarea:not([disabled])'); inputs.each(function () { $(this).val(''); }); $('.loader-icon').remove(); $('.send-contact-form').removeClass('posting'); }
1.5. Zminifikuj pliki js.WskazówkaO tym jak zminifikować pliki js dowiesz się z artykułu o kompilacji i minifikacji plików.2. Agat
2.1. W pliku contact.html odnajdź element z id "contact-form" i powyżej pola e-mail dodaj poniższy kod:{% if config.Contact.Contacts[0] -%} <div class="input-group"> <span class="required-fields-info">{{ translations.Department }} *</span> <select name="contactId" required> {% for contact in config.Contact.Contacts -%} <option value="{{ contact.Id }}">{{ contact.Name }}</option> {% endfor -%} </select> </div> {% endif -%}
2.2. Aby wygląd nowego pola był spójny z resztą formularza, w pliku scss/mobile1.scss odnajdź selektor "input, textarea" i zamień go na: input, textarea, .contact-form-popup select 2.3. Skompiluj i zminifikuj pliki scss.WskazówkaO tym jak skompilować i zminifikować pliki scss dowiesz się z artykułu o kompilacji i minifikacji plików.2.4. Dodaj tłumaczenie dla frazy Department [Dział] Tłumaczenie należy dodać w Panelu administracyjnym: Wygląd sklepu/ Ustawienia na zakładce Tłumaczenia.3. Szafir
3.1. W pliku common/navigation-bars/navigation-contact.html odnajdź element z klasą "form-lq form-ui" i wewnątrz niego dodaj poniższy kod:{% if config.Contact.Contacts[0] -%} <div> <label>{{ translations.Department }}<span class='required-ui'>*</span></label> <span class="select-background-ui w100-ui"> <select name="contactId" required> {% for contact in config.Contact.Contacts -%} <option value="{{ contact.Id }}">{{ contact.Name }}</option> {% endfor -%} </select> </span> <i class="ti-angle-down select-arrow-ui"></i> </div> {% endif -%}
3.2. Dodaj tłumaczenie dla frazy Department [Dział] Tłumaczenie należy dodać w Panelu administracyjnym: Wygląd sklepu/ Ustawienia na zakładce Tłumaczenia.3.3. Aby walidacja działała poprawnie, w pliku js/init-ui2.js, odnajdź funkcję sendContactForm(e) i podmień ją na:
function sendContactForm(e) { if(app.validationBeforePost(e) != 'error'){ $('.during-ajax-modal-lq').removeClass('hidden-lq'); var form = $(e.currentTarget).parents('.form-lq'); var inputs = form.find('input, textarea, select'); var data = inputs.serializeArray(); data.push({name: "__csrf", value: __CSRF}); $.post('', data, function(result) { $('.during-ajax-modal-lq').addClass('hidden-lq'); if (result.action.Result) { var message = form.data('success'); app.temporaryMessage(form, message); $.each(inputs, function (index, value) { if ($(value).attr('name') !== 'contactId' && $(value).attr('name') !== '__action') { $(value).val(''); } }); form.find('.message-lq').remove(); } else { var message = '<p>' + result.action.Message + '</p>'; if(result.action.Code != 100){ app.message(form, message); } } }); $(e.currentTarget).removeClass('error-lq'); } else { $(e.currentTarget).addClass('error-lq'); } }
3.4. Zminifikuj pliki js.WskazówkaO tym jak zminifikować pliki js dowiesz się z artykułu o kompilacji i minifikacji plików.Obsługa cross-sellingu po złożeniu zamówienia
Obsługa cross-sellingu po złożeniu zamówienia
W tym artykule dowiesz się jak zmodyfikować swój szablon, aby po złożeniu zamówienia wyświetliła się sekcja z Cross-Sellingiem.WskazówkaW tym artykule trzeba będzie wprowadzać zmiany w plikach js oraz scss. Z tego artykułu dowiesz się jak je kompilować i minifikować.Szafir
W pliku order/thx.html wyszukaj frazę date-format.html. Pod linijką z tą frazą będzie się znajdował warunek, który trzeba zastąpić poniższym kodem:{% if order.SelectedDelivery.Payment.MethodType == 2 and order.PlacedOrder.ExternalPayment.Success == false -%} {% assign externalPaymentError = true -%} {% endif -%} {% if externalPaymentError or crossSellingSize > 0 -%}
Dalej w tym samym pliku (order/thx.html) wyszukaj frazę lastpagescripts.html. Nad linijką z tą frazą będzie się znajdowało zamknięcie warunku, które trzeba zastąpić poniższym kodem:{% elseif crossSellingSize > 0 -%}{{ translations.CrossSellingInfo }} {% for product in cross-selling.Products -%} {{ product | Img:'compact' }} {{ product | Img:'large' }} {{ product.Name }} {% unless customer.HidePrices -%} {% if product.Price == null or product.AskForPrice -%} {{ translations.AskForPrice }} {% else -%} product.Price -%} class="price-container-ui" {% endif -%}> {{ product.Price | ToPrice }} {{ currency }} {% if customer.Cart.SubtotalPrices -%} {{ translations.Netto | Downcase }} {% else -%} {{ translations.Brutto | Downcase }} {% endif -%} {% if product.PreviousPrice > product.Price -%} {{ product.PreviousPrice | ToPrice }} {{ currency }} {% if customer.Cart.SubtotalPrices -%} {{ translations.Netto | Downcase }} {% else -%} {{ translations.Brutto | Downcase }} {% endif -%} {% endif -%} {% endif -%} {% endunless -%}{% endfor -%}
Następnie w pliku js/init-ui1.js wyszukaj frazę 1019. Będzie to linijka z warunkiem dotyczącym kodu błędu. Pod tym warunkiem wklej poniższy kod:if ($('.crossselling-slider-in-cart-lq').length) { window.UIFeatures.initSlider('.crossselling-slider-in-cart-lq', { dots: true, slidesToShow: 3, slidesToScroll: 3, arrows: false, infinite: false, responsive: [{ breakpoint: 1279, settings: { slidesToShow: 1.7, slidesToScroll: 1, arrows: false, infinite: false, dots: false } }] }); $('.crossselling-slider-in-cart-lq img').each(function () { var src = $(this).data('src'); $(this).attr('src', src); }) }
Na samym końcu pliku js/init-ui2.js wklej poniższy kod:$(document).ready(function () { if ($('.crossselling-slider-in-cart-lq').length) { UIFeatures.initSlider('.crossselling-slider-in-cart-lq', { dots: true, slidesToShow: 3, slidesToScroll: 3, arrows: false, infinite: false, responsive: [{ breakpoint: 1279, settings: { slidesToShow: 1.7, slidesToScroll: 1, arrows: false, infinite: false, dots: false } }] }); $('.crossselling-slider-in-cart-lq img').each(function () { var src = $(this).data('src'); $(this).attr('src', src); }) } });
Na końcu pliku scss/globals/_globals2.scss wklej poniższy kod:.cross-selling-ui{ padding: 40px 0; .minibox-product-container-ui{ padding: 10px; } .minibox-product-ui{ margin: 0; height: 300px; width: 100%; } }
Topaz
W Panelu Administratora przejdź do zakładki Tłumaczenia (Wygląd sklepu -> Ustawienia -> Tłumaczenia) i dodaj tam frazę CrossSellingInfo - Inni kupili również. Następnie przejdź do zakładki Obiekty (Wygląd sklepu -> Ustawienia -> Trzykropek w prawym górnym rogu -> Edytuj ustawienia zaawansowane -> Obiekty) i dodaj tam nowy obiekt typu Nowości i Promocje o nazwie cross-selling. Po jego dodaniu wejdź w jego ustawienia i wybierz Typ Cross-Selling. Następnie pozostając w tych ustawieniach przejdź na zakładkę Strony i zaznacz tam check-box Zamówienie. Zapisz to wszystko kliknięciem w dyskietkę w prawym górnym rogu. W pliku partials/product-item.html wyszukaj frazę config.Products.ShowCode, a następnie usuń warunek (wraz z jego zawartością), którego częścią jest ta fraza. Następnie w pliku staticElements/cart/cart.html wyszukaj frazę cart--step-five. Zastąp kontener z tą klasą (wraz z jego zawartością) poniższym kodem:<class="cart cart--step-five {% if crossSellingSize ><p> 0 -%} with-crossselling {% endif -%}"> <class="cart--step-five-content-container">{{translations.Thx}}, {{ translations.Crt_Order }} nr {{ cart.PlacedOrder.Id }} {{translations.Crt_BeenPlaced}}{{ translations.Crt_DetailsOnMail }} {% if cart.NotDeterminedDeliveryCost or cart.SelectedDelivery.NotDeterminedDeliveryCost %} {{ translations.Crt_NotDeterminedDeliveryCostInfo }}. {% endif -%} {{ translations.Crt_CheckSPAM }}{{ translations.Crt_BackToShop }} {% if cart.SelectedDelivery.Payment.MethodType == 2 and cart.PlacedOrder.ExternalPayment.Success == false -%} <class="cart cart--unfinished-payment"> {{ translations.Crt_RestoreTitle }}
{{ translations.Crt_RestoreText }}
<class="shoppingCart__form--restore inputs-container-js">initializeCrossSellingSlider: function () { $('.crossselling-slider').slick({ infinite: false, slidesToShow: 3, slidesToScroll: 1, responsive: [ { breakpoint: 1441, settings: { slidesToShow: 2 } }, { breakpoint: 769, settings: { slidesToShow: 1 } } ] }); },
Następnie w pliku css/layout.css dodaj poniższy kod:.cart--step-five.with-crossselling{display:block}.cart--step-five a{display:block;width:calc(100% - 50px);max-width:387px;margin-bottom:35px}.crossselling-slider{padding:0}.crossselling-slider .slick-track{margin:0 -20px}.crossselling-slider .slick-prev,.crossselling-slider .slick-next{background:{{settings.sliderBgColor}}}.crossselling-slider .slick-prev:before,.crossselling-slider .slick-next:before{border:solid {{settings.sliderArrowColor}};border-width:0 1px 1px 0;display:inline-block;padding:3px;width:4px;height:4px;top:14px;content:" "}.crossselling-slider .slick-prev:hover,.crossselling-slider .slick-next:hover{background:{{settings.sliderHoverBgColor}}}.crossselling-slider .slick-prev:hover:before,.crossselling-slider .slick-next:hover:before{border-color:{{settings.sliderHoverArrowColor}}}.crossselling-slider .slick-prev{left:-40px}.crossselling-slider .slick-prev:before{left:16px;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.crossselling-slider .slick-next{right:-40px}.crossselling-slider .slick-next:before{left:14px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.crossselling-slider button.slick-prev.slick-arrow.slick-disabled,.crossselling-slider button.slick-arrow.slick-disabled{display:none !important}
Teraz w pliku css/layout-m.css dodaj poniższy kod:.cart--step-five-crossselling-container{margin-top:60px}.crossselling-slider .slick-prev{left:0}.crossselling-slider .slick-next{right:0}
Następnie w pliku css/layout-d.css dodaj poniższy kod:.cart.with-crossselling{display:block}.cart--step-five.with-crossselling .cart--step-five-content-container{width:30%;margin-right:9%;display:inline-block;vertical-align:top}.cart--step-five-crossselling-container{display:inline-block;width:60%;vertical-align:top}
Obsługa dodawania załączników do reklamacji i zwrotów
Obsługa dodawania załączników do reklamacji i zwrotów
W tym artykule dowiesz się jak zmodyfikować swój szablon, aby przy składaniu reklamacji i zwrotów było możliwe dołączenie załączników.WskazówkaNa podstawie tego artykułu trzeba będzie wprowadzać zmiany w plikach js oraz scss. Pamiętaj, że te pliki należy zminifikować. O tym jak skompilować i zminifikować pliki js oraz scss dowiesz się z artykułu o kompilacji i minifikacji plików.Szafir
W pliku product/cart-product.html wyszukaj frazę note-ui. Nad linijką z tą frazą wklej poniższy kod:{% if config.Complaints.AttachmentsEnabled -%} <div> <label class="add-attachement-label-ui" for="file"><i class="ti-clip"></i> {{ translations.AddAttachement }}</label> {% capture maxSize -%}{{config.Complaints.AttachmentMaxSize}}B{% endcapture -%} {% for i in (1..config.Complaints.AttachmentsMaxCount) -%} <div class="input-file-container-ui"><input class="add-attachement-in-complaint-ui add-attachement-in-complaint-lq" accept="{{ config.Complaints.AttachmentExtensions }}" name="file" type="file" data-file-size="{{ config.Complaints.AttachmentMaxSize }}" data-size-exceeded="{{ translations.Com_FileSizeExceeded | Format: maxSize }}" data-invalid-file="{{ translations.Com_InvalidFile | Format: config.Complaints.AttachmentExtensions }}" /> <i class="ti-close clear-file-input-ui clear-file-input-lq hidden-lq"></i></div> {% endfor -%} </div> {% endif -%}
Następnie w pliku customer-profile/complaints/complaints.html wyszukaj frazę complaint.Response. Będzie to linijka z warunkiem. Pod tym warunkiem wklej poniższy kod:{% assign complaintsSize = customer-profile.Complaint.Attachments | Size -%} {% if config.Complaints.AttachmentsEnabled and complaintsSize > 0 -%}</code> <div class="attachements-ui remarks-ui"> {% for file in customer-profile.Complaint.Attachments -%} {% assign type = file.Name | Split: '.' | Last -%} {% if type == "jfif" or type == "jpe" or type == "jpeg" or type == "jpg" -%} {% assign icon = 'ti-image' -%} {% elseif type == "csv" or type == "txt" -%} {% assign icon = 'ti-receipt' -%} {% elseif type == "docx" or type == "odt" -%} {% assign icon = 'ti-write' -%} {% elseif type == "xlsx" or type == "ods" -%} {% assign icon = 'ti-bar-chart' -%} {% elseif type == "pdf" -%} {% assign icon = 'ti-agenda' -%} {% else -%} {% assign icon = 'ti-file' -%} {% endif -%} <div class="file-container-ui file-container-lq"><a href="{{ file.Url }}"><i class="{{ icon }} icon-ui"></i> <span class="line-height-1-ui va-mid-ui">{{ file.Name }}</span></a></div> {% endfor -%} </div> {% endif -%}
Teraz w pliku js/init-ui2.js wyszukaj frazę sendComplaintSuccess(e). Będzie to funkcja, którą należy usunąć. Usuń również jej wywołanie, które jest tuż pod nią. Na samym końcu tego pliku (js/init-ui2.js) wklej poniższy kod:function addAttachementInComplaint(e) { window.attachementsInComplaint = []; var filesArr = $(e.currentTarget).parents('.form-lq').find('.add-attachement-in-complaint-lq'); filesArr.each(function () { if(this.files.length > 0){ var maxSize = $(this).data('file-size'); if(this.files[0].size > maxSize){ var message = $(this).data('size-exceeded'); var popup = '</code> <div class="message-popup-background-ui errors-lq cancel-lq container-to-delete-lq" style="overflow: auto;"> '+ ' <div class="message-popup-ui box-ui after-adding-to-cart-popup-ui message-popup-on-background-lq" style="position: absolute; top: 0; transform: none; margin: 10% auto;"> '+ ' <div class="box-ui product-added-to-cart-ui" style="position: relative; padding: 20px;">'+ __translations.AttachementsNotAdded+ '<i class="ti-close cancel-lq" style="position: absolute; right: 20px; top: 20px; cursor: pointer;"></i>'+ '</div> '+ ' <div style="padding: 20px;"><strong>'+this.files[0].name+'</strong>: '+message+'</div> '+ ' </div> '+ ' </div> '; $('body').append(popup); $('body').addClass('modal-opened-ui'); $(this).val(''); } else { window.attachementsInComplaint.push(this.files[0]); $(this).next().removeClass('hidden-lq'); } } }); }; $('body').on('change', '.add-attachement-in-complaint-lq', function (e) { addAttachementInComplaint(e); }); function sendComplaint(e) { if(app.validationBeforePost(e) != 'error'){ var form = $(e.currentTarget).parents('.form-lq'); var dataFromHTML = form.find('input:not([disabled]), select:not([disabled]), textarea:not([disabled])').serializeArray(); var fileList = window.attachementsInComplaint; if(fileList != undefined){ var filesSize = fileList.length; } var fd = new FormData(); fd.append('__csrf', __CSRF); for(var i=0; i<dataFromHTML.length; i++){ fd.append(dataFromHTML[i].name,dataFromHTML[i].value); } if (filesSize > 0) { window.AttachementsErrors = 0; function addAttachementError(file, message) { if(window.AttachementsNotAdded == undefined){ window.AttachementsNotAdded = []; } var attachement = ' <div style="padding: 20px;"><strong>'+file.name+'</strong>: '+message+'</div> '; window.AttachementsNotAdded.push(attachement); window.AttachementsErrors += 1; }; var input = form.find('[name=file]').eq(0); var extensions = input.attr('accept').split(', '); var fileSize = input.data('file-size'); for (var i=0; i<filesSize; i++) { var file = fileList.pop(); if(file.size < fileSize){ var extensionArr = file.name.split('.'); var extension = '.' + extensionArr[extensionArr.length - 1].toLowerCase(); var wrongExtension = true; for(var j=0; j<extensions.length; j++){ if(extension == extensions[j]){ fd.append('file'+i, file); var wrongExtension = false; } } if(wrongExtension){ var message = input.data('invalid-file'); addAttachementError(file, message); } } else { var message = input.data('size-exceeded'); addAttachementError(file, message); } } if(window.AttachementsNotAdded){ var popup = ' <div class="message-popup-background-ui errors-lq cancel-lq container-to-delete-lq" style="overflow: auto;"> '+ ' <div class="message-popup-ui box-ui after-adding-to-cart-popup-ui message-popup-on-background-lq" style="position: absolute; top: 0; transform: none; margin: 10% auto;"> '+ ' <div class="box-ui product-added-to-cart-ui" style="position: relative; padding: 20px;">'+ __translations.AttachementsNotAdded+ '<i class="ti-close cancel-lq" style="position: absolute; right: 20px; top: 20px; cursor: pointer;"></i>'+ '</div> '+ window.AttachementsNotAdded.join('')+ ' </div> '+ ' </div> '; $('body').append(popup); $('body').addClass('modal-opened-ui'); window.AttachementsNotAdded = undefined; window.AttachementsErrors = undefined; } } $.ajax({ data: fd, processData: false, contentType: false, type: 'POST', success: function (data) { $('.add-attachement-in-complaint-lq').val(''); if (data.action.Result) { form.parents('.add-complaint-form-lq').find('.success-message-lq').removeClass('hidden-lq'); form.addClass('hidden-lq'); } else { app.serverMessage(data, form, e); } } }); } }; $('body').on('click', '.send-complaint-lq', function(e) { sendComplaint(e); }); $('body').on('click', '.clear-file-input-lq', function(e) { var index = $(e.currentTarget).parent().index(); $(e.currentTarget).prev().val(''); window.attachementsInComplaint.splice(index - 1, 1); $(e.currentTarget).addClass('hidden-lq'); });
W plikach scss/globals/_globals2.scss i scss/globals/_globals-m.scss znajdź linijkę z frazą .select-background-ui, input[type="date"]{ i zamień ją na .select-background-ui, input[type="date"], input[type="file"]{.Topaz
W Panelu Administratora przejdź do zakładki Tłumaczenia (Wygląd sklepu/ Ustawienia/ Tłumaczenia) i dodaj tam trzy frazy:- ReportDetails – Szczegóły zgłoszenia,
- ReportSuccessInfo – Na adres e-mail zostało wysłane potwierdzenie. Oczekuj kolejnych wiadomości e-mail o zmianie statusu zgłoszenia.,
- AttachementsNotAdded – Nie dodano wszystkich załączników.
<div class="popupDialog popupDialog__complain popupDialog-js"> <div class="popupDialog__wrapper"> <span class="popupDialog__title">{{ translations.SendComplaintOrReturn }}</span> <div class="complain__product"> <figure><img class="productImage-js" alt="" /></figure> </div> <div class="form complain__form inputs-container-js" data-success-info="{{ translations.ReportSuccessInfo }}"> <div class="form__checkBox checkBoxes__container checkBoxes__container--radio radioContainer-js"> <div class="radioComplaint-js"><input id="radio-complaint" class="checkbox-input" name="__action" type="radio" value="Order/ComplaintAdd" data-name="complaint" /> <label for="radio-complaint"> {{ translations.Prf_OrderComplaint }} </label></div> <div class="radioReturn-js"><input id="radio-return" class="checkbox-input" name="__action" type="radio" value="Order/ReturnAdd" data-name="return" /> <label for="radio-return"> {{ translations.Prf_OrderReturn }} </label></div> </div> <strong>{{ translations.ReportDetails }}</strong> <div class="form__input-wrapper complaintInputWrapper-js"> {% if config.Complaints.Defects <> null -%} {% assign defectsSize = config.Complaints.Defects | Size -%}<select class="form__input-value form__input-value-js" name="defectId" required="">{% if defectsSize > 1 -%} <option value="-1">{% if defectsSize > 1 -%}* {% endif -%} {{translations.ChooseComplaintCause}}</option>{% endif -%} {% for def in config.Complaints.Defects -%} <option value="{{def.Id}}">{{def.Name}}</option>{% endfor -%} </select> {% endif -%} <p class="form__invalid-input form__validation-required-js" style="display: none;">{{ translations.Com_FieldIsMandatory }}</p> </div> <div class="form__input-wrapper complaintInputWrapper-js"><input id="defectDate" class="form__input-value form__icon_padding form__input-value-js" max="{{config.Now | Date: 'yyyy-MM-dd'}}" min="{{order.Date | Date: 'yyyy-MM-dd'}}" name="defectDate" type="date" value="{{config.Now | Date: 'yyyy-MM-dd'}}" placeholder="yyyy-MM-dd" /> <label class="form__input-info" for="defectDate">* {{translations.Prf_DefectDate}}</label></div> <div class="form__input-wrapper complaintInputWrapper-js"> {% if config.Complaints.Requests <> null -%} {% assign requestsSize = config.Complaints.Requests | Size -%}<select class="form__input-value form__input-value-js" name="requestId" required="">{% if requestsSize > 1 -%} <option value="-1">{% if requestsSize > 1 -%}* {% endif %} {{translations.Prf_ComplainRequest}}</option>{% endif %} {% for req in config.Complaints.Requests -%} <option value="{{req.Id}}">{{req.Name}}</option>{% endfor -%} </select> {% endif -%} <p class="form__invalid-input form__validation-required-js" style="display: none;">{{ translations.Com_FieldIsMandatory }}</p> </div> {% assign returnTypes = config.Complaints.Returns | Size -%} {% if returnTypes > 1 -%} <div class="form__input-wrapper returnInputWrapper-js"> <select class="form__input-value form__input-value-js" name="returnId" required=""> <option value="-1">{% if returnTypes > 1 -%}* {% endif %} {{translations.ChooseReturn}}</option>{% for return in config.Complaints.Returns -%} <option value="{{return.Id}}">{{return.Name}}</option>{% endfor -%} </select> <p class="form__invalid-input form__validation-required-js" style="display: none;">{{ translations.Com_FieldIsMandatory }}</p> </div> {% endif %} <div class="form__input-wrapper min-js"><label class="quantityField__label">{{translations.Com_Quantity}}</label> <button class="button-minus-add-product" type="button" data-field="quantity"> </button> <input class="quantity-field quantity__field-js" max="" min="1" name="quantity" type="number" value="1" data-decimal="false" /> <button class="button-plus-add-product" type="button" data-field="quantity"> </button></div> <div class="form__input-wrapper"><input id="accountNumber" class="form__input-value form__input-value-js" maxlength="50" name="accountNumber" type="text" /> <label class="form__input-info form__input-info-js" for="accountNumber">{{translations.Crt_BankAccountNumber}}</label></div> <div class="form__input-wrapper">{{translations.Prf_AdditionalInfo}} <textarea class="form__input-value" name="message"></textarea></div> <div class="form__input-wrapper"><span class="form__requiredFields--info">* {{ translations.Com_RequiredFields }}</span></div> {% if config.Complaints.AttachmentsEnabled -%} <div class="form__input-wrapper attachementsInputWrapper" data-not-added-info="{{translations.AttachementsNotAdded}}"> <div class="form__attachementsLabel">{{ translations.AddAttachment }}</div> {% capture maxSize -%}{{config.Complaints.AttachmentMaxSize}}B{% endcapture -%} {% for i in (1..config.Complaints.AttachmentsMaxCount) -%} <div class="form__attachement-input-container"><input class="addAttachementInComplaint-js" accept="{{ config.Complaints.AttachmentExtensions }}" name="file" type="file" data-file-size="{{ config.Complaints.AttachmentMaxSize }}" data-size-exceeded="{{ translations.Com_FileSizeExceeded | Format: maxSize }}" data-invalid-file="{{ translations.Com_InvalidFile | Format: config.Complaints.AttachmentExtensions }}" /></div> {% endfor -%} </div> {% endif -%} <input class="productId-js" name="no" type="hidden" value="" /> <input name="orderId" type="hidden" value="{{order.Id}}" /> <button class="primary-action-button orderComplaintOrReturnAdd-js" type="button" data-id="{{order.Id}}">{{translations.Report}}</button> </div> </div> </div>
Teraz w pliku js/layout1.js (lub layout0.js jeśli nie ma layout1.js, lub layout.js jeśli nie ma dwóch poprzednich) znajdź zmienną var customerProfile, a w niej funkcję events. Tuż przed nią dodaj poniższy kod:addAttachementInComplaint: function(e) { window.attachementsInComplaint = []; var filesArr = $(e.currentTarget).parents('.inputs-container-js').find('.addAttachementInComplaint-js'); filesArr.each(function () { if(this.files.length > 0){ var maxSize = $(this).data('file-size'); if(this.files[0].size > maxSize){ var message = $('[data-not-added-info]').data('not-added-info') + '. </code></code><strong>' + this.files[0].name + '</strong><code class="lang:ruby decode:true ">: ' + $(this).data('size-exceeded'); app.showTemporaryPopup(message, 'error', '', 8000); $(this).val(''); $(this).next().hide(); } else { window.attachementsInComplaint.push(this.files[0]); $(this).next().show(); } } }); }, sendComplaint: function(e) { if(app.validationBeforePost(e) != 'error'){ var form = $(e.currentTarget).parents('.inputs-container-js'); var dataFromHTML = form.find('input:not([disabled]), select:not([disabled]), textarea:not([disabled])').serializeArray(); var fileList = window.attachementsInComplaint; if(fileList != undefined){ var filesSize = fileList.length; } var fd = new FormData(); fd.append('__csrf', __CSRF); for(var i=0; i<dataFromHTML.length; i++){ fd.append(dataFromHTML[i].name,dataFromHTML[i].value); } if (filesSize > 0) { window.AttachementsErrors = 0; function addAttachementError(file, message) { if(window.AttachementsNotAdded == undefined){ window.AttachementsNotAdded = []; } var attachement = '</code> <div style="padding: 20px;"><strong>'+file.name+'</strong>: '+message+'</div> '; window.AttachementsNotAdded.push(attachement); window.AttachementsErrors += 1; }; var input = form.find('[name=file]').eq(0); var extensions = input.attr('accept').split(', '); var fileSize = input.data('file-size'); for (var i=0; i<filesSize; i++) { var file = fileList.pop(); if(file.size < fileSize){ var extensionArr = file.name.split('.'); var extension = '.' + extensionArr[extensionArr.length - 1].toLowerCase(); var wrongExtension = true; for(var j=0; j<extensions.length; j++){ if(extension == extensions[j]){ fd.append('file'+i, file); var wrongExtension = false; } } if(wrongExtension){ var message = input.data('invalid-file'); addAttachementError(file, message); } } else { var message = input.data('size-exceeded'); addAttachementError(file, message); } } if(window.AttachementsNotAdded){ var message = $('[data-not-added-info]').data('not-added-info') + window.AttachementsNotAdded.join(''); app.showTemporaryPopup(message, 'error', '', 8000); window.AttachementsNotAdded = undefined; window.AttachementsErrors = undefined; } } $.ajax({ data: fd, processData: false, contentType: false, type: 'POST', success: function (data) { $('.addAttachementInComplaint-js').val(''); if (data.action.Result) { var message = form.data('success-info'); app.showTemporaryPopup(message, 'success', '', 8000); $('.clearFileInput-js').hide(); app.hidePopup(e); sessionStorage.removeItem('complains'); sessionStorage.removeItem('order' + (e.currentTarget).dataset.id); $('.order' + (e.currentTarget).dataset.id).remove(); customerProfile.showOrderDetails(e); } else { app.showTemporaryPopup(result.action.Description, 'error', '', 8000); } } }); } },
Następnie w funkcji events dodaj poniższy kod:mainSection.on('change', '.addAttachementInComplaint-js', function (e) { customerProfile.addAttachementInComplaint(e); }); mainSection.on('click', '.orderComplaintOrReturnAdd-js', function(e) { customerProfile.sendComplaint(e); }); mainSection.on('click', '.clearFileInput-js', function(e) { var index = $(e.currentTarget).parent().index(); $(e.currentTarget).prev().val(''); window.attachementsInComplaint.splice(index - 1, 1); $(e.currentTarget).hide(); });
Teraz wyszukaj funkcję orderComplaintOrReturnAdd i usuń ją. Następnie wyszukaj wywołanie tej funkcji (w funkcji events) i również usuń. Następnie w pliku css/layout.css dodaj poniższy kod:.customer .popupDialog__complain .popupDialog__wrapper{max-width:700px;padding-bottom:0}.customer .complain__product{width:40%;padding:0;margin:40px 0;vertical-align:top;display:inline-block;border:none}.customer .complain__product figure{width:100%;height:auto;margin:0 0 20px}.customer .complain__form{width:calc(60% - 84px);display:inline-block;margin:40px}.customer .complain__form>strong{display:block;margin-bottom:20px}.customer .complain__form textarea{margin-top:10px;padding:10px}.customer .customer__orderContent .checkBoxes__container--radio{margin-top:0}.customer .form__attachement-input-container{position:relative}.customer .form__clear-attachement-input{position:absolute;top:11px;cursor:pointer}
Teraz w pliku css/layout-m.css dodaj poniższy kod:.customer .complain__product{width:100%;margin:20px 0}.customer .complain__form{width:100%;margin:20px 0}
Obsługa dostawy o typie negocjowalnym w szablonach
WskazówkaOd 1 czerwca 2025 roku zakończyliśmy aktualizację oraz wydawanie nowych wersji szablonów Bursztyn, Agat i Opal, a tym samym ich wsparcie, aby skupić się na nowoczesnych rozwiązaniach, które jeszcze lepiej odpowiadają na potrzeby dynamicznie rozwijającego się rynku e-commerce. Zachęcamy Was do przejścia na nasze nowe, udoskonalone szablony. Dla sklepów B2C polecamy szablony Topaz, One Page Shop oraz Dla Gastronomii, natomiast dla platform B2B idealnym wyborem będą Rubin i Szafir.Obsługa dostawy o typie negocjowalnym w szablonach
W tym artykule dowiesz się jak zmodyfikować swój szablon, aby obsłużyć dostawy o typie negocjowalnym.Szafir
Na samym początku pliku common/order-summary.html jest warunek z kilkoma assignami. W warunku dodaj taką linijkę {% assign notDeterminedDeliveryCost = order.Delivery.NotDeterminedDeliveryCost -%}, a w elsie dodaj taką {% assign notDeterminedDeliveryCost = order.SelectedDelivery.NotDeterminedDeliveryCost -%}. Kawałek niżej znajduje się warunek {% if order.NotDeterminedDeliveryCost and order.OrderStep != 'Start' -%}. Zamień go na poniższy kod:{% if order.NotDeterminedDeliveryCost or order.SelectedDelivery.NotDeterminedDeliveryCost -%} {% assign notDeterminedDeliveryCost = true -%} {% endif -%} {% if notDeterminedDeliveryCost and order.OrderStep == 'Start' -%}
Następnie w tym samym pliku wyszukaj frazę {% unless order.NotDeterminedDeliveryCost -%} i zamień ją na warunek {% if order.NotDeterminedDeliveryCost == false and notDeterminedDeliveryCost == false -%}. Pamiętaj aby kilka linijek niżej zamienić {% endunless -%} na {% endif -%}. Kawałek dalej znajduje się warunek {% if paymentCost != null -%}. Zamień go na {% if paymentCost != null and order.NotDeterminedDeliveryCost == false and notDeterminedDeliveryCost == false -%} Teraz w pliku order/delivery-partials/delivery-section.html, wyszukaj warunek {% if order.NotDeterminedDeliveryCost == false -%} i zamień go na {% if order.NotDeterminedDeliveryCost == false and deliveryMethod.NotDeterminedDeliveryCost == false -%}. Następnie wyszukaj warunek {% if order.NotDeterminedDeliveryCost == false -%} i zamień go na {% if order.NotDeterminedDeliveryCost == false and order.SelectedDelivery.NotDeterminedDeliveryCost == false -%} W pliku order/cart.html znajdź warunek {% if order.NotDeterminedDeliveryCost and order.OrderStep == 'Start' -%}. Zamień go na poniższy kod:{% if order.NotDeterminedDeliveryCost or order.SelectedDelivery.NotDeterminedDeliveryCost -%} {% assign notDeterminedDeliveryCost = true -%} {% endif -%} {% if notDeterminedDeliveryCost and order.OrderStep == 'Start' -%}
Agat
W pliku partials/cart/cart-content.html znajdź warunek {% if cart.NotDeterminedDeliveryCost == true %} i zamień go na {% if cart.NotDeterminedDeliveryCost or cart.SelectedDelivery.NotDeterminedDeliveryCost %}. Kawałek dalej w tym samym pliku znajdź warunek {% if cart.NotDeterminedDeliveryCost == false %}. Zamień go na poniższy kod:{% if deliveryMethod.Name == cart.SelectedDelivery.Name %} {% assign notDeterminedDeliveryCost = cart.SelectedDelivery.NotDeterminedDeliveryCost -%} {% else %} {% assign notDeterminedDeliveryCost = deliveryMethod.NotDeterminedDeliveryCost -%} {% endif %} {% if cart.NotDeterminedDeliveryCost == false and notDeterminedDeliveryCost == false %}
Kawałek niżej znajdź warunek {% if cart.NotDeterminedDeliveryCost == false %} i zamień go na {% if cart.NotDeterminedDeliveryCost == false and deliveryMethodLvl.NotDeterminedDeliveryCost == false %}. Dalej w tym samym pliku (partials/cart/cart-content.html), oraz w plikach partials/cart/delivery-and-payment.html i partials/cart/summary.html znajdź frazę {% unless cart.NotDeterminedDeliveryCost -%} i zamień ją na {% if cart.NotDeterminedDeliveryCost == false and cart.SelectedDelivery.NotDeterminedDeliveryCost == false -%}. Pamiętaj aby kilka linijek niżej zamienić {% endunless -%} na {% endif -%}. We wszystkich przypadkach przesuń ten {% endif -%} tak aby warunek obejmował też dane związane z kosztami płatności. Podobną zmianę należy wprowadzić w pliku partials/customer/order-details.html. Frazę {% unless customer-profile.Order.NotDeterminedDeliveryCost -%} należy zamienić na {% if customer-profile.Order.NotDeterminedDeliveryCost == false and customer-profile.Order.Delivery.NotDeterminedDeliveryCost == false -%} W plikach partials/cart/delivery-and-payment.html i partials/cart/summary.html znajdź warunek {% if cart.NotDeterminedDeliveryCost -%} i zamień go na {% if cart.NotDeterminedDeliveryCost or cart.SelectedDelivery.NotDeterminedDeliveryCost %}Bursztyn lub Opal
Na początku pliku order/cart.html znajdź warunek {% if cart.NotDeterminedDeliveryCost %} i zamień go na {% if cart.NotDeterminedDeliveryCost or cart.SelectedDelivery.NotDeterminedDeliveryCost %}. Następnie trochę dalej znajdź warunek {% if cart.NotDeterminedDeliveryCost == false %} i zamień go na {% if cart.NotDeterminedDeliveryCost == false and delivery.NotDeterminedDeliveryCost == false %}. Kawałek dalej znajdziesz warunek {% if delivery.FreeDeliveryFrom > cart.ProductsTotalValue and cart.NotDeterminedDeliveryCost == false and delivery.TotalValue > 0 %}. Zamień go na {% if delivery.FreeDeliveryFrom > cart.ProductsTotalValue and cart.NotDeterminedDeliveryCost == false and delivery.NotDeterminedDeliveryCost == false and delivery.TotalValue > 0 %} Następnie w pliku order/stepsummary.html znajdź frazę {{translations.Crt_DeliveryCost}} i całą linijkę z tą frazą nadpisz poniższym kodem:{% if deliveryData.NotDeterminedDeliveryCost == false %}{{translations.Crt_DeliveryCost}}{{deliveryData.TotalValue|ToPrice}} {{cartCurrency}}{% endif %}
Topaz
W pliku staticElements/cart/cart.html znajdź warunek (występuje dwa razy) {% if cart.NotDeterminedDeliveryCost == true %} i zamień go na {% if cart.NotDeterminedDeliveryCost or cart.SelectedDelivery.NotDeterminedDeliveryCost %} (w obu przypadkach). Następnie wyszukaj frazę {{deliveryMethod.DateText}}. Pod linijką z tą frazą znajduje się warunek. Zastąp go wraz z jego zawartością poniższym kodem:{% if deliveryMethod.NotDeterminedDeliveryCost == false and cart.NotDeterminedProductsDeliveryCost == false -%} {{ deliveryMethod.TotalValue | ToPrice }} {{ currency }} {% endif -%}
Teraz wyszukaj frazę {{ payment.DueDateText }}. Pod linijką z tą frazą znajduje się warunek. Zastąp go wraz z jego zawartością poniższym kodem:{% if deliveryMethodLvl.NotDeterminedDeliveryCost == false and cart.NotDeterminedProductsDeliveryCost == false -%} {{ payment.TotalValue | ToPrice }} {{ currency }} {% endif -%}
Obsługa lookbooka w szablonie Topaz
' ); }); }); }); }; addLookbookProducts(); $('body').on('click', '.showLookbookProducts-js', function (e) { $(e.currentTarget).siblings().show(); $(e.currentTarget).hide(); }); $('body').on('click', '.hideLookbookProducts-js', function (e) { $(e.currentTarget).siblings().hide(); $(e.currentTarget).next().show(); $(e.currentTarget).hide(); }); } Następnie w pliku js/layout0.js (lub layout.js jeśli nie ma layout0.js) znajdź zmienną var headerFunctions i podmień ją na jeden z poniższych kodów. Pierwszy jest do nagłówka z domyślnie ukrytą wyszukiwarką, a drugi do nagłówka z domyślnie odkrytą wyszukiwarką. header-1Obsługa lookbooka w szablonie Topaz
W tym artykule dowiesz się jak zmodyfikować swój szablon, aby obsługiwał lookbooka.Topaz
W Panelu Administratora przejdź do zakładki Tłumaczenia (Wygląd sklepu -> Ustawienia -> Tłumaczenia) i dodaj tam dwie frazy. ShowProducts - Pokaż towary, Lookbook - Lookbook. Następnie przejdź do zakładki Bannery (Wygląd sklepu -> Ustawienia -> Bannery) i dodaj tam banner o nazwie lookbook. Po jego dodaniu wejdź w jego ustawienia i zaznacz Lookbook zamiast Standardowy. Resztę uzupełnij wedle własnego uznania. W polu Nazwa (Lookbook) będzie nazwa lookbooka, która będzie się wyświetlać w sklepie. Teraz przejdź do zakładki Strony (Wygląd sklepu -> Ustawienia -> Trzykropek w prawym górnym rogu -> Edytuj ustawienia zaawansowane -> Strony) i przy stronie Lookbook wpisz lookbook.html, a następnie wejdź w ustawienia danej strony i zaznacz check-box header [Nagłówek]. Zapisz to wszystko kliknięciem w dyskietkę w prawym górnym rogu. W pliku elements/header/header-1.html (lub header-2.html - w zależności od wybranej w szablonie wersji nagłówka) wyszukaj frazę config.DefinedPages.Contact. Pod linijką z tą frazą wklej poniższy kod:{% for banner in config.Banners -%} {% assign imagesQuantity = banner.Images | Size -%} {% if banner.Name == 'lookbook' and imagesQuantity == 0 -%} {% assign fakeLookbook = true -%} {% endif -%} {% endfor -%} {% assign lookbooksQuantity = config.Lookbook.List | Size -%} {% if lookbooksQuantity > 1 -%} {{ translations.Lookbook }} {% elseif lookbooksQuantity == 1 or fakeLookbook -%} {{ config.DefinedPages.Lookbook | A }} {% endif -%}
Następnie w folderze staticElements dodaj folder lookbook, a w nim plik lookbook.html, który będzie zawierał poniższy kod:{% include 'partials/common/breadcrumbs.html' -%} {% assign lookbooksQuantity = config.Lookbook.List | Size -%} {% if lookbooksQuantity > 1 -%} {% assign lookbook = config.Lookbook.Current -%} {% elseif lookbooksQuantity == 1 -%} {% assign lookbook = config.Lookbook.List[0] -%} {% endif -%}
Teraz w pliku css/layout.css dodaj poniższy kod:{% if lookbooksQuantity > 0 -%} {{ lookbook.Text }}
{% for image in lookbook.Images -%}{% else -%}{% if image.JSON != "" -%}{% endfor -%}{{translations.ShowProducts | Upcase}}{% endif -%}{{ translations.Lookbook }}
{{'css/img/img-placeholder.jpg' | Img: '', translations.DefaultImage}}560x630{{'css/img/img-placeholder.jpg' | Img: '', translations.DefaultImage}}700x850{{'css/img/img-placeholder.jpg' | Img: '', translations.DefaultImage}}1260x540{{'css/img/img-placeholder.jpg' | Img: '', translations.DefaultImage}}630x950{{'css/img/img-placeholder.jpg' | Img: '', translations.DefaultImage}}560x630.lookbookSection{width:85%;max-width:1400px;margin:50px auto 150px}.lookbook__name{margin-bottom:100px}.lookbook__imageContainer{position:relative;vertical-align:top}.lookbook__imageContainer:nth-child(5n+1){display:inline-block;width:40%;margin-right:calc(10% - 5px)}.lookbook__imageContainer:nth-child(5n+2){display:inline-block;width:50%}.lookbook__imageContainer:nth-child(5n+3){width:90%}.lookbook__imageContainer:nth-child(5n+4){display:inline-block;width:45%;margin-right:calc(15% - 5px)}.lookbook__imageContainer:nth-child(5n){display:inline-block;width:40%}.lookbook__imageContainer img{max-width:100%;max-height:100%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.lookbook__imagePlaceholder{background-color:#f2f2f2}.lookbook__imagePlaceholderSize{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.lookbook__productsToggleButton{position:absolute;right:0;bottom:0;padding:20px;background:#fff;width:250px;text-align:center;cursor:pointer}.lookbook__productsContainer{position:absolute;right:0;bottom:59px;padding:0 20px;background:#fff;width:250px}.lookbook__product{position:relative;padding:20px 0;border-bottom:1px solid #f2f2f2}.lookbook__productName{color:{{settings.inputLabelColor}};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-bottom:10px}.lookbook__productPrice{font-size:18px;font-weight:700;display:inline-block;width:calc(100% - 50px)}.lookbook__checkProductLink{position:absolute;right:0;bottom:20px;color:{{settings.linkFontColor}}}
Następnie w pliku css/layout-m.css dodaj poniższy kod:.lookbookSection{margin:20px auto}.lookbookSection .lookbook__imageContainer{width:100%;margin:0 0 100px}.lookbookSection .lookbook__imageContainer:last-child{margin-bottom:20px}.lookbook__name{margin-bottom:20px}.lookbook__showProductsButton{bottom:0;right:auto;left:50%;transform:translate(-50%, 50%);border:1px solid #f2f2f2}.lookbook__hideProductsButton,.lookbook__productsContainer{position:fixed;width:calc(100% - 40px);z-index:102}.lookbook__productsContainerBackgroundMobile{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(255,255,255,0.8);z-index:101}
Teraz w pliku js/layout1.js (lub layout0.js jeśli nie ma layout1.js, lub layout.js jeśli nie ma dwóch poprzednich) dodaj poniższy kod:if($('.lookbookImageContainer-js').length > 0){ var setLookbookImages = function () { $('.lookbookImageContainer-js').each(function(index){ if(index == 0){ var heightRatio = 1.13; } else if(index == 1){ var heightRatio = 1.22; var marginTopRatio = 0.39; } else if(index == 2){ var heightRatio = 0.43; var marginTopRatio = 0.25; var marginBottomRatio = 0.36; } else if(index == 3){ var heightRatio = 1.52; } else if(index == 4){ var heightRatio = 1.13; var marginTopRatio = 0.46; } var width = $(this).width(); var height = width * heightRatio; $(this).css('height', height); if($(window).width() > 768){ if(marginTopRatio){ var marginTop = height * marginTopRatio; $(this).css('margin-top', marginTop); } if(marginBottomRatio){ var marginBottom = height * marginBottomRatio; $(this).css('margin-bottom', marginBottom); } } else { if(marginTopRatio){ $(this).css('margin-top', 0); } if(marginBottomRatio){ $(this).css('margin-bottom', 100); } } }) }; setLookbookImages(); $(window).resize(function() { setLookbookImages(); }); var addLookbookProducts = function () { var url = $('[data-product-details-url]').data('product-details-url'); var checkTranslation = $('[data-check-translation]').data('check-translation'); $('[data-lookbook-products]').each(function(){ var productContainer = $(this); var products = JSON.stringify(productContainer.data('lookbook-products')); var objProducts = JSON.parse(products); $.each(objProducts, function (index, value) { var productUrl = url + ',,' + value.id; var data = {__collection: 'product-details.Product.Name|product-details.Product.Price'}; $.get(productUrl, data, function (res) { productContainer.append( '
'+ ''+ ''+res.collection['product-details.Product.Name']+''+ ''+res.collection['product-details.Product.Price']+' '+__curr+''+ ''+checkTranslation+'var headerFunctions = { init: function () { headerFunctions.events(); }, events: function () { var pageHeader = $('.pageHeader-js'); pageHeader.on('click', '.showSearchSection-js', function() { $('.pageHeader-js .headerSearchForm-js').toggle(200); $('.pageHeader-js .sitesNavigation-js').hide(200); $('.pageHeader-js .mainNavigation-js').hide(200); $('.pageHeader-js .lookbooksNavigation-js').hide(200); $('.openCategoryMenu-js, .openPagesMenu-js, .openLookbooksMenu-js').removeClass('activeButton-js'); $('.searchFormPhrase-js').focus(); }); pageHeader.on('click', '.showMenuSection-js', function() { $('.pageHeader-js .headerMainMenu-js').toggle(200); }); pageHeader.on('click', '.mainMenuMobileCloseBtn-js', function() { $('.pageHeader-js .headerMainMenu-js').hide(200); }); pageHeader.on('click', '.openCategoryMenu-js', function() { $('.pageHeader-js .sitesNavigation-js').hide(200); $('.pageHeader-js .languageAndCurrencyMenu-js').hide(200); $('.pageHeader-js .headerSearchForm-js').hide(200); $('.pageHeader-js .lookbooksNavigation-js').hide(200); $('.pageHeader-js .mainNavigation-js').toggle(200); $('.openLanguageAndCurrencyMenu-js, .openPagesMenu-js, .openLookbooksMenu-js').removeClass('activeButton-js'); $(this).toggleClass('activeButton-js'); app.loadImages(); }); pageHeader.on('click', '.openLanguageAndCurrencyMenu-js', function() { $('.pageHeader-js .sitesNavigation-js').hide(200); $('.pageHeader-js .mainNavigation-js').hide(200); $('.pageHeader-js .headerSearchForm-js').hide(200); $('.pageHeader-js .lookbooksNavigation-js').hide(200); $('.pageHeader-js .languageAndCurrencyMenu-js').toggle(200); $('.openCategoryMenu-js, .openPagesMenu-js, .openLookbooksMenu-js').removeClass('activeButton-js'); $(this).toggleClass('activeButton-js'); }); pageHeader.on('click', '.openPagesMenu-js', function() { $('.pageHeader-js .mainNavigation-js').hide(200); $('.pageHeader-js .languageAndCurrencyMenu-js').hide(200); $('.pageHeader-js .headerSearchForm-js').hide(200); $('.pageHeader-js .lookbooksNavigation-js').hide(200); $('.pageHeader-js .sitesNavigation-js').toggle(200); $('.openCategoryMenu-js, .openLanguageAndCurrencyMenu-js, .openLookbooksMenu-js').removeClass('activeButton-js'); $(this).toggleClass('activeButton-js'); }); pageHeader.on('click', '.openLookbooksMenu-js', function() { $('.pageHeader-js .mainNavigation-js').hide(200); $('.pageHeader-js .languageAndCurrencyMenu-js').hide(200); $('.pageHeader-js .headerSearchForm-js').hide(200); $('.pageHeader-js .sitesNavigation-js').hide(200); $('.pageHeader-js .lookbooksNavigation-js').toggle(200); $('.openCategoryMenu-js, .openLanguageAndCurrencyMenu-js, .openPagesMenu-js').removeClass('activeButton-js'); $(this).toggleClass('activeButton-js'); }); pageHeader.on('change', '.customerLanguageChange-js', function(e) { if($(this).is(':checked')) {app.customerLanguageChange(e)} }); pageHeader.on('change', '.customerCurrencyChange-js', function(e) { if($(this).is(':checked')) {app.customerCurrencyChange(e)} }); pageHeader.on('click', '.openUndercategoryMenu-js', function(e) { var undercategory = $(e.currentTarget).closest('li').find('ul').first(); $(undercategory).toggle(200); }); } };
header-2var headerFunctions = { init: function () { headerFunctions.events(); }, events: function () { var pageHeader = $('.pageHeader-js'); pageHeader.on('click', '.showSearchSection-js', function() { $('.pageHeader-js .headerSearchForm-js').toggle(200); $('.searchFormPhrase-js').focus(); }); pageHeader.on('click', '.showMenuSection-js', function() { $('.pageHeader-js .headerMainMenu-js').toggle(200); }); pageHeader.on('click', '.mainMenuMobileCloseBtn-js', function() { $('.pageHeader-js .headerMainMenu-js').hide(200); }); pageHeader.on('click', '.openCategoryMenu-js', function() { $('.pageHeader-js .sitesNavigation-js').hide(200); $('.pageHeader-js .languageAndCurrencyMenu-js').hide(200); $('.pageHeader-js .lookbooksNavigation-js').hide(200); $('.pageHeader-js .mainNavigation-js').toggle(200); $('.openLanguageAndCurrencyMenu-js, .openPagesMenu-js, .openLookbooksMenu-js').removeClass('activeButton-js'); $(this).toggleClass('activeButton-js'); app.loadImages(); }); pageHeader.on('click', '.openLanguageAndCurrencyMenu-js', function() { $('.pageHeader-js .sitesNavigation-js').hide(200); $('.pageHeader-js .mainNavigation-js').hide(200); $('.pageHeader-js .lookbooksNavigation-js').hide(200); $('.pageHeader-js .languageAndCurrencyMenu-js').toggle(200); $('.openCategoryMenu-js, .openPagesMenu-js, .openLookbooksMenu-js').removeClass('activeButton-js'); $(this).toggleClass('activeButton-js'); }); pageHeader.on('click', '.openPagesMenu-js', function() { $('.pageHeader-js .mainNavigation-js').hide(200); $('.pageHeader-js .languageAndCurrencyMenu-js').hide(200); $('.pageHeader-js .lookbooksNavigation-js').hide(200); $('.pageHeader-js .sitesNavigation-js').toggle(200); $('.openCategoryMenu-js, .openLanguageAndCurrencyMenu-js, .openLookbooksMenu-js').removeClass('activeButton-js'); $(this).toggleClass('activeButton-js'); }); pageHeader.on('click', '.openLookbooksMenu-js', function() { $('.pageHeader-js .mainNavigation-js').hide(200); $('.pageHeader-js .languageAndCurrencyMenu-js').hide(200); $('.pageHeader-js .sitesNavigation-js').hide(200); $('.pageHeader-js .lookbooksNavigation-js').toggle(200); $('.openCategoryMenu-js, .openLanguageAndCurrencyMenu-js, .openPagesMenu-js').removeClass('activeButton-js'); $(this).toggleClass('activeButton-js'); }); pageHeader.on('change', '.customerLanguageChange-js', function(e) { if($(this).is(':checked')) {app.customerLanguageChange(e)} }); pageHeader.on('change', '.customerCurrencyChange-js', function(e) { if($(this).is(':checked')) {app.customerCurrencyChange(e)} }); pageHeader.on('click', '.openUndercategoryMenu-js', function(e) { var undercategory = $(e.currentTarget).closest('li').find('ul').first(); $(undercategory).toggle(200); }); } };
Dodawanie zgód do płatności online w szablonach
WskazówkaOd 1 czerwca 2025 roku zakończyliśmy aktualizację oraz wydawanie nowych wersji szablonów Bursztyn, Agat i Opal, a tym samym ich wsparcie, aby skupić się na nowoczesnych rozwiązaniach, które jeszcze lepiej odpowiadają na potrzeby dynamicznie rozwijającego się rynku e-commerce. Zachęcamy Was do przejścia na nasze nowe, udoskonalone szablony. Dla sklepów B2C polecamy szablony Topaz, One Page Shop oraz Dla Gastronomii, natomiast dla platform B2B idealnym wyborem będą Rubin i Szafir.Dodawanie zgód do płatności online w szablonach
W tym artykule dowiesz się, jak dodać zgody do swoich płatności online.1. Bursztyn lub Opal
W pliku order/thank-you.html wyszukaj frazę Fields. Będzie to fragment takiej pętli:{% for f in cart.PlacedOrder.ExternalPayment.Fields -%} {% endfor -%}
Pod nią wklej poniższy kod:{% for c in cart.PlacedOrder.ExternalPayment.Consents -%}{% if c.Statement -%} {% else -%}{% endfor %}2. Szafir
W pliku order/thx.html wyszukaj frazę Fields. Będzie to fragment takiej pętli:{% for field in order.PlacedOrder.ExternalPayment.Fields -%} {% endfor -%}
Pod nią wklej poniższy kod:{% for consent in order.PlacedOrder.ExternalPayment.Consents -%}
{% endfor -%} W pliku scss/globals/_globals2.scss na samym końcu wklej poniższy fragment kodu:.order-ui .in-external-payment-ui{ padding-bottom: 0; margin: 20px 0; }
Następnie taki plik należy zapisać zminifikować.WskazówkaO tym jak skompilować i zminifikować pliki scss dowiesz się z artykułu o kompilacji i minifikacji plików.Agat
W pliku partials/cart/summary.html wyszukaj frazę online-payment-step. Jest to klasa elementu form, do którego należy dodać atrybut data-tos-invalid="{{translations.TosRequired}}" tak, aby ostatecznie wyglądał jak kod poniżej: Pozostając dalej w tym samym pliku (partials/cart/summary.html) wyszukaj frazę Fields. Będzie to fragment takiej pętli:{% for f in cart.PlacedOrder.ExternalPayment.Fields -%} {% endfor -%}
Pod nią wklej poniższy kod: {% endfor %} Na końcu pliku js/order.js wklej ten kod:$('body').on('click', '.external-payment-lq', function (e) { e.preventDefault(); var validate = application.uiValidateForm($('.online-payment-step')); if (validate) { $('.online-payment-step').submit(); } });
W pliku js/init.js wyszukaj funkcję uiSetSwitchNameWidthInNewsletter i na jej końcu dodaj poniższy kod:$('#main-section').find('.online-payment-step .switch-name').each(function () { var width = $('.online-payment-info').width(); $('.online-payment-consents').css('width', width); $(this).css('width', width - 65); });
Na końcu pliku scss/main2.scss wklej ten kod:.online-payment-consents{ display: inline-block; list-style-type: none; padding: 0; text-align: left; .switches:after{ content: ''; display: block; clear: both; } }
WskazówkaPamiętaj, że pliki js i scss należy zminifikować. O tym jak skompilować i zminifikować pliki js i scss dowiesz się z artykułu o kompilacji i minifikacji plików.Porównywarka towarów w szablonie Topaz
Porównywarka towarów w szablonie Topaz
W tym artykule dowiesz się jak zmodyfikować swój szablon Topaz, aby obsługiwał porównywarkę towarów.WskazówkaNiniejsza instrukcja przeznaczona jest dla sklepów w wersji 2020.2 lub nowszej!WskazówkaKopiowanie fraz, które należy wyszukać w kodzie, może powodować problemy. Frazy do wyszukania najlepiej przepisać ręcznie, lub skopiować, ale po skopiowaniu podmienić znaki typu - _ ' " itp. W przeciwnym wypadku, fraza może nie zostać odnaleziona w kodzie!WskazówkaW tym artykule trzeba będzie wprowadzać zmiany w plikach js i css. Z tego artykułu dowiesz się jak je minifikowaćPierwszy krok to przypisanie obiektu porównywarki do właściwej strony sklepu. Otwórz Panel Administracyjny, a następnie zakładkę Wygląd sklepu -> Ustawienia. W prawym górnym rogu kliknij przycisk z trzema kwadratami a następnie z rozwijanego menu wybierz opcję Edytuj ustawienia zaawansowane. Wybierz zakładkę Strony. Znajdź stronę Porównywarka (9). W tym samym wierszu, w kolumnie z nazwą pliku, wpisz comparer.html, a następnie zapisz. Kliknij na pole z napisem Porównywarka (9). Pojawi się lista dostępnych obiektów. Kliknij kwadrat przy obiekcie o nazwie comparison-tool, by pokazał się znak wyboru (tzw. "ptaszek"). A następnie zapisz.WskazówkaJeśli na liście obiektów nie widzisz obiektu comparison-tool, wykonaj następujące czynności. Otwórz Panel Administracyjny, a następnie zakładkę Wygląd sklepu -> Ustawienia. Kliknij w prawym górnym rogu na ikonkę z trzema kwadratami i z rozwiniętego menu wybierz opcję Edytuj ustawienia zaawansowane. Przejdź do zakładki Obiekty. Kliknij przycisk Dodaj. W polu Typ wybierz Porównywarka towarów a w polu Nazwa podaj comparison-tool, po czym kliknij Dodaj. Następnie wykonaj opisane wcześniej kroki.Kolejny krok to dodanie tłumaczeń. W tym celu należy w Panelu Administratora wejść w Wygląd sklepu -> Ustawienia i wybrać zakładkę Tłumaczenia. Przycisk Dodaj pozwala na dodanie nowego tłumaczenia. Aby tłumaczenie zostało dodane, należy wprowadzić odpowiednie Id oraz frazę (Tekst) i zatwierdzić przyciskiem Dodaj. Lista Id oraz fraz do wprowadzenia: 1. NoItemsSelectedToCompare - Nie wybrano żadnych towarów do porównania 2. ProductsComparison - Porównanie towarów 3. ProductsComparisonRemove - Usuń porównanie 4. AddMoreProductsToCompare - Dodaj kolejne towary, które chcesz porównać (max. 3) 5. ShowProductsFromCategory - Pokaż inne towary z tej kategorii 6. ComparerReview - Ocena 7. ComparerAvailability - Dostępność 8. ComparerInformations - Informacje podstawowe 9. Manufacturer - Producent 10. Brand - Marka 11. ComparerTechnicalParameters - Parametry techniczne 12. RemoveFromComparisonTool - Usuń z porównania 13. AddedToComparisonTool - Dodano do porównania 14. ItemsToCompare - Możesz porównać od 2 do 4 towarów. 15. ProductsComparisonRemove - Usuń porównanie 16. MaxItemsInComparisonTool - Osiągnięto maksymalną ilość produktówWskazówkaKopiując Id z powyższej instrukcji do Panelu Administracyjnego, upewnij się, że po danym Id nie została skopiowana żadna spacja. Kolejnym krokiem jest utworzenie nowego pliku o nazwie comparer.html w głównym katalogu z plikami Twojego szablonu Topaz. Treść tego pliku powinna wyglądać następująco:{% extends '_layout.html' -%} {% block pageContent -%} {% include 'staticElements/comparer/comparer.html' -%} {% endblock -%}
Możesz pominąć ten krok, jeżeli plik już istnieje, a jego treść jest identyczna jak powyżej. Następnie otwórz folder staticElements. W nim utwórz nowy katalog o nazwie comparer, a w nim utwórz nowy plik o nazwie comparer.html. W pliku tym, umieść następujący kod:{% include 'partials/common/breadcrumbs.html' -%} {% assign comparer = comparison-tool -%} {% assign amount = comparer.Products | Size %}
Kolejnym krokiem jest dodanie odpowiedniego kodu do plików css, odpowiadających za wygląd porównywarki. W tym celu przejdź do katalogu css. Na końcu pliku layout.css wklej następujący kod:{% if amount == 0 %}{{translations.NoItemsSelectedToCompare}} {{translations.Crt_BackToShop}}{{translations.ProductsComparison}} ({{amount}}){% assign index = 0 -%}{{translations.ProductsComparisonRemove}} {% for p in comparer.Products -%} {% endfor -%}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {% assign productAlt = p.NameNoHtml|H %} {{p|Img: 'medium', productAlt}}{{p|A}}{% if p.Price %}{{p.Price|ToPrice}} {{currency}}{% if p.PreviousPrice > p.Price %} {{p.PreviousPrice|ToPrice}} {{currency}} {% endif %}{% else -%}{{ translations.Com_AskForPrice }}{% endif %}{{translations.ComparerReview}}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {{translations.ComparerAvailability}}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {{p.Availability.Text}}{{translations.Com_StockLvl}}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {{p.StockLevel.Text}}{{translations.ComparerInformations}}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {{translations.Manufacturer}}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {{p.Manufacturer.Name}}{{translations.Brand}}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {{p.Brand.Name}}{{translations.Man_ManufacturerCode}}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {{p.ManufacturerCode}}{{translations.Pro_ProductCode}}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {{p.Code}}{{translations.ComparerTechnicalParameters}}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {{attr}}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {% assign attributeValue = p.Attributes[attr] -%} {% assign lastItem = attributeValue | Last -%} {% assign attributesLength = attributeValue | Size -%}{% endfor -%}{% if attributesLength == 0 -%} - {% else -%} {% for a in attributeValue -%} {% if a != lastItem -%} {{a}}, {% else -%} {{a}} {% endif -%} {% endfor -%} {% endif -%}{{translations.Pro_Weight}}{% for p in comparer.Products -%} {% assign index = index | Plus: 1 -%} {{p.Weight | Normalize}} {{ translations.Com_kg }}.comparerContainer{font-family:{{settings.fontFamily}};background:{{settings.primaryPageBgColor}};max-width:1400px;margin:40px auto}.comparerContainer #firstRow{background:{{settings.primaryPageBgColor}} !important}.comparerContainer .row{width:100%;display:block;display:flex;flex-direction:row}.comparerContainer .row section{width:100%;display:inherit}.comparerContainer .groupInfo{background-color:#f8f8f8}.comparerContainer .lastProduct{border-right:none !important}.comparerContainer .noProducts{width:100%;margin-bottom:40px}.comparerContainer .noProducts .title{display:block;font-size:24px;line-height:32px;color:{{settings.primaryFontColor}}}.comparerContainer .noProducts .noProductsLinks{display:block;margin-top:20px;font-size:14px;line-height:24px;color:{{settings.linkFontColor}}}.comparerContainer .noProducts .noProductsLinks:hover{cursor:pointer}.comparerContainer .topSection-info{border-right:1px solid {{settings.borderColor}};border-bottom:1px solid {{settings.borderColor}};border-top:none;border-left:none;width:25%}.comparerContainer .topSection-info .title{display:block;font-size:20px;line-height:32px;color:{{settings.primaryFontColor}};padding-right:10px}.comparerContainer .topSection-info .removeComparer{display:block;margin-top:20px;font-size:14px;line-height:24px;color:{{settings.linkFontColor}}}.comparerContainer .topSection-info .removeComparer:hover{cursor:pointer}.comparerContainer .topSection-productInfo{width:35%;border-right:1px solid {{settings.borderColor}};border-bottom:1px solid {{settings.borderColor}};border-top:none;border-left:none;position:relative}.comparerContainer .topSection-productInfo .productImage{height:150px;position:relative}.comparerContainer .topSection-productInfo .productImage a{cursor:initial}.comparerContainer .topSection-productInfo .productImage .itemPrev,.comparerContainer .topSection-productInfo .productImage .itemNext{position:absolute;border-radius:50%;background-color:{{settings.sliderBgColor}};width:30px;height:30px;top:50%;border:none;transition:200ms}.comparerContainer .topSection-productInfo .productImage .itemPrev:hover,.comparerContainer .topSection-productInfo .productImage .itemNext:hover{background-color:{{settings.linkFontColor}};border:none !important}.comparerContainer .topSection-productInfo .productImage .itemPrev:hover .svgIcon,.comparerContainer .topSection-productInfo .productImage .itemNext:hover .svgIcon{fill:{{settings.sliderHoverArrowColor}} !important;border:none !important}.comparerContainer .topSection-productInfo .productImage .itemPrev{left:5px}.comparerContainer .topSection-productInfo .productImage .itemNext{right:5px}.comparerContainer .topSection-productInfo .productImage .svgItemPrev{padding-left:0px !important;margin-left:-9px !important;margin-top:-3px !important;fill:{{settings.sliderArrowColor}} !important}.comparerContainer .topSection-productInfo .productImage .svgItemNext{float:right;margin-top:-3px !important;fill:{{settings.sliderArrowColor}} !important;padding-top:0 !important;margin-right:-7px !important}.comparerContainer .topSection-productInfo .productImage img{display:block;margin:0 auto;max-height:150px;object-fit:contain;max-width:50%;cursor:pointer !important}.comparerContainer .topSection-productInfo .productImage .svgIcon{width:43px;height:34px;fill:#e5e5e5;margin:0 auto;display:block;padding-top:58px;padding-left:40px}.comparerContainer .topSection-productInfo .addMoreProducts{margin-top:10px;display:block;color:{{settings.secondaryFontColor}};text-align:center;font-size:14px;line-height:24px;margin-left:40px;font-weight:400}.comparerContainer .topSection-productInfo .showMoreProducts{font-weight:500;font-size:14px;line-height:24px;color:{{settings.linkFontColor}};margin-top:15px;margin-left:40px;text-align:center}.comparerContainer .topSection-productInfo .showMoreProducts>a:hover{cursor:pointer}.comparerContainer .topSection-productInfo .removeItem{position:absolute;top:10px;right:37px;background-color:{{settings.linkFontColor}};-webkit-mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/light/times.svg) no-repeat 50% 50%;mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/light/times.svg) no-repeat 50% 50%;width:15px;height:15px}.comparerContainer .topSection-productInfo .removeItem:hover{cursor:pointer}.comparerContainer .topSection-productInfo .productName{font-size:16px;line-height:24px;height:50px;margin-top:10px;margin-left:40px;color:{{settings.primaryFontColor}}}.comparerContainer .topSection-productInfo .productPrice{font-size:18px;line-height:26px;display:inline;font-weight:bold;color:{{settings.productPriceFontColor}};margin-left:40px}.comparerContainer .topSection-productInfo .redPrice{color:{{settings.ribbonPromotionColor}}}.comparerContainer .topSection-productInfo .previousPrice{font-size:14px;font-weight:400;display:inline;text-decoration:line-through;color:{{settings.productPricePreviousFontColor}};margin-left:40px}.comparerContainer .topSection-productInfo .currency{font-size:12px;line-height:18px;color:{{settings.primaryFontColor}};font-weight:bold}.comparerContainer .topSection-productInfo .buttons{margin:30px 40px 50px;width:calc(100% - 80px);height:40px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center}.comparerContainer .topSection-productInfo .buttons .disableCartButton{visibility:hidden}.comparerContainer .topSection-productInfo .buttons .addToCartButton{width:75%;height:24px;text-transform:uppercase;font-size:14px;line-height:24px;font-weight:400;background-color:{{settings.primaryBtnBgColor}};color:{{settings.primaryBtnFontColor}};border:1px solid {{settings.primaryBtnBorderColor}};transition:200ms;text-align:center;padding:8px 0}.comparerContainer .topSection-productInfo .buttons .addToCartButton:hover{background-color:{{settings.primaryBtnHoverBgColor}};color:{{settings.primaryBtnHoverFontColor}};border:1px solid {{settings.primaryBtnHoverBorderColor}};cursor:pointer}.comparerContainer .topSection-productInfo .buttons .addToFavouriteButton{border:1px solid {{settings.secondaryBtnBorderColor}};width:40px;height:40px;background-color:{{settings.primaryPageBgColor}};transition:200ms}.comparerContainer .topSection-productInfo .buttons .addToFavouriteButton:hover{border-color:{{settings.secondaryBtnHoverBorderColor}};cursor:pointer}.comparerContainer .topSection-productInfo .buttons .addToFavouriteButton:hover .favouriteIcon{background-color:{{settings.secondaryBtnHoverBorderColor}}}.comparerContainer .topSection-productInfo .buttons .addToFavouriteButton .wishList{-webkit-mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/solid/heart.svg) !important;mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/solid/heart.svg) !important;background-color:{{settings.secondaryBtnHoverBorderColor}} !important}.comparerContainer .topSection-productInfo .buttons .addToFavouriteButton .favouriteIcon{-webkit-mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/light/heart.svg);mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/light/heart.svg);background-color:{{settings.primaryFontColor}};width:20px;height:20px;display:block;margin:10px auto 0}.comparerContainer .topSection-productInfo .buttons .wishListBorder{border-color:{{settings.secondaryBtnHoverBorderColor}}}.comparerContainer .lastAttribute{border-bottom:1px solid {{settings.borderColor}}}.comparerContainer .property{border-right:1px solid {{settings.borderColor}};border-bottom:1px solid {{settings.borderColor}};border-top:none;border-left:none;width:25%}.comparerContainer .property .propertyName{font-size:16px;color:{{settings.primaryFontColor}};font-weight:400;line-height:24px;text-align:left;padding:18px 10px;text-transform:capitalize}.comparerContainer .property .groupName{color:{{settings.secondaryFontColor}};font-size:14px;font-weight:bold;padding:8px 0 8px 10px;text-transform:capitalize}.comparerContainer .propertyValueContainer{width:35%;border-right:1px solid {{settings.borderColor}};border-bottom:1px solid {{settings.borderColor}};border-top:none;border-left:none}.comparerContainer .propertyValueContainer .rating{width:calc(100% - 80px);margin:18px 40px}.comparerContainer .propertyValueContainer .rating .stars{width:13px;height:13px}.comparerContainer .propertyValueContainer .rating .productRating--color{fill:{{settings.linkFontColor}}}.comparerContainer .propertyValueContainer .rating .ratingCount{font-size:14px;color:{{settings.secondaryFontColor}};line-height:24px;font-weight:400;margin-left:12px}.comparerContainer .propertyValueContainer .propertyValue{width:calc(100% - 80px);margin:18px 40px;font-size:14px;line-height:24px;color:{{settings.primaryFontColor}};font-weight:300;word-break:break-word}.comparerContainer .propertyValueContainer .delivery{color:{{settings.linkFontColor}}}@media only screen and (max-width: 1350px){.comparerContainer .fourItems .removeItem{right:20px}.comparerContainer .fourItems .productName,.comparerContainer .fourItems .buttons{margin-left:20px;margin-right:20px}.comparerContainer .fourItems .buttons{width:calc(100% - 40px);margin-bottom:20px}.comparerContainer .fourItems .productPrice,.comparerContainer .fourItems .previousPrice{margin-left:20px;display:block}.comparerContainer .fourItems .previousPrice{height:0}.comparerContainer .twoItems{width:50%}.comparerContainer .propertyValueContainer .propertyValue,.comparerContainer .propertyValueContainer .rating{margin-left:20px;margin-right:20px}.comparerContainer .propertyValueContainer .rating{width:calc(100% - 40px)}}
Do pliku layout-m.css wklej następujący kod:@media only screen and (max-width: 768px){.oneItem{margin-left:20px !important;margin-right:20px !important;width:calc(100% - 40px) !important}.row>section{width:75% !important}.row>section .comparerSlider{width:50% !important}.row>section .lastProduct{border-right:1px solid {{settings.borderColor}} !important}.comparerSlider .slick-track{height:calc(100% - 1px) !important}.topSection-info .title,.topSection-info .removeComparer,.property .groupName,.property .propertyName{padding-left:20px !important}.noProducts{margin-left:20px}}@media only screen and (max-width: 580px){.row section{width:60% !important}.row .topSection-info,.row .property{width:40% !important}.previousPrice{display:block !important}}@media only screen and (max-width: 385px){.buttons{width:calc(100% - 10px) !important;margin-left:5px !important;margin-right:5px !important}.title{font-size:16px !important}.removeComparer{font-size:12px !important}}
Do pliku layout-d.css wklej następujący kod:@media only screen and (max-width: 1150px){.comparerContainer .fourItems .buttons .addToCartButton{display:block !important;width:auto !important;padding:8px 15px !important}.comparerContainer .fourItems .buttons .addToFavouriteButton{margin:10px auto}}@media only screen and (min-width: 971px) and (max-width: 1050px){.buttons{margin-left:10px !important;margin-right:10px !important;width:calc(100% - 20px) !important}}@media only screen and (max-width: 970px){.row .property{border-right:none}.row section{width:75% !important}.row section .comparerSlider{width:50% !important}.row section .lastProduct{border-right:1px solid {{settings.borderColor}} !important}.comparerSlider .slick-track{height:calc(100% - 1px) !important}.copmarerContainer .topSection-info .buttons{width:calc(100% - 40px)}.copmarerContainer .topSection-info .removeItem{right:20px}.copmarerContainer .topSection-info .productName,.copmarerContainer .topSection-info .buttons{margin-left:20px;margin-right:20px}.copmarerContainer .topSection-info .productPrice,.copmarerContainer .topSection-info .previousPrice{margin-left:20px;display:block}.copmarerContainer .topSection-info .previousPrice{height:0}}
Następnie należy dodać odpowiedni kod do plików js. W tym celu, w plikach Topaza, otwórz folder js a następnie plik layout0.js. Odszukaj linijkę z frazą productListFunctions.init();. Pod znalezioną linijką znajduje się linia ze znakiem }. Pod nią wklej następujący kod:if($('body').find('.comparerContainer').index() >= 0) { comparerFunctions.init(); }
Otwórz plik layout1.js znajdujący się w tym samym katalogu. Poniższy kod możesz wkleić na samym początku pliku:var comparerFunctions = { init: function() { this.events(); }, events: function() { $(document).ready(function(){ $('.propertyValue-js').each(function(index) { var t = $(this).text(); t = t.replace(/([A-Z])/g, ' $1').trim(); $(this).text(t); }) $('.row').each(function() { if(!($(this).hasClass('groupInfo'))) { $(this).children('.property').css('box-shadow', '2px 0 2px -2px #E5E5E5'); $(this).children('.topSection-info').css('box-shadow', '2px 0 2px -2px #E5E5E5'); } }); var amount = $('#amount').attr('value'); var windowWidth = $(window).width(); if (amount <= 2) { $('.topSection-productInfo').css('width', '50%'); $('.propertyValueContainer').css('width', '50%'); if(amount == 1 && windowWidth <= 768) { $('.productPrice').addClass('oneItem'); $('.productName').addClass('oneItem'); $('.buttons').addClass('oneItem'); $('.lastProduct > *').css('margin-left', '10px', '!important'); $('.lastProduct > *').css('margin-right', '10px', '!important'); } else if(amount == 1 && windowWidth <= 600) { $('.topSection-productInfo').css('width', '100%', '!important'); $('.propertyValueContainer').css('width', '100%', '!important'); $('.lastProduct').css('display', 'none'); } } if ((windowWidth <= 970 && amount > 2) || (windowWidth <= 742 && amount == 2)) { $(".row > section").addClass("comparerSlider"); var slider = $('.comparerSlider').slick({ infinite: true, slidesToShow: 2, slidesToScroll:1, draggable: false, autoplay: false, autoplaySpeed: 8000, arrows:false, swipe:false, responsive: [ { breakpoint: 768, settings: { slidesToShow: 1, } } ] }); if(amount == 2) { slider.slick('slickSetOption', 'infinite', false); } if(windowWidth <= 970 && windowWidth > 768 && amount > 2) { showSliderArrows(); } if (windowWidth <= 768 && amount > 2) { $(".itemPrev").removeClass('hidden'); $(".itemNext").removeClass('hidden'); } if(windowWidth <= 742 && amount == 2) { $(".itemNext").removeClass('hidden'); } $(".itemPrev").on( "click", function() { slider.slick("slickPrev").delay(500); if((windowWidth <= 970 && windowWidth > 768 && amount > 2)) { showSliderArrows(); } if(amount == 2) { $('.itemPrev').addClass('hidden'); $('.itemNext').removeClass('hidden'); } }); $(".itemNext").on( "click", function() { slider.slick("slickNext").delay( 500 ); if((windowWidth <= 970 && windowWidth > 768 && amount > 2)) { showSliderArrows(); } if(amount == 2) { $('.itemNext').addClass('hidden'); $('.itemPrev').removeClass('hidden'); } }); } }); var topSection = document.getElementById("firstRow"); var topPosition = topSection.offsetTop; $(window).on('scroll', function() { if (window.pageYOffset > (topPosition)) { topSection.style.position = 'sticky'; topSection.style.top = '0'; topSection.style.zIndex = '100'; } else { topSection.style.position = 'inherit'; topSection.style.top = 'none'; topSection.style.zIndex = 'inherit'; } }); $('body').on('click', '.productWishListAdd-js', function (e) { app.productWishListAdd(e); }); $('body').on('click', '.productWishListRemove-js', function (e) { app.productWishListRemove(e); }); $('body').on('click', '.removeItem', function (e) { app.productComparisonToolDeleteItem(e); }); $('body').on('click', '.removeComparer', function (e) { var productIds = $(this).parent('.removeComparerContainer').children($('input [name="productId"]')); app.productComparisonToolDeleteAll(productIds); }); function showSliderArrows() { var currentProducts = $('.topSection-productInfo'); var activeProducts = []; var i=0; currentProducts.each(function() { if($(this).attr('aria-hidden') == 'false') { activeProducts[i++] = $(this); } }); activeProducts[0].find('.itemPrev').removeClass('hidden'); activeProducts[0].find('.itemNext').addClass('hidden'); activeProducts[1].find('.itemNext').removeClass('hidden'); activeProducts[1].find('.itemPrev').addClass('hidden'); } } }
Następnie należy dodać możliwość dodawania produktów do porównywarki z poziomu szczegółów towaru. Otwórz katalog elements -> product. W zależności do tego, jaką wersję szczegółów towaru wybrałeś w Kreatorze, w katalogu będzie plik product-details-1.html lub product-details-2.html. Wykonaj kolejne kroki w zależności od tego, który plik znajduje się w Twoim Topazie.
Dalsza instrukcja dla pliku product-details-1.html
Otwórz plik i wyszukaj linię, w której znajduje się fragment comparison-tool-add-button. Musisz usunąć wszystko pomiędzy liniami o treści (włącznie z nimi). Pod usuniętymi liniami kodu znajdują się dwie linie o treści </div> i {% endif -%}. Nad nimi wklej następujący kod:{% assign isInComparisonTool = false -%} {% for itemId in customer.ComparisonToolItems -%} {% if itemId == product-details.Product.Id -%} {% assign isInComparisonTool = true -%} {% endif -%} {% endfor -%}
a pod nimi wklej następujący kod:{% assign comparisonToolItems = customer.ComparisonToolItems | Size | Plus: 1 -%}{{translations.AddedToComparisonTool}} ({{comparisonToolItems}}/4){% assign ComparerItems = customer.ComparisonToolItems | Size | Plus: 1 -%}{{translations.Cmp_Compare}}.product-details .addToComparePopup{display:none;position:fixed;z-index:100;right:10%;bottom:51px;transition:200ms;width:400px;height:62px;box-shadow:0 3px 8px #616060;background-color:{{settings.primaryPageBgColor}}}.product-details .addToComparePopup .comparisonIcons{margin-left:25px;display:inline-block}.product-details .addToComparePopup .comparisonIcons .comparerItemIcon{width:5px;height:5px;margin-right:10px;-webkit-mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/regular/box.svg) no-repeat 50% 50%;mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/regular/box.svg) no-repeat 50% 50%;background-color:{{settings.secondaryFontColor}};display:inline-block;padding:10px}.product-details .addToComparePopup .comparisonIcons .addedToCompare{background-color:{{settings.linkFontColor}} !important}.product-details .addToComparePopup .comparisonInfo{width:100%;position:relative;margin-top:6px;line-height:24px;display:block}.product-details .addToComparePopup .addToCompare{display:inline-block;font-size:14px;line-height:24px;margin-left:25px;color:{{settings.primaryFontColor}};font-weight:500}.product-details .addToComparePopup .closeComparePopup{position:absolute;top:0;right:0;margin-right:25px;background-color:{{settings.primaryFontColor}};-webkit-mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/light/times.svg) no-repeat 50% 50%;mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/light/times.svg) no-repeat 50% 50%;width:14px;height:14px}.product-details .addToComparePopup .closeComparePopup:hover{cursor:pointer}.product-details .addToComparePopup .comparisonIcon{float:right;margin-top:5px;margin-right:2px}.product-details .addToComparePopup .comparisonIcon .svgIcon{fill:{{settings.linkFontColor}};margin:0 5px -3px 0;width:15px;height:15px}.product-details .addToComparePopup .goToComparisonTool{color:{{settings.linkFontColor}};line-height:24px;font-size:14px;font-weight:400;margin-right:25px}
W pliku layout-m.css wklej następujący kod:@media only screen and (min-width: 461px) and (max-width: 768px){.addToComparePopup{bottom:16px !important;right:15% !important}} @media only screen and (max-width: 599px){.addToComparePopup{width:100% !important;bottom:0 !important;right:0 !important;left:0 !important}}
A w pliku layout-d.css wklej następujący kod:@media only screen and (min-width: 769px) and (max-width: 900px){.addToComparePopup{bottom:16px !important;right:15% !important}}
Pozostało dodać kod w plikach js. Otwórz katalog js a w nim plik layout0.js. Wyszukaj frazę productComparisonToolAdd. Musisz usunąć kilka linii kodu, od znalezionej przed chwilą (włącznie) do najbliższej linii o treści }, (około 11 linii kodu). W miejsce usuniętego kodu, wklej poniższy:productComparisonToolAdd: function (e) { var data = $(e.currentTarget).find('input').serializeArray(); var comparisonItems = data[4].value; if(comparisonItems >= 4) { $('.addToComparePopup').fadeIn(); var msg =__translations.MaxItemsInComparisonTool; $('.addToCompare').text(msg); } else { var url = data[2].value; $.post(null, data, function (result) { if (result.action.Result) { $('.addToComparePopup').fadeIn(); $('#comparison-tool-delete-button').removeClass('hidden'); $('#comparison-tool-add-button').addClass('hidden'); } else if (result.action.Code != 100) { app.showTemporaryPopup(result.action.Message, 'error'); } }); } }, productComparisonToolDelete: function (e) { var data = $(e.currentTarget).find('input').serializeArray(); var pId = data[1].value; $.post(null,{__action:'product/ComparisonToolDelete',__csrf:__CSRF,productId:pId},function(d){ setInterval(function() { location.reload(); }, 1000); }); }, productComparisonToolDeleteItem: function (e) { var pId = $(e.currentTarget).attr('data-id'); $.post(null,{__action:'product/ComparisonToolDelete',__csrf:__CSRF,productId:pId,__template:'comparer.html'},function(d){ setInterval(function() { location.reload(); }, 1000); }); }, productComparisonToolDeleteAll: function (e) { e.each(function() { var pId = $(this).attr('data-id'); $.post(null,{__action:'product/ComparisonToolDelete',__csrf:__CSRF,productId:pId,__template:'comparer.html'}); }) setInterval(function() { location.reload(); }, 3000); },
Otwórz plik layout1.js. Wyszukaj linię o treści app.productComparisonToolAdd(e);. Następujący kod musisz wkleić poniżej kolejnej linii o treści });:body.on('click', '.productComparisonToolDelete-js', function (e) { app.productComparisonToolDelete(e); }); body.on('click', '.closeComparePopup', function (e) { $('.addToComparePopup').addClass('hidden'); });
Jeśli posiadasz pierwszą wersję szczegółów towaru, to koniec instrukcji. Dalsza część dotyczy zmian dla wersji drugiej szczegółów towaru.
Dalsza instrukcja dla pliku product-details-2.html
Otwórz plik i wyszukaj linię, w której znajduje się fragment productComparisonToolAdd-js. Musisz usunąć wszystko pomiędzy liniami o treści (włącznie z nimi). Pod usuniętymi liniami kodu znajdują się dwie linie o treści </div> i {% endif -%}. Nad nimi wklej następujący kod:{% assign isInComparisonTool = false -%} {% for itemId in customer.ComparisonToolItems -%} {% if itemId == product-details.Product.Id -%} {% assign isInComparisonTool = true -%} {% endif -%} {% endfor -%}
a pod nimi wklej następujący kod:{{translations.AddedToComparisonTool}}{{translations.ItemsToCompare}}{{translations.ProductsComparisonRemove}}{% for itemId in customer.ComparisonToolItems -%} {% endfor -%}{% assign ComparerItems = customer.ComparisonToolItems | Size | Plus: 1 -%}{% assign ComparerItems = customer.ComparisonToolItems | Size | Plus: 1 -%} {% if ComparerItems > 1 -%}{{translations.Cmp_Compare}}{% endif -%}.product-details .addToComparePopup{display:none;position:fixed;margin-left:auto;margin-right:auto;right:0;left:0;top:30%;width:30%;height:auto;background-color:{{settings.primaryPageBgColor}};transition:200ms;z-index:100;opacity:1 !important;box-shadow:0 3px 8px #616060}.product-details .addToComparePopup .comparisonIcons{width:calc(100% - 70px);margin:40px auto !important;text-align:center}.product-details .addToComparePopup .comparisonInfo{width:100%;position:relative;margin-top:40px;line-height:26px;display:block}.product-details .addToComparePopup .comparisonInfo .comparerItemIcon{width:40px;height:40px;margin-right:10px;-webkit-mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/regular/box.svg) no-repeat 50% 50%;mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/regular/box.svg) no-repeat 50% 50%;background-color:{{settings.secondaryFontColor}};display:inline-block;padding:10px}.product-details .addToComparePopup .comparisonInfo .addedToCompare{background-color:{{settings.linkFontColor}} !important}.product-details .addToComparePopup .comparisonInfo .addToCompare{margin-left:70px;font-size:18px;font-weight:500;color:{{settings.primaryFontColor}}}.product-details .addToComparePopup .comparisonInfo .comparisonItems{font-size:14px;line-height:24px;color:{{settings.primaryFontColor}};display:inline-block;margin-left:70px}.product-details .addToComparePopup .comparisonInfo .removeComparison{margin-right:42px;margin-top:2px;float:right;font-size:14px;line-height:24px;font-weight:400;color:{{settings.linkFontColor}}}.product-details .addToComparePopup .comparisonInfo .removeComparison:hover{cursor:pointer}.product-details .addToComparePopup .comparisonInfo .closeComparePopup{position:absolute;top:4px;right:0;margin-right:40px;background-color:{{settings.primaryFontColor}};-webkit-mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/light/times.svg) no-repeat 50% 50%;mask:url(https://static.comarchesklep.pl/files/fonts/fontawesome-pro-5.6.3-web/svgs/light/times.svg) no-repeat 50% 50%;width:18px;height:18px}.product-details .addToComparePopup .comparisonInfo .closeComparePopup:hover{cursor:pointer}.product-details .addToComparePopup .goToComparisonTool{width:60%;height:24px;text-transform:uppercase;font-size:14px;line-height:24px;font-weight:400;background-color:{{settings.primaryBtnBgColor}};color:{{settings.primaryBtnFontColor}};border:1px solid {{settings.primaryBtnBorderColor}};transition:200ms;text-align:center;padding:8px 0;margin:40px auto;display:block}.product-details .addToComparePopup .goToComparisonTool:hover{background-color:{{settings.primaryBtnHoverBgColor}};color:{{settings.primaryBtnHoverFontColor}};border:1px solid {{settings.primaryBtnHoverBorderColor}};cursor:pointer}@media only screen and (max-width: 1550px){.product-details .comparisonItems,.product-details .removeComparison{display:block;width:100%;text-align:center;float:none !important}.product-details .comparisonItems{margin:0 auto !important}.product-details .removeComparison{margin:20px auto 0 !important}}
W pliku layout-m.css wklej następujący kod:@media only screen and (max-width: 768px){.addToComparePopup{width:calc(100% - 40px) !important}} @media only screen and (max-width: 330px){.addToComparePopup>.addToCompare{margin-left:20px !important}}
A w pliku layout-d.css wklej następujący kod:@media only screen and (min-width: 641px) and (max-width: 1077px){.addToComparePopup{width:50% !important}}
Pozostało dodać kod w plikach js. Otwórz katalog js a w nim plik layout0.js. Wyszukaj frazę productComparisonToolAdd. Musisz usunąć kilka linii kodu, od znalezionej przed chwilą (włącznie) do najbliższej linii o treści }, (około 11 linii kodu). W miejsce usuniętego kodu, wklej poniższy:productComparisonToolAdd: function (e) { var data = $(e.currentTarget).find('input').serializeArray(); var comparisonItems = data[4].value; if(comparisonItems >= 4) { $('.addToComparePopup').fadeIn(); var msg =__translations.MaxItemsInComparisonTool; $('.addToCompare').text(msg); } else { var url = data[2].value; $.post(null, data, function (result) { if (result.action.Result) { $('.addToComparePopup').fadeIn(); $('#comparison-tool-delete-button').removeClass('hidden'); $('#comparison-tool-add-button').addClass('hidden'); } else if (result.action.Code != 100) { app.showTemporaryPopup(result.action.Message, 'error'); } }); } }, productComparisonToolDelete: function (e) { var data = $(e.currentTarget).find('input').serializeArray(); var pId = data[1].value; $.post(null,{__action:'product/ComparisonToolDelete',__csrf:__CSRF,productId:pId},function(d){ setInterval(function() { location.reload(); }, 1000); }); }, productComparisonToolDeleteItem: function (e) { var pId = $(e.currentTarget).attr('data-id'); $.post(null,{__action:'product/ComparisonToolDelete',__csrf:__CSRF,productId:pId,__template:'comparer.html'},function(d){ setInterval(function() { location.reload(); }, 1000); }); }, productComparisonToolDeleteAll: function (e) { e.each(function() { var pId = $(this).attr('data-id'); $.post(null,{__action:'product/ComparisonToolDelete',__csrf:__CSRF,productId:pId,__template:'comparer.html'}); }) setInterval(function() { location.reload(); }, 3000); },
Otwórz plik layout1.js. Wyszukaj linię o treści app.productComparisonToolAdd(e);. Następujący kod musisz wkleić poniżej kolejnej linii o treści });:body.on('click', '.removeComparison', function (e) { var productIds = $(this).parent('.deleteComparison-js').children($('input [name="productId"]')); app.productComparisonToolDeleteAll(productIds); }); body.on('click', '.productComparisonToolDelete-js', function (e) { app.productComparisonToolDelete(e); }); body.on('click', '.closeComparePopup', function (e) { $('.addToComparePopup').addClass('hidden'); });
Nowoczesne dolne menu nawigacji w wersji mobilnej w szablonie Topaz
Nowoczesne dolne menu nawigacji w wersji mobilnej w szablonie Topaz
W tym artykule dowiesz się jak zmodyfikować swój szablon Topaz, aby w wersji mobilnej posiadał nowoczesne dolne menu nawigacji.WskazówkaNiniejsza instrukcja przeznaczona jest dla sklepów w wersji 2020.2 lub nowszej!WskazówkaKopiowanie fraz, które należy wyszukać w kodzie, może powodować problemy. Frazy do wyszukania najlepiej przepisać ręcznie, lub skopiować, ale po skopiowaniu podmienić znaki typu - _ ' " itp. W przeciwnym wypadku, fraza może nie zostać odnaleziona w kodzie!WskazówkaW tym artykule trzeba będzie wprowadzać zmiany w plikach js i css. Z tego artykułu dowiesz się jak je minifikowaćDodanie kodu dolnego menu
1. Pierwszym krokiem jest dodanie pliku z kodem dolnego menu. W tym celu w plikach szablonu otwórz katalog partials a w nim utwórz plik bottom-menu.html. Wklej do niego poniższy kod:Dodanie tłumaczeń
Następnie należy dodać tłumaczenia. W tym celu otwórz Panel Administracyjny, a w nim odpowiednio Wygląd sklepu -> Ustawienia -> zakładka Tłumaczenia. Aby dodać nowe tłumaczenia, kliknij przycisk Dodaj, podaj odpowiednie Id, Tekst i zatwierdź przyciskiem Dodaj. Lista tłumaczeń do wprowadzenia (Id - Tekst): 1. Start - Start 2. SearchInShop - Szukaj w sklepie 3. Account - KontoWskazówkaUważaj, aby przy kopiowaniu Id nie znalazła się żadna spacja przed ani po Id, w przeciwnym wypadku tłumaczenie nie wyświetli się w sposób poprawny!Ustawienie wyświetlania etykiet w Panelu Administracyjnym
Dolne menu obsługuje ustawienie wyświetlania etykiet. Można je wyświetlać lub nie (wtedy zostają same ikonki). Aby wszystko działało poprawnie, otwórz plik __settings.liquid. Kolejny krok to dodanie kodu odpowiedzialnego za wygląd dolnego menu. W tym celu otwórz katalog css i wklej poniższy kod na końcu pliku layout.css. Wyszukaj linię o treści {% when '1' %}. Pod nią wklej ten kod:{% assign displayLabelsOnBottomNavigationMenu = "Wyświetlaj etykiety w dolnym menu nawigacji" -%}
W tym samym pliku wyszukaj linię z frazą {% else %}. Pod nią wklej ten kod:{% assign displayLabelsOnBottomNavigationMenu = "Display labels in the bottom navigation menu" -%}
Poniżej znajdują się sekcje kodu do ustawień. Każda sekcja zaczyna się od <section> a kończy się </section>. Poniższy kod wklej tuż pod sekcją (czyli pod jej tagiem </section>), której kolejna linijka zawiera frazę productListType{{displayLabelsOnBottomNavigationMenu}}
WskazówkaPo dodaniu niniejszego kodu, koniecznie otwórz zakładkę Wygląd sklepu -> Ustawienia w Twoim Panelu Administracyjnym, i wybierz "TAK" lub "NIE" przy nowo dodanej opcji włączania/wyłączania wyświetlania etykiet w dolnym menu!Dodanie kodu odpowiedzialnego za wygląd dolnego menu
Kolejny krok to dodanie kodu odpowiedzialnego za wygląd dolnego menu. W tym celu otwórz katalog css i wklej poniższy kod na końcu pliku layout.css@media only screen and (min-width: 769px){.bottomMenuBack{display:none}.bottomMenu{display:none}}@media only screen and (max-width: 769px){.bottomMenuBack{display:block;width:100%;height:56px}.bottomMenu{width:100%;height:41px;background-color:{{settings.primaryPageBgColor}};display:flex;flex-direction:row;flex-wrap:wrap;position:fixed;bottom:0;padding-top:10px;padding-bottom:5px;z-index:12}.bottomMenu .menuItem{flex:0 1 20%;margin:0 auto;display:flex;flex-direction:column;justify-content:center}.bottomMenu .menuItem .svgContainer{margin:0 auto;position:relative}.bottomMenu .menuItem svg{fill:{{settings.primaryFontColor}};width:20px;height:18px;margin:0 auto}.bottomMenu .menuItem .itemsCounter{position:absolute;border-radius:50%;font-size:9px;width:14px;height:14px;top:-5px;right:-6px;font-weight:500;color:{{settings.primaryPageBgColor}};background-color:{{settings.linkFontColor}};text-align:center}.bottomMenu .menuItem .text{font-size:11px;line-height:18px;color:{{settings.primaryFontColor}};font-weight:300;font-family:{{settings.fontFamily}};text-align:center;margin:0 auto}.bottomMenu .activePage svg{fill:{{settings.linkFontColor}}}}
Dodanie funkcji
Następnie należy dodać odpowiednie funkcje do plików w katalogu js. W tym celu otwórz wspomniany przed chwilą katalog, a w nim otwórz plik layout0.js 1. Wyszukaj linię z frazą $('body').toggleClass('noscroll');. Kolejna linia pod nią zawiera znak }. Pod nią wklej następujący kod:$('.headerMainMenu-js').scroll(function(){ if(($(this).css('display') != 'none' && $('.bottomMenu').css('display') != 'none')) { if($(this).scrollTop() > 0) { $('.go-to-top__btn-js').fadeIn(); } else { $('.go-to-top__btn-js').fadeOut(); } } });
2. Wyszukaj linię z frazą closePopup: function (e) {. Tuż nad nią wklej poniższy kod:showBottomMenuOnMobile: function () { var windowWidth = $(window).width(); if(windowWidth < 769) { $('.bottomMenu').removeClass('hidden'); $('.bottomMenuBack').removeClass('hidden'); } else if (windowWidth >= 769) { $('.bottomMenu').addClass('hidden'); $('.bottomMenuBack').addClass('hidden'); } },
3. Modyfikacja funkcji dodawania i usuwania przedmiotów z listy ulubionych. Wyszukaj frazę productWishListAdd: function (e) {. Należy usunąć całą funkcję (od wyszukanej linijki włącznie, do najbliższej linijki o treści }, (ok. 13 linijek). W ich miejsce wklej ten kod:productWishListAdd: function (e) { var data = $(e.currentTarget).find('input').serializeArray(); $.post(null, data, function (result) { if (result.action.Result) { $(e.currentTarget).addClass(['active-js', 'productWishListRemove-js']); $(e.currentTarget).removeClass('productWishListAdd-js'); sessionStorage.removeItem('wish-list'); app.showTemporaryPopup(result.action.Message, 'success'); if($(e.currentTarget).hasClass('addToFavouriteButton')) { $(e.currentTarget).children('.favouriteIcon').addClass('wishList'); $(e.currentTarget).addClass('wishListBorder'); } } else if (result.action.Code != 100) { app.showTemporaryPopup(result.action.Message, 'error'); } }); if($('.bottomMenu')) { var items = parseInt( $('.bottomMenu .menuItem .favouriteItems').text()) +1; $('.bottomMenu .menuItem .favouriteItems').text(items); if(parseInt($('.bottomMenu .menuItem .favouriteItems').text()) > 0) { $('.bottomMenu .menuItem .favouriteItems').removeClass('hidden'); } else { $('.bottomMenu .menuItem .favouriteItems').addClass('hidden'); } } },
Pod spodem znajduje się linijka o treści productWishListRemove: function (e) {. Usuń treść tej funkcji analogicznie jak poprzednio (do najbliższej linii o treści }, - ok. 13 linijek). Wklej w to miejsce następujący kod:productWishListRemove: function (e) { var data = $(e.currentTarget).find('input').serializeArray(); $.post(null, data, function (result) { if (result.action.Result) { $(e.currentTarget).removeClass(['active-js', 'productWishListRemove-js']); $(e.currentTarget).addClass('productWishListAdd-js'); sessionStorage.removeItem('wish-list'); app.showTemporaryPopup(result.action.Message, 'success'); if($(e.currentTarget).hasClass('addToFavouriteButton')) { $(e.currentTarget).children('.favouriteIcon').removeClass('wishList'); $(e.currentTarget).removeClass('wishListBorder'); } } else if (result.action.Code != 100) { app.showTemporaryPopup(result.action.Message, 'error'); } }); if($('.bottomMenu')) { var items = parseInt( $('.bottomMenu .menuItem .favouriteItems').text()) -1; $('.bottomMenu .menuItem .favouriteItems').text(items); if(parseInt($('.bottomMenu .menuItem .favouriteItems').text()) > 0) { $('.bottomMenu .menuItem .favouriteItems').removeClass('hidden'); } else { $('.bottomMenu .menuItem .favouriteItems').addClass('hidden'); } } },
4. Wyszukaj linię z frazą $(e.currentTarget).parents('.inputs-container-js').find('.enterKeyTrigger-js').trigger('click');. Pod nią będą dwie linie, pierwsza o treści } a druga o treści });. Pod nimi wklej poniższy kod:$(window).on('load', function(e) { app.showBottomMenuOnMobile(); }); $(window).on('resize', function(e) { app.showBottomMenuOnMobile(); }); $('.showBottomMenuSection-js').on('click', function(e) { $('.pageHeader-js .headerMainMenu-js').toggle(200); })
5.Wyszukaj linię z frazą updateProductsInCart: function () {. Kilka linii poniżej będzie linia z frazą $('.incrementProductsInCart-js').text(newValue);. Wklej tuż pod nią następujący kod:if($('.bottomMenu')) { $('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').text(newValue); if(parseInt($('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').text()) > 0) { $('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').removeClass('hidden'); } else { $('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').addClass('hidden'); } }
6. Wyszukaj linię z frazą incrementProductsInCart: function () {. Kilka linii poniżej będzie linia z frazą $('.incrementProductsInCart-js').text(newValue);. Wklej tuż pod nią następujący kod:if($('.bottomMenu')) { $('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').text(newValue); if(parseInt($('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').text()) > 0) { $('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').removeClass('hidden'); } else { $('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').addClass('hidden'); } }
7. Wyszukaj linię z frazą decrementProductsInCart: function () {. Kilka linii poniżej będzie linia z frazą $('.incrementProductsInCart-js').text(newValue);. Wklej tuż pod nią następujący kod:if($('.bottomMenu')) { $('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').text(newValue); if(parseInt($('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').text()) > 0) { $('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').removeClass('hidden'); } else { $('.bottomMenu .menuItem .itemsCounter').not('.favouriteItems').addClass('hidden'); } }
8. W pliku layout1.js wyszukaj linię productWishListDelete: function (e) {. Pod nią znajduje się linia z kodem app.post(e, customerProfile.currentTabTemplateUpdate, 'wish-list');. Pod tą linią wklej poniższy kod:if($('.bottomMenu')) { var items = parseInt( $('.bottomMenu .menuItem .favouriteItems').text()) -1; $('.bottomMenu .menuItem .favouriteItems').text(items); if(parseInt($('.bottomMenu .menuItem .favouriteItems').text()) > 0) { $('.bottomMenu .menuItem .favouriteItems').removeClass('hidden'); } else { $('.bottomMenu .menuItem .favouriteItems').addClass('hidden'); } }
Modyfikacja stopki - obie wersje stopki
Kolejny krok to modyfikacja pliku ze stopką, pozwalająca na wyświetlanie dolnego menu. Aby to zrobić, otwórz katalogi elements -> footer. W środku znajdziesz jeden plik .html, o nazwie footer-1.html albo footer-2.html. Otwórz plik, i na samym jego końcu wklej tę linię:{% include 'partials/bottom-menu.html' -%}
Uwaga! Jeśli stopka w Twoim szablonie Topaz jest w wersji 2 (w powyższym katalogu posiadasz plik footer-2.html), to konieczne jest dodanie jednej zmiany w wyglądzie stopki. Otwórz katalog css a w nim plik layout-m.css i doklej na jego końcu poniższy kod:@media screen and (max-width: 599px){.footer{margin-bottom:56px}}
Modyfikacja przycisku powrotu na górę strony
W pliku layout.css wyszukaj frazę {.go-to-top__btn-js{width:50px;height:50px;bottom:20px}}. Powinna znajdować się pod koniec jednej z linii/jednego z bloków kodu. W znalezionej frazie zamień wartość przy bottom z 20px na 60px. Dzięki temu przycisk odpowiedzialny za powrót na górę strony nie będzie zasłaniał dolnego menu.Modyfikacja profilu Klienta
Następnie otwórz katalog css a w nim plik layout.css. Wyszukaj duży blok kodu rozpoczynający się od .customer{position:relative}. Usuń cały blok, po czym wklej w jego miejscu następujący:.customer{position:relative}.customer__blockContent.hide-on-mobile{display:block}.customer .form__input-wrapper:focus-within>label{color:{{settings.inputActiveLabelColor}}}.customer .form input:focus,.customer .form select:focus{border-bottom:1px solid {{settings.inputActiveLabelColor}}}.customer .form input,.customer .form select{border-bottom:1px solid {{settings.primaryFontColor}}}.customer .customer__emptySection{width:100%}.customer .customer__emptySection ol{padding:30px 20px 30px 71px;margin:0;box-sizing:border-box;counter-reset:my-counter;list-style:none}.customer .customer__emptySection ol li{position:relative;counter-increment:my-counter;margin-bottom:30px;color:#959494;font-size:14px;font-weight:400;line-height:1.8}.customer .customer__emptySection ol li:before{content:counter(my-counter);border-radius:50%;padding:8px 11px 7px;font-size:12px;color:{{settings.linkFontColor}};background-color:#f5f4f4;position:absolute;font-weight:600;left:-51px;line-height:normal;top:-2px}.customer .loyaltyProgram .customer__emptySectionImage .icon{top:39px;left:34px}.customer .loyaltyProgram .customer__emptySectionImage .icon .svgIcon{width:44px;height:33px}.customer .customer__emptySectionImage{width:115px;height:115px;border:1px solid #E5E5E5;text-align:center;position:relative;margin:40px auto}.customer .customer__emptySectionImage--bg:before,.customer .customer__emptySectionImage--bg{background:white;height:121px;position:absolute;width:57px;left:28px;top:-3px}.customer .customer__emptySectionImage--bg:before{content:' ';transform:rotate(90deg);left:-1px;top:0}.customer .customer__emptySectionImage .icon{fill:#E5E5E5;position:absolute;top:37px;left:39px}.customer .customer__emptySectionImage .icon .svgIcon{width:37px;height:37px}.customer .customer__emptySectionImage .icon--small{fill:#e5e5e5;position:absolute;background-color:#fff;bottom:30px;right:35px}.customer .customer__emptySectionImage .icon--small .svgIcon{width:19px;height:19px}.customer .customer__sectionTitle,.customer .customer__emptySectionTitle{color:#a9a8a8;display:block;font-size:14px;font-weight:400;max-width:90%}.customer .customer__sectionTitle--center,.customer .customer__emptySectionTitle--center{text-align:center;margin:0 auto}.customer .customer__sectionTitle--left,.customer .customer__emptySectionTitle--left{margin:0 0 10px 22px}.customer .customer__sectionTitle--bold,.customer .customer__emptySectionTitle--bold{margin-top:45px;color:{{settings.primaryFontColor}};font-weight:500}.customer .customer__emptySectionButton{display:block;width:265px;margin:40px auto;text-decoration:none;box-sizing:border-box}.customer__flexboxContainer{display:flex}@media screen and (min-width: 600px){.customer__flexboxContainer{margin-top:40px}}.customer__content{max-width:100%;min-width:62%;min-height:500px}.customer .customer__addresses .customer__contentBox{min-height:100px}@media screen and (min-width: 600px){.customer .popupBackground-js{background-color:#00000014;position:fixed;top:0;left:0;right:0;z-index:11;bottom:0;content:' '}}.customer .customer__contentSection{display:block;position:relative;margin:0 22px 45px;max-width:100%}.customer .customer__contentSection--edit{position:absolute;color:{{settings.linkFontColor}};top:0;right:-5px;padding:0 5px;cursor:pointer}.customer .customer__contentSection--edit .svgIcon__pen{width:16px;height:16px;fill:{{settings.linkFontColor}}}@media screen and (min-width: 600px){.customer .customer__contentSection{max-width:310px}}.customer .customer__contentSection.customer__contentBox{border:1px solid #d6d6d6;padding:20px 30px 18px;box-sizing:border-box}.customer .customer__contentSection.customer__contentBox .customer__contentBoxTitle{display:none;visibility:hidden}.customer .customer__contentSection.customer__contentBox--color{border-color:{{settings.linkFontColor}}}.customer .customer__contentSection.customer__contentBox .customer__contentPreview>span{color:#999}.customer .customer__contentSection.customer__contentBox .customer__contentPreview>span:first-of-type{display:block;height:45px;line-height:27px;font-size:18px;font-weight:300;color:{{settings.primaryFontColor}}}.customer .customer__contentSection.customer__contentBox .customer__contentSection--edit{bottom:15px;right:15px;top:unset}.customer .customer__contentSection.customer__contentBox.editSection-js{margin:0;border-color:white;position:absolute;background-color:white;z-index:11}@media screen and (min-width: 600px){.customer .customer__contentSection.customer__contentBox.editSection-js{position:fixed !important;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}}.customer .customer__contentSection.customer__contentBox.editSection-js .customer__contentBoxTitle{cursor:pointer;display:block;visibility:visible;padding:0 0 40px;position:relative;font-size:18px;font-weight:500}.customer .customer__contentSection.customer__contentBox.editSection-js .customer__contentSection--edit{color:{{settings.primaryBtnBgColor}};position:absolute;padding:12px;border-radius:50%;bottom:unset;width:43px;height:43px;text-align:center;box-sizing:border-box}.customer__title{text-transform:uppercase;font-size:14px;font-weight:500;color:{{settings.primaryFontColor}};display:block;padding-bottom:35px}.customer__title--smallLetters{text-transform:none;font-size:12px}.customer__title--color{color:{{settings.linkFontColor}};text-transform:none}@media screen and (max-width: 599px){.customer .customer__breadcrumbs--desktop{display:none;visibility:hidden}}.customer .customer__breadcrumbs--mobile{background-color:{{settings.$breadcrumbsBgColor}};color:{{settings.breadcrumbsFontColor}};font-size:14px}@media screen and (min-width: 600px){.customer .customer__breadcrumbs--mobile{display:none;visibility:hidden}}.customer .customer__breadcrumbs--mobile>span{padding:27px 0;display:inline-block;margin:0 22px}.customer .customer__breadcrumbs--mobile>span>svg{margin:0 15px -4px -5px}.customer .customer__menu{background-color:#fff;transition:200ms;z-index:9}.customer .customer__menu .mobileLogout{display:none}@media screen and (min-width: 600px){.customer .customer__menu{margin-right:4%;padding-left:3%}}@media screen and (min-width: 768px){.customer .customer__menu{margin-right:5%}}@media screen and (min-width: 600px){.customer .customer__menu li.active-js .customer__menu--submenu{display:block;background-color:#fff;padding:5px 0 5px 25px;margin:9px 0 -10px -30px}.customer .customer__menu>ul>li.active-js{border-left:5px solid {{settings.linkFontColor}}}.customer .customer__menu>ul>li{border-left:5px solid #fff}.customer .customer__menu li .customer__menu--submenu .active-js{color:{{settings.linkFontColor}}}}.customer .customer__menu--submenu{display:none}@media screen and (min-width: 600px){.customer .customer__menu>ul{border-right:1px solid #d6d6d6}}.customer .customer__menu ul{list-style:none;padding:5px 0 5px 43px;font-size:14px;color:#959494;margin:0}@media screen and (min-width: 600px){.customer .customer__menu ul{padding:5px 0 0 2px;margin-left:-10px;box-sizing:border-box;min-width:210px}}.customer .customer__menu ul>li{padding:10px 0 10px 23px}.customer .customer__menu ul>li:first-of-type{padding-top:10px}.customer .customer__menu ul>li li{padding:10px 0 10px 23px}.customer .customer__menu ul>li li:first-of-type{padding-top:10px}.customer .customer__menu ul li{cursor:pointer}.customer .customer__submenu{font-size:14px}.customer .customer__submenu ul{margin:0;padding:0;list-style:none;position:relative}.customer .customer__submenu li{color:#a9a8a8;display:inline-block;padding:20px 17px 20px 22px}@media screen and (min-width: 600px){.customer .customer__submenu li{padding-bottom:30px}.customer .customer__submenu li.active-js{position:absolute;left:0}}@media screen and (min-width: 600px){.customer .customer__submenu{font-weight:400;margin-bottom:6px}}@media screen and (min-width: 600px){.customer .customer__submenu--mobile{display:none;visibility:hidden}}@media screen and (min-width: 600px){.customer .customer__addresses .customer__contentSection.customer__contentBox{min-height:140px}.customer .customer__contentSection.customer__contentBox.editSection-js .customer__contentSection--edit{top:18px}.customer .customer__contentSection.customer__contentSection--hidden.editSection-js .customer__contentSection--edit{padding:15px;top:18px;left:unset;right:15px}.customer .customer__contentSection.customer__contentSection--hidden.editSection-js .customer__contentSection--edit .svgIcon{width:16px;height:16px}}.customer .customer__contentSection .customer__contentSection--inner{font-size:14px}.customer .customer__contentSection .customer__hiddenForm-js.editMode-js>.form__input-wrapper,.customer .customer__contentSection .customer__hiddenForm-js.editMode-js>button,.customer .customer__contentSection .customer__hiddenForm-js.editMode-js>.form__checkBox{display:inline-block;visibility:visible}.customer .customer__contentSection .customer__hiddenForm-js.editMode-js .customer__contentPreview{display:none;visibility:hidden}.customer .customer__contentSection .customer__hiddenForm-js>.form__input-wrapper,.customer .customer__contentSection .customer__hiddenForm-js>button,.customer .customer__contentSection .customer__hiddenForm-js>.form__checkBox{display:none;visibility:hidden}.customer .customer__contentSection .customer__hiddenForm-js>.form__input-wrapper{margin-bottom:13px}.customer .customer__contentSection .customer__hiddenForm-js>.form__input-wrapper.form__input-lastSmall{padding-bottom:15px}.customer .customer__contentSection .customer__hiddenForm-js .secondary-action-button{margin-top:0}.customer .customer__contentSection .customer__hiddenForm-js .customer__contentPreview{display:block;visibility:visible;line-height:2}.customer .customer__contentSection .customer__hiddenForm-js .customer__contentPreview label{display:block;font-size:11px;color:#d6d6d6}.customer .customer__contentSection .customer__hiddenForm-js .customer__contentPreview input:disabled{font-size:26px;color:#AEADAD;background-color:transparent;border:none}.customer .customer__contentSection.customer__contentSection--hidden{border:none}@media screen and (min-width: 600px){.customer .customer__contentSection.customer__contentSection--hidden.editSection-js .customer__contentSection--edit{font-size:16px;color:{{settings.primaryBtnBgColor}}}}.customer .customer__contentSection.customer__contentSection--hidden .customer__contentSection--edit{display:inline-block}@media screen and (min-width: 600px){.customer .customer__contentSection.customer__contentSection--hidden .customer__contentSection--edit{color:{{settings.linkFontColor}};fill:{{settings.linkFontColor}};font-size:40px;background-color:transparent;cursor:pointer;position:absolute;top:55px;left:128px}.customer .customer__contentSection.customer__contentSection--hidden .customer__contentSection--edit .svgIcon{width:48px;height:48px}}.customer .smallBoxesSection .customer__title{padding-bottom:25px;margin:-40px 0 0 22px}@media screen and (min-width: 600px){.customer .smallBoxesSection .customer__title{margin:-25px 0 0 22px;width:100%;box-sizing:border-box}}.customer .smallBoxesSection .customer__contentBox{position:relative}.customer .smallBoxesSection .customer__contentSection.customer__contentBox{margin-bottom:35px}.customer .smallBoxesSection .customer__contentSection.customer__contentBox span{display:block;font-size:14px}.customer .smallBoxesSection .customer__contentSection.customer__contentBox span:nth-child(1){font-size:18px;font-weight:300}.customer .smallBoxesSection .customer__contentSection.customer__contentBox span:nth-child(2){padding:15px 0}.customer .smallBoxesSection .customer__contentSection.customer__contentBox span:nth-child(2):first-letter{text-transform:uppercase}.customer .smallBoxesSection .customer__contentSection.customer__contentBox span:nth-child(3){opacity:.5}.customer .smallBoxesSection .customer__contentBoxButton{cursor:pointer;fill:{{settings.linkFontColor}};position:absolute;padding:12px;bottom:3px;right:5px}.customer .smallBoxesSection .customer__contentBoxButton .svgIcon{width:15px;height:15px}.customer .complaints .complaints__productBox,.customer .complaints .reviews__productBox,.customer .complaints .wishList__productBox,.customer .customerReviews .complaints__productBox,.customer .customerReviews .reviews__productBox,.customer .customerReviews .wishList__productBox,.customer .wishList .complaints__productBox,.customer .wishList .reviews__productBox,.customer .wishList .wishList__productBox{margin:20px 25px 40px;position:relative;max-width:375px;box-sizing:border-box}.customer .complaints .wishList__removeProduct span,.customer .customerReviews .wishList__removeProduct span,.customer .wishList .wishList__removeProduct span{font-size:19px;color:#939292;fill:#939292;position:absolute;right:-15px;top:-16px;padding:15px;cursor:pointer}.customer .complaints .complaints__product,.customer .complaints .reviews__product,.customer .complaints .wishList__product,.customer .customerReviews .complaints__product,.customer .customerReviews .reviews__product,.customer .customerReviews .wishList__product,.customer .wishList .complaints__product,.customer .wishList .reviews__product,.customer .wishList .wishList__product{text-decoration:none;display:flex;padding-bottom:25px;border-bottom:1px solid #e5e5e5}.customer .complaints .complaints__productDetails,.customer .complaints .reviews__productDetails,.customer .complaints .wishList__productDetails,.customer .customerReviews .complaints__productDetails,.customer .customerReviews .reviews__productDetails,.customer .customerReviews .wishList__productDetails,.customer .wishList .complaints__productDetails,.customer .wishList .reviews__productDetails,.customer .wishList .wishList__productDetails{margin-left:15px;width:calc(100% - 145px)}.customer .complaints .complaints__productDetails span,.customer .complaints .reviews__productDetails span,.customer .complaints .wishList__productDetails span,.customer .customerReviews .complaints__productDetails span,.customer .customerReviews .reviews__productDetails span,.customer .customerReviews .wishList__productDetails span,.customer .wishList .complaints__productDetails span,.customer .wishList .reviews__productDetails span,.customer .wishList .wishList__productDetails span{display:block;color:#191616;font-size:14px;max-width:100%;overflow:hidden;max-height:23px;font-weight:500;white-space:nowrap;text-overflow:ellipsis;margin-bottom:8px}.customer .complaints .complaints__productDetails span.product__previousPrice,.customer .complaints .reviews__productDetails span.product__previousPrice,.customer .complaints .wishList__productDetails span.product__previousPrice,.customer .customerReviews .complaints__productDetails span.product__previousPrice,.customer .customerReviews .reviews__productDetails span.product__previousPrice,.customer .customerReviews .wishList__productDetails span.product__previousPrice,.customer .wishList .complaints__productDetails span.product__previousPrice,.customer .wishList .reviews__productDetails span.product__previousPrice,.customer .wishList .wishList__productDetails span.product__previousPrice{margin-bottom:0;color:#999fa2;font-weight:400}.customer .complaints .complaints__productDetails span a,.customer .complaints .reviews__productDetails span a,.customer .complaints .wishList__productDetails span a,.customer .customerReviews .complaints__productDetails span a,.customer .customerReviews .reviews__productDetails span a,.customer .customerReviews .wishList__productDetails span a,.customer .wishList .complaints__productDetails span a,.customer .wishList .reviews__productDetails span a,.customer .wishList .wishList__productDetails span a{color:#191616;text-decoration:none}.customer .complaints .complaints__productDetails span.wishList__addToCart,.customer .complaints .reviews__productDetails span.wishList__addToCart,.customer .complaints .wishList__productDetails span.wishList__addToCart,.customer .customerReviews .complaints__productDetails span.wishList__addToCart,.customer .customerReviews .reviews__productDetails span.wishList__addToCart,.customer .customerReviews .wishList__productDetails span.wishList__addToCart,.customer .wishList .complaints__productDetails span.wishList__addToCart,.customer .wishList .reviews__productDetails span.wishList__addToCart,.customer .wishList .wishList__productDetails span.wishList__addToCart{color:{{settings.linkFontColor}};fill:{{settings.linkFontColor}};text-transform:uppercase;bottom:25px;margin-bottom:0;position:absolute}.customer .complaints .complaints__productDetails span.wishList__addToCart .svgIcon,.customer .complaints .reviews__productDetails span.wishList__addToCart .svgIcon,.customer .complaints .wishList__productDetails span.wishList__addToCart .svgIcon,.customer .customerReviews .complaints__productDetails span.wishList__addToCart .svgIcon,.customer .customerReviews .reviews__productDetails span.wishList__addToCart .svgIcon,.customer .customerReviews .wishList__productDetails span.wishList__addToCart .svgIcon,.customer .wishList .complaints__productDetails span.wishList__addToCart .svgIcon,.customer .wishList .reviews__productDetails span.wishList__addToCart .svgIcon,.customer .wishList .wishList__productDetails span.wishList__addToCart .svgIcon{width:19px;height:19px;margin-bottom:-2px}.customer .complaints .complaints__productDetails .complaint__statusText,.customer .complaints .complaints__productDetails p.reviews__reviewText,.customer .complaints .reviews__productDetails .complaint__statusText,.customer .complaints .reviews__productDetails p.reviews__reviewText,.customer .complaints .wishList__productDetails .complaint__statusText,.customer .complaints .wishList__productDetails p.reviews__reviewText,.customer .customerReviews .complaints__productDetails .complaint__statusText,.customer .customerReviews .complaints__productDetails p.reviews__reviewText,.customer .customerReviews .reviews__productDetails .complaint__statusText,.customer .customerReviews .reviews__productDetails p.reviews__reviewText,.customer .customerReviews .wishList__productDetails .complaint__statusText,.customer .customerReviews .wishList__productDetails p.reviews__reviewText,.customer .wishList .complaints__productDetails .complaint__statusText,.customer .wishList .complaints__productDetails p.reviews__reviewText,.customer .wishList .reviews__productDetails .complaint__statusText,.customer .wishList .reviews__productDetails p.reviews__reviewText,.customer .wishList .wishList__productDetails .complaint__statusText,.customer .wishList .wishList__productDetails p.reviews__reviewText{display:none;line-height:2;font-size:14px;margin:10px 0 0 -115px}.customer .complaints .complaints__productDetails .complaint__statusText,.customer .complaints .reviews__productDetails .complaint__statusText,.customer .complaints .wishList__productDetails .complaint__statusText,.customer .customerReviews .complaints__productDetails .complaint__statusText,.customer .customerReviews .reviews__productDetails .complaint__statusText,.customer .customerReviews .wishList__productDetails .complaint__statusText,.customer .wishList .complaints__productDetails .complaint__statusText,.customer .wishList .reviews__productDetails .complaint__statusText,.customer .wishList .wishList__productDetails .complaint__statusText{max-height:100px}.customer .complaints .complaints__productDetails .complaint__statusText span,.customer .complaints .reviews__productDetails .complaint__statusText span,.customer .complaints .wishList__productDetails .complaint__statusText span,.customer .customerReviews .complaints__productDetails .complaint__statusText span,.customer .customerReviews .reviews__productDetails .complaint__statusText span,.customer .customerReviews .wishList__productDetails .complaint__statusText span,.customer .wishList .complaints__productDetails .complaint__statusText span,.customer .wishList .reviews__productDetails .complaint__statusText span,.customer .wishList .wishList__productDetails .complaint__statusText span{display:inline-block;font-weight:400}.customer .complaints .complaints__productDetails .complaint__statusText span:nth-child(odd),.customer .complaints .reviews__productDetails .complaint__statusText span:nth-child(odd),.customer .complaints .wishList__productDetails .complaint__statusText span:nth-child(odd),.customer .customerReviews .complaints__productDetails .complaint__statusText span:nth-child(odd),.customer .customerReviews .reviews__productDetails .complaint__statusText span:nth-child(odd),.customer .customerReviews .wishList__productDetails .complaint__statusText span:nth-child(odd),.customer .wishList .complaints__productDetails .complaint__statusText span:nth-child(odd),.customer .wishList .reviews__productDetails .complaint__statusText span:nth-child(odd),.customer .wishList .wishList__productDetails .complaint__statusText span:nth-child(odd){width:111px;opacity:.5}.customer .complaints .complaints__productDetails .complaint__statusText span:nth-child(even),.customer .complaints .reviews__productDetails .complaint__statusText span:nth-child(even),.customer .complaints .wishList__productDetails .complaint__statusText span:nth-child(even),.customer .customerReviews .complaints__productDetails .complaint__statusText span:nth-child(even),.customer .customerReviews .reviews__productDetails .complaint__statusText span:nth-child(even),.customer .customerReviews .wishList__productDetails .complaint__statusText span:nth-child(even),.customer .wishList .complaints__productDetails .complaint__statusText span:nth-child(even),.customer .wishList .reviews__productDetails .complaint__statusText span:nth-child(even),.customer .wishList .wishList__productDetails .complaint__statusText span:nth-child(even){width:50%}.customer .complaints .complaints__productDetails span.complaint__moreDetails,.customer .complaints .complaints__productDetails span.review__link,.customer .complaints .reviews__productDetails span.complaint__moreDetails,.customer .complaints .reviews__productDetails span.review__link,.customer .complaints .wishList__productDetails span.complaint__moreDetails,.customer .complaints .wishList__productDetails span.review__link,.customer .customerReviews .complaints__productDetails span.complaint__moreDetails,.customer .customerReviews .complaints__productDetails span.review__link,.customer .customerReviews .reviews__productDetails span.complaint__moreDetails,.customer .customerReviews .reviews__productDetails span.review__link,.customer .customerReviews .wishList__productDetails span.complaint__moreDetails,.customer .customerReviews .wishList__productDetails span.review__link,.customer .wishList .complaints__productDetails span.complaint__moreDetails,.customer .wishList .complaints__productDetails span.review__link,.customer .wishList .reviews__productDetails span.complaint__moreDetails,.customer .wishList .reviews__productDetails span.review__link,.customer .wishList .wishList__productDetails span.complaint__moreDetails,.customer .wishList .wishList__productDetails span.review__link{font-size:14px;margin-top:70px;text-decoration:underline;font-weight:400;color:{{settings.linkFontColor}};fill:{{settings.linkFontColor}};margin-bottom:0;cursor:pointer}.customer .complaints .complaints__productDetails span.complaint__moreDetails a,.customer .complaints .complaints__productDetails span.review__link a,.customer .complaints .reviews__productDetails span.complaint__moreDetails a,.customer .complaints .reviews__productDetails span.review__link a,.customer .complaints .wishList__productDetails span.complaint__moreDetails a,.customer .complaints .wishList__productDetails span.review__link a,.customer .customerReviews .complaints__productDetails span.complaint__moreDetails a,.customer .customerReviews .complaints__productDetails span.review__link a,.customer .customerReviews .reviews__productDetails span.complaint__moreDetails a,.customer .customerReviews .reviews__productDetails span.review__link a,.customer .customerReviews .wishList__productDetails span.complaint__moreDetails a,.customer .customerReviews .wishList__productDetails span.review__link a,.customer .wishList .complaints__productDetails span.complaint__moreDetails a,.customer .wishList .complaints__productDetails span.review__link a,.customer .wishList .reviews__productDetails span.complaint__moreDetails a,.customer .wishList .reviews__productDetails span.review__link a,.customer .wishList .wishList__productDetails span.complaint__moreDetails a,.customer .wishList .wishList__productDetails span.review__link a{color:{{settings.linkFontColor}}}.customer .complaints .complaints__productDetails span.complaint__moreDetails .svgIcon,.customer .complaints .complaints__productDetails span.review__link .svgIcon,.customer .complaints .reviews__productDetails span.complaint__moreDetails .svgIcon,.customer .complaints .reviews__productDetails span.review__link .svgIcon,.customer .complaints .wishList__productDetails span.complaint__moreDetails .svgIcon,.customer .complaints .wishList__productDetails span.review__link .svgIcon,.customer .customerReviews .complaints__productDetails span.complaint__moreDetails .svgIcon,.customer .customerReviews .complaints__productDetails span.review__link .svgIcon,.customer .customerReviews .reviews__productDetails span.complaint__moreDetails .svgIcon,.customer .customerReviews .reviews__productDetails span.review__link .svgIcon,.customer .customerReviews .wishList__productDetails span.complaint__moreDetails .svgIcon,.customer .customerReviews .wishList__productDetails span.review__link .svgIcon,.customer .wishList .complaints__productDetails span.complaint__moreDetails .svgIcon,.customer .wishList .complaints__productDetails span.review__link .svgIcon,.customer .wishList .reviews__productDetails span.complaint__moreDetails .svgIcon,.customer .wishList .reviews__productDetails span.review__link .svgIcon,.customer .wishList .wishList__productDetails span.complaint__moreDetails .svgIcon,.customer .wishList .wishList__productDetails span.review__link .svgIcon{margin-bottom:-4px;transition:300ms}.customer .complaints .complaints__productDetails span.complaint__moreDetails .svgIcon.rotateUp-js,.customer .complaints .complaints__productDetails span.review__link .svgIcon.rotateUp-js,.customer .complaints .reviews__productDetails span.complaint__moreDetails .svgIcon.rotateUp-js,.customer .complaints .reviews__productDetails span.review__link .svgIcon.rotateUp-js,.customer .complaints .wishList__productDetails span.complaint__moreDetails .svgIcon.rotateUp-js,.customer .complaints .wishList__productDetails span.review__link .svgIcon.rotateUp-js,.customer .customerReviews .complaints__productDetails span.complaint__moreDetails .svgIcon.rotateUp-js,.customer .customerReviews .complaints__productDetails span.review__link .svgIcon.rotateUp-js,.customer .customerReviews .reviews__productDetails span.complaint__moreDetails .svgIcon.rotateUp-js,.customer .customerReviews .reviews__productDetails span.review__link .svgIcon.rotateUp-js,.customer .customerReviews .wishList__productDetails span.complaint__moreDetails .svgIcon.rotateUp-js,.customer .customerReviews .wishList__productDetails span.review__link .svgIcon.rotateUp-js,.customer .wishList .complaints__productDetails span.complaint__moreDetails .svgIcon.rotateUp-js,.customer .wishList .complaints__productDetails span.review__link .svgIcon.rotateUp-js,.customer .wishList .reviews__productDetails span.complaint__moreDetails .svgIcon.rotateUp-js,.customer .wishList .reviews__productDetails span.review__link .svgIcon.rotateUp-js,.customer .wishList .wishList__productDetails span.complaint__moreDetails .svgIcon.rotateUp-js,.customer .wishList .wishList__productDetails span.review__link .svgIcon.rotateUp-js{transform:rotate(-90deg);transition:300ms}.customer .complaints .complaints__productDetails span.complaint__moreDetails,.customer .complaints .reviews__productDetails span.complaint__moreDetails,.customer .complaints .wishList__productDetails span.complaint__moreDetails,.customer .customerReviews .complaints__productDetails span.complaint__moreDetails,.customer .customerReviews .reviews__productDetails span.complaint__moreDetails,.customer .customerReviews .wishList__productDetails span.complaint__moreDetails,.customer .wishList .complaints__productDetails span.complaint__moreDetails,.customer .wishList .reviews__productDetails span.complaint__moreDetails,.customer .wishList .wishList__productDetails span.complaint__moreDetails{margin-top:45px}.customer .complaints .complaints__productDetails span.complaint__link,.customer .complaints .reviews__productDetails span.complaint__link,.customer .complaints .wishList__productDetails span.complaint__link,.customer .customerReviews .complaints__productDetails span.complaint__link,.customer .customerReviews .reviews__productDetails span.complaint__link,.customer .customerReviews .wishList__productDetails span.complaint__link,.customer .wishList .complaints__productDetails span.complaint__link,.customer .wishList .reviews__productDetails span.complaint__link,.customer .wishList .wishList__productDetails span.complaint__link{color:#939292;fill:#939292;margin-top:0;padding:15px;cursor:pointer;position:absolute;top:-17px;right:-17px}.customer .complaints .complaints__productDetails span.complaint__type,.customer .complaints .reviews__productDetails span.complaint__type,.customer .complaints .wishList__productDetails span.complaint__type,.customer .customerReviews .complaints__productDetails span.complaint__type,.customer .customerReviews .reviews__productDetails span.complaint__type,.customer .customerReviews .wishList__productDetails span.complaint__type,.customer .wishList .complaints__productDetails span.complaint__type,.customer .wishList .reviews__productDetails span.complaint__type,.customer .wishList .wishList__productDetails span.complaint__type{font-size:12px;font-weight:400;text-transform:uppercase;display:inline}.customer .complaints .complaints__productDetails span.complaint__type>span,.customer .complaints .reviews__productDetails span.complaint__type>span,.customer .complaints .wishList__productDetails span.complaint__type>span,.customer .customerReviews .complaints__productDetails span.complaint__type>span,.customer .customerReviews .reviews__productDetails span.complaint__type>span,.customer .customerReviews .wishList__productDetails span.complaint__type>span,.customer .wishList .complaints__productDetails span.complaint__type>span,.customer .wishList .reviews__productDetails span.complaint__type>span,.customer .wishList .wishList__productDetails span.complaint__type>span{margin-left:2px;font-size:12px;font-weight:400;text-transform:capitalize;text-overflow:ellipsis;white-space:nowrap;display:inline-block;margin-bottom:-3px;max-width:50%}.customer .complaints .complaints__image,.customer .complaints .reviews__image,.customer .complaints .wishList__image,.customer .customerReviews .complaints__image,.customer .customerReviews .reviews__image,.customer .customerReviews .wishList__image,.customer .wishList .complaints__image,.customer .wishList .reviews__image,.customer .wishList .wishList__image{position:relative;width:100px;margin:0;height:130px;padding:0;text-align:center;font-size:50px;color:#E5E5E5;overflow:hidden}.customer .complaints .complaints__image img,.customer .complaints .reviews__image img,.customer .complaints .wishList__image img,.customer .customerReviews .complaints__image img,.customer .customerReviews .reviews__image img,.customer .customerReviews .wishList__image img,.customer .wishList .complaints__image img,.customer .wishList .reviews__image img,.customer .wishList .wishList__image img{width:auto;min-width:100px;max-width:100%}.customer .complaints span.complaints__lightText,.customer .customerReviews span.complaints__lightText,.customer .wishList span.complaints__lightText{opacity:.5;font-weight:400;margin-top:8px}.customer .customer__dateHourSpace{display:inline !important;padding:0 7px}@media screen and (min-width: 600px){.customer .customerReviews{margin-top:20px}}.customer .customerReviews .customer__title{margin-left:22px}.customer .customerPagination{list-style:none;margin:0 0 0 22px;padding:0}.customer .customerPagination li{display:inline-block;margin:0;color:rgba(25,22,22,0.5);padding:0;cursor:pointer}.customer .customerPagination li.active span{color:#191616}.customer .customer__orderContent{color:{{settings.primaryFontColor}};position:absolute;top:0;background-color:white;right:0;left:0}.customer .customer__orderContent .orderContent__setIcon{margin-bottom:-2px;fill:{{settings.secondaryFontColor}}}.customer .customer__orderContent .orderContent__showSet{display:block;font-size:14px;font-weight:400;cursor:pointer}.customer .customer__orderContent .orderContent__productsRow.orderContent__setElement{display:none;max-height:159px}.customer .customer__orderContent .orderContent__productsRow.orderContent__setElement.elementVisible-js{animation:showSetAnimation .5s;animation-fill-mode:both;display:flex}@keyframes showSetAnimation{from{height:0}to{height:210px}}@media screen and (min-width: 600px){.customer .customer__orderContent{left:240px;width:calc(100% - 250px);z-index:11;top:125px}}.customer .customer__orderContent .form__input-info[for="defectDate"]{top:-5px;font-size:11px}.customer .customer__orderContent .form__icons{fill:{{settings.linkFontColor}}}.customer .customer__orderContent textarea{height:auto}.customer .customer__orderContent .form .form__icon_padding{padding-left:25px}.customer .customer__orderContent .customer__title{padding-bottom:25px}.customer .customer__orderContent .orderContent{padding:25px;box-sizing:border-box}.customer .customer__orderContent .orderContent__infoBox{margin-bottom:30px}.customer .customer__orderContent .orderContent__infoBox>span{display:block}.customer .customer__orderContent .orderContent__infoBox .orderContent__lightText{font-size:14px;color:#adabab;line-height:2;font-weight:400}.customer .customer__orderContent .orderContent__productDetails{font-weight:500;font-size:14px;width:calc(100% - 130px)}.customer .customer__orderContent .orderContent__productTitle{display:block;color:#191616;font-size:14px;max-width:100%;overflow:hidden;max-height:70px;font-weight:500;white-space:nowrap;text-overflow:ellipsis;margin-bottom:8px}.customer .customer__orderContent .orderContent__productTitle a{text-decoration:none;color:#191616;max-height:20px}.customer .customer__orderContent .orderContent__productDetails span.orderContent__productAttributes{font-size:12px;color:#a9a7a7;display:block;line-height:1.2;white-space:normal}.customer .customer__orderContent .orderContent__productPrice{display:block}.customer .customer__orderContent .orderContent__bottomText{margin-top:62px;display:inline-block}.customer .customer__orderContent .orderContent__complainBtn{display:block;margin:20px 0 5px;text-decoration:underline;color:{{settings.linkFontColor}};fill:{{settings.linkFontColor}};font-weight:400;cursor:pointer}.customer .customer__orderContent .orderContent__complainBtn svg{margin:0 3px -4px 0}.customer .customer__orderContent .orderContent__summary div{display:flex;justify-content:space-between;align-items:center;font-size:14px}.customer .customer__orderContent .orderContent__summary div span:nth-child(2){font-weight:500}.customer .customer__orderContent .orderContent__summary .orderContent__finalPrice{font-weight:500;font-size:18px;margin:40px 0}.customer .customer__orderContent .orderContent__status{margin:37px 0;font-size:14px;justify-content:space-between;display:flex}.customer .customer__orderContent .orderContent__status span:first-letter{text-transform:uppercase}.customer .customer__orderContent .orderContent__status span:first-of-type{color:#a9a7a7}.customer .customer__orderContent .orderContent__status span:last-of-type{color:{{settings.linkFontColor}};font-weight:500}.customer .customer__orderContent .orderContent__btn{width:100%;margin:0 0 20px}.customer .customer__orderContent .orderContent__productsRow{border-bottom:1px solid {{settings.borderColor}};padding:14px 0;max-height:210px;box-sizing:border-box;display:flex}.customer .customer__orderContent .orderContent__productsRow.orderContent__titleRow{height:auto;padding:0}.customer .customer__orderContent .orderContent__productsRow.orderContent__titleRow span:nth-child(2){min-width:190px}.customer .customer__orderContent .orderContent__productImage{width:100px;height:130px;overflow:hidden;margin-right:22px;flex-shrink:0}.customer .customer__orderContent .orderContent__productImage img{width:auto;min-width:100px;max-width:100%}.customer .customer__orderContent .checkBoxes__container--radio{display:flex;justify-content:flex-start;margin:30px 0 25px -10px}.customer .customer__orderContent .orderContent__link{text-decoration:underline;color:{{settings.linkFontColor}}}.customer .customer__orderContent .orderContent__docsToPrint{font-size:14px;margin:-10px -4px 23px}.customer .customer__orderContent .orderContent__docsToPrint__item{display:block;padding:0 0 5px 5px;margin-bottom:5px}.customer .customer__orderContent .orderContent__docsToPrint__item svg{width:14px;margin:0 3px -3px 0;fill:{{settings.secondaryFontColor}}}.customer .customer__orderContent .form__input-wrapper .quantityField__label{display:block;margin-bottom:10px}.customer .customer__orderContent .form__input-wrapper.min-js .button-minus-add-product svg{fill:#dddddd;transition:200ms}.customer .customer__orderContent .form__input-wrapper.max-js .button-plus-add-product svg{fill:#dddddd;transition:200ms}.customer .customer__orderContent .form__input-wrapper .button-minus-add-product,.customer .customer__orderContent .form__input-wrapper .button-plus-add-product{cursor:pointer;outline:none;background-color:{{settings.primaryPageBgColor}};border:none;color:{{settings.primaryFontColor}};width:55px;height:55px;display:inline-block;font-weight:700;margin:0}.customer .customer__orderContent .form__input-wrapper .button-minus-add-product{font-size:23px}.customer .customer__orderContent .form__input-wrapper .button-minus-add-product svg{transition:200ms;margin-bottom:-2px;fill:{{settings.primaryFontColor}}}.customer .customer__orderContent .form__input-wrapper .button-plus-add-product{font-size:20px}.customer .customer__orderContent .form__input-wrapper .button-plus-add-product svg{margin-bottom:-2px;transition:200ms;fill:{{settings.primaryFontColor}}}.customer .customer__orderContent .form__input-wrapper .quantity-field{border:1px solid #191616;background-color:{{settings.primaryPageBgColor}};color:{{settings.primaryFontColor}};width:70px;height:55px;text-align:center;padding:0;box-sizing:border-box;font-size:17px;font-weight:500;left:-2px;margin-right:-4px;display:inline-block;position:relative}.customer .complain__product{display:flex;margin:35px 0 20px;padding:12px 0;border-bottom:1px solid {{settings.borderColor}}}.customer .complain__product figure svg{display:none;visibility:hidden}.customer .complain__product figure img{display:inline-block;visibility:visible}.customer .complain__product figure.noImage-js img{display:none;visibility:hidden}.customer .complain__product figure.noImage-js svg{display:inline-block;visibility:visible;height:40px;margin-top:25px}.customer .complain__product .complain__productTitle{font-weight:500;color:{{settings.primaryFontColor}};display:block;font-size:14px}.customer .complain__product .complain__lightText{font-weight:400;color:#adabab;font-size:13px}.customer .complain__product figure{width:85px;height:100px;overflow:hidden;margin:0 15px 0 0;display:inline-block}.customer .complain__product img{width:100%;height:auto}.customer .complain__product p{margin:0}.customer .customer__consents{font-size:14px}@media screen and (max-width: 599px){.customer .customer__consents{margin-top:20px}}.customer .customer__consents .primary-action-button,.customer .customer__consents .secondary-action-button{display:block;margin:15px 0 30px;width:100%}.customer .customer__consents ul{margin:0;padding:0;list-style:none}.customer .customer__consents li{line-height:1.8}.customer .customer__consents span{display:block}.customer .customer__consents .consentWithdraw__warning{color:#CE283E;font-size:12px;margin-top:15px}.customer .customer__consents .consentAccepted__date{color:#959494}.customer .customer__consents .acceptedConsents li{margin-bottom:30px}.customer .customer__consents .consentChannel{margin-top:10px}.customer .customer__consents .consentDetails{display:none;margin-bottom:-10px}.customer__socialButton{color:#fff;font-size:14px;text-transform:uppercase;font-weight:400;display:block;margin-bottom:20px;padding:17px;text-align:center;cursor:pointer;letter-spacing:1px}.customer__socialButton svg{fill:#fff}.customer__socialButton__google{background-color:#DD4B39}.customer__socialButton__google svg{margin:0 5px -7px 0;height:26px;width:26px}.customer__socialButton__facebook{background-color:#3B5998}.customer__socialButton__facebook svg{margin:0 5px -4px 0;height:20px;width:20px}@media screen and (min-width: 600px){.customer .complaints.complaints__emptySectionMargin{margin-top:-52px}.customer .complaints{margin-top:-60px}}.customer .showOrder-js{cursor:pointer}.customer .orderContent__additionalInformation .customer__title__attachments{padding-top:25px;text-align:left !important}.customer .orderContent__additionalInformation .attachmentsFile{display:block;text-decoration:none}.customer .orderContent__additionalInformation .attachmentsFile .attachmentsFile__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:75%;display:inline-block;margin-bottom:-9px}.customer .orderContent__additionalInformation .attachmentsFile .svgIcon{margin-bottom:-3px}.customer .customer__history{width:100%;padding:0 20px;box-sizing:border-box;text-align:center}.customer .customer__history__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;padding-bottom:5px;border-bottom:1px solid #f2f2f2;margin-bottom:5px;font-size:13px;font-weight:300;align-items:center}.customer .customer__history__row:last-of-type{border-bottom:none;margin-bottom:20px}.customer .customer__history__rowTitle{font-size:15px;width:35%;text-align:left;font-weight:400}.customer .popupDialog__complain .popupDialog__wrapper{max-width:700px;padding-bottom:0}.customer .complain__product{width:40%;padding:0;margin:40px 0;vertical-align:top;display:inline-block;border:none}.customer .complain__product figure{width:100%;height:auto;margin:0 0 20px}.customer .complain__form{width:calc(60% - 84px);display:inline-block;margin:40px}.customer .complain__form>strong{display:block;margin-bottom:20px}.customer .complain__form textarea{margin-top:10px;padding:10px}.customer .customer__orderContent .checkBoxes__container--radio{margin-top:0}.customer .form__attachement-input-container{position:relative}.customer .form__clear-attachement-input{position:absolute;top:11px;cursor:pointer}
W tym samym katalogu otwórz plik layout-m.css. Wyszukaj blok kodu z frazą .hide-on-mobile-order. Usuń go i wklej w jego miejsce następujący kod:@media screen and (max-width: 768px){.hide-on-mobile-order{display:none;visibility:hidden}.customer__blockContent.hide-on-mobile{display:none}.hide-on-desktop-order{display:inline-block;visibility:visible}.customer .customer__menu ul{border-right:none}}@media screen and (max-width: 599px){.temporaryPopup{width:100%;text-align:center;min-height:72px;background-color:#f2f2f2;box-sizing:border-box;top:0;margin:0;padding:26px 0}.customer .customer__menu ul{padding:12px 0 5px 0}.customer .customer__menu ul>li.active-js{color:{{settings.linkFontColor}}}.customer .customer__menu ul>li{padding:18px 0 18px 23px}.customer .customer__orderContent .orderContent__status{margin:0 0 37px}.customer .customer__orderContent{min-height:100%}}@media screen and (max-width: 359px){.customer .customer__orderContent .orderContent__complainBtn{margin:7px 0 0 -130px}}@media screen and (max-width: 479px){.customer .popupDialog__complain{padding:0}.customer .popupDialog__complain .popupDialog__closeBtn{top:17px;right:17px}}@media screen and (max-width: 768px){.customer__flexboxContainer{flex-direction:column}}@media screen and (max-width: 599px){.customer .customer__contentSection.customer__contentBox.editSection-js{padding:5px 20px 15px;top:155px}.customer .customer__contentSection.customer__contentBox.editSection-js .customer__contentBoxTitle{display:none;visibility:hidden}.customer .customer__contentSection.customer__contentBox.editSection-js .customer__contentSection--edit{top:-77px;right:13px;background-color:#fff;width:45px;height:44px;padding:14px 11px 11px;color:{{settings.linkFontColor}};fill:{{settings.linkFontColor}}}}@media screen and (min-width: 600px) and (max-width: 768px){.customer .customer__contentSection.customer__contentBox.editSection-js .customer__contentBoxTitle{font-size:16px;padding:10px 0 30px}}@media screen and (min-width: 630px){.customer .customer__contentSection.customer__contentBox.editSection-js{max-width:360px}}@media screen and (max-width: 599px){.customer .customer__contentSection.customer__contentSection--hidden{position:static}.customer .customer__contentSection.customer__contentSection--hidden .customer__contentSection--edit{position:absolute;color:white;fill:white;background-color:{{settings.linkFontColor}};border-radius:50%;font-size:18px;width:43px;height:43px;text-align:center;box-sizing:border-box;top:80px;padding:13px 11px 11px;box-shadow:0 2px 5px 1px #0000001c}.customer .customer__contentSection.customer__contentSection--hidden.editSection-js .customer__contentSection--edit{background-color:transparent}}@media screen and (max-width: 599px){.customer__content{flex-grow:5}}@media screen and (max-width: 768px){.customer .customer__breadcrumbs--desktop{display:none;visibility:hidden}}@media screen and (max-width: 768px){.customer .customer__breadcrumbs--mobile{display:inherit;visibility:visible}}@media screen and (max-width: 768px){.customer .customer__menu{position:absolute;top:71px;left:-300px;flex-grow:1}.customer .customer__menu.customer__menuActive-js{left:0;bottom:0;right:0}}@media screen and (max-width: 768px){.customer .mobileLogout{display:block !important;width:100% !important;margin-top:50px}.customer .mobileLogoutButton{width:calc(100% - 40px);padding:18px 0;margin-left:20px;margin-right:20px;text-align:center;color:{{settings.primaryBtnFontColor}};background-color:{{settings.primaryBtnBgColor}};border:1px solid {{settings.primaryBtnBorderColor}};transition:200ms;text-transform:uppercase;font-size:14px;line-height:24px;font-weight:400}.customer .mobileLogoutButton:hover{cursor:pointer;color:{{settings.primaryBtnHoverFontColor}};background-color:{{settings.primaryBtnHoverBgColor}};border:1px solid {{settings.primaryBtnHoverBorderColor}}}}@media screen and (max-width: 599px){.customer .customer__submenu{margin-bottom:30px}}@media screen and (max-width: 599px){.customer .customer__submenu.customer__submenu--desktop{display:none;visibility:hidden}}@media screen and (max-width: 599px){.customer .customer__menu .active-js,.customer .customer__submenu .active-js{color:{{settings.linkFontColor}}}}.customer .complain__product{width:100%;margin:20px 0}.customer .complain__form{width:100%;margin:20px 0}@media screen and (max-width: 599px){.loyaltyProgram .customer__title,.wishList .customer__title{margin:-40px 0 0 22px}}
Kolejnym krokiem jest otwarcie pliku static-elements -> customer-profile -> customer-profile.html. Kilka linii przed końcem pliku znajduje się linia z frazą </nav>. Tuż nad nią (a przed linią z frazą </ul>) wstaw poniższy kod:{{ translations.Cpr_Logout }}Inne zmiany
Otwórz plik layout1.js. Wyszukaj linię z frazą var mainSection = $('main');. Tuż pod nią wklej poniższy kod:mainSection.on('click', '.customerLogout-js', function (e) { app.customerLogout(e); });
Następnie w tym samym pliku wyszukaj linijkę mainSection.on('click', '.customer__menuActivate-js', customerProfile.showCustomerProfileMenu); i tuż nad nią wklej:jest $(window).on('load', function(e) { let searchFavParam = new URLSearchParams(window.location.search); if(searchFavParam.has('fav')) { $('.customer__menu').addClass('customer__menu-js'); $('.customerProfileButton').removeClass('activePage'); $('.favouriteItemsButton').addClass('activePage'); var favourites = $('.customerPrimaryMenu-js').find('[data-template="wish-list"]'); favourites.click(); } else if (searchFavParam.has('accountData')) { var accountData = $('.customerPrimaryMenu-js').find('[data-template="account-data"]'); accountData.click(); } });
Otwórz plik css -> layout.css. Wyszukaj .popup-dialog.after-adding-to-cart-popup{z-index:12;bottom:0;top:0;right:0;left:0;margin:auto;position:fixed;padding:30px;box-sizing:border-box}. Zamień liczbę 12 przy z-index na 101.Modyfikacja nagłówków - obie wersje nagłówka
Na koniec należy zmodyfikować wygląd nagłówków. Aby sprawdzić, którą wersję nagłówka posiadasz, wejdź do katalogu elements -> header. Jeśli w środku znajduje się plik header-1.html to posiadasz wersję 1. Jeśli header-2.html to wersję 2. W zależności od posiadanej wersji, wykonaj odpowiednie instrukcje (kod dla obu wersji będzie się różnić). Jeśli posiadasz nagłówek w wersji 1: Otwórz katalog css a w nim plik layout-m.css. W nim znajduje się bardzo długa linia, w której treści pojawia się fraza headerSection. Usuń całą tę linię i wklej w jej miejsce poniższy kod:@media only screen and (max-width: 767px){.headerSection{height:60px}.headerSection .headerSection__mainMenu__closeBtn{display:block}.headerSection .header__icon svg{width:18px;height:18px}.headerSection .header__icon.header__login{display:none}.headerSection .mainMenu__navLink{position:relative}.headerSection .mainMenu__navLink.header__icon svg{top:16px;right:2px;position:absolute}.headerSection .headerSection__shopData{position:absolute;top:30px;right:30px}.headerSection .headerSection__shopData>span:nth-child(1),.headerSection .headerSection__shopData>span:nth-child(2){display:none}.headerSection .headerSection__logo img,.headerSection .headerSection__logo svg,.headerSection .headerSection__logo{min-height:30px;height:30px}.headerSection.headerSection__bg>.headerSection__row{height:110px;padding:15px 35px}.headerSection .mainNavigation__image,.headerSection .headerSection__mainMenu.headerSection__row,.headerSection .headerSection__searchForm{display:none;position:fixed;top:0;bottom:56px;overflow-y:auto;overflow-x:hidden;z-index:1}.headerSection .headerSection__mainMenu{position:absolute;top:50px;left:0;right:0;background-color:{{settings.headerBgColor}};color:{{settings.headerFontColor}}}.headerSection .headerSection__mainMenu .headerSection__mainMenu__closeBtn{text-align:left;position:absolute;padding:15px;width:105px;box-sizing:border-box;left:20px;top:-40px;font-size:16px;color:{{settings.linkFontColor}};fill:{{settings.linkFontColor}};background-color:{{settings.headerBgColor}};cursor:pointer}.headerSection .headerSection__mainMenu .headerSection__mainMenu__closeBtn span{display:none}.headerSection .headerSection__mainMenu .headerSection__mainMenu__closeBtn svg{margin-bottom:-3px;margin-top:50px}.headerSection .headerSection__mainMenu .headerSection__navigation{position:relative}.headerSection .headerSection__mainMenu .mainNavigation{box-shadow:none}.headerSection .headerSection__mainMenu .mainNavigation ul{text-transform:none}.headerSection .headerSection__mainMenu .mainNavigation ul ul{display:none}.headerSection .headerSection__mainMenu .mainNavigation.mainNavigation__sites li,.headerSection .headerSection__mainMenu .mainNavigation ul .mainNavigation__category,.headerSection .headerSection__mainMenu .mainNavigation ul .mainNavigation__undercategory{font-size:12px;padding:10px 0;display:inline-block;width:100%;border-bottom:1px solid {{settings.borderColor}}}.headerSection .headerSection__mainMenu .mainNavigation.mainNavigation__sites li a,.headerSection .headerSection__mainMenu .mainNavigation ul .mainNavigation__category a,.headerSection .headerSection__mainMenu .mainNavigation ul .mainNavigation__undercategory a{color:{{settings.headerFontColor}};text-decoration:none;display:inline-block;padding:5px 0;width:calc(100% - 22px)}.headerSection .headerSection__mainMenu .headerSection__mainMenu__navLinks{display:flex;flex-direction:column;padding:50px 40px 40px}.headerSection .headerSection__mainMenu .mainMenu__navLink{padding:15px 0;border-bottom:1px solid {{settings.borderColor}};width:100%;text-align:left}.headerSection .headerSection__mainMenu .mainMenu__navLink a{display:inline-block;width:100%}.headerSection .headerSection__mainMenu .mainNavigation__categories__noChilds{display:block !important}.headerSection .header__icon.mobileMenuIcon{display:none}.headerSection .headerSection__iconsMenu .mobileMenuIcon,.headerSection .headerSection__iconsMenu .mobileSearchIcon{display:inline-block}.headerSection .headerSection__iconsMenu .header__cart .iconsMenuItem__text{display:inline-block;margin-top:5px}.headerSection .headerSection__iconsMenu .header__cart .iconsMenuItem__text i{display:none}.headerSection .headerSection__iconsMenu .headerSection__iconsMenuItem{margin-left:15px}.headerSection .mobileMenuIcon .iconsMenuItem__text{text-transform:uppercase}.headerSection .mobileMenuIcon svg{top:3px;margin:4px 0 0;width:20px;height:20px}.headerSection .headerSection__iconsMenu{display:flex;flex-direction:row;justify-content:space-between;font-size:10px;position:static;bottom:22px;right:35px}.headerSection .headerSection__searchForm{position:fixed;top:45px;background-color:{{settings.headerBgColor}};left:0;right:0;width:100%;max-width:100%;height:100%;padding:35px 0 0;margin:-45px 0 0 0}.headerSection .headerSection__searchForm svg{fill:{{settings.linkFontColor}};display:block;margin-left:33px;margin-bottom:25px}.headerSection .headerSection__searchForm__searchButtonMobile{display:block;position:fixed;left:0;bottom:100px;width:calc(100% - 38px);height:48px;margin-left:20px;margin-right:20px;background-color:{{settings.primaryBtnBgColor}};border:1px solid {{settings.primaryBtnBorderColor}};color:{{settings.primaryBtnFontColor}};transition:200ms;text-transform:uppercase;font-size:14px;line-height:24px;font-weight:400;font-family:{{settings.fontFamily}}}.headerSection .headerSection__searchForm__searchButtonMobile:hover{background-color:{{settings.primaryBtnHoverBgColor}};color:{{settings.primaryBtnHoverFontColor}};border-color:{{settings.primaryBtnHoverBorderColor}}}.headerSection .headerSection__searchForm__btn{background-color:{{settings.linkFontColor}};color:#fff;fill:#fff;position:relative;right:5px;top:-1px}.headerSection .headerSection__searchForm__phrase{margin:10px 0;width:calc(100% - 71px);max-width:calc(100% - 71px)}.headerSection .headerSection__shopData{font-size:14px;top:-23px;left:15px;position:relative}.headerSection .headerSection__languageAndCurrencyMenu{position:relative;box-shadow:none;top:0;width:calc(100% - 20px);left:-5px}.headerSection .headerSection__shopData span.headerSection__languageAndCurrencyMenu__openBtn{display:block}.headerSection .customerLogin__mobileButton{display:block;position:relative;margin:20px 40px 40px}.headerSection .customerLogin__mobileButton svg{fill:{{settings.primaryBtnFontColor}};margin:0 5px -4px}.headerSection .hideOnMobile{display:none}}
W tym samym katalogu otwórz plik layout.css. Znajdź cały blok kodu, w którym występują frazy headerSection. Usuń go i wklej w jego miejsce następujący kod:.headerSection{color:{{settings.headerFontColor}};background-color:{{settings.headerBgColor}};width:100%;height:120px;box-sizing:border-box;position:relative;z-index:13}.headerSection .activeButton-js{color:{{settings.dropdownArrowColor}} !important}.headerSection.headerSection__bg>.headerSection__row{display:flex;width:100%;height:120px;padding:29px 3% 29px 3%;box-sizing:border-box;flex-direction:column;justify-content:space-between;position:relative}.headerSection .headerSection__logo{height:36px;width:auto;text-align:center;z-index:1}.headerSection .headerSection__logo img,.headerSection .headerSection__logo svg{height:36px;width:auto}.headerSection .header__icon{display:inline-block;color:{{settings.headerFontColor}};fill:{{settings.headerFontColor}};text-decoration:none;vertical-align:middle;text-align:center;cursor:pointer}.headerSection .header__icon svg{width:20px;position:relative;height:18px;top:5px}.headerSection .header__icon--arrowDown{transform:rotate(90deg);fill:{{settings.dropdownArrowColor}}}.headerSection .header__icon.mobileMenuIcon{display:none}.headerSection .headerSection__row{position:relative;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.headerSection .headerSection__languageAndCurrencyMenu,.headerSection .mainNavigation{display:none}.headerSection .headerSection__mainMenu__closeBtn{display:none}.headerSection .headerSection__languageAndCurrencyMenu__openBtn{cursor:pointer}.headerSection .mainNavigation{background-color:{{settings.headerBgColor}};border-radius:5px;box-shadow:0 10px 30px 10px rgba(0,0,0,0.12)}.headerSection .mainNavigation ul{margin:0;padding:0;list-style:none}.headerSection .headerSection__navigation{position:absolute}.headerSection .headerSection__mainMenu__navLinks{text-transform:uppercase;font-size:14px;position:relative;padding:10px 0 0}.headerSection .headerSection__mainMenu__navLinks .mainMenu__navLink{margin-right:30px}.headerSection .headerSection__mainMenu__navLinks .mainMenu__navLink a{text-decoration:none;color:{{settings.headerFontColor}};position:relative;bottom:-3px}.headerSection .headerSection__mainMenu__navLinks .mainMenu__navLink a:visited,.headerSection .headerSection__mainMenu__navLinks .mainMenu__navLink a:focus,.headerSection .headerSection__mainMenu__navLinks .mainMenu__navLink a:active{color:{{settings.headerFontColor}}}.headerSection .headerSection__mainMenu__navLinks .header__icon.header__icon--arrowDown{margin-left:-5px}.headerSection .headerSection__iconsMenu{font-size:14px;padding-top:3px;position:absolute;bottom:-37px;right:0;z-index:1}.headerSection .headerSection__iconsMenu .mobileMenuIcon{display:none}.headerSection .headerSection__iconsMenu .activeCart .header__icon{color:{{settings.linkFontColor}};fill:{{settings.linkFontColor}}}.headerSection .headerSection__iconsMenu .header__icon{margin-bottom:8px}.headerSection .headerSection__iconsMenu .headerSection__iconsMenuItem{margin-left:23px}.headerSection .headerSection__iconsMenu .iconsMenuItem__text{display:none}.headerSection .headerSection__iconsMenu .iconsMenuItem__text i{font-style:normal}.headerSection .headerSection__iconsMenu .header__cart .iconsMenuItem__text{display:inline-block}.headerSection .headerSection__searchForm{position:absolute;top:100px;background-color:{{settings.headerBgColor}};left:0;right:0;width:100%;display:none;padding:30px 15px;margin:0;overflow:hidden;box-sizing:border-box;text-align:center;box-shadow:0 5px 5px 0 rgba(9,9,9,0.2)}.headerSection .headerSection__searchForm__searchButtonMobile{display:none}.headerSection .headerSection__searchForm__phrase{max-width:436px;width:100%;height:36px;padding:0 0 11px;box-sizing:border-box;border-bottom:1px solid {{settings.linkFontColor}};color:{{settings.headerFontColor}};background-color:transparent}.headerSection .headerSection__searchForm__btn{position:absolute;top:30px;width:36px;height:36px;background-color:rgba(255,255,255,0.25);outline:none;border:none;display:none}.headerSection .headerSection__searchForm__btn svg{width:16px;height:16px;top:2px}.headerSection .searchForm__searchAutocomplete{background-color:{{settings.headerBgColor}};display:block;margin:0 auto;padding:20px 0;top:45px;position:relative;box-sizing:border-box;box-shadow:0 5px 5px 0 rgba(9,9,9,0.2)}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product{color:{{settings.headerFontColor}};display:flex;margin:0 auto;max-width:436px;width:100%;border-bottom:1px solid #f2f2f2;padding:15px 0;font-size:12px}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product:last-child{border-bottom:none}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product__img{width:50px;height:60px;margin-right:15px}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product__img img{width:100%;height:auto}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product__names{width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product__price{color:{{settings.secondaryFontColor}};margin-top:5px;font-weight:300}.headerSection .headerSection__shopData{font-size:12px;position:absolute;top:-40px;right:0}.headerSection .headerSection__shopData .svgIcon{height:13px;width:13px;fill:{{settings.dropdownArrowColor}};margin:0 5px -2px 25px}.headerSection .headerSection__shopData .svgIcon.svgIcon--envelope{margin-bottom:-3px}.headerSection .headerSection__languageAndCurrencyMenu{position:absolute;box-sizing:border-box;width:225px;background-color:{{settings.headerBgColor}};border-radius:5px;top:32px;right:0;box-shadow:0 10px 30px 10px rgba(0,0,0,0.12);text-transform:uppercase;z-index:2}.headerSection .headerSection__languageAndCurrencyMenu .languageAndCurrencyMenu__container{display:flex;flex-wrap:wrap;width:100%;padding:20px 20px 10px;box-sizing:border-box}.headerSection .headerSection__languageAndCurrencyMenu .languageAndCurrencyMenu__container>div{width:50%}.headerSection .headerSection__languageAndCurrencyMenu .checkBoxes__container input:checked+label .checkBoxes__checkIcon{top:9px}.headerSection .headerSection__languageAndCurrencyMenu .checkBoxes__container input+label:before{top:48%}.headerSection .headerSection__languageAndCurrencyMenu .languageAndCurrencyMenu__btn{width:100%;display:inline-block;padding:15px 0 13px;font-size:14px;font-weight:500;text-align:center;border-top:1px solid {{settings.borderColor}};color:{{settings.linkFontColor}};cursor:pointer}.headerSection .headerSection__languageAndCurrencyMenu .languageAndCurrencyMenu__title{color:{{settings.breadcrumbsFontColor}};font-weight:500;display:inline-block;padding-left:12px;width:100%;margin:10px 0 5px;opacity:.5}.headerSection .checkBoxes__container input+label{color:{{settings.headerFontColor}}}.headerSection .banner__size{color:{{settings.headerBgColor}};text-align:center}.headerSection .customerLogin__mobileButton{display:none}@media screen and (min-width: 1601px){.headerSection.headerSection__bg>.headerSection__row{padding:29px 0}}
Jest to konieczne, ponieważ zmian w nagłówku było zbyt wiele, by wyszukiwać i zmieniać pojedyncze elementy. Podobnie należy zrobić z kodem nagłówka. Otwórz katalog elements -> header a następnie otwórz znajdujący się w nim plik header-1.html, usuń jego zawartość i wklej następujący kod:{% assign categories = page.GroupNodes %} {% assign lngCount = config.Languages | Size -%} {% assign currentLang = config.Languages[page.LanguageId] -%}
{{ translations.Hea_Menu }} {% assign logoAlt = config.Shop.Name | H -%} {{config.Shop.ImageUrl | Img: '', logoAlt}}{{ translations.Com_Search }} {% if usr.Authenticated -%} {% else -%} {{ translations.Log_Login }} {% endif -%}{{ translations.Hea_Menu }} {% if header.Nodes[0] -%} {{ translations.Com_Categories }} {% endif -%} {{ translations.Hea_Pages }} {{ config.DefinedPages.Contact | A }} {% for banner in config.Banners -%} {% assign imagesQuantity = banner.Images | Size -%} {% if banner.Name == 'lookbook' and imagesQuantity == 0 -%} {% assign fakeLookbook = true -%} {% endif -%} {% endfor -%} {% assign lookbooksQuantity = config.Lookbook.List | Size -%} {% if lookbooksQuantity > 1 -%} {{ translations.Lookbook }} {% elseif lookbooksQuantity == 1 or fakeLookbook -%} {{ config.DefinedPages.Lookbook | A }} {% endif -%}{% if config.Shop.Contact.PhoneNo != '' -%} {{config.Shop.Contact.PhoneNo}} {% endif -%} {% if config.Shop.Contact.Email != '' -%} {{ config.Shop.Contact.Email }} {% endif -%} {{ config.Languages[page.LanguageId].Language }} / {{ customer.Currency }}{% if usr.Authenticated == false -%} {{translations.Com_Login}} / {{translations.Registration}} {% endif -%}{{ translations.Prf_Language }} {% for language in config.Languages -%} {% endfor -%}{{ translations.Com_Currency }} {% for currency in config.Currencies -%} {% endfor -%}pageHeader.on('click', '.closeSearchButton > svg', function() { $('.pageHeader-js .headerSearchForm-js').toggle(200); }); pageHeader.on('input', '.searchFormPhrase-js', function() { if($(this).val().length > 0) { $('.headerSection__searchForm__searchButtonMobile').removeClass('hidden'); } else { $('.headerSection__searchForm__searchButtonMobile').addClass('hidden'); } });
Jeśli posiadasz nagłówek w wersji 2: Otwórz katalog css a w nim plik layout-m.css. W nim znajduje się bardzo długa linia, w której treści pojawia się fraza headerSection. Usuń całą tę linię i wklej w jej miejsce poniższy kod:@media only screen and (max-width: 768px){.headerSection{height:60px}.headerSection .header__icon svg{width:15px;height:15px}.headerSection .mainMenu__navLink{position:relative}.headerSection .mainMenu__navLink.header__icon svg{top:16px;right:2px;position:absolute}.headerSection .headerSection__logo img,.headerSection .headerSection__logo svg,.headerSection .headerSection__logo{min-height:30px;height:30px}.headerSection.headerSection__bg>.headerSection__row{height:110px;padding:15px 20px}.headerSection .mainNavigation__image,.headerSection .headerSection__mainMenu.headerSection__row,.headerSection .headerSection__searchForm{display:none}.headerSection .headerSection__mainMenu{position:fixed;top:0;bottom:56px;overflow:auto;z-index:1;left:0;right:0;background-color:{{settings.headerBgColor}};color:{{settings.headerFontColor}}}.headerSection .headerSection__mainMenu .headerSection__mainMenu__closeBtn{display:block;text-align:left;position:relative;padding:15px;width:50px;box-sizing:border-box;left:-15px;color:{{settings.linkFontColor}};fill:{{settings.linkFontColor}};cursor:pointer}.headerSection .headerSection__mainMenu .headerSection__navigation{position:relative}.headerSection .headerSection__mainMenu .mainNavigation{box-shadow:none}.headerSection .headerSection__mainMenu .mainNavigation ul{text-transform:none}.headerSection .headerSection__mainMenu .mainNavigation ul ul{display:none}.headerSection .headerSection__mainMenu .mainNavigation.mainNavigation__sites li,.headerSection .headerSection__mainMenu .mainNavigation ul .mainNavigation__category,.headerSection .headerSection__mainMenu .mainNavigation ul .mainNavigation__undercategory{font-size:12px;padding:10px 0;display:inline-block;width:100%;border-bottom:1px solid {{settings.borderColor}}}.headerSection .headerSection__mainMenu .mainNavigation.mainNavigation__sites li a,.headerSection .headerSection__mainMenu .mainNavigation ul .mainNavigation__category a,.headerSection .headerSection__mainMenu .mainNavigation ul .mainNavigation__undercategory a{color:{{settings.headerFontColor}};text-decoration:none;display:inline-block;padding:5px 0;width:calc(100% - 20px)}.headerSection .headerSection__mainMenu .headerSection__mainMenu__navLinks{display:flex;flex-direction:column;padding:10px 20px 40px}.headerSection .headerSection__mainMenu .mainMenu__navLink{padding:15px 0;border-bottom:1px solid {{settings.borderColor}};width:100%;text-align:left}.headerSection .headerSection__mainMenu .mainMenu__navLink a{display:inline-block;width:100%}.headerSection .headerSection__mainMenu .mainNavigation__categories__noChilds{display:block !important}.headerSection .headerSection__row{flex-direction:row}.headerSection .headerSection__iconsMenu .hideOnMobile{display:none !important}.headerSection .headerSection__iconsMenu .mobileMenuIcon,.headerSection .headerSection__iconsMenu .mobileSearchIcon{display:inline-block}.headerSection .headerSection__iconsMenu .header__cart .iconsMenuItem__text,.headerSection .headerSection__iconsMenu .iconsMenuItem__text{display:block;margin-top:5px}.headerSection .headerSection__iconsMenu .headerSection__iconsMenuItem{margin-left:0}.headerSection .headerSection__iconsMenu{display:flex;flex-direction:row;justify-content:space-between;margin-top:-9px;font-size:10px}.headerSection .headerSection__searchForm{position:fixed;top:0;padding-top:25px;left:0;right:0;width:100%;max-width:100%;bottom:0;overflow:auto;height:auto;background-color:{{settings.primaryPageBgColor}};z-index:1}.headerSection .headerSection__searchForm .closeSearchButton{display:block;margin-bottom:25px;margin-left:20px}.headerSection .headerSection__searchForm .closeSearchButton:hover{cursor:pointer}.headerSection .headerSection__searchForm .closeSearchButton svg{width:18px;height:18px;fill:{{settings.linkFontColor}}}.headerSection .headerSection__searchForm__btn{display:none;background-color:{{settings.linkFontColor}};color:#fff;fill:#fff;position:relative;right:5px;top:-1px}.headerSection .headerSection__searchForm__searchButtonMobile{display:block;position:fixed;left:0;bottom:100px;width:calc(100% - 38px);height:48px;margin-left:20px;margin-right:20px;background-color:{{settings.primaryBtnBgColor}};border:1px solid {{settings.primaryBtnBorderColor}};color:{{settings.primaryBtnFontColor}};transition:200ms;text-transform:uppercase;font-size:14px;line-height:24px;font-weight:400;font-family:{{settings.fontFamily}}}.headerSection .headerSection__searchForm__searchButtonMobile:hover{background-color:{{settings.primaryBtnHoverBgColor}};color:{{settings.primaryBtnHoverFontColor}};border-color:{{settings.primaryBtnHoverBorderColor}}}.headerSection .headerSection__searchForm__phrase{margin:10px 20px 10px 20px;width:calc(100% - 40px);max-width:calc(100% - 40px);border-left:none;border-right:none;border-top:none;padding-bottom:14px;border-bottom:1px solid {{settings.primaryFontColor}}}.headerSection .headerSection__shopData{font-size:14px;top:-23px;left:-5px}.headerSection .headerSection__languageAndCurrencyMenu{position:relative;box-shadow:none;top:0;width:calc(100% - 20px);left:-5px}.headerSection .headerSection__searchForm__phrase{background-color:rgba(255,255,255,0.4);color:{{settings.secondaryFontColor}}}.headerSection .headerSection__searchForm__phrase::placeholder{color:{{settings.secondaryFontColor}}}.headerSection .searchForm__searchAutocomplete{position:fixed;display:block;top:110px;left:0;width:100%}.headerSection .customerLogin__mobileButton{display:block;position:relative;margin:20px 40px 40px}.headerSection .customerLogin__mobileButton svg{fill:{{settings.primaryBtnFontColor}};margin:0 5px -4px}}@media only screen and (max-width: 360px){.headerSection.headerSection__bg>.headerSection__row{padding:15px}.headerSection .headerSection__mainMenu .headerSection__mainMenu__navLinks{padding:10px 20px 40px}.headerSection .headerSection__shopData{left:0}}
W tym samym katalogu otwórz plik layout.css. Znajdź cały blok kodu, w którym występują frazy headerSection. Usuń go i wklej w jego miejsce następujący kod:.headerSection{color:{{settings.headerFontColor}};background-color:{{settings.headerBgColor}};width:100%;height:150px;box-sizing:border-box;position:relative;z-index:13}.headerSection .activeButton-js{color:{{settings.dropdownArrowColor}} !important}.headerSection.headerSection__bg>.headerSection__row{display:flex;width:100%;height:150px;padding:29px 3% 29px 3%;box-sizing:border-box;flex-direction:column;justify-content:space-between}.headerSection .headerSection__logo{height:36px;width:auto;text-align:center;overflow:hidden}.headerSection .headerSection__logo img,.headerSection .headerSection__logo svg{height:36px;width:auto}.headerSection .header__icon{display:inline-block;color:{{settings.headerFontColor}};fill:{{settings.headerFontColor}};text-decoration:none;vertical-align:middle;text-align:center;cursor:pointer}.headerSection .header__icon svg{width:20px;position:relative;height:18px;top:5px}.headerSection .header__icon--arrowDown{transform:rotate(90deg);fill:{{settings.dropdownArrowColor}}}.headerSection .headerSection__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;position:relative}.headerSection .headerSection__languageAndCurrencyMenu,.headerSection .headerSection__shopData>span:nth-child(1),.headerSection .headerSection__shopData>span:nth-child(2),.headerSection .mainNavigation{display:none}.headerSection .headerSection__languageAndCurrencyMenu__openBtn{cursor:pointer}.headerSection .mainNavigation{background-color:{{settings.headerBgColor}};border-radius:5px;box-shadow:0 10px 30px 10px rgba(0,0,0,0.12)}.headerSection .mainNavigation ul{margin:0;padding:0;list-style:none}.headerSection .headerSection__navigation{position:absolute}.headerSection .headerSection__mainMenu__navLinks{text-transform:uppercase;font-size:14px;position:relative}.headerSection .headerSection__mainMenu__navLinks .mainMenu__navLink{margin-right:30px}.headerSection .headerSection__mainMenu__navLinks .mainMenu__navLink a{text-decoration:none;color:{{settings.headerFontColor}};position:relative;bottom:-3px}.headerSection .headerSection__mainMenu__navLinks .mainMenu__navLink a:visited,.headerSection .headerSection__mainMenu__navLinks .mainMenu__navLink a:focus,.headerSection .headerSection__mainMenu__navLinks .mainMenu__navLink a:active{color:{{settings.headerFontColor}}}.headerSection .headerSection__mainMenu__navLinks .header__icon.header__icon--arrowDown{margin-left:-5px}.headerSection .headerSection__mainMenu__closeBtn{display:none}.headerSection .headerSection__iconsMenu{font-size:14px;padding-top:3px}.headerSection .headerSection__iconsMenu .mobileMenuIcon,.headerSection .headerSection__iconsMenu .mobileSearchIcon{display:none}.headerSection .headerSection__iconsMenu .activeCart .header__icon{color:{{settings.linkFontColor}};fill:{{settings.linkFontColor}}}.headerSection .headerSection__iconsMenu .header__icon{margin-bottom:8px}.headerSection .headerSection__iconsMenu .headerSection__iconsMenuItem{margin-left:23px}.headerSection .headerSection__iconsMenu .iconsMenuItem__text{display:none}.headerSection .headerSection__iconsMenu .header__cart .iconsMenuItem__text{display:inline-block}.headerSection .headerSection__searchForm{height:36px;position:relative;box-sizing:border-box;width:30%;max-width:420px}.headerSection .headerSection__searchForm__searchButtonMobile,.headerSection .headerSection__searchForm .closeSearchButton{display:none}.headerSection .headerSection__searchForm__phrase{max-width:420px;width:100%;height:36px;padding:12px 10px 11px;box-sizing:border-box;border:1px solid {{settings.borderColor}};color:{{settings.headerFontColor}};background-color:rgba(255,255,255,0.25)}.headerSection .headerSection__searchForm__phrase::placeholder{color:{{settings.headerFontColor}};opacity:.7}.headerSection .headerSection__searchForm__btn{position:absolute;top:0;right:-35px;width:36px;height:36px;background-color:rgba(255,255,255,0.25);outline:none;border:1px solid {{settings.borderColor}}}.headerSection .headerSection__searchForm__btn svg{width:16px;height:16px;top:2px}.headerSection .searchForm__searchAutocomplete{display:block;margin:0 auto;padding:20px 0;top:45px;z-index:9;width:100%;position:absolute;box-sizing:border-box}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product{color:{{settings.headerFontColor}};display:flex;width:80%;max-width:500px;margin:0 auto;padding:15px 20px;background-color:{{settings.headerBgColor}};border-bottom:1px solid #f2f2f2;box-shadow:0 5px 5px 0 rgba(9,9,9,0.2);font-size:12px}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product:last-child{border-bottom:none}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product__img{width:50px;height:60px;margin-right:15px}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product__img img{width:100%;height:auto}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product__names{width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.headerSection .searchForm__searchAutocomplete .searchAutocomplete__product__price{color:{{settings.secondaryFontColor}};margin-top:5px;font-weight:300}.headerSection .headerSection__shopData{font-size:12px;top:7px;position:relative;color:{{settings.headerFontColor}}}.headerSection .headerSection__shopData .svgIcon{height:13px;width:13px;fill:{{settings.dropdownArrowColor}};margin:0 5px -2px 25px}.headerSection .headerSection__shopData .svgIcon.svgIcon--envelope{margin-bottom:-3px}.headerSection .headerSection__languageAndCurrencyMenu{position:absolute;box-sizing:border-box;width:225px;background-color:{{settings.headerBgColor}};border-radius:5px;top:32px;right:0;box-shadow:0 10px 30px 10px rgba(0,0,0,0.12);text-transform:uppercase}.headerSection .headerSection__languageAndCurrencyMenu .languageAndCurrencyMenu__container{display:flex;flex-wrap:wrap;width:100%;padding:20px 20px 10px;box-sizing:border-box}.headerSection .headerSection__languageAndCurrencyMenu .languageAndCurrencyMenu__container>div{width:50%}.headerSection .headerSection__languageAndCurrencyMenu .checkBoxes__container input:checked+label .checkBoxes__checkIcon{top:9px}.headerSection .headerSection__languageAndCurrencyMenu .checkBoxes__container input+label:before{top:48%}.headerSection .headerSection__languageAndCurrencyMenu .languageAndCurrencyMenu__btn{width:100%;display:inline-block;padding:15px 0 13px;font-size:14px;font-weight:500;text-align:center;border-top:1px solid {{settings.borderColor}};color:{{settings.linkFontColor}};cursor:pointer}.headerSection .headerSection__languageAndCurrencyMenu .languageAndCurrencyMenu__title{color:{{settings.headerFontColor}};font-weight:500;display:inline-block;padding-left:12px;width:100%;opacity:.5;margin:10px 0 5px}@media screen and (min-width: 768px){.headerSection .headerSection__navigation{top:32px;left:-5px}.headerSection .mainNavigation__sites{padding:30px;left:100px;position:absolute;top:0;min-width:155px;box-sizing:border-box}.headerSection .mainNavigation__sites li>a{text-transform:none;color:{{settings.headerFontColor}};font-weight:300;font-size:12px;box-sizing:border-box;text-decoration:none;margin-bottom:15px;display:inline-block;width:100%}.headerSection .mainNavigation__sites li>a:hover{color:{{settings.headerFontColor}};font-weight:400}.headerSection .mainNavigation__sites li>a:hover span{border-bottom:1px solid {{settings.linkFontColor}}}.headerSection .mainNavigation__sites li>a span{border-bottom:1px solid {{settings.headerBgColor}};padding:5px 0;display:inline-block}.headerSection .mainNavigation__sites li:last-child a{margin-bottom:0}.headerSection .mainNavigation__lookbooks{padding:30px;left:315px;position:absolute;top:0;min-width:155px;box-sizing:border-box}.headerSection .mainNavigation__lookbooks li>a{text-transform:none;color:{{settings.headerFontColor}};font-weight:300;font-size:12px;box-sizing:border-box;text-decoration:none;margin-bottom:15px;display:inline-block;width:100%}.headerSection .mainNavigation__lookbooks li>a:hover{color:{{settings.headerFontColor}};font-weight:400}.headerSection .mainNavigation__lookbooks li>a:hover span{border-bottom:1px solid {{settings.linkFontColor}}}.headerSection .mainNavigation__lookbooks li>a span{border-bottom:1px solid {{settings.headerBgColor}};padding:5px 0;display:inline-block;white-space:nowrap}.headerSection .mainNavigation__lookbooks li:last-child a{margin-bottom:0}.headerSection .mainNavigation__links{min-width:468px;max-width:1265px;padding:35px;left:0;position:absolute;top:0}.headerSection .mainNavigation__links .mainNavigation__categories{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.headerSection .mainNavigation__links .mainNavigation__categories .mainNavigation__categories__noChilds{display:flex;flex-direction:column}.headerSection .mainNavigation__links .mainNavigation__categories>ul{width:100%;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.headerSection .mainNavigation__links .mainNavigation__categories>ul>li{margin-bottom:20px;width:220px;flex-grow:1}.headerSection .mainNavigation__links .mainNavigation__image{height:295px;width:220px;min-width:220px;overflow:hidden}.headerSection .mainNavigation__links .mainNavigation__image img{width:220px;height:auto}.headerSection .mainNavigation__links .mainNavigation__image img[alt]{display:block;text-transform:none;box-sizing:border-box}.headerSection .mainNavigation__links .mainNavigation__category a,.headerSection .mainNavigation__links .mainNavigation__undercategory a{box-sizing:border-box;text-decoration:none}.headerSection .mainNavigation__links .mainNavigation__category,.headerSection .mainNavigation__links .mainNavigation__undercategory{display:inline-block;width:80%}.headerSection .mainNavigation__links .mainNavigation__category .header__icon,.headerSection .mainNavigation__links .mainNavigation__undercategory .header__icon{display:none}.headerSection .mainNavigation__links .mainNavigation__category{margin-bottom:25px;max-width:80%}.headerSection .mainNavigation__links .mainNavigation__undercategory{margin-bottom:15px}.headerSection .mainNavigation__links .mainNavigation__undercategory a{text-transform:none;color:{{settings.headerFontColor}};width:100%;font-weight:300;font-size:12px;display:inline-block}.headerSection .mainNavigation__links .mainNavigation__undercategory a span{border-bottom:1px solid {{settings.headerBgColor}};display:inline-block;padding:5px 0}.headerSection .mainNavigation__links .mainNavigation__undercategory a:hover{color:{{settings.headerFontColor}};font-weight:400}.headerSection .mainNavigation__links .mainNavigation__undercategory a:hover span{border-bottom:1px solid {{settings.linkFontColor}}}.headerSection .mainNavigation__links .mainNavigation__category a{color:{{settings.headerFontColor}};font-size:12px;font-weight:500;width:100%;display:inline-block}}.headerSection .checkBoxes__container input+label{color:{{settings.headerFontColor}}}.headerSection .banner__size{color:{{settings.headerBgColor}};text-align:center}.headerSection .customerLogin__mobileButton{display:none}@media screen and (max-width: 949px){.headerSection .headerSection__shopData span.headerSection__languageAndCurrencyMenu__openBtn{display:inline-block}}@media screen and (min-width: 1601px){.headerSection.headerSection__bg>.headerSection__row{padding:29px 0}}
Jest to konieczne, ponieważ zmian w nagłówku było zbyt wiele, by wyszukiwać i zmieniać pojedyncze elementy. Podobnie należy zrobić z kodem nagłówka. Otwórz katalog elements -> header a następnie otwórz znajdujący się w nim plik header-2.html, usuń jego zawartość i wklej następujący kod:{% assign categories = page.GroupNodes %} {% assign lngCount = config.Languages | Size -%} {% assign currentLang = config.Languages[page.LanguageId] -%}
{% assign logoAlt = config.Shop.Name | H -%} {{config.Shop.ImageUrl | Img: '', logoAlt}}{% else -%} {% endif -%} {{ translations.Com_Search }}{% if usr.Authenticated -%}{% if header.Nodes[0] -%} {{ translations.Com_Categories }} {% endif -%} {{ translations.Hea_Pages }} {{ config.DefinedPages.Contact | A }} {% for banner in config.Banners -%} {% assign imagesQuantity = banner.Images | Size -%} {% if banner.Name == 'lookbook' and imagesQuantity == 0 -%} {% assign fakeLookbook = true -%} {% endif -%} {% endfor -%} {% assign lookbooksQuantity = config.Lookbook.List | Size -%} {% if lookbooksQuantity > 1 -%} {{ translations.Lookbook }} {% elseif lookbooksQuantity == 1 or fakeLookbook -%} {{ config.DefinedPages.Lookbook | A }} {% endif -%}{% if config.Shop.Contact.PhoneNo != '' -%} {{config.Shop.Contact.PhoneNo}} {% endif -%} {% if config.Shop.Contact.Email != '' -%} {{ config.Shop.Contact.Email }} {% endif -%} {{ config.Languages[page.LanguageId].Language }} / {{ customer.Currency }}{{ translations.Prf_Language }} {% for language in config.Languages -%} {% endfor -%}{{ translations.Com_Currency }} {% for currency in config.Currencies -%} {% endfor -%}pageHeader.on('click', '.closeSearchButton > svg', function() { $('.pageHeader-js .headerSearchForm-js').toggle(200); }); pageHeader.on('input', '.searchFormPhrase-js', function() { if($(this).val().length > 0) { $('.headerSection__searchForm__searchButtonMobile').removeClass('hidden'); } else { $('.headerSection__searchForm__searchButtonMobile').addClass('hidden'); } });
W tym samym pliku wyszukaj linię z frazą $('.go-to-top__btn-js').click(function(){. Tuż pod nią wklej ten kod:$('html, body, .headerMainMenu-js').animate({scrollTop : 0}, 800);
Zmiany w zakresie wymagalności adresu e-mail do kuponu rabatowego w szablonie Topaz
Zmiany w zakresie wymagalności adresu e-mail do kuponu rabatowego w szablonie Topaz
Z tego artykułu dowiesz się, jak wprowadzić zmiany w zakresie wymagalności adresu e-mail do kuponu rabatowego w Twoim szablonie Topaz. Dzięki wprowadzonym zmianom, adres e-mail będzie wymagany tylko dla kuponów subsksrybentów.WskazówkaUWAGA! Do poprawnego działania wszystkich funkcji wymagana jest wersja sklepu 2020.2 lub nowsza!WskazówkaPodczas kopiowania fraz do wyszukania z niniejszego artykułu, mogą wystąpić problemy ze znakami -, _, ', ". Jeśli nie jesteś w stanie odnaleźć poszczególnych fraz w kodzie, spróbuj przepisać te znaki ręcznie, lub zamiast kopiować frazy do wyszukania z artykułu, przepisać je.WskazówkaW tym artykule trzeba będzie wprowadzać zmiany w plikach js i css. Z tego artykułu dowiesz się jak je minifikować1. Przejdź do katalogu staticElements -> cart i otwórz plik cart.html. Wyszukaj w nim frazę js-close-coupon. Cała znaleziona linia powinna wyglądać w ten sposób:var emailInput = $('.cart__input-email'); if(result.action.Code == "107" && emailInput.hasClass('hidden')) { var msg =__translations.DiscountEmail; app.showTemporaryPopup(msg, 'error'); emailInput.removeClass('hidden'); return; }
W celu upewnienia się, sprawdź, czy następna linia po wstawionym przez Ciebie kodzie wygląda następująco: if (result.action.Result) {. 3. Otwórz plik base_layout.html znajdujący się w głównym katalogu z plikami szablonu Topaz. Wyszukaj frazę __translations. Pod znalezioną linią wstaw następujący fragment kodu:DiscountEmail: "{{translations.DiscountEmail}}",
4. Ostatnim krokiem jest dodanie jednego tłumaczenia. W tym celu otwórz Panel Administracyjny, a następnie Wygląd sklepu -> Ustawienia -> Tłumaczenia. Kliknij przycisk z napisem Dodaj. W polu Id wprowadź DiscountEmail a w polu tekst Dla wybranego kuponu wymagane jest podanie e-mail. Zatwierdź przyciskiem Dodaj. W ten sposób zmodyfikowałeś swój szablon Topaz pod względem zmian w zakresie wymagalności adresu e-mail do kuponu rabatowego. Pamiętaj, że aby powyższe zmiany działały poprawnie, wymagany jest sklep w wersji 2020.2 i nowszej!Nowy sposób prezentacji rabatów w profilu klienta w szablonie Szafir
Nowy sposób prezentacji rabatów w profilu klienta w szablonie Szafir
W tym artykule dowiesz się, jak zmodyfikować szablon Szafir, aby obsługiwał nowy sposób prezentacji rabatów w profilu klienta.WskazówkaDo poprawnego działania potrzebujesz sklepu w wersji 2020.2 lub nowszej!WskazówkaKopiowanie fraz, które należy wyszukać w kodzie, może powodować problemy. Frazy do wyszukania najlepiej przepisać ręcznie, lub skopiować, ale po skopiowaniu podmienić znaki typu - _ ' " itp. W przeciwnym wypadku, fraza może nie zostać odnaleziona w kodzie!WskazówkaW tym artykule trzeba będzie wprowadzać zmiany w plikach js i css. Z tego artykułu dowiesz się jak je minifikować1. Otwórz plik common -> navigation-bars -> main-navigation-bar-partial.html. W pliku tym wyszukaj frazę {% if usr.Authenticated == true -%}. Trzy linie poniżej, powinna znajdować się linia zaczynająca się od <a href. Podmień tę linię na następującą:{% elseif page.QueryString contains 'tab=discounts' -%} {% assign pageQueryName = customer-profile.DiscountsERP.PageQueryGET -%} {% assign paginationPageCount = customer-profile.DiscountsERP.PageCount -%} {% assign paginationPageNo = customer-profile.DiscountsERP.PageNo -%} {% assign template = 'customer-profile/discounts/discounts-list.html' -%} {% assign templateContainer = '.discounts-list-lq' -%} {% assign tab = 'discounts' -%} {% elseif page.QueryString contains 'tab=discount-details' -%} {% assign pageQueryName = customer-profile.DiscountDetPageQueryGET -%} {% assign paginationPageCount = customer-profile.DiscountERPDetails.PageCount -%} {% assign paginationPageNo = customer-profile.DiscountERPDetails.PageNo -%} {% assign template = 'customer-profile/discounts/discount-elements.html' -%} {% assign templateContainer = '.discount-elements-lq' -%} {% assign tab = 'discount-details' -%} {% assign id = customer-profile.DiscountERPDetails.Id -%} {% assign discountString = customer-profile.DiscountQueryGET -%}
3. Otwórz katalog customer-profile -> discounts. W nim otwórz plik discounts.html. Usuń jego treść, i wklej następujący kod:{% include 'customer-profile/menu.html' -%}
{{translations.DiscountsInfo}}
{% include 'customer-profile/discounts/discounts-list.html' -%}4. W tym samym katalogu utwórz plik discount-details.html. Wklej do niego następujący kod:{% include 'common/date-format.html' -%} {% assign discount = customer-profile.DiscountERPDetails -%} {% assign pageQueryName = customer-profile.DiscountsERP.PageQueryGET -%} {% assign queries = page.QueryString | Split: '&' -%} {% for query in queries -%} {% if query contains 'page=' -%} {% assign pageQueryNo = query | Split: '=' | Last -%} {% break -%} {% else -%} {% assign pageQueryNo = 1 -%} {% endif -%} {% endfor -%} {% if discount.Description != '' and discount.Description != null -%}
5. W tym samym katalogu utwórz plik discount-elements.html i wklej do niego następujący kod: {% endif -%} {% if discount.Thresholds -%} {% for threshold in discount.Thresholds -%}{{translations.Threshold}}: {% if threshold.ThresholdType == 1 -%} {{threshold.Threshold | ToPrice}} {{threshold.ThresholdSymbol}} {% else -%} {{threshold.Threshold}} {% endif -%}{{translations.QuantityThreshold}}: {{threshold.ThresholdMinPositionsCount}}{% include 'customer-profile/discounts/discount-elements.html' with threshold -%}{% endfor -%} {% else -%}{% include 'customer-profile/discounts/discount-elements.html' with discount -%}{% endif -%}{% assign discount = customer-profile.DiscountERPDetails -%} {% if include -%} {% assign elementsParent = include -%} {% else -%} {% assign elementsParent = discount -%} {% endif -%}
6. W tym samym katalogu utwórz plik discounts-list.html i wklej do niego następujący kod:{% assign anyGroup = false -%} {% assign anyProduct = false -%} {% assign anyThreshold = false -%} {% assign anyBundleThreshold = false -%} {% assign anyTotalPrice = false -%} {% assign anySubtotalPrice = false -%} {% for element in elementsParent.Elements -%} {% if element.Group != null -%} {% assign anyGroup = true -%} {% endif -%} {% if element.Product != null -%} {% assign anyProduct = true -%} {% endif -%} {% if element.Threshold != null and element.Threshold > 0 -%} {% assign anyThreshold = true -%} {% endif -%} {% if element.BundleThreshold != null and element.BundleThreshold > 0 -%} {% assign anyBundleThreshold = true -%} {% endif -%} {% if element.FixedPrice -%} {% if element.TotalPrice != null and element.TotalPrice > 0 -%} {% assign anyTotalPrice = true -%} {% endif -%} {% if element.SubtotalPrice != null and element.SubtotalPrice > 0 -%} {% assign anySubtotalPrice = true -%} {% endif -%} {% endif -%} {% endfor -%}{% assign paginationPageCount = discount.PageCount -%} {% if paginationPageCount > 1 -%}{% if anyGroup and anyProduct -%} {{translations.Product}}/{{translations.Category}} {% elseif anyGroup -%} {{translations.Category}} {% else -%} {{translations.Product}} {% endif -%}{% unless element.FixedPrice and anySubtotalPrice == false -%}{% if element.FixedPrice and anySubtotalPrice -%} {{translations.Price}} {{translations.Netto | Downcase }} {% else -%} {{translations.Discount}} {% endif -%}{% endunless -%} {% if anyThreshold or anyBundleThreshold or anyTotalPrice -%}{% if element.FixedPrice and anyTotalPrice -%} {{translations.Price}} {{translations.Brutto | Downcase}} {% elseif anyBundleThreshold -%} {{translations.BundleThreshold}} {% else -%} {{translations.Threshold}} {% endif -%}{% endif -%}{{ forloop.index }}{% if element.Group != null -%} {% if element.Group.Url -%} {% endif -%} {{ element.Group.Name }} {% if element.Group.Url -%} {% endif -%} {% else -%} {% if element.Product.Url -%} {% endif -%} {{ element.Product.NameNoHtml }} {% if element.Product.Url -%} {% endif -%} {% endif -%}{% unless element.FixedPrice and anySubtotalPrice == false -%}{% if element.FixedPrice -%} {% if element.SubtotalPrice > 0 -%} {{ translations.Price | Downcase }} {{ translations.Netto | Downcase }} {% endif -%} {% else -%} {{ translations.Discount | Downcase }} {% endif -%} {% if element.FixedPrice -%} {% if element.SubtotalPrice > 0 -%} {{ element.SubtotalPrice | ToPrice }} {% endif -%} {% else -%} {% if element.Type == 1 or element.Type == 3 or element.Type == 9 -%} {{ element.Value | ToPrice }} {% else -%} {{ element.Value | Normalize }} {% endif -%} {% endif -%} {{ element.ValueSymbol }}{% endunless -%} {% if anyThreshold or anyBundleThreshold or anyTotalPrice -%}{% if element.FixedPrice -%} {% if element.TotalPrice > 0 -%} {{ translations.Price | Downcase }} {{ translations.Brutto | Downcase }} {% endif -%} {% elseif element.BundleThreshold > 0 -%} {{ translations.BundleThreshold | Downcase }} {% elseif element.Threshold > 0 -%} {{ translations.Threshold | Downcase }} {% endif -%} {% if element.FixedPrice -%} {% if element.TotalPrice > 0 -%} {{ element.TotalPrice | ToPrice }} {% endif -%} {{ element.ValueSymbol }} {% elseif element.BundleThreshold > 0 -%} {% if element.Type == 1 or element.Type == 3 or element.Type == 9 -%} {{ element.BundleThreshold | ToPrice }} {% else -%} {{ element.BundleThreshold | Normalize }} {% endif -%} {{ element.BundleThresholdSymbol }} {% elseif element.Threshold > 0 -%} {% if element.Type == 1 or element.Type == 3 or element.Type == 9 -%} {{ element.Threshold | ToPrice }} {% else -%} {{ element.Threshold | Normalize }} {% endif -%} {{ element.ThresholdSymbol }} {% endif -%}{% endif -%}{% include 'common/pagination.html' -%}{% include 'common/date-format.html' -%} {% assign discountsERP = customer-profile.DiscountsERP -%} {% assign discountString = customer-profile.DiscountQueryGET | H -%} {% assign paginationPageNo = discountsERP.PageNo -%} {% if paginationPageNo == 1 -%} {% assign orderValuesSize = customer-profile.DiscountsEshop.OrderValue | Size -%} {% if orderValuesSize > 0 -%} {% assign anyDiscount = true -%} {% for orderValue in customer-profile.DiscountsEshop.OrderValue -%}
7. Następnie przejdź do katalogu customer-profile. Otwórz plik menu.html. Wyszukaj linię <ul class="category-column-ui customer-profile-menu-ui category-column-lq attached-lq customer-profile-menu-lq" data-container=".customer-profile-content-lq">. Linia pod spodem zaczyna się od <li class="load-erp-data-lq. Podmień ją na następującą:{{ orderValue.Discount | Normalize }} %{{ orderValue.ValueFrom }} {{ customer.Currency }} - {{ orderValue.ValueTo }} {{ customer.Currency }}{% if orderValue.DateTill -%} {{ translations.ValidTo | Downcase }}: {{ orderValue.DateTill | Date:dateFormat }} {% else -%} {{ translations.ValidLifetime | Downcase }} {% endif -%}{{ regular.Discount | Normalize }} %{{ translations.ForRegularCustomer }}{% if regular.DateTill -%} {{ translations.ValidTo | Downcase }}: {{ regular.DateTill | Date:dateFormat }} {% else -%} {{ translations.ValidLifetime | Downcase }} {% endif -%}{{ firstOrder.Discount | Normalize }} %{{ translations.ForNewCustomer }}{% if firstOrder.DateTill -%} {{ translations.ValidTo | Downcase }}: {{ firstOrder.DateTill | Date:dateFormat }} {% else -%} {{ translations.ValidLifetime | Downcase }} {% endif -%}{{ translations.Details }}{{ discount.Name }}{% if discount.DateTill -%} {% if discount.DateFrom -%}{{ translations.ValidFrom | Downcase }}: {{ discount.DateTill | Date:dateFormat }}{% endif -%} {{ translations.ValidTo | Downcase }}: {{ discount.DateTill | Date:dateFormat }} {% else -%} {{ translations.ValidLifetime | Downcase }} {% endif -%}function setProductNameMaxWidthInTable() { if($(window).width() > 1279) { function calculateProductNameMaxWidthInTable(parent) { if(parent){ var header = parent.find('.products-table-header-container-lq'); } else { var header = $('.products-table-header-container-lq'); } var headerWidth = header.width(); var nameWidth = headerWidth; function calculateNameWidth(className) { var elements = header.find(className); var size = elements.length; if (size == 1) { nameWidth -= elements.outerWidth(); } else if (size > 1) { elements.each(function () { nameWidth -= $(this).outerWidth(); }); } } calculateNameWidth('.remove-product-lq'); calculateNameWidth('.open-complaint-form-container-lq'); calculateNameWidth('.price-like-column-lq'); calculateNameWidth('.percent-column-lq'); calculateNameWidth('.amount-stepper-column-lq'); calculateNameWidth('.currency-column-lq'); calculateNameWidth('.options-column-lq'); calculateNameWidth('.number-column-lq'); if ($('.attributes-view-lq').index() != -1) { var freeSpaceWidth = headerWidth; function calculateFreeSpaceWidth(className) { var elements = header.find(className); var size = elements.length; if(className == '.attributes-view-lq' && size > 5){ size = 5; } if (size == 1) { freeSpaceWidth -= elements.outerWidth(); } else if (size > 1) { elements.each(function (i) { if(i < size){ freeSpaceWidth -= $(this).outerWidth(); } else { return false; } }); } } calculateFreeSpaceWidth('.remove-product-lq'); calculateFreeSpaceWidth('.open-complaint-form-container-lq'); calculateFreeSpaceWidth('.attributes-view-lq'); calculateFreeSpaceWidth('.arrow-lq'); calculateFreeSpaceWidth('.options-column-lq'); calculateFreeSpaceWidth('.name-column-lq'); if (nameWidth > freeSpaceWidth) { var difference = nameWidth - freeSpaceWidth; var amountStepperWidth = $('.amount-stepper-column-lq').outerWidth() + difference; $('.amount-stepper-column-ui').css('width', amountStepperWidth); nameWidth = freeSpaceWidth; } } if(parent){ parent.find('.name-and-code-lq').css('width', nameWidth); } else { $('.name-and-code-lq').css('width', nameWidth); } if ($('.choose-cart-table-view-lq').index() != -1) { nameWidth -= $('.choose-cart-table-view-lq').width(); } if(parent){ parent.find('.products-table-header-container-lq .name-and-code-lq').css('width', nameWidth); } else { $('.products-table-header-container-lq .name-and-code-lq').css('width', nameWidth); } }; if($('.discount-elements-table-lq').index() != -1){ $('.discount-elements-table-lq').each(function(){ calculateProductNameMaxWidthInTable($(this)); }); } else { calculateProductNameMaxWidthInTable() } } };
9. Otwórz plik scss -> globals -> _globals-m.scss. Wyszukaj frazę .position-attributes-set-form-lq{. Poniżej znajdują się dwie linie o treści }. Tuż pod nimi wklej poniższy kod:&.discount-element-ui{ height: 100px; .name-and-code-lq{ margin-top: 4px; } .price-like-column-ui{ left: 60px; text-align: left; .prices-ui{ left: 0; } } .value-ui{ position: absolute; left: 40px; font-size: 10px; top: 2px; } }
W tym samym katalogu otwórz plik _globals2.scss. Wyszukaj linię // Discounts in customer-profile. Poniżej znajduje się linia .discount-item-ui{. Tuż pod nią wklej poniższą linijkę:height: 72px;
Poniżej znajduje się linia .discount-value-ui{. Klika linii poniżej znajdziesz linię o treści vertical-align: middle;. Słowo middle zamień na top. Kolejne kilka linii poniżej znajduje się linia o treści .currency-ui{. Tuż nad nią wklej ten kod:&.clickable-ui{ cursor: pointer; }
10. Otwórz Panel administracyjny, a w nim zakładkę Wygląd sklepu -> Ustawienia -> Tłumaczenia. Nowe tłumaczenia dodaj poprzez kliknięcie przycisku Dodaj, wprowadzenie Id, Tekstu i zatwierdzenie przyciskiem Dodaj. Należy dodać następujące tłumaczenia (Id - Tekst): 1. Threshold - Próg 2. QuantityThreshold - Próg ilościowy 3. BundleThreshold - Próg pakietowyWskazówkaKopiując Id tłumaczeń upewnij się, że przed lub za danym Id nie znajduje się żadna spacja, inaczej tłumaczenie może nie zadziałać w sposób poprawny!WskazówkaPamiętaj, aby po wprowadzeniu zmian w plikach scss i js, wykonać odpowiednie komendy opisane w artykule o minifikacji, do którego link znajduje się na samej górze niniejszego artykułu. Przed wykonaniem odpowiedniej komendy dla plików js, usuń z katalogu js pliki: init-ui1.min.js, collection-points.min.js, init-ui2.min.js, init.min.js, sw.min.js. Po wykonaniu komendy możesz usunąć plik slick.min.min.js.Slajder producentów w szablonie Topaz
Slajder producentów w szablonie Topaz
W tym artykule dowiesz się jak zmodyfikować swój szablon, aby obsługiwał slajder producentów.WskazówkaW tym artykule trzeba będzie wprowadzać zmiany w plikach js i css. Z tego artykułu dowiesz się jak je minifikować.W Panelu Administracyjnym przejdź do zakładki Obiekty (Wygląd sklepu -> Ustawienia -> Więcej (prawy górny róg) -> Edytuj ustawienia zaawansowane -> Obiekty). Naciśnij przycisk Dodaj. W formularzu wybierz Menu producentów i marek, a jako nazwę ustaw manufacturer-brand. Teraz kliknij na nowo utworzony obiekt na liście. Po otwarciu ustawień obiektu, przejdź do zakładki Strony a następnie zaznacz Strona główna, Produkty i Szczegóły produktu, w zależności od tego na jakiej stronie ma być umiejscowiony slajder (istnieje możliwość wyświetlenia slajdera na wszystkich w.w. stronach). Zapisz poprzez kliknięcie przycisku Zapisz w prawym górnym rogu. W ten sposób będzie możliwe wyświetlanie logo producentów na stronie sklepu. Kolejnym krokiem jest dodanie na stronę sklepu podglądu slidera. Dostępne są dwa warianty. Pierwszy z nich wyświetla loga producentów w prosty sposób, a drugi wokół każdego logo dodaje cienką ramkę. W celu wykonania tej operacji, przejdź do plików sklepu, otwórz katalog elements a następnie utwórz w nim nowy katalog o nazwie manufacturer. W nowo utworzonym katalogu należy stworzyć pliki o nazwie manufacturer-1.html oraz manufacturer-2.html (w zależności czy chcemy wariant pierwszy, drugi czy obydwa). Następnie w pliku tym należy dodać poniższy kod:UwagaNa jednej stronie można dodać tylko jeden slider!Wariant zwykły:
{% if manufacturer-brand.Manufacturers -%} {% assign manufacturers = manufacturer-brand.Manufacturers -%} <div class="manufacturer1-slider"> {% for manufacturer in manufacturers -%} {% if manufacturer.ImageId > 0 -%} <div class="manufacturer1-slider__wrapper"> {% if manufacturer.Url != empty -%} <a aria-label="manufacturer" class="item" href="{{manufacturer.Url}}"> {% endif -%} <figure> {% if manufacturer.Heading != null -%} {% assign title = {{manufacturer.Heading | H}} -%} {% else -%} {% assign title = {{manufacturer.Name | H}} -%} {% endif -%} {{manufacturer | Img: "compact"}} </figure> {% if manufacturer.Url != empty -%} </a> {% endif -%} </div> {% endif -%} {% endfor -%} </div> {% endif -%}
Wariant z ramką wokół logo:
{% assign manufacturerSliderSize = manufacturer-brand.Manufacturers | Size -%} {% if manufacturer-brand.Manufacturers -%} {% assign manufacturers = manufacturer-brand.Manufacturers -%} <div class="manufacturer2-slider"> {% for manufacturer in manufacturers -%} {% if manufacturer.ImageId > 0 -%} <div class="manufacturer2-slider__wrapper"> <div class="slider2-element-border"> {% if manufacturer.Url != empty -%} <a class="item" href="{{manufacturer.Url}}"> {% endif -%} <figure> {% if manufacturer.Heading != null -%} {% assign title = {{manufacturer.Heading | H}} -%} {% else -%} {% assign title = {{manufacturer.Name | H}} -%} {% endif -%} {{manufacturer | Img: "compact"}} </figure> {% if manufacturer.Url != empty -%} </a> {% endif -%} </div> </div> {% endif -%} {% endfor -%} </div> {% endif -%}
- Strona główna -- home-page.html
- Lista produktów -- product-list.html
- Strona produktu -- product-page.html
Wariant zwykły:
{% include 'elements/manufacturer/manufacturer-1.html' with 'manufacturer-brand' -%}
Wariant z ramką wokół logo:
{% include 'elements/manufacturer/manufacturer-2.html' with 'manufacturer-brand' -%}
Kod ten należy umieścić w dowolnym miejscu pomiędzy linią {% block pageContent -%} a linią {% endblock -%}. Powyższa linia kodu odpowiada za położenie bloga na stronie głównej, dlatego jej umiejscowienie zależy od własnych preferencji. Następnie należy otworzyć katalog css a w nim plik layout.css. Na jego końcu wklejamy następujący kod:Wariant zwykły:
.manufacturer1-slider{margin:20px auto;background-color:{{settings.primaryPageBgColor}};height:auto}.manufacturer1-slider .slick-track{height:100%;display:flex;align-items:center;justify-content:center}.manufacturer1-slider__wrapper{width:100%;box-sizing:border-box;position:relative}.manufacturer1-slider__wrapper a{height:100px}.manufacturer1-slider__wrapper a figure{display:flex;align-items:center;justify-content:center}.manufacturer1-slider__wrapper a figure img{filter:grayscale(100%)}.manufacturer1-slider__wrapper a figure img:hover{filter:none}
Wariant z ramką wokół logo:
.manufacturer2-slider{margin:20px auto;background-color:{{settings.primaryPageBgColor}};height:auto}.manufacturer2-slider .slick-track{display:flex;align-items:center;justify-content:center}.manufacturer2-slider__wrapper{margin:0 25px;box-sizing:border-box}.manufacturer2-slider__wrapper .slider2-element-border{display:flex;align-items:center;border:1px #ebebeb solid;justify-content:center;height:150px}.manufacturer2-slider__wrapper a figure{display:flex;justify-content:center;box-sizing:content-box}.manufacturer2-slider__wrapper a figure img{filter:grayscale(100%);max-width: 150px;}.manufacturer2-slider__wrapper a figure img:hover{filter:none}
Po wykonaniu powyższych operacji, wracamy do głównego katalogu, otwieramy folder js a w nim plik layout1.js. Następujący kod należy wkleić na końcu pliku:Wariant zwykły:
$('.manufacturer1-slider').slick({ lazyLoad: 'progressive', infinite: true, slidesToShow: 5, slidesToScroll: 1, draggable: true, autoplay: false, autoplaySpeed: 3000, arrows: false, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 4 } }, { breakpoint: 768, settings: { slidesToShow: 3 } }, { breakpoint: 550, settings: { centerMode: true, slidesToShow: 1 } } ] });
Wariant z ramką wokół logo:
$('.manufacturer2-slider').slick({ lazyLoad: 'progressive', infinite: true, slidesToShow: 4, slidesToScroll: 1, draggable: true, autoplay: true, autoplaySpeed: 3000, arrows: false, responsive: [ { breakpoint: 1600, settings: { slidesToShow: 3 } }, { breakpoint: 1024, settings: { slidesToShow: 2 } }, { breakpoint: 768, settings: { slidesToShow: 1 } }, { breakpoint: 550, settings: { centerMode: true, slidesToShow: 1 } } ] });
Slajder marek w szablonie Topaz
Slajder marek w szablonie Topaz
W tym artykule dowiesz się jak zmodyfikować swój szablon, aby obsługiwał slajder marek.WskazówkaW tym artykule trzeba będzie wprowadzać zmiany w plikach js i css. Z tego artykułu dowiesz się jak je minifikować.W Panelu Administracyjnym przejdź do zakładki Obiekty (Wygląd sklepu -> Ustawienia -> Więcej (prawy górny róg) -> Edytuj ustawienia zaawansowane -> Obiekty). Naciśnij przycisk Dodaj. W formularzu wybierz Menu producentów i marek, a jako nazwę ustaw manufacturer-brand. Teraz kliknij na nowo utworzony obiekt na liście. Po otwarciu ustawień obiektu, przejdź do zakładki Strony a następnie zaznacz Strona główna, Produkty i Szczegóły produktu, w zależności od tego na jakiej stronie ma być umiejscowiony slajder (istnieje możliwość wyświetlenia slajdera na wszystkich w.w. stronach). Zapisz poprzez kliknięcie przycisku Zapisz w prawym górnym rogu. W ten sposób będzie możliwe wyświetlanie logo producentów na stronie sklepu. Kolejnym krokiem jest dodanie na stronę sklepu podglądu slidera. Dostępne są dwa warianty. Pierwszy z nich wyświetla loga producentów w prosty sposób, a drugi wokół każdego logo dodaje cienką ramkę. W celu wykonania tej operacji, przejdź do plików sklepu, otwórz katalog elements a następnie utwórz w nim nowy katalog o nazwie brand. W nowo utworzonym katalogu należy stworzyć pliki o nazwie brand-1.html oraz brand-2.html (w zależności czy chcemy wariant pierwszy, drugi czy obydwa). Następnie w pliku tym należy dodać poniższy kod:UwagaNa jednej stronie można dodać tylko jeden slider!Wariant zwykły:
{% if manufacturer-brand.Brands -%} {% assign brands = manufacturer-brand.Brands -%} <div class="brand1-slider"> {% for brand in brands -%} {% if brand.ImageId > 0 -%} <div class="brand1-slider__wrapper"> {% if brand.Url != empty -%} <a aria-label="brand-url" class="item" href="{{brand.Url}}"> {% endif -%} <figure> {% if brand.Heading != null -%} {% assign title = {{brand.Heading | H}} -%} {% else -%} {% assign title = {{brand.Name | H}} -%} {% endif -%} {{brand | Img: "compact"}} </figure> {% if brand.Url != empty -%} </a> {% endif -%} </div> {% endif -%} {% endfor -%} </div> {% endif -%}
Wariant z ramką wokół logo:
{% if manufacturer-brand.Brands -%} {% assign brands = manufacturer-brand.Brands -%} <div class="brand2-slider"> {% for brand in brands -%} {% if brand.ImageId > 0 -%} <div class="brand2-slider__wrapper"> <div class="slider2-element-border"> {% if brand.Url != empty -%} <a class="item" href="{{brand.Url}}"> {% endif -%} <figure> {% if brand.Heading != null -%} {% assign title = {{brand.Heading | H}} -%} {% else -%} {% assign title = {{brand.Name | H}} -%} {% endif -%} {{brand | Img: "compact"}} </figure> {% if brand.Url != empty -%} </a> {% endif -%} </div> </div> {% endif -%} {% endfor -%} </div> {% endif -%}
- Strona główna --