Extrafield $object->subprice

Hello, good day, sorry for the inconvenience, I have a question, I created several extrafields but in two I want to take values from the columns and add and multiply them and show them in the extrafield created, have the result of pu with discount and total without discount, I don’t know If you understand me, I put an image of the progress and the columns I made, I hope you can help me

foro ingles

When creating a Complementary Attribute aka an Extra field, I believe you should take a look at the Computed Field

Yes, of course, but I don’t understand the logic well since I want to take, for example, the subprice variable and multiply it by the quantity, I thought of $object->subprice*$object->qty. However, my result is blank and even when displaying only the $object-qty variable the result is blank. thanks

Hello,

You should use $objectoffield and not $object

1 Like

thanks ilove so much

sorry, and for values like “discount” and “totalexcltax”?

Do a print_r($objectoffield) to see all the possible fileds

1 Like