Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1408589

    Hallo,
    a new special issue :)

    I have created products as portfolio pages. On the first page is the “Portfolio Raster” shown -> just product image and name. On click at this product the portfolio page opens with product details and price. Now, the price should be also visible in the products that are shown in the Portfolio Raster below the product name.

    Sure, i can add it manully as a text block. But is there a way to “clone” the price text block from the detail pages and show it also in the Portfolio raster? So that finally i only need to update the price in the portfolio product detail pages if price changes?

    Hope this is clear enough described :)

    #1408616

    Hey Sebastian,

    Thank you for the inquiry.

    Did you enable the excerpt in the portfolio grid settings? If so, you can add the following filter in the functions.php file to append the product price to the excerpt:

    add_filter("avf_portfolio_grid_excerpt", function($excerpt, $entry) {
    	$id = $entry->ID;
    
    	if( get_post_type( $id ) == "product" ) {
    		$product = wc_get_product( $id );
    		$excerpt .= "<span class='av-portfolio-product-price'>" . $product->get_regular_price() . "</span>";
    	}
    
        return $excerpt;
    }, 10, 2);
    

    Best regards,
    Ismael

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