Magento Forum

   
Populated Shopping Cart via URL? 
 
mkorsmo
Jr. Member
 
Total Posts:  4
Joined:  2008-06-22
 

Is it possible to send a user directly to a magento shopping cart prepopulated with an item? Such as a “buy now” button on another, related site? And would it be possible to pass a custom attribute (say, the text for an engraving?) into a custom field?

I don’t need a solution, just a shove in the right direction.

Regards,

Matt

 
Magento Community Magento Community
Magento Community
Magento Community
 
alistek
Sr. Member
 
Total Posts:  293
Joined:  2008-04-02
Normal, IL
 

I am actually working on something similar in concept to that, passing in variables through parameters.  The basic idea is that in the core/<module>/Block you have the files that control what data your frontend theme template files have and then set relevant data that way.  That would be how to do it but I am still having trouble with it.  There is a function:

$this->getRequest->getParam('id');

Whatever is the parameter passed to the getParam function is what is in your url, i.e.

/catalog/id/1/

This means that whatever variable you assign the parameter to will get the value after the ‘id’ url section (1).  I am trying to figure out in the controllers section what to do with anything not /catalog/, i.e. with the paramaters appended and directing it to the right place.

EDIT: I should have said that you would do that in the Blocks directory not in the template directories.

-Adam

 
Magento Community Magento Community
Magento Community
Magento Community
 
mkorsmo
Jr. Member
 
Total Posts:  4
Joined:  2008-06-22
 

Thanks for your replay. That sounds like an approach to explore for certain.

Even the ability to send them to a product page with a special field to contain the customer specific details would work.

- Matt

 
Magento Community Magento Community
Magento Community
Magento Community
 
alistek
Sr. Member
 
Total Posts:  293
Joined:  2008-04-02
Normal, IL
 

There is no reason that couldn’t work due to the fact that you can pull in data through parameters quite easily.  The struggle I am having right now is the fact that in my IndexController, I cannot get it to pull the parameters correctly, and I may not be doing it in the right place.  Once I get that figured out then all of that should be trivial.  Just a matter or modifying the controllers to redirect where you want them to go based on the input.

-Adam

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

did you ever figure this out - we are trying to do the same thing - we have a flash site that you can configure the product in the click on go to store which goes to the product page and we want it to fill in all of the options that the user chose in the flash portion.

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