Magento 2.1 – Set Different Prices for Different Store Views and Render in Admin Product Form

adminformmagento-2.1priceproduct-attributestore-view

I am working on an extension in which I need to create different prices based on the different store view. I have created own table in which I am saving store view id and product id on event catalog_product_save_after.

I want to join this table with a product price table in the data provider of product form in admin. I tried with different tricks, but I failed. I need to show the price per store view. Could anyone help me to achieve this? Help will be appreciated

Thank You

enter image description here

Best Answer

I got the answer the answer of above question by printing events in \vendor\magento\framework\Event\Manager.php

On event catalog_product_edit_action call your own observer just fetch price data for particular store view and set that price like this

  $observer->getProduct()->setPrice(50);

that's it, here static price 50 is set in admin product edit form.

Related Topic