Viewing 1 replies (of 1 total)
  • If you look at the woocommerce-template files for the shop loop or single-product, you can see that in order to display the price it is used as:

    global $product;
    echo $product->get_price();

    This is the needed woocommerce functions.

    But if you are asking the whereabout of the “price” in the “database”, than it is not that simple 🙂
    But basically it is restored in a combination of (posts) and (postmeta) tables.

    (posts) table have the product id
    (postmeta) table stores the price-value in the (meta_value);
    where (meta_key= “_price”) and (post_id= the product-ID from posts table)

    Try looking at the WooCodex for detailed usages for those Woocommerce functions, hooks, etc…

Viewing 1 replies (of 1 total)

The topic ‘Where the price variable stored?’ is closed to new replies.