Skip to content

Instantly share code, notes, and snippets.

public function __construct() {
add_action( 'woocommerce_single_product_summary', array( &$this, 'add_custom_html' ), 15 );
}
public function add_custom_html() {
$content = "
<table>
<tr>
<th></th>
<th>Small</th>
<th>Medium</th>
<th>Large</th>
</tr>
public function add_custom_html() {
global $post;
$product_id = $post->ID;
$categories = get_the_terms( $product_id, 'product_cat' );
if( empty ( $categories ) ){
return;
}
$content = "
public function include_files() {
include_once('custom.html'); //path to your html file
}
public function add_custom_html() {
global $post;
$product_id = $post->ID;
$categories = get_the_terms( $product_id, 'product_cat' );
if( empty ($categories)){
public function add_custom_html() {
global $post;
$product_id = $post->ID;
$categories = get_the_terms( $product_id, 'product_cat' );
if( empty ($categories)){
return;
}
//add image url in the src attribute
<table>
<tr>
<th></th>
<th>Small</th>
<th>Medium</th>
<th>Large</th>
</tr>
<tr>
<td>USA</td>
ppublic function add_custom_html() {
global $post;
$product_id = $post->ID;
$ids = array( 780, 767, 643);
$content = "
<table>
<tr>
<th></th>
<th>Small</th>
public function add_custom_html() {
global $post;
$product_id = $post->ID;
$ids = array( 780, 767, 643);
$tags = get_the_terms( $product_id, 'product_tag' );
if( empty( $tags ) ){
return;
}
public function add_custom_html() {
global $post;
$product_id = $post->ID;
$categories = get_the_terms( $product_id, 'product_cat' );
if( empty ($categories)){
return;
}
$content = "
public function add_after_add_to_cart() {
global $post;
$product_id = $post->ID;
$categories = get_the_terms( $product_id, 'product_cat' );
if( empty( $categories ) ) {
return;
}
foreach( $categories as $cat ) {