0

I have to change Customer Group.

Once Customer has purchased X Product & Order Status is Completed. In Order apart from X Product if there are any other products then no issue.

Don't wanna use Cron Job. Can manage through Observer?

On Admin Side Once we Click on "Ship", it changes Status to "Completed". So need to execute the event on click of that?

Which Event needs to Call?

Followed below links

Change customer group upon buying a specific product

https://cyrillschumacher.com/magento2-list-of-all-dispatched-events/

https://www.mageplaza.com/magento-2-module-development/magento-2-events.html

1

1 Answer 1

0
5
  • From Admin By clicking on "Submit Shipment" it's not calling
    – Jackson
    Commented Nov 25, 2016 at 6:37
  • You catch sales_order_shipment_save_after? Commented Nov 25, 2016 at 6:40
  • <event name="sales_order_shipment_save_after"> <observer name="change_user_Group" instance="Custom\Module\Observer\ChangeUserGroupObserver" /> </event> i have created file in my custom module located @ magento\app\code\Custom\Module\etc\adminhtml\events.xml
    – Jackson
    Commented Nov 25, 2016 at 6:42
  • Try to get some info: $shipment = $observer->getEvent()->getShipment(); /** @var \Magento\Sales\Model\Order $order */ $order = $shipment->getOrder(); Commented Nov 25, 2016 at 6:48
  • @AnkitShah You can get the shipment info? Commented Nov 26, 2016 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.