Advertisement
Dzhubal

Untitled

Sep 16th, 2019
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const popup = '<style>\
  2.         .cart-item-info-container a::after {\
  3.             content: "Подробнее";\
  4.             visibility: visible;\
  5.             border-color: #c90057;\
  6.             color: #c90057;\
  7.             font-size: 1em;\
  8.             display: inline;\
  9.             text-decoration: underline;\
  10.             border-style: solid;\
  11.             border-width: 1px;\
  12.             font-weight: bold;\
  13.             line-height: 1.42857143;\
  14.             padding: 4px 11px;\
  15.             border-radius: 4px;\
  16.             position: absolute;\
  17.             left: 0;\
  18.             top: 0;\
  19.         }\
  20.     \
  21.         .cart-item-info-container a {\
  22.             visibility: hidden;\
  23.             position: relative;\
  24.         }\
  25.     </style>\
  26.     <div class="popup-row">\
  27.         <div class="popup-cell">\
  28.             <div class="popup-block">\
  29.                 <div class="image" style=" background-image: url(https://files.carrotquest.io/message-images/20360/20360-1566900229866-bx4mbdd8.jpeg); background-position: center; background-size: contain; background-repeat: no-repeat;height:200px;"></div>\
  30.             </div>\
  31.             <div class="popup-block">\
  32.                 <div class="cart-container">\
  33.                     {% set massViewed = [] %}\
  34.                     {% set massViewedName = [] %}\
  35.                     {% for e in get_last_events("$product_viewed") %}\
  36.                         {% if e.props["$name"].lower().strip() not in massViewedName %}\
  37.                             {% set x = massViewed.append(e) %}\
  38.                             {% set x = massViewedName.append(e.props["$name"].lower().strip()) %}\
  39.                         {% endif %}\
  40.                     {% endfor %}\
  41.                     {% for b in massViewed[:4] %}\
  42.                         {% set url = b.props["$url"] %}\
  43.                         {% set img = b.props["$img"] %}\
  44.                         {% set name = b.props["$name"] %}\
  45.                         {% set price = b.props["$price"] %}\
  46.                         <div class="cart-item">\
  47.                             <div class="cart-item-img" style="background-image: url("{{ img }}")"></div>\
  48.                             <div class="cart-item-info-container">\
  49.                                 <div class="cart-item-info" style="color: #000000;">\
  50.                                     <div class="cart-item-name">{{ name }}</div>\
  51.                                     <div class="cart-item-price right">\
  52.                                         <span class="cart-item-price-cost">{{ price }}</span><span class="cart-item-currency-symbol"> ₽</span>\
  53.                                     </div>\
  54.                                 </div>\
  55.                                 {{ url }}\
  56.                             </div>\
  57.                         </div>\
  58.                     {% endfor %}\
  59.                 </div>\
  60.             </div>\
  61.         </div>\
  62.     </div>';
  63.  
  64. const div = document.createElement('div');
  65.  
  66. div.innerHTML = popup;
  67. div.id = 'cqPopup';
  68. document.body.appendChild(div);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement