Tags/topics: 
1
Answers
Vote up!
0
Vote down!

Embedding Sculpteo content

Hi,
I'm completely new to Commerce (just set up Kickstart 2 a few days ago). Not so new to Drupal, but by no means a professional developer. Hobbyist might be a good description.

Well, I want to build a store that takes advantage of the api provided by www.sculpteo.com for their 3D printing services. Using their webAPI, it is possible to embedded their service without their branding. I'll link to their WebAPI documentation pages where you can read about it if you want.

The short version and the basics of my question.
I have various ways to embed their content,
a) Via a special div - <div class="sculpteo_thumbnail" style="width: 250px; height: 350px; position: relative"></div> (more info here)
b) Or using an iframe - <iframe type="text/html" width="250" height="350" src="http://www.sculpteo.com/en/embed/thumbnail/22827170155872258460069652532... frameborder="0" scrolling="no"></iframe> (more info here)
c) Or using a button which opens a popup overlay - <div class="sculpteo_button" click="order"" uuid="CWU47edB"></div> (more info here)
Some javascript is required too, but no issue there.

My question is how, or where and which way would you get that content into Commerce? I think my problem is one of choices... I could get it happening in Drupal generally, but a little unsure about Commerce specifically.

I did notice one way which was a button to a popup overlay, which would be easy enough to add I guess. But then how best to handle the returning response to a 'add to cart' click assuming I want to handle the transaction on my site and not on Sculpteo?

I'm a little confused as to where to start. Knowing where to start, I can probably do my own work from there to move it along quite a way... but I'm a little stuck right now figuring out which way to hold it!

Thanks for all help provided,
Miles

Asked by: Miles McCusker
on September 25, 2014

1 Answer

Vote up!
0
Vote down!

Miles,

Sounds to me like you only have half the puzzle figured out. I recommend getting a blank sheet of paper and drawing a graph of how your website sells 3D printing capabilities. Ultimately you'll need a "handoff" to Sculpteo and then they will need to redirect back to your website to finish the transaction. It's those two touchpoints you need to be very clear about and determining where they happen in the lifetime of a customer's interaction of your "checkout workflow" is going to be crucial. Specifically, do you want them to purchase the ability before they use sculpteo, or do you want them to use sculpteo and then charge.

Option 1: Charge for Access -> API Service

You could use Commerce License to charge for node creation or even just simply to access the tools and manage the "how much" on sculpteo's website.

Option 2: API Service -> Charge

Assuming the API sends information back to your website, you can use Pricing Calculation on a Product to achieve a custom order amount. Assuming the API service sends back "Customer A needs $84 worth of 3D printing" ... I would store this on a line item with a field called "API Result" and attach a specific product that has a multiplier/upcharge on the product itself ... maybe the "Gold Printing Product" which offers faster shipping and larger prints ... Finally, I would create a pricing rule that confirms it's a printing product and has an API result and then multiply the API number with my own 50% upcharge and BAM you have a line item that is $126.

Josh

Josh Miller
Answer by: Josh Miller
Posted: Sep 25, 2014

Comments

Thanks Josh,
The idea to draw it out will help me make sure I understand the process. Good for sanity. Sculpteo appear to have built their system with all that in mind, allowing me to handle the shopping cart side of things. They throw back to me a price and order number etc. Then I have to make sure the money actually goes to the right place afterwards.

A Drupal developer friend has pointed me in the direction of a field with the Sculpteo uid number, which I can format to become part of a the special div (or iframe or whichever method I want to use) in a tpl file somewhere.

However, the issue of dynamic pricing (depending on the final configuration of the printed item - it can change a little bit) plus my mark-up might need to be solved in the way you suggest. I hadn't stopped to worry about that side of things just yet... until you mentioned it. And it is an equally important problem to solve!

Miles

- Miles McCusker on September 26, 2014