7

No, because it is a 1:n association, there are multiple statuses per state. You can, however, get a list of all statuses that are assigned to a state $stateCode, and their names, with: $statuses = Mage::getResourceModel('sales/order_status_collection') ->addStateFilter($stateCode) ->toOptionHash(); $statuses then contains an array in the ...


4

We should take a look some tests: dev/tests/integration/testsuite/Magento/Payment/_files/order_status.php /** @var \Magento\Sales\Model\Order\Status $status */ $status = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Sales\Model\Order\Status'); //status for state new $status->setData('status', 'custom_new_status')->...


3

It occurred to me that Magento does this when viewing an Order in the backend; specifically the "Comments History" box has a dropdown populated with allowed Statuses for the given state. Looking into that block turned up this solution: public function getStatuses() { $state = $this->getOrder()->getState(); $statuses = $this->getOrder()->...


3

class InstallData implements InstallDataInterface { /** * Sales setup factory * * @var SalesSetupFactory */ private $salesSetupFactory; /** * @var Builder */ private $sequenceBuilder; /** * @var SequenceConfig */ private $sequenceConfig; /** * @param SalesSetupFactory $salesSetupFactory * @param Builder $sequenceBuilder * @param ...


2

I'll assume you know how to create a new extension. Add a new cronjob in the file config.xml of your extension: <?xml version="1.0" encoding="UTF-8"?> <config> <!-- ... rest your extension configuration ... --> <crontab> <jobs> <cancel_pending_orders> <schedule> ...


2

The states like "pending" and "processing" change based on certain conditions. You can define custom statuses but those are always assigned to one of those states. To get from "pending" from "processing", create an invoice or a shipment. Orders become "processing" if one of these exist but not both. Update: I see, you tagged the post with php. ...


2

You need to create a new module and use a 'plugin' to add some logic to the isAvailable method of Magento\OfflinePayments\Model\Cashondelivery. Example plugin class: <?php namespace Your\Module\Plugin; use Magento\Payment\Model\Method\AbstractMethod; use Magento\Quote\Model\Quote; class CashondeliveryPlug { public function aroundIsAvailable(...


1

To create a new order status follow the below step : Create a Custom Order Status Assign an order status to a state Custom an existing order status Remove an order status from the current state On the Admin Panel, Stores > Settings > Order Status. In the upper-right corner, click on Create New Status. To check detail description check this How to ...


1

Create new order status and assign to close state. Check following url Change order status In this example they explain for pending status. I think it may help you. For change state, i think you need to add new action in dropdown and on select newly created action you have to write code for change state. For add new label in action dropdown, please check ...


1

Use Magento\Sales\Model\ResourceModel\Order\Status\Collection class to get status collection protected $statusCollection; public function __construct( ... \Magento\Sales\Model\ResourceModel\Order\Status\Collection $statusCollection, ... ) { ... $this->statusCollection = $statusCollection; ... } public function ...


1

Have you gone through all the error logs including system.log, execption.log and braintree.log ensuring there are no errors or restrictions whether whitelisted all IP's and cleared all rules with our firewall to ensure there is nothing blocking us there. try using the IP instead of the URL for the ens URL Create new API keys & Check user permissions


1

If you are creating extension then you can use below script into your InstallData.php or UpgradeData.php $states = [ 'test' => [ 'label' => __('test'), 'statuses' => ['test' => ['default' => '1']], 'visible_on_front' => true, ], ]; foreach ($states as $code => $info) { ...


1

The solution is to remove the check $order->canCancel() because it can be cancelled (and cleared after X days)


1

I was with the same doubt and found this post that helped me a lot to understand See https://www.mageworx.com/wiki/magento-2-order-status/ Maybe help u too !!!


1

An order state can have multiple order statuses, whereas one order status is the default of one order state. You can check out the Order States and Statuses here: System > Order Statuses as shown in this picture: Standard order status as of Magento CE 1.9.2.0 (see table sales_order_status) are: Canceled Closed Complete Suspected Fraud On Hold Payment ...


1

The only other way is modifying the database directly, but I wouldn't recommend that. Thus, you'll have to create invoice and shipment programatically.


1

Pending = not paid yet Processing = Paid not shipped/Shipped not paid So I would go with processing


Only top voted, non community-wiki answers of a minimum length are eligible