[Support request] Feature Request: Display Woo Product Price in Card

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Feature Request: Display Woo Product Price in Card

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #27806
    Louis
    Participant

    Morning,

    I’m using WPSP instead of WooCommerce Blocks because WCB is so hard to work with.

    I’d like to include the Woocommerce Product Price in my cards – on the same line as Author, but aligned right. Do you perhaps have a snippet available for this?

    Also, if it makes sense to include this as a default feature in WPSP…

    #27809
    elvin
    Moderator

    Hi there,

    Perhaps this snippet may point you to the right direction:

    add_action('wpsp_after_content', function(){
    	if(function_exists('woocommerce_template_loop_add_to_cart')){
    		$product = wc_get_product( get_the_ID() );
    		woocommerce_template_loop_add_to_cart();
    		echo '</br>';
    		echo 'Regular Price:  '.$product->get_regular_price().'</br>';
    		echo 'Sale Price:  '.$product->get_sale_price().'</br>';
    		echo 'Current Price:  '.$product->get_price().'</br>';
    		echo 'Description:  '.$product->get_description().'</br>';
    		echo 'Short Description:  '.$product->get_short_description().'</br>';
    	}
    });

    You can edit the snippet to remove the things you don’t need.

    Note: While it’s possible, WPSP isn’t exactly made for products so we’re not exactly sure if it’s a good idea to add things like this as adding too much may bloat the plugin too much.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.