3 votes
Accepted

how to round Discounts (either half of full number) or total of cart

Are you using a custom adjuster for the discount? If yes, then just use round() to round up. ... $num = $adjustment->amount; // 12.48 $adjustment->amount = round($num, 1, PHP_ROUND_HALF_UP); // ...
user avatar
2 votes
Accepted

How I'll get the orderId in EVENT_AFTER_COMPLETE_ORDER in craft commerce?

Since it's a property-read, you can't do it with Order as an element, but you can try to deal with it via recorders, something like that use yii\base\Event; use craft\commerce\elements\Order; use ...
user avatar
1 vote
Accepted

Add amount to cart line item

You would need to change the price of the line item based on the option data sent in. https://craftcms.com/knowledge-base/dynamically-customizing-line-item-prices
user avatar
  • 6,672
1 vote

Get order shipping address in module

You could also use $order->getShippingAddress() which is even shorter! :)
user avatar
  • 418

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