Question

Is it possible, in Magento, to build a button to add a new simple product while creating an order in the backend?

It is not important that the product would be saved in the catalog: it should to be saved into the order. Only two of the product's attributes would be needed: name and tax rate (optionally others). Qty e price could be edited from the order cart.

Was it helpful?

Solution 2

Thanks to Beto Castillo I went into the spirit to think more clearly about this. The project is yet under construction. Anyway starting steps could be:

  1. Create the right inputs to add a new product in a ChildHtml of sales/order/create/data.phtml, and adjust the layout files. Along with the inputs there will be a button to trigger the creation of the product. In one of this inputs I have to load options for tax rates.
  2. There is plenty of ways to create a new product, i.e. Magento: Adding new products programmatically. I just need to get the above inputs.
  3. The product should be added to order quotes in the database (I could start with this: Create order programmatically in Magento)
  4. Update the create order view, calling an ajax function to reload the item grid. Part of the code already exists in Magento. All this steps should be packed into the same ajax call: here comes the controller action named by Beto Castillo.

So the answer is yes, it is possible.

OTHER TIPS

Yes, it's posible, you need a controller in order to do that. Remember that you need to provide us the code that you're working on, and don't expect that we program all for you. Thanks

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top