Syndicate

Feed

Testing Shopify add to cart functionality from another website while staying put

This is a plain demo of what's explained over here.

Add to Cart form

You wanna buy a bag to carry around your junk, and give me an opportunity to buy more junk for myself?



BUY AN AWFUL BAG NOW (while quantities last)

Cart Content in an iframe

Checkout

More Info Please

Adding to the Cart from a remote website

Last edited by Caroline Schnapp about 42 weeks ago.

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

How come it does not go to cart page after form is submitted ?

Because of this:

<input type="hidden" value="back" name="return_to" />

I'd prefer to do this - work

I'd prefer to do this - work with logical names like the permalink and the sku - blood diamonds than work with id's. It worries me from a maintenance point of view.

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:

<form action="/cart/add" method="post">
 
  <div id="product-variants">
    <div id="price-field">£3.00 GBP
    </div>
 
    <div class="selector-wrapper">
      <select id="product-select-option-0" class="single-option-selector">
        <option value="1024x768">1024x768
        </option>
      </select>
    </div>
    <select style="display: none;" id="product-select" name="id">
 
      <option value="29928632">1024x768 - £3.00
      </option>
 
    </select>
 
  </div>
 
  <input class="" src="http://cdn.shopify.com/s/files/1/0031/8302/assets/purchase.png?1261150992" name="add" value="Purchase" id="purchase" type="image">
</form>

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.

Pizza

I like pizza very much.

Help

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.
Kevin

It unquestionably is okay

It unquestionably is okay for examining your articles, give thank yourself to you for the info and details sharing.

Blizzard

Codies has released the launch trailer for Bodycount ahead of the 信長の野望 RMTgame's UK release this Friday.メイプルストーリー RMTFeaturing new gameplay footage, the movie shows off the shooter's overpowered weaponry in action, tearing up bodies and 'shredding' destructible environments. Watch in HD リネージュ RMTNo comments yet, be the first! Lastリネージュ2 rmt week Codemasters launchedRO RMT a developer diary focusing on the game's competitive multiplayer andアラド RMT co-op modes.A Bodycount demo is available for those of you who want to try out the game pre-release. Tom Ivan

shopping

Cunning and useful in some situations. It also works pretty well so all should try it.

HI

This is a great blog posting and very useful. I really appreciate the research you put into it.

The tenet of customer

The tenet of customer service in the online shopping process is simple: the more you engage potential customers, and provide links relevant to their needs, the more they’ll buy and the longer they’ll remain a customer. As it turns out, the solution to that challenge may be as simple as using shopping cart functionality to its fullest. Thanks for sharing.

Many carts now can integrate

Many carts now can integrate messaging that highlights the benefits that can be earned through membership in a customer loyalty program. This can be a great revenue builder. An online retailer of woolen products, uses its frequent buyer loyalty program to drive not only consistent visitors to the site but also additional revenue. Thanks for sharing.

clearing the cart before adding to cart?

Any way to accomplish this?

I'd like to clear the cart before the user selects items to add. Alternatively, if the user could press an 'empty cart' button that would be cool.

Thanks in advance for your help.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <css> <html> <javascript> <mysql> <php> <span> <a> <b> <i> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <sup> <sub> <dd> <del> <blockquote> <img> <q> <p> <div>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <css>, <html>, <javascript>, <mysql>, <php>, <rails>, <ruby>.

More information about formatting options

CAPTCHA
I have to wonder if you're a human spammer or a machine, or less likely someone who cares to leave his or her thoughts behind.