Add item to Magento cart with custom text

755 Views Asked by At

I want to programmatically add items to Magento cart using external page through mage.php. I found some how-tos, but due to a lack of experience, I need to allow the customer create the product as with a textfield for customer to enter their own custom text to be applied to product.

So this is not about making any predefined custom options with own sku, just upon order to let the user customize the product with own text and to send this custom entered text to cart and order.

For example: customer orders a red pen with text "Hello" and other pem, the same model, but with text "Hello" on it.

Is any sample code available for this? I'm a Magento beginner, but with long experience of PHP coding.

1

There are 1 best solutions below

2
On

For starters: You would have to modify the QUOTE object and table in order to store extra information, modify the 'add to cart' method to set the custom value to the added fields. The next thing is to modify the functionality of creating order from quote it is configurable in an XML. That should do the trick;)

I know it is fairly generic but maybe it will help for now.