• Resolved emzdesign

    (@emzdesign)


    I’m working on a website that’s using a discount pricing plugin for logged in users. So when a user is logged in it will give them a 10% on all prices.

    I’ve got the plugin to show the discounted price but it isn’t showing the original price, which I want to display to show the saving the customer is getting.

    Is there an SQL query I can do that will get the original price straight from the database?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    Is there an SQL query I can do that will get the original price straight from the database?

    WooCommerce has a couple of public functions to retrieve product info.

    global $product;
    $product = wc_get_product( $post_id );

    And then:

    $product->get_regular_price();
    $product->get_sale_price();
    $product->get_price();

    Kind regards,

    Plugin Support Thu P. a11n

    (@thup90)

    Hi there,

    I hope you found the previous reply helpful. We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Getting data direct from database’ is closed to new replies.