Showing results for 
Search instead for 
Did you mean: 

Create a calculated and orderable field

Create a calculated and orderable field


I would like to be able to create a field that is visible when I do a search (such as a price) that is the result of a math computation between two fields of a registered user (or two default fields if the user is not registered). How can I create this virtual field so it is orderable (maybe as a default sort). Which files should I edit?
Thank you all.


Re: Create a calculated and orderable field

Could you create this as two attributes? Then you can import the two fields when you update the price column meaning that they become static rather than dynamic. You can add both of these to be possible to be sorted by. 


Then your customisation just becomes hiding one of these based on if the customer is logged in or not. 

If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!