Add new order button status magento
To add a new order button with a specific status in Magento, you can follow these steps:
Step 1: Create a new button
In the Magento admin panel, go to System
> Configuration
> Sales
> Orders
> Order Options
. Click on the Add New Button
button.
Step 2: Configure the button
In the Add New Button
form, enter the following information:
Button Label
: Enter the text you want to display for the button (e.g. "New Order").Button Code
: Enter a unique code for the button (e.g. "new_order").Button Type
: SelectAction
as the button type.Action
: SelectOrder
as the action.Status
: Select the status you want to set for the new order (e.g. "pending").
Step 3: Add the button to the order view page
In the Magento admin panel, go to System
> Configuration
> Sales
> Orders
> Order View
. Click on the Add Button
button.
Step 4: Configure the button position
In the Add Button
form, select the position where you want to display the button (e.g. Order Actions
).
Step 5: Save the changes
Save the changes to the configuration.
Step 6: Test the button
Go to the order view page and click on the new button. The order should be created with the specified status.
Here is an example of how the button code might look:
<?php
$button = $this->getLayout()->createBlock('adminhtml/widget_button');
$button->addAttribute('id', 'new_order');
$button->setClass('save');
$button->setLabel('New Order');
$button->setOnClick('this.form.submit();');
$button->setUrl($this->getUrl('sales/order/new'));
echo $button->toHtml();
?>
This code creates a new button with the label "New Order" and sets the URL to the sales/order/new
action. When the button is clicked, it submits the form and creates a new order with the specified status.
Note: You may need to modify the button code to fit your specific requirements.