1

I am created one manual order for a customer, which consists 100 products, how can I give 40% discount for total order value, how can I do that, individual order discount is not possible.

0

Have you tried to add a Shopping Cart Price Rule?

Conditions:

Conditions

Actions:

Actions


Edit:

You can alter order amount with this script

MAGENTO_ROOT/filename.php?id=YOUR_ORDER_ID&discount=DISCOUNT_PERCENT

<?php
require_once('./app/Mage.php');
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$request = Mage::app()->getRequest();

$orderId = (int) $request->getParam('id', 0);
$discount = (int) $request->getParam('discount', 0);

if ($orderId && $discount) {
    // $order = Mage::getModel('sales/order')->load($orderId);
    $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);

    if ($order) {
        $discountAmmount = $order->getSubtotal() * $discount / 100;
        $grandTotal      = $order->getSubtotal() - $discountAmmount;

        $order->setDiscountAmount($discountAmmount)->setBaseDiscountAmout($discountAmmount);
        $order->setGrandTotal($grandTotal)->setBaseGrandTotal($grandTotal);
        $order->save();
    }
}

Note: this is not complete! You may also adjust tax amount and maybe item base prices. Also this is accessable for everybody, you should add an IP restriction. So I do not recommend to use it as it is!

  • This one also good, but every custom order count may vary, how can i edit total order value at the order creation. – user51361 Jun 6 '17 at 9:58
  • Mhhh ... if you create the order from backend you can manually set an individual price. – sv3n Jun 6 '17 at 10:04
  • Every time individual price assigning takes more times, that's why I am searching time speed up. – user51361 Jun 6 '17 at 10:06
  • Updated answer to change discount programmatically ... if this is what you're looking for, i can complete this code later ... – sv3n Jun 6 '17 at 11:06
  • there is no issue about tax, let me check in my localhost. – user51361 Jun 6 '17 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy