• Resolved FilipeOS

    (@filipeos)


    Hi there,

    I have a stock manager export plugin and I need to print the MSRP for each product (or variation), whats the variable name on the database to get it or code please?

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Algoritmika

    (@algoritmika)

    Hi @filipeos,

    MSRP is saved as a product (i.e. post) meta with _alg_msrp key. If I would need to get it via PHP, I would call:

    get_post_meta( $product_id, '_alg_msrp', true );

    Hope that helps. Please let me know if you have any questions.

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @filipeos,

    We’ve just released new plugin v1.3.4. There I’ve added new more sophisticated function for retrieving the MSRP from the product:

    
    $msrp                  = alg_wc_msrp_get_product_msrp( $product_id );
    $msrp_discount         = alg_wc_msrp_get_product_msrp( $product_id, 'msrp_discount' );
    $msrp_discount_percent = alg_wc_msrp_get_product_msrp( $product_id, 'msrp_discount_percent', 0 );
    

    * You can also omit $product_id – in this case the function will try to get current product’s ID.
    * When retrieving $msrp_discount_percent – third parameter (i.e. 0) defines the number of decimals to which final result is rounded.

    Please let me know if something is not working as expected. And if you like the plugin, please consider leaving us a rating.

    Thread Starter FilipeOS

    (@filipeos)

    Hi there,

    Yes your other comment helped. Will it still work after this change you did?

    Plugin Author Algoritmika

    (@algoritmika)

    @filipeos,

    If you mean getting MSRP with get_post_meta() – yes, it will still work.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Get MSRP Price’ is closed to new replies.