Hi,
So I have been toying around with this for awhile. I have created a flash swf that will allow my customers to customize their product with a nice GUI. What I want to do is have a button at the end of the my flash product editor that will send it to the shopping cart. Right now I have the flash swf call a php file that creates a new product within the appropriate zencart databases and then it returns the products_id. This works 100% perfectly.
Now I want to add this to the customer's cart. I have tried inserting the new product_id into the customers_basket DB, however, I ran into issues with the customer_ID number. It tends to want to default to 0 all the time. So i scratched that idea.
I then began to analyze much of the zencart code within various. Based on my research of the files and researching many threads, I have come to the conclusion that when a call is made to the following:
(### being the categories ID and the product ID respectively)Code:http://www.domain.com/index.php?main_page=product_info&cPath=###&products_id=###&action=add_product
the product is added to the cart. I have also come to the understanding that the variables cart_quantity, product_id, and any attributes involved with the product are sent as parameters using POST.
What I have tried doing is sending the parameters to that URL within AS3 (i can post this code if necessary). This did not work and the page just said "transferring data from ....." and did nothing.
My next step was to try it from my php function that I call from the flash that has been working to submit new products to the zencart DBs.
What this is doing is returning the code of the shopping_cart pageCode:$postdata = http_build_query(array('cart_quantity' => '1','products_id' => '33')); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata )); $context = stream_context_create($opts); $result = file_get_contents('http://www.domain.com/index.php?main_page=product_info&cPath=###&products_id=###&action=add_product', false, $context);
Any ideas?



