Thank you for this. This is a really cool trick and exactly what I have been looking for, cannot believe I have not noticed this before.
I am trying to make alternative store front with php/json and shopify rest api. And this definately gets me closer to where I want to be.
I got one questions. How come it does not go to cart page after form is submitted ? That is when I do that on my page and click submit the products are added to the cart and I am sent to the cart page, it does not happen in your case.
Is there an option to make a call to shopify, passing a product permalink and sku (say), and it have it return the standard shopify html where you select a variant, and press the submit button? The entire form in other words, like this:
It's worth creating a tutorial for this. Give me a week to put it together.
Hint: you will need to use {% layout none %} in a special template in your Shopify's admin, while using PHP (or Ruby) to include the HTML on your page on that website of yours that's not hosted on Shopify.
Comments
question
Thank you for this. This is a really cool trick and exactly what I have been looking for, cannot believe I have not noticed this before.
I am trying to make alternative store front with php/json and shopify rest api. And this definately gets me closer to where I want to be.
I got one questions. How come it does not go to cart page after form is submitted ? That is when I do that on my page and click submit the products are added to the cart and I am sent to the cart page, it does not happen in your case.
Using return_to=back
Because of this:
<input type="hidden" value="back" name="return_to" />more declarative option possible?
Hi Caroline, thanks for this.
Is there an option to make a call to shopify, passing a product permalink and sku (say), and it have it return the standard shopify html where you select a variant, and press the submit button? The entire form in other words, like this:
I'd prefer to do this - work with logical names like the permalink and the sku - than work with id's. It worries me from a maintenance point of view.
Thanks for your help Caroline.
Mike.
There's a way, yes.
It's worth creating a tutorial for this. Give me a week to put it together.
Hint: you will need to use
{% layout none %}in a special template in your Shopify's admin, while using PHP (or Ruby) to include the HTML on your page on that website of yours that's not hosted on Shopify.Post new comment