Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Design a product using Flash
 
Ryuno
Jr. Member
 
Total Posts:  3
Joined:  2008-08-07
 

I sell custom designed furniture, and want to be able to do the following:

1. Customer goes to my website (which is Magento).
2. Customer picks a product (say a chair or table).
3. Customer goes to product page, and embedded on that page is a flash designer.
4. They can play with the designer until they are happy with their design, and then click a button to add it to the cart.

Is this possible to do, and if so how?

What I’m mainly not sure about are these things:

1. How do I embed a flash app on the product page (and this app will be different for each product)?
2. How do I add an item to the cart from the flash app?

Thank you so much for anyone who can shed any light on this confusing issue! I am looking at the documentation at the moment, but can’t seem to answer my questions.

Ryuno

 
Magento Community Magento Community
Magento Community
Magento Community
 
dada21
Jr. Member
 
Total Posts:  28
Joined:  2008-04-01
 

Flash can “easily” pass information to the main site, similarly to how selecting a configurable product would do.

It is not for the faint of heart, but it can be done.  Basically your Flash file would have variables that would change based on what features/options/etc the user picked.  Those variables would be the same variables that the configurable product page would have, but instead of passing those variables from a variety of dropdown boxes, it would do it through the Flash object.

Do you have any Flash coding skills, or are you hoping for a step-by-step tutorial?  I could probably whip something like this up in a day, but I don’t hire myself out.  If you aren’t VERY familiar with Flash, I’d hire a designer who has passed variables before, and I’m sure they could do it fairly cheaply.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ryuno
Jr. Member
 
Total Posts:  3
Joined:  2008-08-07
 

I don’t have any Flash skills, but I do have a fair bit of experience with PHP and other languages.

When you say “Flash can “easily” pass information to the main site”, how does this work? Can the flash app call a URL (i.e a PHP script), or send a POST to a url, or communicate with the MySQL DB directly?

How would I get the flash app into the product page? Can this be done just by putting it into a design template, or will I need to hack around a bit to do this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dada21
Jr. Member
 
Total Posts:  28
Joined:  2008-04-01
 

Flash easily posts to a URL:

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15935&sliceId;=2

Great little tutorial from Adobe there.

Getting it into the product page is a bit more tedious, but it can be done.  What I would do is create a new attribute called “FlashExists” and set it to yes if there’s a flash object for that product, no if there isn’t.  In the project display page, I would query this attribute, and then call up the default code if = no, call up the flash code if = yes.  Maybe even put the flash object file name in another attribute which you can call up directly from the new page code.

I don’t think it would be a HUGE hack, but DOCUMENT YOUR STEPS because when Magento releases an update, you’ll need to re-add all that good stuff again.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ryuno
Jr. Member
 
Total Posts:  3
Joined:  2008-08-07
 

You’ve been a great help, thanks!

I will have a play around and see what I can come up with smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 
dada21 - 07 August 2008 10:14 AM

Flash easily posts to a URL:

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15935&sliceId;=2

Great little tutorial from Adobe there.

Getting it into the product page is a bit more tedious, but it can be done.  What I would do is create a new attribute called “FlashExists” and set it to yes if there’s a flash object for that product, no if there isn’t.  In the project display page, I would query this attribute, and then call up the default code if = no, call up the flash code if = yes.  Maybe even put the flash object file name in another attribute which you can call up directly from the new page code.

I don’t think it would be a HUGE hack, but DOCUMENT YOUR STEPS because when Magento releases an update, you’ll need to re-add all that good stuff again.

You should be able to get away with not hacking at the core code for this (i mean, you can literally copy and paste core code into the “local” folder, add xml to the modules.xml so mangento knows its there, and then hack merrily away at the copy).
I suppose if magento updates, you’ll still need changes, but at least it won’t be to the core

So I guess my conclusion is to agree with documenting your steps thoroughly. (lol)

I should also mention that figuring out what variables PHP sends to do something like “add item to cart” might be a complicated step - since it’s all object oriented, some POST variables might be hard to track down (not necessarily that there is a POST variable, but what it is and how it’s passed might be).

Figuring this out would be a good push in understanding Magento :D

 
Magento Community Magento Community
Magento Community
Magento Community
 
GFX Complex
Member
 
Avatar
Total Posts:  47
Joined:  2007-11-19
St.Louis
 

Here’s the simplest way to thing about how this would best work.
1: create the product as you would normally with it’s attributes that product needs to have, be it check box’s, dropdowns, ect.....

If you wanted to use the default system and NOT flash, the enduser would have to make their choices by use of checkboxs, dropdowns, ect… The choices that the enduse picks are are stored in vars in the php and then sent via the header when the user adds that item to the shopping cart.

The idea is the same if you want to use flash, instead of having your vars stored in php and passed in the header when the enduser clicks the add to chart button in php, you hide attribute checkboxs, dropdowns, ect. in php and reproduct the same options in flash for your enduser. Then have the enduser click on a button in flash to add the item to the shopping cart that way flash can send the same vars in the header of the post request thus alowing the users to make the same choices they would have in php but on now they do it in flash.

The tricky part is to only hide the attribute for products with the need for flash and show them for normal products that way your not breaking the built in functionality of magneto, only extending upon it.

The other trick is to fined out what pre vars flash needs.
Example: if flash is adding the item to the shopping cart it’s likely you need a product ID and price, ect…
So for that you will have to pass the flash player some flash vars once the swf file is loaded in the browser.  Passing the vars is not so hard, it’s knowing what vars it will need and in what order. As this would suggest you will most likely need to pass the same vars from the flash var in the harder along with the choices of the enduser.

If you really want to get fancy you could pass the product attribute options to flash via flash vars that way you could make the system a little more dynamic.

 
Magento Community Magento Community
Magento Community
Magento Community
 
GFX Complex
Member
 
Avatar
Total Posts:  47
Joined:  2007-11-19
St.Louis
 

after a little bit of proxy sniffing. I can tell you that there are 3 default vars that are sent via the header when a product is added to the shopping cart.

1: product - data type: int ("most likely the product ID")
2: related_product - data type: unknown ("since I did not have a related product I did not pass this var, my thoughts it’s the product ID of the related product.")
3: qty - data type: int ("this is the quantities of the product being added to the cart")

If you don’t use a web proxy debugger I would get one. I favor Charles from http://www.charlesproxy.com/

 
Magento Community Magento Community
Magento Community
Magento Community
 
GFX Complex
Member
 
Avatar
Total Posts:  47
Joined:  2007-11-19
St.Louis
 

Heres a update for you if you are using custom options for you products

1: product - data type: int ("most likely the product ID")
2: related_product - data type: unknown ("since I did not have a related product I did not pass this var, my thoughts it’s the product ID of the related product.")

//Here’s when the custom options get passed
3: options["ID"]: data type of the value depends on the option you have set.  and where ID is in options["ID"] that is an int data type that id the ID of the option.
4: options["ID"]: the list continues in this order if there are any more options for that product.

?: qty - data type: int ("this is the quantities of the product being added to the cart")

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top