Buy button Same Window

Va_C
Tourist
5 0 1

When we link the buy button to checkout page and after clicking checkout to finalize order the checkout page opens in a new window, is it possible somehow to open it in same window?

This way it would be less noticeable costumers are leaving main website.

Thank you

Replies 12 (12)
Mircea_Piturca
Shopify Partner
1493 42 320

There is not live link to your store so I am guessing that the link to checkout page has a target="_blank" attribute. Just remove that.

Finally—Add variant descriptions to your products
Va_C
Tourist
5 0 1

I'm placing buy button in external website and the link goes to cart first. Problem is not the buy button but rather that slide window when the cart  opens and you click checkout and it opens a small window to complete order.

When you do this in a shopify store and not actualy external website when you checkout things are smoother and checkout opens in the same window without poping an window like in external site.

I wanted this to be the same in external website.

Thank you.

Jeremy_Sanchez
Shopify Partner
1 0 0

I am also curious to know if this is possible. We have a number of clients that would like to implement the buy button functionality, but they do not want the checkout to open in a new window.

Mircea_Piturca
Shopify Partner
1493 42 320

You could use the new Javascript SDK, links will not open in new window. Here is an example: http://shopify.github.io/js-buy-sdk/examples/

Finally—Add variant descriptions to your products
Va_C
Tourist
5 0 1

Thank you Mircea Piturca.

Unfortunately that is a bit to much for me to acomplish.

Do you know a more newbie friendly guide?

Thank you

Mircea_Piturca
Shopify Partner
1493 42 320

Pretty much that would be the guide.

It is a new API not many examples are out there yet.

Finally—Add variant descriptions to your products
Va_C
Tourist
5 0 1

Ah I see. Got wait for some other examples then as that is a bit advanced to me and don't know where to imlement that code.

Thx

Kajzer_Sose
New Member
1 0 0

Can someone explain me or show where to put and which code to get this like on this page http://awesomescreenshot.com/0145u6ms69, and after click "checkout" to open checkout page in same window?

DrBee
Tourist
8 0 2

See thread https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/using-buy-button-checkout-to-redirect-...

Replace the following line of code;

<script type="text/javascript">

With the code below;

<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);

The checkout page should now open in the same window.

Cheers

Gary