0

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Peminator
  • 783
  • 1
  • 9
  • 24
  • In some seven years this question has not acquired useful answers, probably because it needs more details or focus. I will try to close it for now. – halfer Aug 07 '21 at 09:11

1 Answers1

0

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.

miszyman
  • 131
  • 4
  • awwww i see letter fly trough my head :) if any more links could be provided would help me, as Im totally not understanging now, but will try to google it. As a note, i use external pages using the include(Mage.php), but have to do it somehow... – Peminator Dec 09 '14 at 18:50
  • look inside: Mage_Sales_Model_Quote class and config.xml in Mage_Sales module, also you'll have to add an installer to extend sales_flat_quote_item and sales_flat_order tables with an additional tables – miszyman Dec 10 '14 at 13:02