Using buy button - checkout to redirect not pop up

New Member
1 0 0
Does this only work if you have a cart?

The ‘cart’ code is not in my embed.

We have it set up so you go straight to checkout from the ‘buy button’..


Any work arounds would be great! We sell one item exclusively and this pop up just makes everything super weird!!
0 Likes
New Member
1 0 0

You might want to re-create your button, as it could be related to which options you enable when creating. 

I just did as the post suggested, adding that one line, at the right spot, and it indeed takes you to the checkout URL in the original window/screen.

0 Likes
New Member
4 0 0

I tired to use that line of code as well but after click checkout it re-directs to a blank page.  Any thoughts on what I might be doing wrong?

 

},
"cart": {
"contents": {
"button": true
},
"popup":false,
"text": {
"total": "Subtotal",
"button": "Checkout"
}
}

 

Screen Shot 2019-08-26 at 7.12.34 PM.png

0 Likes
New Member
4 0 0

I'm having trouble following - should it look like this: 

 

<div id='collection-component-1566951966130'></div>
<script type="text/javascript">
<script data-shopify-buy-ui="">
window.open = function (open) {
return function (url, name, features) {
// Pass through non-shopify URLS
if (url.indexOf("myshopify") < 0) {
return open.call(window, url, name, features);
}
// Use current window
console.log("Redirecting to:", url);
window.location.href = url;
return null;
};
}(window.open);
/*<![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();
  }
0 Likes
Highlighted
Shopify Partner
14 0 21

Used DrBee's suggestion and it keeps me in the same window. However, if I want to checkout through the regular shop or go back to the store to order additional items, the "regular" store cart has nothing in it.  Any idea how to merge those two carts?

0 Likes