как выделить кнопку корзины из кнопок покупки? - PullRequest
0 голосов
/ 02 марта 2020

Я пытаюсь разработать свой новый веб-сайт на Wix и добавить кнопки Shopify. Проблема в том, что «кнопки» включают в себя несколько элементов, а также кнопку корзины. Я хочу изолировать эту кнопку, чтобы я мог разместить ее на всех своих страницах, чтобы клиенты имели доступ к ней со всех страниц. Эта страница поддержки объясняет это: https://community.shopify.com/c/Shopify-Discussion/Buy-button-Shopping-cart-visible-on-all-pages/m-p/358495

Но для меня это звучит как греческий. Помогите пожалуйста!

    <div id='product-component-1583166252177'></div>
<script type="text/javascript">
/*<![CDATA[*/
(function () {
  var scriptURL = 'https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js';
  if (window.ShopifyBuy) {
    if (window.ShopifyBuy.UI) {
      ShopifyBuyInit();
    } else {
      loadScript();
    }
  } else {
    loadScript();
  }
  function loadScript() {
    var script = document.createElement('script');
    script.async = true;
    script.src = scriptURL;
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(script);
    script.onload = ShopifyBuyInit;
  }
  function ShopifyBuyInit() {
    var client = ShopifyBuy.buildClient({
      domain: 'cb-i-hate-perfume.myshopify.com',
      storefrontAccessToken: '81323dd099141e420e3cf7f7c05f1eb2',
    });
    ShopifyBuy.UI.onReady(client).then(function (ui) {
      ui.createComponent('product', {
        id: '4649389326469',
        node: document.getElementById('product-component-1583166252177'),
        moneyFormat: '%24%7B%7Bamount%7D%7D',
        options: {
  "product": {
    "styles": {
      "product": {
        "@media (min-width: 601px)": {
          "max-width": "calc(25% - 20px)",
          "margin-left": "20px",
          "margin-bottom": "50px"
        },
        "text-align": "right"
      },
      "title": {
        "font-weight": "normal"
      }
    },
    "text": {
      "button": "Add to cart"
    }
  },
  "productSet": {
    "styles": {
      "products": {
        "@media (min-width: 601px)": {
          "margin-left": "-20px"
        }
      }
    }
  },
  "modalProduct": {
    "contents": {
      "img": false,
      "imgWithCarousel": true,
      "button": false,
      "buttonWithQuantity": true
    },
    "styles": {
      "product": {
        "@media (min-width: 601px)": {
          "max-width": "100%",
          "margin-left": "0px",
          "margin-bottom": "0px"
        }
      }
    },
    "text": {
      "button": "Add to cart"
    }
  },
  "cart": {
    "text": {
      "total": "Subtotal",
      "button": "Checkout"
    }
  }
},
      });
    });
  }
})();
/*]]>*/
</script>
...