Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @dellmaster,

    Thank you for reaching out.

    I have escalated this with our development team. They will get back to you as soon as they can.

    Kind regards,
    Moshtafizur

    Thread Starter dellmaster

    (@dellmaster)

    I made it by

    $product->update_meta_data(‘_wc_cog_cost’, floatval($cost_price));

    Plugin Contributor Pablo Pacheco

    (@karzin)

    Hi @dellmaster ,

    You can use update_meta_data function, but the cost meta from our plugin is _alg_wc_cog_cost.

    In the end, the example would be like this:

    $product->update_meta_data( '_alg_wc_cog_cost' , floatval( $cost_price ) );
    Plugin Contributor Pablo Pacheco

    (@karzin)

    An additional note,

    After using the update_meta_data(), you should use the save() method as well. Example:

    $product->update_meta_data( '_alg_wc_cog_cost' , floatval( $cost_price ) );
    $product->save();

    Hi,

    I hope you are well and safe.

    We haven’t received any reply regarding the issue. So we are going to mark the ticket as “Resolved”.But if you have any questions, then please let us know.

    Kind regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to set product cost in code’ is closed to new replies.