Hi there,
I am trying to create a buy button to embed on a clients website which links the products in the collection through to the actual Shopify store rather than having the cart and modal popups. From what I can tell via the documentation here: https://shopify.github.io/buy-button-js/customization/ This should be possible via:
Product Attributes buttonDestination
Type: String: 'cart', 'modal', 'checkout', 'onlineStore'
Default value: 'cart'
However when I set this option in the config and click the View Product button it opens a new tab with the following:
https://<hostname><currentpage>/null?channel=buy_button&referrer=http%3A%2F%2F<hostname>%2F<currentpage>%2F&variant=XXXX
Any ideas what is going on - does this only work for particular types of embed?
Any help would be appreciated.
Solved! Go to the solution
This is an accepted solution.
After spending some time looking into this - the Shopify SDK uses the onlineStoreUrl method on the product and in the docs it says the following:
onlineStoreUrl (URL) | The online store URL for the product. A value of null indicates that the product is not published to the Online Store sales channel. |
The site is currently in development and although the product is live on the development store I assume it is returning Null because it is not possible to view the product on the store at this time.
Hope this helps someone if they have the same issue.
User | Count |
---|---|
25 | |
24 | |
23 | |
19 | |
13 |