Hi,
How can i trigger Awcoupon on edit order in virtuemart?
I want to edit items in the order, like change the quantity or delete 1 item, but i can't get the calculation to take in consideration the coupon in the admin area.
Thanks
Thanks
yaniv
subtract the discount from the total and remove it from the history of used coupon
<?php
$data = new stdclass;
$data->virtuemart_paymentmethod_id = x;
$data->virtuemart_shipmentmethod_id = y;
....
$cart = VirtuemartCart::getCart( true, [], $data );
$cart->setCouponCode( 'coupon' );
$prices = $cart->getCartPrices( true );
?>
<?php
$order->coupon_discount = $prices['salesPriceCoupon'];
?>