<?php/** * Related Products * * This template is a modification of the woocommerce/single-product/related.php template, it reimplements the related products * to show a list of related products inside the WooCommerce Product Table plugin. * * @version 3.9.0 */if(!defined('ABSPATH')){exit;}if(!$related_products){return;}$ids=[];foreach($related_productsas$related_product){$ids[]=$related_product->get_id();}if(empty($ids)){return;}// You can customize the shortcode according your site's needs. Replace// everything between the single quote marks with your product_table shortcode of// choice. Just make sure to leave the `include="%s"` part in tact.$shortcode='[product_table include="%s"]';?><section class="related products"><?php$heading=apply_filters('woocommerce_product_related_products_heading',__('Related products','woocommerce'));if($heading):?> <h2><?phpechoesc_html($heading);?></h2><?phpendif;?><?phpechodo_shortcode(sprintf($shortcode,implode(',',$ids)));?></section>
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.