Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Roger

Do simple calculations

Hi, sometimes I need to set up simple calculations for custom fields.

Right now I’m looking for a way to calculate the margin for each product.
E.g. Cost of Goods / Regular price = margin.

That would be cool if you find a way to implement it – or maybe it is already possible, I’ve just not found the way? :)

I understand I can add some custom fields using extra code, but very often the custom fields we have available is already added by plugins, and I don’t have the skills to create extra code to do calculations based on those, and then put the result in another custom field which I in turn can get using Admin Columns.. :\

I tried a search and found some people looking for the same possibility, but those posts I found was 4-6 years old, so I gave myself blessings for adding a new request for it here :)

And I just have to say it again – Holy Cow(!) this plugin is so freaking valuable – how much it can do – and how time saving it is… I don’t have enough words in my English vocabulary to express it.

Much based on your plugin, I’ve been able to migrate two LARGE stores from Prestashop to Woocommerce, with a total of 5000 products and 400 categories, with different sizing maps for clothes and costumes, clothing departments “men, women, kids” and so on. It would not have been possible to get it all done if it wasn’t for Admin Columns.
So again – thanks!

8 months ago
Roger

Err– I meant of course:
E.g. Regular price / Cost of Goods = margin 🤦‍♂️

8 months ago
Stefan
Developer

Roger,

Thank you very much for your feedback, I’m glad you like the plugin and that it already helped you so much :)
There is no one-fits-all solution in our plugin that can do calculations based on multiple columns.
If there is a use case that fits in our core plugin or in one of our integrations, we could always make a custom column of it. Although your margin calculation seems like a very nice use case, it contains a custom field that is not available in WooCommerce by default, the ‘cost of goods’ price. This means that a column like that in our WooCommerce integration could not be used by everyone, which makes it a no-go for our WooCommerce integration.

The alternative for that is to create a custom column for it. The toolkit gives an example of how to create the column. The code for the column is not that difficult, but it still needs some coding to accomplish. If you can find a developer and show him what you want in combination with the toolkit we have, I’m sure will get a column in no time that gives you the desired calculated value.

Creating a custom field to store the margin is of course also possible, but in that case, you’ll need to keep track of any changes made in the price or cost of goods fields. The advantage of this way is that you can easily use our pro features like sorting and filtering.

Calculating the margin on the fly is quick to make and it works well for displaying the value, but making it sortable and filterable will become more difficult to make.

8 months ago
Roger

Thanks.

You are referring to the toolkit. Is this somewhere in the docs?
Could you share a link, or did I misunderstand?

8 months ago

You must be logged in to reply to this topic.