How to display product profit programmatically?

Top WooCommerce & WordPress Plugins Forums Cost of Goods for WooCommerce How to display product profit programmatically?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #89588
    Luis
    Participant

    Hi,

    I am to use %profit%_(%profit_percent%)) on Bear / Woobe plugin to show profit on a table column. Apparently it is not working. Is this a calculated field that does not store the result on a meta field? Or am I doing something wrong?

    Thank you.

    Luis

    #89589
    WPFactory Plugins
    Participant
    Plugin Author

    Hi Luis,

    Yes, it’s not stored on a meta field. it’s calculated dynamically.
    If you’d like to get it from outside the plugin probably you’d be able to do it like this:

    alg_wc_cog()->core->products->get_product_profit_html( $product_id, $template = '%profit% (%profit_percent%)' );
    
    #90738
    Pablo
    Moderator
    Plugin Support

    Just a note,

    Now we are storing the product profit on some different meta fields:

    • _alg_wc_cog_profit
    • _alg_wc_cog_profit_percent
    • _alg_wc_cog_profit_margin
    • This reply was modified 1 year, 7 months ago by Pablo.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.