• Resolved andi0tx

    (@andi0tx)


    Hi,

    I would like to use the shortcodes like [products ids=”1,2,3″] but without shwoing the prices and the product names. How can I do that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    As this is a default short-code, and render the output accordingly.

    You can you use below trick to achieve your goal,

    for removing the price:

    add_filter( 'woocommerce_variable_sale_price_html', 'ced_remove_prices', 10, 2 );
    add_filter( 'woocommerce_variable_price_html', 'ced_remove_prices', 10, 2 );
    add_filter( 'woocommerce_get_price_html', 'ced_remove_prices', 10, 2 );
     
    function ced_remove_prices( $price, $product ) {
    if ( ! is_admin() ) $price = '';
    return $price;
    } 

    for removing title:

    .woocommerce-loop-product__title {
        display: none;
    }

    Thanks,

    • This reply was modified 4 years, 1 month ago by cedcommerce.
    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    We haven’t heard back from you in a while, so I’m going to mark this thread as resolved — hopefully the snippets provided worked for you!

    If you have any further questions, please start a new thread.

    Have a wonderful day!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shortcode for products without name and price’ is closed to new replies.