Hi there,
First of all, excuse my horror english.
Thanks a lot for all the comunity for your help in this forum.
I will post a very useful method to integrate flash in the zencart sistem.
You can view how it looks in Zebra Vinilos Decorativos - GO TO ANY (-NOT MURAL-) PRODUCT TO SEE IT -
I sell products that everyone of them use the same atributes names an options and values
Atribute colors with a lot of posibilities
Atribute Finisihing with 2 posibilities Mate and Shine
Atribute orientation Normal or mirror.
First of all I create the atributes in admin of zencart
then I take note of the id of every atribute and option
then, I create good looking buttons on a nice interface, where users can change the atributes in a so mutch more interactive way.
when the user selected everything as he wants, he clicks flash button ADD
then I pass the query that adds that product from flash to zencart adding all the hidden values like color and its selected option,
Code:
sendVars.products_id=_global.products_id; // data obtained from a javascript that recognizes url of the html page -- IF YOU NEED EXPLANATION ON HOW TO MAKE THIS METHOD IN FLASH, I WILL TELL IN OTHER POST
sendVars.cart_quantity="1";
if(_global.acabado=="mate"){
_global.acab="67"; // data decided by the user in the flash environmente
}
if(_global.acabado=="brillo"){ // user selected shine as finishing
_global.acab="66"; // data decided by the user in the flash environmente
}
sendVars["id[7]"] =_global.acab;// ID 7 ( wich is atribute name FINISIHING is MATE or SHINE -- defined in the 2 conditions above
if(_global.orientacion=="normal"){
_global.orient="68"; // data decided by the user in the flash environmente
}
if(_global.orientacion=="espejado"){// user selected mirror as orientation
_global.orient="69";// data decided by the user in the flash environmente
}
sendVars["id[8]"] =_global.orient;//// ID 8 ( wich is atribute name ORIENTATION is NORMAL or MIRROR -- defined in the 2 conditions above
sendVars["id[6]"] =_global.usercolor;//// // ID 6 ( wich is atribute name COLOR is decided by the user in the flash environment
sendVars["id[txt_9]"] = _global.medidasazen;//// // ID 9 ( wich is atribute name MEDIDAS is decided by the user in the flash environment /// this is just a simulation , this atribute doesn´t change the price, it only tells me the size that the user selected, to change the price I used a very useful tactic explained in this forum http://www.zen-cart.com/forum/showthread.php?t=70499 IF YOU NEED EXPLANATION ON HOW TO MAKE THIS METHOD IN FLASH, I WILL TELL IN OTHER POST
_global.peticion="http://www.mydomain.com/mystore/index.php?main_page=product_info&cPath="+_global.cPath/* OBTAINED BY JAVASCRIPT THAT RECOGNIZES THE URL AND THEN COLLECT THE CPATH */+"&products_id="+_global.products_id+"&action=add_product";
sendVars.send(_global.peticion, "_self", "POST");// this sentence send the query to zencart.
In the product info display , I disabled the php code that displays the atributes AND THE BUTTON "BUY" ( to avoid show the atributes twice, once in flash and again in php )
This idea is only useful if every product of your shop uses the same atributes.
If you have different atributes for different products in your shop, just ignore this post.
Thanks to everyone and cya !
Bookmarks