custom/plugins/PixupWishlistSW6/src/Resources/views/storefront/page/wishlist/index.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/base.html.twig' %}
  2. {% block base_offcanvas_navigation %}
  3.     {{ parent() }}
  4. {% endblock %}
  5. {% block base_content %}
  6.     {{ parent() }}
  7.     <!-- wishlist site scripts -->
  8.     <script>
  9.         function printCurrentWishlist(){
  10.             //get information about wishlist
  11.             window.print();
  12.             /**
  13.             let id = document.getElementById("wishlistPageTitle").dataset.wishlistId;
  14.             url = "{{ url("frontend.pixup.wishlist.ajax.get_wishlists", {
  15.                 'productId':'null',
  16.                 'wishlistId':'--wishlistId--',
  17.                 'returnProducts': 'true'
  18.             }) }}";
  19.             url = url.replace(/--wishlistId--/,escape(id));
  20.             pixupWishlist_ajaxCore(url,function(xhttp){
  21.                 data = JSON.parse(xhttp.responseText);
  22.                 if(data.error.success !== true){
  23.                     displayMessage(data.error.codes[0].label,false,);
  24.                     return false;
  25.                 }
  26.                 data = data.data.wishlists[0];
  27.                 let wishlistId = data.id;
  28.                 let isOwnWishlist = data.isOwnWishlist;
  29.                 let wishlistName = data.name;
  30.                 let wishlistPrivate = data.private;
  31.                 let wishlistBirthday = data.birthday;
  32.                 let wishlistEditable = data.editable;
  33.                 let wishlistExternal = data.external;
  34.                 let wishlistSubscribed = data.subscribed;
  35.                 var products = [];
  36.                 for(k in data.products){
  37.                     product = data.products[k];
  38.                     if(typeof product.price !== 'undefined' && product.price !== null){
  39.                         var price = product.price.gross.toFixed(2);
  40.                         var currencyId = product.price.currencyId;
  41.                     }else{
  42.                         var price = null;
  43.                         var currencyId = null;
  44.                     }
  45.                     productInfo = {
  46.                         id : product.id,
  47.                         ean : product.ean,
  48.                         ordernumber : product.productNumber,
  49.                         name : product.name,
  50.                         price : price,
  51.                         currencyId: currencyId
  52.                     };
  53.                     products.push(productInfo);
  54.                 }
  55.                 //display print version
  56.                 d = document;
  57.                 title = d.createElement("div");
  58.                 title.innerHTML = wishlistName;
  59.                 table = d.createElement("table");
  60.                 table.style.width="100%";
  61.                 tr = d.createElement("tr");
  62.                 th = d.createElement("th");
  63.                 th.innerHTML = "Article";
  64.                 th.style.width="80%";
  65.                 tr.appendChild(th);
  66.                 th = d.createElement("th");
  67.                 th.innerHTML = "Price";
  68.                 tr.appendChild(th);
  69.                 table.appendChild(tr);
  70.                 for(i=0;i<products.length;i++){
  71.                     tr = d.createElement("tr");
  72.                     td = d.createElement("td");
  73.                     td.innerHTML = "<span style=\"font-weight:bold\">"+products[i].name+"</span><br/><span style=\"font-size:0.7em\"> orderNumber: "+products[i].ordernumber+"</span>";
  74.                     tr.appendChild(td);
  75.                     td = d.createElement("td");
  76.                     td.innerHTML = products[i].price;
  77.                     tr.appendChild(td);
  78.                     table.appendChild(tr);
  79.                     tr = d.createElement("tr");
  80.                     td = d.createElement("td");
  81.                     td2 = d.createElement("td");
  82.                     td.innerHTML = "<hr/>";
  83.                     td2.innerHTML = "<hr/>";
  84.                     tr.appendChild(td);
  85.                     tr.appendChild(td2);
  86.                     table.appendChild(tr);
  87.                 }
  88.                 wrapper = d.createElement("div");
  89.                 wrapper.appendChild(table);
  90.                 var WinPrint = window.open('', '', 'left=0,top=0,width=800,height=900,toolbar=0,scrollbars=0,status=0');
  91.                 WinPrint.document.write(wrapper.innerHTML);
  92.                 WinPrint.document.close();
  93.                 WinPrint.focus();
  94.                 WinPrint.print();
  95.                 //WinPrint.close();
  96.             },[]);
  97.              **/
  98.         }
  99.         function displayMessage(text,success,disapear=4000){
  100.             let messageBody = document.getElementById("messageContainer");
  101.             //create new msg
  102.             let div = document.createElement("div");
  103.             div.innerHTML = text;
  104.             div.classList = "pixupWishlistErrorMsg";
  105.             div.addEventListener("click",function (){
  106.                 this.parentNode.removeChild(this);
  107.             });
  108.             div.style.backgroundColor = (success === true)?"#1b9448":"#8e0107";
  109.             disapear = (typeof disapear == "number")?disapear:4000;
  110.             messageBody.appendChild(div);
  111.             setTimeout(function(){
  112.                 messageBody.removeChild(div)
  113.             },disapear);
  114.         }
  115.         function pixupWishlist_ajaxCore(url,callback,options=null){
  116.             var xhttp = new XMLHttpRequest();
  117.             xhttp.onreadystatechange = function() {
  118.                 if (this.readyState == 4 && this.status == 200) {
  119.                     if(options !== null) {
  120.                         callback(this, ...options);
  121.                     }else
  122.                         callback(this);
  123.                 }
  124.             };
  125.             xhttp.open("GET", url, true);
  126.             xhttp.send();
  127.         }
  128.         function pixupWishlist_removeFromWishlistInit(url,productId,removeElementId,wishlistId){
  129.             pixupWishlist_ajaxCore(url,function(xhttp,url,productId,removeElementId,wishlistId){
  130.                 data = JSON.parse(xhttp.responseText);
  131.                 if(data.data.success) {
  132.                     element = document.getElementById(removeElementId);
  133.                     element.parentNode.removeChild(element);
  134.                     substrectOneFromWLHeader(); {# inside layout/header/header.html.twig #}
  135.                     //substrect one from side menu
  136.                     element = document.getElementById("menu"+wishlistId+"-count");
  137.                     element.innerHTML = (parseInt(element.innerHTML,0)-1).toString();
  138.                 }else{
  139.                     if(data.error.codes[0].code !== 0){
  140.                         displayMessage(data.error.codes[0].label,false,4000);
  141.                     }
  142.                 }
  143.             },[url,productId,removeElementId,wishlistId]);
  144.         }
  145.         function pixupWishlist_createWishlistInit(url){
  146.             name = document.getElementById("wishlistName").value;
  147.             if(!document.getElementById("wishlistName").value) {
  148.                 document.getElementById("wishlistName").style.border = "1px solid red";
  149.                 return;
  150.             }else
  151.                 document.getElementById("wishlistName").style.border = "1px solid #bcc1c7";
  152.             products = JSON.stringify({});
  153.             {% if wishlistCanBePublic %}
  154.                 privateState = document.getElementById("wishlistPrivate").checked;
  155.                 editable = document.getElementById("wishlistEditable").checked;
  156.                 {% if wishlistBirthday %}
  157.                 birthday = document.getElementById('wishlistBirthday').checked;
  158.                 {% else %}
  159.                  birthday = false;
  160.                 {% endif %}
  161.                 password = document.getElementById("wishlistPassword").value;
  162.                 password = (password == "")?null:password;
  163.             {% else %}
  164.                 privateState = true;
  165.                 editable = false;
  166.                 password = null;
  167.                 birthday = false;
  168.             {% endif %}
  169.             wishlistId = null;
  170.             url = url.replace(/--name--/, escape(name)).replace(/--products--/,escape(products))
  171.                 .replace(/--private--/,privateState).replace(/--editable--/,editable).replace(/--birthday--/,birthday)
  172.                 .replace(/--password--/,escape(password)).replace(/--wishlistId--/,wishlistId);
  173.             pixupWishlist_ajaxCore(url,function(xhttp,name,editable,privateState,birthday){
  174.                 data = JSON.parse(xhttp.responseText);
  175.                 if(data.data.success === false){
  176.                     displayMessage(data.error.codes[0].label,false,6000);
  177.                 }else{
  178.                     $('#pixupWishlist_createWishlistModal').modal("hide");
  179.                     {% if wishlistCanBePublic %}
  180.                     document.getElementById("wishlistPassword").value = "";
  181.                     {% endif %}
  182.                     document.getElementById("wishlistName").value = "";
  183.                     //init menu entry
  184.                     pixupWIshlist_createMenuEntry(data.data.wishlistId,name,privateState,editable,birthday);
  185.                     pixupWishlist_switchWishlist(data.data.wishlistId)
  186.                 }
  187.             },[name,editable,privateState,birthday])
  188.         }
  189.         function pixupWIshlist_createMenuEntry(wishlistId,name,privateState,editable,birthday){
  190.             var div = document.createElement("div");
  191.             div.id = "menu"+wishlistId;
  192.             div.classList = "pixupWishlistMenuEntry";
  193.             div.dataset.wishlistId = wishlistId;
  194.             div.dataset.wishlistLabel = name;
  195.             div.setAttribute('onclick','pixupWishlist_switchWishlist(this.dataset.wishlistId)');
  196.             div.innerHTML += "<span><span id=\"menu"+wishlistId+"-name\">"+name+"</span> (<span id=\"menu"+wishlistId+"-count\">0</span>)</span>";
  197.             div.innerHTML += pixup_createBatchDivs(privateState,editable,birthday);
  198.             document.getElementById("pixupWishlistMenu").insertBefore(div,document.getElementById("pixupWishlistMenu").firstChild);
  199.         }
  200.         function pixupWishlist_removeWishlistModal(name){
  201.             title = document.getElementById("delete_wishlist_title");
  202.             title.innerHTML = title.innerHTML.replace(/--namePlaceHolder--/,name);
  203.             $('#pixupWishlist_deleteWishlistModal').modal();
  204.         }
  205.         function pixupWishlist_removeWishlistInit(url,wishListId){
  206.             url = url.replace(/--wishlistId--/,wishListId);
  207.             pixupWishlist_ajaxCore(url,function(xhttp,url,wishlistId){
  208.                 data = JSON.parse(xhttp.responseText);
  209.                 $('#pixupWishlist_deleteWishlistModal').modal("hide");
  210.                 if(data.data.success === true) {
  211.                     wishlistContent = document.getElementById(wishlistId);
  212.                     wishlistMenu = document.getElementById("menu"+wishlistId);
  213.                     wishlistContent.parentNode.removeChild(wishlistContent);
  214.                     wishlistMenu.parentNode.removeChild(wishlistMenu);
  215.                     //history.pushState({page: 1}, "wishlist", "/wishlist/");
  216.                     window.history.pushState({}, null, window.location.toString().replace(/\/pixup\/wishlist(\/.*)?/gi, '/pixup/wishlist/'))
  217.                     id = document.getElementById("pixupWishlistMenu").children[0].id.replace(/menu/,"");
  218.                     if(id === ""){
  219.                         //no wishlist in list remove all old variables
  220.                         title = document.getElementById("wishlistPageTitle");
  221.                         title.innerHTML = "";
  222.                         title.dataset.wishlistId = "";
  223.                         document.getElementById('wishlist_header_actions').style.display = "none";
  224.                         return;
  225.                     }
  226.                     pixupWishlist_switchWishlist(document.getElementById("pixupWishlistMenu").children[0].id.replace(/menu/,""));
  227.                 }else if(data.data.success === false){
  228.                     displayMessage(data.error.codes[0].label,false);
  229.                 }
  230.             },[url,wishListId]);
  231.         }
  232.         function pixupWishlist_switchWishlist(newWishlistId){
  233.             if(!newWishlistId)
  234.                 return
  235.             /**
  236.              * TODO add ajax method to load product container
  237.              */
  238.             window.history.pushState({}, null, window.location.toString().replace(/\/pixup\/wishlist(\/.*)?/gi, '/pixup/wishlist/'+newWishlistId))
  239.             url = "{{ url('frontend.pixup.wishlist.ajax.get_wishlists', {'wishlistId': "--wishlistId--", 'returnView':'true'})  }}";
  240.             url = url.replace(/--wishlistId--/,escape(newWishlistId));
  241.             addLoadingCircle(document.getElementById("pixupWishlistContent"));
  242.             pixupWishlist_ajaxCore(url,function(xhttp){
  243.                 data = JSON.parse(xhttp.responseText).data;
  244.                 document.getElementById("pixupWishlistContent").innerHTML = data.view;
  245.                 document.getElementById('wishlist_header_actions').style.display = "block";
  246.                 titleBox = document.getElementById("wishlistPageTitle");
  247.                 //titleBox.innerHTML = data.wishlists[0].name;
  248.                 //titleBox.innerHTML += pixup_createBatchDivs(data.wishlists[0].private,data.wishlists[0].editable,data.wishlists[0].birthday,data.wishlists[0].subscribed);
  249.                 titleBox.dataset.wishlistId = data.wishlists[0].id;
  250.                 //adjust menu
  251.                 menuItems = document.getElementById("pixupWishlistMenu").children;
  252.                 for(i=0;i<menuItems.length;i++){
  253.                     if(menuItems[i].id === "menu"+data.wishlists[0].id)
  254.                         menuItems[i].classList += " pixupWishlistMenuEntryActive";
  255.                     else
  256.                         menuItems[i].classList.remove("pixupWishlistMenuEntryActive");
  257.                 }
  258.                 //reload the plugins so the add to cart btn works and events are registerd by shopware
  259.                 PluginManager.initializePlugins();
  260.             });
  261.         }
  262.         function pixupWishlist_editWishlistTrigger(wishListId){
  263.             //opens the modal box and sets the correct data
  264.             modal = document.getElementById("pixupWishlist_editWishlistModal");
  265.             modal.dataset.wishlistId = wishListId;
  266.             nameField = document.getElementById("wishlist_edit_Name");
  267.             {% if wishlistCanBePublic %}
  268.             privateField = document.getElementById("wishlist_edit_Public");
  269.             {% if wishlistBirthday %}
  270.                 birthday = document.getElementById("wishlist_edit_Birthday");
  271.             {% endif %}
  272.             editableField = document.getElementById("wishlist_edit_Editable");
  273.             passwordField = document.getElementById("wishlist_edit_Password");
  274.             {% endif %}
  275.             //get information about wishlist
  276.             url = "{{ url("frontend.pixup.wishlist.ajax.get_wishlists", {
  277.                 'productId':'null',
  278.                 'wishlistId':'--wishlistId--'
  279.             }) }}";
  280.             url = url.replace(/--wishlistId--/,wishListId);
  281.             pixupWishlist_ajaxCore(url,function(xhttp){
  282.                 data = JSON.parse(xhttp.responseText).data;
  283.                 nameField.value = data.wishlists[0].name;
  284.                 {% if wishlistCanBePublic %}
  285.                 privateField.checked = data.wishlists[0].private;
  286.                     {% if wishlistBirthday %}
  287.                         birthday.checked = data.wishlists[0].birthday;
  288.                     {% endif %}
  289.                 editableField.checked = data.wishlists[0].editable;
  290.                 passwordField.value = data.wishlists[0].password;
  291.                 {% endif %}
  292.                 modalTitle = document.getElementById("pixupWishlist_edit_title");
  293.                 modalTitle.innerHTML = modalTitle.innerHTML.replace(/--namePlaceHolder--/,data.wishlists[0].name);
  294.             });
  295.             $('#pixupWishlist_editWishlistModal').modal()
  296.         }
  297.         function pixupWishlist_editeWishlistInit(url){
  298.             modal = document.getElementById("pixupWishlist_editWishlistModal");
  299.             wishlistID = modal.dataset.wishlistId;
  300.             nameField = document.getElementById("wishlist_edit_Name").value;
  301.             {% if wishlistCanBePublic %}
  302.             privateField = document.getElementById("wishlist_edit_Public").checked;
  303.             editableField = document.getElementById("wishlist_edit_Editable").checked;
  304.                 {% if wishlistBirthday %}
  305.                 birthdayField = document.getElementById("wishlist_edit_Birthday").checked;
  306.                 {% else %}
  307.                 birthdayField = "";
  308.                 {% endif %}
  309.             passwordField = document.getElementById("wishlist_edit_Password").value;
  310.             {% else %}
  311.             privateField = "";
  312.             editableField = "";
  313.             passwordField = "";
  314.             birthdayField = "";
  315.             {% endif %}
  316.             url = url.replace(/--name--/,escape(nameField)).replace(/--private--/,privateField).replace(/--birthday--/,birthdayField)
  317.                 .replace(/--editable--/,editableField).replace(/--password--/,escape(passwordField)).replace(/--wishlistId--/,wishlistID);
  318.             pixupWishlist_ajaxCore(url,function(xhttp,wishlistID,name,editableField,privateField,birthdayField){
  319.                 data = JSON.parse(xhttp.responseText);
  320.                 if(data.data.success === false){
  321.                     displayMessage(data.error.codes[0].label,false);
  322.                 }else{
  323.                     $('#pixupWishlist_editWishlistModal').modal("hide");
  324.                     menuItem = document.getElementById('menu'+wishlistID);
  325.                     menuItem.dataset.wishlistId = wishlistID;
  326.                     menuItem.dataset.wishlistLabel = name;
  327.                     menuItem.innerHTML = "<span><span id=\"menu"+wishlistID+"-name\">"+name+"</span> (<span id=\"menu"+wishlistID+"-count\">"+document.getElementById("menu"+wishlistID+"-count").innerHTML+"</span>)</span>"
  328.                     menuItem.innerHTML += pixup_createBatchDivs(privateField,editableField,birthdayField);
  329.                     title = document.getElementById("wishlistPageTitle");
  330.                     //title.innerHTML = name + pixup_createBatchDivs(privateField,editableField,birthdayField);
  331.                 }
  332.             },[wishlistID,nameField,editableField,privateField,birthdayField])
  333.         }
  334.         function pixup_createBatchDivs(publicState,editable,birthday,subscribed = false){
  335.             html = "<span>";
  336.             if(publicState === false)
  337.             html += `<span data-toggle="tooltip" data-placement="top" title="{{ "pixup-wishlist.wishlist-page.wishlist.batch.public"|trans }}">{% sw_icon "lock-open" style {"class":" pxModeIcon","size":"xs"} %}</span>`;
  338.             if(editable === true)
  339.             html += `<span data-toggle="tooltip" data-placement="top" title="{{ "pixup-wishlist.wishlist-page.wishlist.batch.editable"|trans }}">{% sw_icon "paper-pencil" style {"class":" pxModeIcon","size":"xs"} %}</span>`;
  340.             if(birthday === true)
  341.             html += `<span data-toggle="tooltip" data-placement="top" title="{{ "pixup-wishlist.wishlist-page.wishlist.batch.birthday"|trans }}">{% sw_icon "package-gift" style {"class":" pxModeIcon","size":"xs"} %}</span>`;
  342.             if(subscribed === true)
  343.             html += `<span data-toggle="tooltip" data-placement="top" title="{{ "pixup-wishlist.wishlist-page.wishlist.batch.subscribed"|trans }}">{% sw_icon "avatar" style {"class":" pxModeIcon","size":"xs"} %}</span>`;
  344.             html +="</span>";
  345.             return html;
  346.         }
  347.         {% if wishlistCanBePublic %}
  348.         function pixupWishlist_shareWishlist(wishlistId){
  349.             url = "{{ url("frontend.pixup.wishlist.ajax.get_wishlists", {
  350.                 'productId':'null',
  351.                 'wishlistId':'--wishlistId--'
  352.             }) }}";
  353.             url = url.replace(/--wishlistId--/,wishlistId);
  354.             pixupWishlist_ajaxCore(url,function(xhttp){
  355.                 data = JSON.parse(xhttp.responseText).data;
  356.                 WishlistIsPrivate = data.wishlists[0].private;
  357.                 body = document.getElementById("pixupWishlist_shareWishlist_body");
  358.                 btn = document.getElementById("pixupWishlist_share_btn");
  359.                 title = document.getElementById("share_wishlist_title");
  360.                 title.innerHTML = title.innerHTML.replace(/--namePlaceHolder--/,data.wishlists[0].name)
  361.                 if(WishlistIsPrivate) {
  362.                     body.value = "{{ "pixup-wishlist.wishlist-page.shareWishlist.privateError"|trans }}";
  363.                     body.style.backgroundColor = "darkred";
  364.                     body.style.color = "white";
  365.                     btn.style.display = "none";
  366.                 }else{
  367.                     body = document.getElementById("pixupWishlist_shareWishlist_body");
  368.                     loc = window.location;
  369.                     body.value = (loc.href.includes(data.wishlists[0].id))?window.location.href:
  370.                         loc.protocol+"//"+loc.host+"/"+"pixup/wishlist/"+data.wishlists[0].id;
  371.                     body.style.backgroundColor = "";
  372.                     body.style.color = "";
  373.                     btn.style.display = "block"
  374.                 }
  375.                 $('#pixupWishlist_shareWishlistModal').modal();
  376.             });
  377.         }
  378.         function pixupWishlist_copyWishlistLink(){
  379.             var copyText = document.getElementById("pixupWishlist_shareWishlist_body");
  380.             copyText.select();
  381.             copyText.setSelectionRange(0, 99999);
  382.             document.execCommand('copy');
  383.         }
  384.         {% endif %}
  385.         function addLoadingCircle(elem){
  386.             var circle = document.createElement("div");
  387.             circle.innerHTML = "<div class=\"spinner-grow text-primary\"style=\"width:4rem;height:4rem;\" role=\"status\">\n" +
  388.                 "  <span class=\"sr-only\">Loading...</span>\n" +
  389.                 "</div>";
  390.             var div = document.createElement("div");
  391.             div.style.backgroundColor = "rgba(0,0,0,.2)";
  392.             div.style.position = "absolute";
  393.             div.style.top = "0px";
  394.             div.style.right = "0px";
  395.             div.style.height = "100%";
  396.             div.style.width = "100%";
  397.             div.style.display = "flex";
  398.             div.style.alignItems = "center";
  399.             div.style.justifyContent = "center";
  400.             div.appendChild(circle);
  401.             elem.style.position = "relative";
  402.             elem.appendChild(div);
  403.             return div;
  404.         }
  405.     </script>
  406.     <!-- product-prev-box scripts -->
  407.     <script>
  408.         function pixupWishlist_changeVariant(wishedGroupId,className,parentId,currentProduct,index,productContainerId = null){
  409.             url = "{{ url('frontend.pixup.wishlist.ajax.get_product_variant', {'parentId': '--parentId--','options':'--options--','wishedGroupId':'--wishedGroupId--'})  }}";
  410.             elements = document.getElementsByClassName(className);
  411.             options = {};
  412.             for(i=0;i<elements.length;i++){
  413.                 if(elements[i].checked) {
  414.                     groupId = elements[i].name;
  415.                     optionId = elements[i].value;
  416.                     options[groupId] = optionId;
  417.                 }
  418.             }
  419.             options = JSON.stringify(options);
  420.             url = url.replace(/--parentId--/,escape(parentId)).replace(/--options--/,escape(options)).replace(/--wishedGroupId--/,escape(wishedGroupId));
  421.             pixupWishlist_ajaxCore(url,function(xhttp,currentProduct,index,productContainerId){
  422.                 data = JSON.parse(xhttp.responseText).data;
  423.                 circle = addLoadingCircle(document.getElementById(productContainerId));
  424.                 if(data.success === true){
  425.                     //replace variantProductId with current product
  426.                     variantProductId = data.response.id;
  427.                     wishlistId =  document.getElementById(productContainerId).dataset.wishlistId;
  428.                     url = "{{ url('frontend.pixup.wishlist.ajax.replace_from_wishlist', {'oldId':'--oldId--','newId':'--newId--','wishListId':'--wishlistid--'}) }}";
  429.                     url = url.replace(/--oldId--/,currentProduct).replace(/--newId--/,variantProductId).replace(/--wishlistid--/,wishlistId);
  430.                     pixupWishlist_ajaxCore(url,function(xhttp){
  431.                         data = JSON.parse(xhttp.responseText);
  432.                         if(data.data.success === true) {
  433.                             //replace current productBox with new productId
  434.                             url = "{{ url('frontend.pixup.wishlist.product_box', {'productId': '--productId--','index':'--index--','wishlistId':"--wishlistId--"}) }}";
  435.                             url = url.replace(/--productId--/, variantProductId).replace(/--index--/, index).replace(/--wishlistId--/,wishlistId);
  436.                             pixupWishlist_ajaxCore(url, function(xhttp,productContainerId,newProductId){
  437.                                 document.getElementById(productContainerId).innerHTML = xhttp.responseText;
  438.                                 document.getElementById(productContainerId).dataset.productId = newProductId;
  439.                             },[productContainerId,variantProductId]);
  440.                         }else{
  441.                             //output error and remove loading circle
  442.                             displayMessage(data.error.codes[0].label,false,4000);
  443.                             document.getElementById(productContainerId).removeChild(circle);
  444.                             return false;
  445.                         }
  446.                     });
  447.                 }
  448.             },[currentProduct,index,productContainerId]);
  449.         }
  450.         function pixupWishlist_moveProduct(productId,checkboxElem,removeElem,currentWishlistId){
  451.             isOnWishlist = (checkboxElem.dataset.isOnWishlist!=='false');
  452.             checked = checkboxElem.checked;
  453.             if((isOnWishlist === true && checked === true) ||
  454.                 (isOnWishlist === false && checked === false))
  455.                 return true;
  456.             remove = (isOnWishlist == true && checked == false)?true:false;
  457.             if(remove === 'true' || remove === true)
  458.                 baseUrl = "{{ url('frontend.pixup.wishlist.ajax.remove_product', {'productId': '--product-id--','wishlistId': '--wishListId--'})  }}";
  459.             else
  460.                 baseUrl = "{{ url('frontend.pixup.wishlist.ajax.add_product', {'productId': '--product-id--','wishlistId': '--wishListId--'})  }}";
  461.             url = baseUrl.replace(/--product-id--/,escape(productId)).replace(/--wishListId--/,escape(checkboxElem.value));
  462.             pixupWishlist_ajaxCore(url,function(xhttp,remove,removeElem,wishlistId){
  463.                 data = JSON.parse(xhttp.responseText).data;
  464.                 if(data.success ===true){
  465.                     if(remove === 'true' || remove === true) {
  466.                         if(currentWishlistId == wishlistId) {
  467.                             element = document.getElementById(removeElem);
  468.                             element.parentNode.removeChild(element);
  469.                         }
  470.                         //substrect one from side menu
  471.                         element = document.getElementById("menu"+wishlistId+"-count");
  472.                         element.innerHTML = (parseInt(element.innerHTML,0)-1).toString();
  473.                     }else{
  474.                         //add one from side menu
  475.                         element = document.getElementById("menu"+wishlistId+"-count");
  476.                         element.innerHTML = (parseInt(element.innerHTML,0)+1).toString();
  477.                     }
  478.                     if(wishlistId == -1) {// means that a wishlist is created
  479.                         //get infor about new created wishlist
  480.                         url = "{{ url("frontend.pixup.wishlist.ajax.get_wishlists", {
  481.                             'productId':'null',
  482.                             'wishlistId':'--wishlistId--'
  483.                         }) }}";
  484.                         url = url.replace(/--wishlistId--/,data.wishlistId);
  485.                         pixupWishlist_ajaxCore(url,function(xhttp){
  486.                             data = JSON.parse(xhttp.responseText).data.wishlists[0];
  487.                             pixupWIshlist_createMenuEntry(data.id,data.name,data.private,data.editable,data.birthday);
  488.                         });
  489.                     }
  490.                 }
  491.             },[remove,removeElem,checkboxElem.value]);
  492.         }
  493.         function pixupWishlist_moveProductInit(url,productId,removeElem,currentWishlistId){
  494.             pixupWishlist_ajaxCore(url,function(xhttp,productId,removeElem,currentWishlistId){
  495.                 var safeBtn = document.getElementById('pixupWishlist_save');
  496.                 var select = document.getElementById("pixupWishlist_chooseWishlistModal_body_select");
  497.                 var data = JSON.parse(xhttp.responseText).data.wishlists;
  498.                 //clear old event Listener ( so only one function can listen on it )
  499.                 safeBtnClone = safeBtn.cloneNode(true);
  500.                 //set listener
  501.                 safeBtnClone.addEventListener("click", function(){
  502.                     //get all selected checkboxes and send the value to the changeState function
  503.                     var all_checkboxes = document.querySelectorAll('input[name="pixupWishlistCheckBoxWishlistSelector[]"]');
  504.                     for(var x = 0, l = all_checkboxes.length; x < l;  x++)
  505.                     {
  506.                         pixupWishlist_moveProduct(
  507.                             productId,
  508.                             all_checkboxes[x],
  509.                             removeElem,
  510.                             currentWishlistId
  511.                         );
  512.                     }
  513.                     $('#pixupWishlist_chooseWishlistModal').modal('hide')
  514.                 });
  515.                 safeBtn.parentNode.replaceChild(safeBtnClone, safeBtn);
  516.                 //delete options
  517.                 select.innerHTML = "";
  518.                 //create a checkbox for every recieved wishlist ( subscribed wishlists excluded )
  519.                 ownWishlistAdded = false;
  520.                 for(i=0;i<data.length;i++){
  521.                     if(data[i].subscribed === true)
  522.                         continue;
  523.                     ownWishlistAdded = true;
  524.                     select.appendChild(createCheckbox(data[i],productId));
  525.                 }
  526.                 //if no wishlist exsist
  527.                 if(ownWishlistAdded === false){
  528.                     // if the id is -1 it will create a new wishlist
  529.                     customData = {name:"{{ "pixup-wishlist.product-detail.modal.createNewWishlist"|trans }}",id:-1,products:{product:-1}};
  530.                     select.appendChild(createCheckbox(customData,2));
  531.                 }
  532.                 //add checkboxes for subcribed wishlists
  533.                 match = 0;
  534.                 for(i=0;i<data.length;i++){
  535.                     if(data[i].subscribed === false)
  536.                         continue;
  537.                     if(data[i].editable !== true)
  538.                         continue;
  539.                     match++;
  540.                     if(match === 1) {
  541.                         var hr = document.createElement("hr");
  542.                         var div = document.createElement("div");
  543.                         div.classList = "center PixupCechBoxGroupTitle";
  544.                         div.innerHTML = "{{ "pixup-wishlist.product-detail.modal.subscribedWishlists"|trans }}";
  545.                         select.appendChild(hr);
  546.                         select.appendChild(div);
  547.                     }
  548.                     select.appendChild(createCheckbox(data[i],productId,"PixupCheckBoxRow2"));
  549.                 }
  550.                 $('#pixupWishlist_chooseWishlistModal').modal()
  551.             },[productId,removeElem,currentWishlistId])
  552.         }
  553.         function createCheckbox(data,productId, className = "") {
  554.             var div = document.createElement("div");
  555.             div.className = "custom-control custom-checkbox PixupCheckBoxRow "+className;
  556.             var input = document.createElement("input");
  557.             input.type = "checkbox";
  558.             input.className = "custom-control-input";
  559.             input.id = "pixupWishlist" + i;
  560.             input.name = "pixupWishlistCheckBoxWishlistSelector[]";
  561.             input.value = data.id;
  562.             isOnWishlist = false;
  563.             products = Object.values(data.products);
  564.             for(let x = 0; products.length > x;x++){
  565.                 if(products[x] === productId) {
  566.                     isOnWishlist = true;
  567.                     break;
  568.                 }
  569.             }
  570.             input.dataset.isOnWishlist = isOnWishlist;
  571.             if (isOnWishlist)
  572.                 input.checked = true;
  573.             var label = document.createElement("label");
  574.             label.className = "custom-control-label";
  575.             label.htmlFor = "pixupWishlist" + i;
  576.             label.innerHTML = data.name;
  577.             div.appendChild(input);
  578.             div.appendChild(label);
  579.             return div
  580.         }
  581.     </script>
  582.     <!-- product-configurator scripts -->
  583.     <script>
  584.         var activeSelectTimeout = null;
  585.         var activeOptionContainer = null;
  586.         var activeOptionSelect = null;
  587.         var activeIcon = null;
  588.         function pixupShowSelect(optionSelectId, optionContainerId, iconId){
  589.             optionSelect = document.getElementById(optionSelectId);
  590.             optionContainer = document.getElementById(optionContainerId);
  591.             icon = document.getElementById(iconId);
  592.             if(activeOptionContainer !== null)
  593.                 pixupCloseSelectByReference(activeOptionContainer,activeOptionSelect,activeIcon);
  594.             activeOptionContainer = optionContainer;
  595.             activeOptionSelect = optionSelect;
  596.             activeIcon = icon;
  597.             optionContainer.style.overflow = "visible";
  598.             icon.firstElementChild.style.transform ="rotate(180deg)";
  599.             icon.style.zIndex = 2001;
  600.             optionSelect.style.zIndex = 2000;
  601.             optionSelect.style.backgroundColor = "#f6f6f6";
  602.             optionSelect.classList.add("optionSelectLayerActive");
  603.         }
  604.         function pixupCloseSelectByReference(optionContainer,optionSelect,icon){
  605.             console.log("clear");
  606.             optionContainer.style.overflow = "hidden";
  607.             icon.firstElementChild.style.transform = "rotate(0deg)";
  608.             icon.style.zIndex = null;
  609.             optionSelect.style.zIndex = null;
  610.             optionSelect.style.backgroundColor = null;
  611.             optionSelect.classList.remove("optionSelectLayerActive");
  612.             activeOptionContainer = null;
  613.             activeOptionSelect = null;
  614.             activeIcon = null;
  615.             if(activeSelectTimeout !== null)
  616.                 clearTimeout(activeSelectTimeout);
  617.         }
  618.         function pixupCloseSelect(optionSelectId, optionContainerId, iconId){
  619.             optionSelect = document.getElementById(optionSelectId);
  620.             optionContainer = document.getElementById(optionContainerId);
  621.             icon = document.getElementById(iconId);
  622.             activeSelectTimeout = setTimeout(function(){
  623.                 pixupCloseSelectByReference(optionContainer,optionSelect,icon);
  624.             },200);
  625.         }
  626.     </script>
  627.     <script>
  628.         window.onload = function() {
  629.             PluginManager.initializePlugins();
  630.         }
  631.     </script>
  632.     <!-- Modal -->
  633.     <!--Create-->
  634.     {% block pixup_wishlist_page_modal_create %}
  635.         <div class="modal fade" id="pixupWishlist_createWishlistModal" tabindex="-1" role="dialog" aria-labelledby="{{  "pixup-wishlist.wishlist-page.createModal.title"|trans }}" aria-hidden="true">
  636.             <div class="modal-dialog" role="document">
  637.                 <div class="modal-content">
  638.                     <div class="modal-header">
  639.                         <h5 class="modal-title" id="pixupWishlist_title">{{  "pixup-wishlist.wishlist-page.createModal.title"|trans }}</h5>
  640.                         <br>
  641.                         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  642.                             <span aria-hidden="true">&times;</span>
  643.                         </button>
  644.                     </div>
  645.                     <div class="modal-body">
  646.                         <div id="pixupWishlist_chooseWishlistModal_body">
  647.                             <div class="form-group row">
  648.                                 <label for="wishlistName" class="col-sm-2 col-form-label">{{  "pixup-wishlist.wishlist-page.createModal.form.name"|trans }}</label>
  649.                                 <div class="col-sm-10">
  650.                                     <input class="form-control" id="wishlistName" placeholder="{{  "pixup-wishlist.wishlist-page.createModal.form.placeholder.name"|trans }}">
  651.                                 </div>
  652.                             </div>
  653.                             {% if wishlistCanBePublic %}
  654.                             <div class="form-group row">
  655.                                 <label for="wishlistPassword" class="col-sm-2 col-form-label">{{  "pixup-wishlist.wishlist-page.createModal.form.password"|trans }}</label>
  656.                                 <div class="col-sm-10">
  657.                                     <input type="password" class="form-control" id="wishlistPassword" placeholder="{{  "pixup-wishlist.wishlist-page.createModal.form.placeholder.password"|trans }}">
  658.                                 </div>
  659.                             </div>
  660.                             <div class="form-group row">
  661.                                 <div class="custom-control custom-checkbox" style="margin-left:1.5em;" data-toggle="tooltip" data-placement="bottom"
  662.                                      title="{{  "pixup-wishlist.wishlist-page.createModal.form.privateDescription"|trans }}">
  663.                                     <input type="checkbox" class="custom-control-input" name="wishlistPrivate" id="wishlistPrivate" checked>
  664.                                     <label for="wishlistPrivate" class="custom-control-label">{{  "pixup-wishlist.wishlist-page.createModal.form.private"|trans }}</label>
  665.                                     {% sw_icon "lock-open" style {"class":" pxModeIcon","size":"xs"} %}
  666.                                 </div>
  667.                                 <div class="custom-control custom-checkbox" style="margin-left:1.5em;" data-toggle="tooltip" data-placement="bottom"
  668.                                      title="{{  "pixup-wishlist.wishlist-page.createModal.form.editableDescription"|trans }}">
  669.                                     <input type="checkbox" class="custom-control-input" id="wishlistEditable">
  670.                                     <label for="wishlistEditable" class="custom-control-label">{{  "pixup-wishlist.wishlist-page.createModal.form.editable"|trans }}</label>
  671.                                     {% sw_icon "paper-pencil" style {"class":" pxModeIcon","size":"xs"} %}
  672.                                 </div>
  673.                                 {% if wishlistBirthday %}
  674.                                 <div class="custom-control custom-checkbox" style="margin-left:1.5em;" data-toggle="tooltip" data-placement="bottom"
  675.                                      title="{{  "pixup-wishlist.wishlist-page.createModal.form.birthdayDescription"|trans }}">
  676.                                     <input type="checkbox" class="custom-control-input" id="wishlistBirthday">
  677.                                     <label for="wishlistBirthday" class="custom-control-label">{{  "pixup-wishlist.wishlist-page.createModal.form.birthday"|trans }}</label>
  678.                                     {% sw_icon "package-gift" style {"class":" pxModeIcon","size":"xs"} %}
  679.                                 </div>
  680.                                 {% endif %}
  681.                             </div>
  682.                             {% endif %}
  683.                         </div>
  684.                     </div>
  685.                     <div class="modal-footer">
  686.                         <button type="button" class="btn btn-secondary" data-dismiss="modal">{{  "pixup-wishlist.wishlist-page.createModal.close"|trans }}</button>
  687.                         <button onclick="pixupWishlist_createWishlistInit(
  688.                             '{{ url("frontend.pixup.wishlist.ajax.create_wishlist", {
  689.                             'name': "--name--",
  690.                             'products':'--products--',
  691.                             'private':'--private--',
  692.                             'editable':'--editable--',
  693.                             'birthday':'--birthday--',
  694.                             'password':'--password--',
  695.                             'wishListId':'--wishlistId--'
  696.                         })  }}',
  697.                             )" type="button" class="btn btn-primary">{{  "pixup-wishlist.wishlist-page.createModal.save"|trans }}</button>
  698.                     </div>
  699.                 </div>
  700.             </div>
  701.         </div>
  702.     {% endblock %}
  703.     <!--edit-->
  704.     {% block pixup_wishlist_page_modal_edit %}
  705.         <div class="modal fade" id="pixupWishlist_editWishlistModal" data-wishlist-id="" tabindex="-1" role="dialog" aria-labelledby="edit" aria-hidden="true">
  706.             <div class="modal-dialog" role="document">
  707.                 <div class="modal-content">
  708.                     <div class="modal-header">
  709.                         <h5 class="modal-title" id="pixupWishlist_edit_title">{{  "pixup-wishlist.wishlist-page.editWishlist.title"|trans({"%name%":"--namePlaceHolder--"}) }}</h5>
  710.                         <br>
  711.                         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  712.                             <span aria-hidden="true">&times;</span>
  713.                         </button>
  714.                     </div>
  715.                     <div class="modal-body">
  716.                         <div id="pixupWishlist_edit_chooseWishlistModal_body_select">
  717.                             <div class="form-group row">
  718.                                 <label for="wishlist_edit_Name" class="col-sm-2 col-form-label">{{  "pixup-wishlist.wishlist-page.editWishlist.form.name"|trans }}</label>
  719.                                 <div class="col-sm-10">
  720.                                     <input class="form-control" id="wishlist_edit_Name" placeholder="{{  "pixup-wishlist.wishlist-page.editWishlist.form.placeholder.name"|trans }}">
  721.                                 </div>
  722.                             </div>
  723.                             {% if wishlistCanBePublic %}
  724.                             <div class="form-group row">
  725.                                 <label for="wishlist_edit_Password" class="col-sm-2 col-form-label">{{  "pixup-wishlist.wishlist-page.editWishlist.form.password"|trans }}</label>
  726.                                 <div class="col-sm-10">
  727.                                     <input type="password" class="form-control" id="wishlist_edit_Password" placeholder="{{  "pixup-wishlist.wishlist-page.editWishlist.form.placeholder.password"|trans }}">
  728.                                 </div>
  729.                             </div>
  730.                             <div class="form-group row">
  731.                                 <div class="custom-control custom-checkbox" style="margin-left:1.5em;" data-toggle="tooltip" data-placement="bottom"
  732.                                      title="{{  "pixup-wishlist.wishlist-page.editWishlist.form.privateDescription"|trans }}">
  733.                                     <input type="checkbox" class="custom-control-input" name="wishlistPrivate" id="wishlist_edit_Public" checked>
  734.                                     <label for="wishlist_edit_Public" class="custom-control-label">{{  "pixup-wishlist.wishlist-page.editWishlist.form.private"|trans }}</label>
  735.                                     {% sw_icon "lock-open" style {"class":" pxModeIcon","size":"xs"} %}
  736.                                 </div>
  737.                                 <div class="custom-control custom-checkbox" style="margin-left:1.5em;" data-toggle="tooltip" data-placement="bottom"
  738.                                      title="{{  "pixup-wishlist.wishlist-page.editWishlist.form.editableDescription"|trans }}">
  739.                                     <input type="checkbox" class="custom-control-input" id="wishlist_edit_Editable">
  740.                                     <label for="wishlist_edit_Editable" class="custom-control-label">{{  "pixup-wishlist.wishlist-page.editWishlist.form.editable"|trans }}</label>
  741.                                     {% sw_icon "paper-pencil" style {"class":" pxModeIcon","size":"xs"} %}
  742.                                 </div>
  743.                                 {% if wishlistBirthday %}
  744.                                 <div class="custom-control custom-checkbox" style="margin-left:1.5em;" data-toggle="tooltip" data-placement="bottom"
  745.                                      title="{{  "pixup-wishlist.wishlist-page.editWishlist.form.birthdayDescription"|trans }}">
  746.                                     <input type="checkbox" class="custom-control-input" id="wishlist_edit_Birthday">
  747.                                     <label for="wishlist_edit_Birthday" class="custom-control-label">{{  "pixup-wishlist.wishlist-page.editWishlist.form.birthday"|trans }}</label>
  748.                                     {% sw_icon "package-gift" style {"class":" pxModeIcon","size":"xs"} %}
  749.                                 </div>
  750.                                 {% endif %}
  751.                             </div>
  752.                             {% endif %}
  753.                         </div>
  754.                     </div>
  755.                     <div class="modal-footer">
  756.                         <button type="button" class="btn btn-secondary" data-dismiss="modal">{{  "pixup-wishlist.wishlist-page.editWishlist.close"|trans }}</button>
  757.                         <button onclick="pixupWishlist_editeWishlistInit(
  758.                             '{{ url("frontend.pixup.wishlist.ajax.edit_wishlist", {
  759.                             'name': "--name--",
  760.                             'wishListId':'--wishlistId--',
  761.                             'private':'--private--',
  762.                             'editable':'--editable--',
  763.                             'birthday':'--birthday--',
  764.                             'password':'--password--'
  765.                         })  }}',
  766.                             )" type="button" class="btn btn-primary">{{  "pixup-wishlist.wishlist-page.editWishlist.save"|trans }}</button>
  767.                     </div>
  768.                 </div>
  769.             </div>
  770.         </div>
  771.     {% endblock %}
  772.     {% block pixup_wishlist_page_modal_share %}
  773.         {% if wishlistCanBePublic %}
  774.         <!--share wishlist-->
  775.         <div class="modal fade" id="pixupWishlist_shareWishlistModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  776.             <div class="modal-dialog" role="document">
  777.                 <div class="modal-content">
  778.                     <div class="modal-header">
  779.                         <h5 class="modal-title" id="share_wishlist_title">{{  "pixup-wishlist.wishlist-page.shareWishlist.title"|trans({"%name%":"--namePlaceHolder--"}) }}</h5>
  780.                         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  781.                             <span aria-hidden="true">&times;</span>
  782.                         </button>
  783.                     </div>
  784.                     <div class="modal-body">
  785.                         <div class="modal-title">{{  "pixup-wishlist.wishlist-page.shareWishlist.description"|trans }}</div>
  786.                         <input class="form-control" type="text" id="pixupWishlist_shareWishlist_body" readonly>
  787.                     </div>
  788.                     <div class="modal-footer">
  789.                         <button type="button" class="btn btn-secondary" data-dismiss="modal">{{  "pixup-wishlist.wishlist-page.shareWishlist.close"|trans }}</button>
  790.                         <button id="pixupWishlist_share_btn" type="button" class="btn btn-primary"
  791.                         onclick="pixupWishlist_copyWishlistLink()">{{  "pixup-wishlist.wishlist-page.shareWishlist.copy"|trans }}</button>
  792.                     </div>
  793.                 </div>
  794.             </div>
  795.         </div>
  796.         {% endif %}
  797.     {% endblock %}
  798.     <!--delete wishlist-->
  799.     {% block pixup_wishlist_page_modal_delete %}
  800.         <div class="modal fade" id="pixupWishlist_deleteWishlistModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  801.             <div class="modal-dialog" role="document">
  802.                 <div class="modal-content">
  803.                     <div class="modal-header">
  804.                         <h5 class="modal-title" id="delete_wishlist_title">{{  "pixup-wishlist.wishlist-page.deleteWishlist.title"|trans({"%name%":"--namePlaceHolder--"}) }}</h5>
  805.                         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  806.                             <span aria-hidden="true">&times;</span>
  807.                         </button>
  808.                     </div>
  809.                     <div class="modal-body">
  810.                         <div class="modal-title">{{  "pixup-wishlist.wishlist-page.deleteWishlist.description"|trans }}</div>
  811.                     </div>
  812.                     <div class="modal-footer">
  813.                         <button type="button" class="btn btn-secondary" data-dismiss="modal">{{  "pixup-wishlist.wishlist-page.deleteWishlist.close"|trans }}</button>
  814.                         <button id="pixupWishlist_delete_btn" type="button" class="btn btn-primary"
  815.                                 onclick="pixupWishlist_removeWishlistInit(
  816.                                     '{{ url('frontend.pixup.wishlist.ajax.delete_wishlist', {'wishlistId': "--wishlistId--"})  }}',
  817.                                     document.getElementById('wishlistPageTitle').dataset.wishlistId
  818.                                     )">
  819.                             {{  "pixup-wishlist.wishlist-page.deleteWishlist.delete"|trans }}
  820.                         </button>
  821.                     </div>
  822.                 </div>
  823.             </div>
  824.         </div>
  825.     {% endblock %}
  826.     {% block pixup_wishlist_page_wrapp %}
  827.         <div class="pixupWishlistWrapp">
  828.             {% block pixup_wishlist_page_header %}
  829.             <div class="pixupWishlistHeader">
  830.                 {% set selectedWishlist = {} %}
  831.                 {% if wishlistId is not empty %}
  832.                     {% for wishlist in wishlists %}
  833.                         {% if wishlist.id == wishlistId %}
  834.                             {% set selectedWishlist = wishlist %}
  835.                         {% endif %}
  836.                     {% endfor %}
  837.                 {% endif %}
  838.                 {% if selectedWishlist is empty %}
  839.                     {% set selectedWishlist = wishlists[0] %}
  840.                 {% endif %}
  841.                 <script>
  842.                     window.history.pushState({page: 1}, "wishlist", window.location.toString().replace(/\/pixup\/wishlist(\/.*)?/gi, '/pixup/wishlist/'+"{{selectedWishlist.id is not empty ? selectedWishlist.id : wishlists[0].id}}"));
  843.                 </script>
  844.                 <h1 class="wishListTitle text-primary" id="wishlistPageTitle"
  845.                       data-wishlist-id="{{selectedWishlist.id}}"
  846.                 >
  847.                     {#
  848.                     {% if publicWishlist is empty %}
  849.                         {{selectedWishlist.name}}
  850.                     {% else %}
  851.                         {{ publicWishlist[0].name }} - <span style="color:red;font-size:0.7em;">{{ "pixup-wishlist.wishlist-page.header.external"|trans }}</span>
  852.                     {% endif %}
  853.                     #}
  854.                     {% sw_icon 'px-heart' style{"namespace":"PixupWishlistSW6",'pack': 'pixup',"class":" PixupWishlistPageHeartIcon pxOutlinePrimarFat"} %} {{ "pixup-wishlist.wishlist-page.title"|trans }}
  855.                 </h1>
  856.             </div>
  857.             {% endblock %}
  858.             {% block pixup_wishlist_page_alert %}
  859.             <div role="alert"
  860.                  id="messageContainer"
  861.                  class="pixupWishlistErrorContainer"
  862.             >
  863.             </div>
  864.             {% if subscribedToWishlist == true %}
  865.                 {# message to display if user subscribed to new wishlist #}
  866.                 <script>
  867.                     displayMessage("{{ "pixup-wishlist.wishlist-page.success.subscribed"|trans }}",true,6000);
  868.                 </script>
  869.             {% endif %}
  870.             {% if message %}
  871.                 {% if message == 8 %}
  872.                     <script>
  873.                         displayMessage("{{ "pixup-wishlist.wishlist-page.errorCodes.8"|trans }}",false,4000);
  874.                     </script>
  875.                 {% endif %}
  876.             {% endif %}
  877.             {% endblock %}
  878.             {% block pixup_wishlist_page_container %}
  879.                 <div class="pixupWishlistContainer">
  880.                     <input type="checkbox" id="pixupWishlistMobileMenuBtn" style="display:none;" checked>
  881.                     <label for="pixupWishlistMobileMenuBtn" class="pixupWishlistMobileMenuBtn">
  882.                         {{ "pixup-wishlist.actions.name"|trans }}
  883.                         <span class="pixupWishlistMobileMenuBtnIcon">
  884.                             {% sw_icon 'arrow-head-down' style {"class":" pixupWishlistMobileMenuBtnIconColor" } %}
  885.                         </span>
  886.                     </label>
  887.                     {% if message != 8 %}
  888.                         {% block pixup_wishlist_page_wishlists %}
  889.                             <div class="pixupWishlistMenu" id="pixupWishlistMenu">
  890.                                 {% for wishlist in wishlists %}
  891.                                     {% block pixup_wishlist_page_wishlists_item %}
  892.                                         <div id="menu{{ wishlist.id }}" class="pixupWishlistMenuEntry {{ selectedWishlist.id == wishlist.id?"pixupWishlistMenuEntryActive":"" }}" data-wishlist-id="{{ wishlist.id }}" data-wishlist-label="{{ wishlist.name }}"
  893.                                         onclick="pixupWishlist_switchWishlist(this.dataset.wishlistId)">
  894.                                             <span><span id="menu{{ wishlist.id }}-name">{{ wishlist.name }}</span> (<span id="menu{{ wishlist.id }}-count">{{ wishlist.products|length }}</span>)</span>
  895.                                         </div>
  896.                                         <script>
  897.                                             document.getElementById("menu{{ wishlist.id }}").innerHTML += pixup_createBatchDivs({{wishlist.private?'true':'false' }},{{wishlist.editable?'true':'false' }},{{wishlist.birthday?'true':'false' }},{{wishlist.subscribed?'true':'false' }});
  898.                                         </script>
  899.                                     {% endblock %}
  900.                                 {% endfor %}
  901.                                 {% block pixup_wishlist_page_allowmultiple %}
  902.                                     {% if page.header.pixup.allowMultipleWishlists %}
  903.                                         <div class="pixupWishlistMenuEntry" onclick="$('#pixupWishlist_createWishlistModal').modal()">
  904.                                             <span>
  905.                                                 + {{ "pixup-wishlist.wishlist-page.header.addWishlist"|trans }}
  906.                                             </span>
  907.                                         </div>
  908.                                     {% endif %}
  909.                                 {% endblock %}
  910.                             </div>
  911.                         {% endblock %}
  912.                         {% block pixup_wishlist_page_details %}
  913.                             <div class="wishlistContentWrapper">
  914.                                 <div id="wishlist_header_actions" style="{% if publicWishlist is not empty or wishlists is empty %}display:none{% endif %}" class="pxWishlistIconSettings">
  915.                                     {% if wishlistCanBePublic %}
  916.                                         <span class="btn pxWishlistPageHeaderIcons"
  917.                                               onclick="pixupWishlist_shareWishlist(
  918.                                               document.getElementById('wishlistPageTitle').dataset.wishlistId
  919.                                               )"
  920.                                               title="{{ "pixup-wishlist.wishlist-page.header.shareWishlist"|trans }}">
  921.                                         {% sw_icon 'share' style {"class":" pxHeaderIcon"} %}
  922.                                         <span class="btn-description">{{ "pixup-wishlist.wishlist-page.header.shareWishlist"|trans }}</span>
  923.                                         </span>
  924.                                     {% endif %}
  925.                                     <span class="btn pxWishlistPageHeaderIcons"
  926.                                           onclick="pixupWishlist_editWishlistTrigger(
  927.                                               document.getElementById('wishlistPageTitle').dataset.wishlistId
  928.                                             )"
  929.                                           title="{{ "pixup-wishlist.wishlist-page.header.editWishlist"|trans }}">
  930.                                         {% sw_icon 'settings' style {"class":" pxHeaderIcon"} %}
  931.                                         <span class="btn-description">{{ "pixup-wishlist.wishlist-page.header.editWishlist"|trans }}</span>
  932.                                     </span>
  933.                                     {% if wishlistCanBePrinted %}
  934.                                         <span class="btn pxWishlistPageHeaderIcons"
  935.                                               onclick="printCurrentWishlist(
  936.                                               document.getElementById('wishlistPageTitle').dataset.wishlistId
  937.                                             )"
  938.                                               title="{{ "pixup-wishlist.wishlist-page.header.printWishlist"|trans }}">
  939.                                         {% sw_icon 'printer' style {"class":" pxHeaderIcon"} %}
  940.                                         <span class="btn-description">{{ "pixup-wishlist.wishlist-page.header.printWishlist"|trans }}</span>
  941.                                     </span>
  942.                                     {% endif %}
  943.                                     <span class="btn pxWishlistPageHeaderIcons"
  944.                                           onclick="pixupWishlist_removeWishlistModal(document.getElementById('menu'+document.getElementById('wishlistPageTitle').dataset.wishlistId+'-name').innerHTML)"
  945.                                           title="{{ "pixup-wishlist.wishlist-page.header.removeWishlist"|trans }}">
  946.                                         {% sw_icon 'trash' style {"class":" pxHeaderIcon"} %}
  947.                                         <span class="btn-description">{{ "pixup-wishlist.wishlist-page.header.removeWishlist"|trans }}</span>
  948.                                     </span>
  949.                                 </div>
  950.                                 {% block pixup_wishlist_page_details_content %}
  951.                                     <div class="pixupWishlistContent" id="pixupWishlistContent">
  952.                                         {% for wishlist in wishlists%}
  953.                                         {% if (selectedWishlist.id is not empty ? selectedWishlist.id : wishlists[0].id) == wishlist.id %}
  954.                                             {% set wishlists = [wishlist] %}
  955.                                         {% endif %}
  956.                                     {% endfor %}
  957.                                         {% for wishlist in publicWishlist %}
  958.                                             {# if a public wishlist is selected #}
  959.                                             {% set wishlists = [wishlist] %}
  960.                                         {% endfor %}
  961.                                         {% if fullAjaxMode is not true %}
  962.                                             {% sw_include '@Storefront/wishlist/box/product-collection-view.html.twig' with {
  963.                                                 wishlists: wishlists
  964.                                             } only %}
  965.                                         {% endif %}
  966.                                     </div>
  967.                                 {% endblock %}
  968.                             </div>
  969.                         {% endblock %}
  970.                     {% else %}
  971.                         {% block pixup_wishlist_page_error %}
  972.                             <div style="width:100%; text-align:center; font-size: 2em;">{{ "pixup-wishlist.wishlist-page.errorCodes.8"|trans }}</div>
  973.                         {% endblock %}
  974.                     {% endif %}
  975.                 </div>
  976.             {% endblock %}
  977.         </div>
  978.     {% endblock %}
  979.     {% block pixup_wishlist_page_fullajax %}
  980.     <script>
  981.         {% if fullAjaxMode %}
  982.         pixupWishlist_switchWishlist('{{ wishlistId }}')
  983.         {% endif %}
  984.     </script>
  985.     {% endblock %}
  986. {% endblock %}