• Resolved quackounousa

    (@quackounousa)


    Hi There!

    I’m trying to get the EWD_URP_Overall_Score using the get_post_meta function. However I can’t seem to find the EWD_URP_Overall_Score when I display all of the meta fields, when I add the field manually in the product page I can fetch it easily. What is a solution for being able to fetch the user rating for a product?

    Thanks,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    It would depend where you’re trying to fetch it and whether or not the post meta is already loaded. For example: if you’re doing this on a single.php post page that you created specifically for our post type, then the post meta should already be loaded. If you are doing outside the loop, then you’ll need fetch the post ID first and then the info you want. If you’re doing it in a theme template file, for example, it’s not enough to just specify the meta data name. You need to get the post info first.

    Where are you trying to do this?

    Thread Starter quackounousa

    (@quackounousa)

    Alright bear with me:

    I’m using your other plugin (Product Catalog) to display products. Above the Product name I’ve added a custom display rating that currently displays the “wp_review_total” rating.

    $Average_Rating = get_post_meta(GiveWCID($Product),’wp_review_total’, true );
    $Customer_Rating= get_post_meta(GiveWCID($Product),’EWD_URP_Overall_Score’, true );

    The GiveWCID($Product) function returns the ID of Product in WooCommerce to be able to fetch the correct rating because Product Catalog has different IDs assigned to products.

    Where can I visually see where EWD_URP_Overall_Score is being updated?

    I echoed get_post_meta(GiveWCID($Product)) to see all the metafields in an array format and EWD_URP_Overall_Score would not be included in that list.

    Thanks

    Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    Unfortunately, something like this goes beyond the scope of our support, which does not include helping implement a custom solution.

    For where you can see the EWD_URP_Overall_Score, you could just echo it in another existing div on the page that is already displaying other content. That way you’ll see what value it returns, so you can know if it’s actually pulling the value you need.

    It would not be included in the WooCommerce post meta data. You’d need to query the post and meta from our post type (urp_review).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fetching EWD_URP_Overall_Score’ is closed to new replies.