Support » Plugin: WP Show Posts » Woocommerce price

  • Hi Tom,
    Is there a way to add Woocommerce price on the grid? I tried with More settings >> Meta key by adding _price there but so far no luck. Is that even possible?

    If not then do you have any plans regarding adding Woocommerce related features either in free or Pro version?
    Thanks,
    J.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi

    I’m currently using the wpsp_after_title hook to show prices for all my products but i guess its possible to target specific category,products etc. This is my code but i don’t guarantee it’s the best way to do it 🙂

    //Wpsp show product price after product title
    add_action( 'wpsp_after_title','jam_show_product_price' );
    function jam_show_product_price()
    {
    global $product;
    if ( $price_html = $product->get_price_html() )
    echo $price_html;
    }
    • This reply was modified 1 year, 2 months ago by  En18Zone.

    Hi En18Zone;
    Thank you. Seems to be working.
    Any thoughts how to show a product category term also under title?

    I would have done something along the lines of http://wordpress.stackexchange.com/questions/150031/retrieve-product-category-name-by-product-category-id-woocommerce

    But im curious myself how to combine both those snippets so please post back your code if you get it to work.

    Well the above doesn’t seem to work but the code below gives you category link.

     if ( $categ = $product->get_categories() )
        echo $categ;

    Thanks. That’s the one i was looking for.

    // Category under WP posts title
    add_action( ‘wpsp_after_title’,’show_product_cat’ );
    function show_product_cat()
    {
    global $product;
    if ( $categ = $product->get_categories() )
    echo $categ;
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Woocommerce price’ is closed to new replies.