Magento Forum

   
Can I Pre populate product page by passing in variables
 
DesignGal
Jr. Member
 
Total Posts:  4
Joined:  2008-09-22
 

Hi there, I have a possible client who has 8 product colors and as many designs configurations. That resulted in as many as 5,000 configurations that a buyer could choose. The developer originally did the clients site in flash but wanted to avoid creating 5000 SKU’s so they set up Magento for them.

My question is, can they still choose their product configuration through the flash site, then when they click purchase product, export the product and option variables they chose in the flash into Magento, so that it automatically populated the cart with their chosen design, rather than forcing them to complete the process again.

Thanks in advance
Blue Leaf Graphics

 
Magento Community Magento Community
Magento Community
Magento Community
 
wdchoi
Jr. Member
 
Total Posts:  20
Joined:  2008-11-17
 

Hi there too !

Ok, I’m not sure I got what you wrote, but I might give you the lead here.

From the flash, you should be able to call normal urls with parameters… I hope you’re comfortable with magento’s MVC. If not, ask me.

So, you have to go see the Mage/Checkout/controllers/CartController.php. In it you’ll see the addAction(). This is the action you need to call to add a product in your cart. From there, you have to find which parameters need to be given. For now, the main one is ?product=product_id

As for the SKU and configurations issue, I believe it is possible to change the way to add a product in the cart. Right now, the addAction mentionned above needs the product_id parameter to add the product. When it finds the product_id, it loads the product by the id. That’s the thing to change. You can override this controller and the addAction (actually, the _initProduct() method called within) to load a product by other parameters… which would be the configurations parameters you want to. however, note that your final selected product must be unique. (by that I mean that the parameters you choose to use here must help you get one and only one product to add in your cart).

David

 
Magento Community Magento Community
Magento Community
Magento Community
 
DesignGal
Jr. Member
 
Total Posts:  4
Joined:  2008-09-22
 

Hi there - I think I might have confused you - what is happening is we have a flash site (that we didn’t design) you can configure the product in it, then you click go to shopping cart. It jumps you to the products page in magento where all of the product options SHOULD be set for you using the URL variables.

?clr=Coral&op1;=handle&op2;=brake&interior;=AL.BILL&intclr;=white

But it’s not working - any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
silverdog
Jr. Member
 
Total Posts:  4
Joined:  2009-03-23
 

Design Gal

Did you ever get this working?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nishantkyal
Jr. Member
 
Total Posts:  4
Joined:  2009-10-12
 

Hi,

Thanks for your help. I can now add product by calling the add action.

However, my product has to be configured with options before adding to cart. How do I do that?

 
Magento Community Magento Community
Magento Community
Magento Community
 
tmort
Jr. Member
 
Total Posts:  5
Joined:  2010-01-13
 

Hey all,

Did you ever find a way to fill out custom options before adding it to cart?

 
Magento Community Magento Community
Magento Community
Magento Community
 
TRMMarketing
Sr. Member
 
Avatar
Total Posts:  145
Joined:  2009-11-29
 

Use can just add to cart using a query string I found this wiki very helpful

http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/adding_a_product_to_the_cart_via_querystring

I should mention that I found that someone had to be on the site itself for this to function when being called from flex. I am guessing this has to do with the session not being set correctly otherwise.

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