How to set default order status is complete when the order is created in Magento 1.xCustom cron causing one page checkout deadlocksforce magento order status completeCreate invoice and shipment in magento via cron based on store view and order agehow to manually set order status to “Complete”?Change Order Status to custom status after order is completehow to change the status of the order to pending from complete?how to change magento order status programatically?Magento 2 - Change order status when Credit memo createdMagento 2 How to disable price from orders, customer account and order view if custom module is enabled?Magento 2.2.2 error when setting order status with API
Diagram with cylinder shapes and rectangles
What is the meaning of "prairie-dog" in this sentence?
What does "frozen" mean (e.g. for catcodes)?
What are the consequences for a developed nation to not accept any refugees?
Can we share mixing jug/beaker for developer, fixer and stop bath?
Where are the Wazirs?
Name for an item that is out of tolerance or over a threshold
What is the average number of draws it takes before you can not draw any more cards from the Deck of Many Things?
Tesco's Burger Relish Best Before End date number
Interpretation of non-significant results as "trends"
What are the effects of abstaining from eating a certain flavor?
What does the multimeter dial do internally?
Which is a better conductor, a very thick rubber wire or a very thin copper wire?
What purpose does mercury dichloride have in fireworks?
Passwordless authentication - how and when to invalidate a login code
Calculate the largest palindromic number from the product of two 6-digit numbers (100000 to 999999)
Jimmy needs your help!
What happens if a short can't be covered?
How did the IEC decide to create kibibytes?
Taking my Ph.D. advisor out for dinner after graduation
Gory anime with pink haired girl escaping an asylum
3-way switches no longer serving their purpose
Will Jimmy fall off his platform?
Was it ever illegal to name a pig "Napoleon" in France?
How to set default order status is complete when the order is created in Magento 1.x
Custom cron causing one page checkout deadlocksforce magento order status completeCreate invoice and shipment in magento via cron based on store view and order agehow to manually set order status to “Complete”?Change Order Status to custom status after order is completehow to change the status of the order to pending from complete?how to change magento order status programatically?Magento 2 - Change order status when Credit memo createdMagento 2 How to disable price from orders, customer account and order view if custom module is enabled?Magento 2.2.2 error when setting order status with API
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a problem, my shop allows users to buy products with "Manage Stock = No and Qty = 0".
It's work fine, but when the order is created, if the customer buys the product with qty > 0 then order status = complete, but qty < 0, order status is not complete.
How to set default order status is complete when the order is created.
Thanks all.
My code
protected function _getOrderCreateModel()
return Mage::getSingleton('adminhtml/sales_order_create');
public function createOrder($object)
$this->init($object);
$methodInstance = $this->_getOrderCreateModel()->getQuote()->getPayment()->getMethodInstance();
$methodInstance->getInfoInstance()->setQuote($this->_getOrderCreateModel()->getQuote());
$methodInstance->validate();
$this->_getOrderCreateModel()->getQuote()->setStoreToQuoteRate(1);
$this->_getOrderCreateModel()->getQuote()->setBaseToGlobalRate(1);
$this->_getOrderCreateModel()->getQuote()->setStoreToBaseRate(1);
$this->_getOrderCreateModel()->getQuote()->setBaseToQuoteRate(1);
if ($this->checkRewardPointModule()):
$amt = (-1) * Mage::helper("posrewardpoints")->creditsToMoney($object['pos_credits_credits_used']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsApplied($object['pos_credits_applied']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsCreditsUsed($object['pos_credits_credits_used']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsMoneyUsed($amt);
endif;
$this->_getOrderCreateModel()->saveQuote();
$this->_getOrderCreateModel()->getQuote()->setTotalsCollectedFlag(true);
$order = $this->_getOrderCreateModel()->createOrder();
$order->setData('pos_user_id', $object['pos_user_id']);
if ($object['comments'] != '')
$order->addStatusToHistory($order->getStatus(), $object['comments'], false);
$order->save();
if ($object['order_collected_by'] != '')
$state = $order->getState();
$status = 'order_collected_by';
$isNotified = false;
$order->setState($state);
$order->setStatus($status);
$order->addStatusToHistory($order->getStatus(), $object['order_collected_by'],$isNotified);
$order->save();
$couponCode = $this->_getOrderCreateModel()->getQuote()->getCouponCode();
if (!empty($couponCode))
Mage::helper('PointOfSales/Discount')->deleteCoupon();
$this->_getOrderCreateModel()->getQuote()->setIsActive(false)->save();
$this->affectWarehouse($order);
return $order;
magento-1.9 orders order-status
add a comment |
I have a problem, my shop allows users to buy products with "Manage Stock = No and Qty = 0".
It's work fine, but when the order is created, if the customer buys the product with qty > 0 then order status = complete, but qty < 0, order status is not complete.
How to set default order status is complete when the order is created.
Thanks all.
My code
protected function _getOrderCreateModel()
return Mage::getSingleton('adminhtml/sales_order_create');
public function createOrder($object)
$this->init($object);
$methodInstance = $this->_getOrderCreateModel()->getQuote()->getPayment()->getMethodInstance();
$methodInstance->getInfoInstance()->setQuote($this->_getOrderCreateModel()->getQuote());
$methodInstance->validate();
$this->_getOrderCreateModel()->getQuote()->setStoreToQuoteRate(1);
$this->_getOrderCreateModel()->getQuote()->setBaseToGlobalRate(1);
$this->_getOrderCreateModel()->getQuote()->setStoreToBaseRate(1);
$this->_getOrderCreateModel()->getQuote()->setBaseToQuoteRate(1);
if ($this->checkRewardPointModule()):
$amt = (-1) * Mage::helper("posrewardpoints")->creditsToMoney($object['pos_credits_credits_used']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsApplied($object['pos_credits_applied']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsCreditsUsed($object['pos_credits_credits_used']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsMoneyUsed($amt);
endif;
$this->_getOrderCreateModel()->saveQuote();
$this->_getOrderCreateModel()->getQuote()->setTotalsCollectedFlag(true);
$order = $this->_getOrderCreateModel()->createOrder();
$order->setData('pos_user_id', $object['pos_user_id']);
if ($object['comments'] != '')
$order->addStatusToHistory($order->getStatus(), $object['comments'], false);
$order->save();
if ($object['order_collected_by'] != '')
$state = $order->getState();
$status = 'order_collected_by';
$isNotified = false;
$order->setState($state);
$order->setStatus($status);
$order->addStatusToHistory($order->getStatus(), $object['order_collected_by'],$isNotified);
$order->save();
$couponCode = $this->_getOrderCreateModel()->getQuote()->getCouponCode();
if (!empty($couponCode))
Mage::helper('PointOfSales/Discount')->deleteCoupon();
$this->_getOrderCreateModel()->getQuote()->setIsActive(false)->save();
$this->affectWarehouse($order);
return $order;
magento-1.9 orders order-status
add a comment |
I have a problem, my shop allows users to buy products with "Manage Stock = No and Qty = 0".
It's work fine, but when the order is created, if the customer buys the product with qty > 0 then order status = complete, but qty < 0, order status is not complete.
How to set default order status is complete when the order is created.
Thanks all.
My code
protected function _getOrderCreateModel()
return Mage::getSingleton('adminhtml/sales_order_create');
public function createOrder($object)
$this->init($object);
$methodInstance = $this->_getOrderCreateModel()->getQuote()->getPayment()->getMethodInstance();
$methodInstance->getInfoInstance()->setQuote($this->_getOrderCreateModel()->getQuote());
$methodInstance->validate();
$this->_getOrderCreateModel()->getQuote()->setStoreToQuoteRate(1);
$this->_getOrderCreateModel()->getQuote()->setBaseToGlobalRate(1);
$this->_getOrderCreateModel()->getQuote()->setStoreToBaseRate(1);
$this->_getOrderCreateModel()->getQuote()->setBaseToQuoteRate(1);
if ($this->checkRewardPointModule()):
$amt = (-1) * Mage::helper("posrewardpoints")->creditsToMoney($object['pos_credits_credits_used']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsApplied($object['pos_credits_applied']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsCreditsUsed($object['pos_credits_credits_used']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsMoneyUsed($amt);
endif;
$this->_getOrderCreateModel()->saveQuote();
$this->_getOrderCreateModel()->getQuote()->setTotalsCollectedFlag(true);
$order = $this->_getOrderCreateModel()->createOrder();
$order->setData('pos_user_id', $object['pos_user_id']);
if ($object['comments'] != '')
$order->addStatusToHistory($order->getStatus(), $object['comments'], false);
$order->save();
if ($object['order_collected_by'] != '')
$state = $order->getState();
$status = 'order_collected_by';
$isNotified = false;
$order->setState($state);
$order->setStatus($status);
$order->addStatusToHistory($order->getStatus(), $object['order_collected_by'],$isNotified);
$order->save();
$couponCode = $this->_getOrderCreateModel()->getQuote()->getCouponCode();
if (!empty($couponCode))
Mage::helper('PointOfSales/Discount')->deleteCoupon();
$this->_getOrderCreateModel()->getQuote()->setIsActive(false)->save();
$this->affectWarehouse($order);
return $order;
magento-1.9 orders order-status
I have a problem, my shop allows users to buy products with "Manage Stock = No and Qty = 0".
It's work fine, but when the order is created, if the customer buys the product with qty > 0 then order status = complete, but qty < 0, order status is not complete.
How to set default order status is complete when the order is created.
Thanks all.
My code
protected function _getOrderCreateModel()
return Mage::getSingleton('adminhtml/sales_order_create');
public function createOrder($object)
$this->init($object);
$methodInstance = $this->_getOrderCreateModel()->getQuote()->getPayment()->getMethodInstance();
$methodInstance->getInfoInstance()->setQuote($this->_getOrderCreateModel()->getQuote());
$methodInstance->validate();
$this->_getOrderCreateModel()->getQuote()->setStoreToQuoteRate(1);
$this->_getOrderCreateModel()->getQuote()->setBaseToGlobalRate(1);
$this->_getOrderCreateModel()->getQuote()->setStoreToBaseRate(1);
$this->_getOrderCreateModel()->getQuote()->setBaseToQuoteRate(1);
if ($this->checkRewardPointModule()):
$amt = (-1) * Mage::helper("posrewardpoints")->creditsToMoney($object['pos_credits_credits_used']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsApplied($object['pos_credits_applied']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsCreditsUsed($object['pos_credits_credits_used']);
$this->_getOrderCreateModel()->getQuote()->setPosCreditsMoneyUsed($amt);
endif;
$this->_getOrderCreateModel()->saveQuote();
$this->_getOrderCreateModel()->getQuote()->setTotalsCollectedFlag(true);
$order = $this->_getOrderCreateModel()->createOrder();
$order->setData('pos_user_id', $object['pos_user_id']);
if ($object['comments'] != '')
$order->addStatusToHistory($order->getStatus(), $object['comments'], false);
$order->save();
if ($object['order_collected_by'] != '')
$state = $order->getState();
$status = 'order_collected_by';
$isNotified = false;
$order->setState($state);
$order->setStatus($status);
$order->addStatusToHistory($order->getStatus(), $object['order_collected_by'],$isNotified);
$order->save();
$couponCode = $this->_getOrderCreateModel()->getQuote()->getCouponCode();
if (!empty($couponCode))
Mage::helper('PointOfSales/Discount')->deleteCoupon();
$this->_getOrderCreateModel()->getQuote()->setIsActive(false)->save();
$this->affectWarehouse($order);
return $order;
magento-1.9 orders order-status
magento-1.9 orders order-status
edited Jun 28 at 11:08
TN98
asked Jun 28 at 10:46
TN98TN98
31010 bronze badges
31010 bronze badges
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f280071%2fhow-to-set-default-order-status-is-complete-when-the-order-is-created-in-magento%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f280071%2fhow-to-set-default-order-status-is-complete-when-the-order-is-created-in-magento%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown