how to get values from two content types using one entity reference I'm using Drupal 7 and have 3 content types - 


Product 
Purchase 
Sales 


In sales content type, I'm using entity reference I want to fetch and display "product name" from Product content type and "MRP" from Purchase content type. How can I achieve this by configuration?
If all 3 Content types need to be interrelated then it makes sense to use the same Entity Reference Field to connect them (two CTs both use the same Field to reference the third CT). 

But this isn't a requirement, it just makes some things easier if using Views to display information from one CT node on related CT nodes. While this can be solved using Views there is an easier way. 

Use Content view modes to control ER Field display

The easiest way to control which Fields from the referenced node an Entity reference Field should display is to use Content type Fields view modes (not related to Views module). 

You can see available view modes on the Manage display page of a Content type, at the bottom under Custom display settings. 

You need to enable an existing view mode or create a new one on your Product and Purchase Content types, so they can be used for ER Field on Sales CT. 

Select the view mode you want to use (Manage display page) for this purpose and on Product CT hide all the Fields except the product name. 

Similarly, on the Purchase CT view mode you selected for this purpose hide all the Fields except MRP.

Then on Sales CT Manage display page (I'm assuming you have two different ER Fields, one for each CT referenced) select Rendered entity as your ER Field Format for both Fields, and change its configuration to use the view mode you configured in previous steps. 

This way when you visit a Sales node it will show product name and MRP Fields from the referenced nodes instead of their node titles. 

Create new Content view modes in D7

You might need to create a new view mode for this purpose. In D7 it doesn't come out of the box (as it does in D8), but you can create new modes with the help of an additional module or a very simple custom module. Read all about it in this article: 3 Easy Ways to Create View Modes in Drupal 7. 

Display information from another node

To display one node information on a different page (in your case you want to display MRP field from a Purchase node on Service pages) you can use Views module (this is different from view modes mentioned above). 

You use Views to create a Block Display, filter out the node you need, and show only the MRP Field. The place that Block in a region in your theme (maybe Content region) and configure it so it shows only on Service CT nodes. 


Create a new View of showing Content of type All, Create a Block of fields, showing 0 item (this means unlimited, for performance reasons)
Add a new Filter Content: Nid, keep the Operator Is equal to and enter your Purchase node ID number in the Value field (you can see the NID number on that node Edit page in the link)  

If you have Views preview enabled you can now see that exact Purchase node title in the Preview results
Rearrange the Filters so that Content: Nid Filter is above the Content: Published (Yes) Filter (this is for performance reasons)
Remove the Content: Title from Fields 
Add a new Field Content: MRP (or whatever that field is called in your case), configure how you want that Field to appear on Service nodes
Save the View and place your Block in a region of your theme, but limit it to show only on Service CT


To test it visit one Service node and see if the Purchase MRP is showing there, and if you visit any other page then it shouldn't show.