GEO my WP Support

Use this forum for technical support and general questions related to GEO my WP plugin and its core add-ons only. For technical support and general questions related to any of the premium extensions please open a new premium support ticket.

[Not resolved]How to show the product price on Geo search result?

Home Forums Support How to show the product price on Geo search result?

This topic contains 3 replies, has 3 voices, and was last updated by  Eyal Fitoussi 6 days, 1 hour ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #55946

    hasanbaluch
    Participant

    I am using GEO my WP plugin in my ecommerce website. I want to show the price of the product below the excerpt. Is it possible to add the price and other information on search result?

    #56144

    bootlick
    Participant

    Go in the results.php and add the following code:

    the weird text is the < and > don’t know why its doing that in post

    I am trying to figure out how to make it all nice by adding the sale sign and the x out of the price, but this does the trick

    Okay got fancier

    • This reply was modified 6 days, 22 hours ago by  bootlick.
    • This reply was modified 6 days, 22 hours ago by  bootlick.
    • This reply was modified 6 days, 22 hours ago by  bootlick.
    • This reply was modified 6 days, 1 hour ago by  Eyal Fitoussi.
    #56148

    bootlick
    Participant

    <!– Adding Price–>
    <b>Price:</b>

    <span class=”woocommerce-Price-amount amount”><span class=”woocommerce-Price-currencySymbol”>$</span>
    <?php
    $product = new WC_Product(get_the_ID());
    $regular_price = $product->regular_price;
    echo $regular_price;
    ?>

    </span>
    <ins><span class=”woocommerce-Price-amount amount”><span class=”woocommerce-Price-currencySymbol”>$</span>
    <?php
    $product = new WC_Product(get_the_ID());
    $sale_price = $product->sale_price;
    echo $sale_price;
    ?>

    #56155

    Eyal Fitoussi
    Keymaster

    Thank you @bootlick for helping out and posting a solution.

    I fixed the code above. In the future you should wrap code within PRE tag.

    The above solution should work.

    Note that in the search results template files there are a few action hooks that you could also use to dynamically add data to the results using a custom function.

    Kind regards,

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.