Answer the question
In order to leave comments, you need to log in
Why is the html output code not working in the woocommerce product card?
function add_custom_html() {
$content = "
<table>
<tr>
<th>Наименование</th>
<th>Скидка от 1000р</th>
<th>Скидка от 50000р</th>
<th>Скидка от 100000р</th>
<th>Скидка от 500000р</th>
<th скидка от 1000000р</th>
</tr>
<tr>
<td>Arton</td>
<td>17%</td>
<td>20%</td>
<td>22%</td>
<td>24%</td>
<td>26%</td>
</tr>
<tr>
<td>Deton Universal Classic</td>
<td>4%</td>
<td>6%</td>
<td>12%</td>
<td>16%</td>
<td>23%</td>
</tr>
<tr>
<td>Deton Universal Akril</td>
<td>4%</td>
<td>6%</td>
<td>12%</td>
<td>16%</td>
<td>23%</td>
</tr>
</table>
";
echo $content;
}
function __construct() {
add_action( 'woocommerce_single_product_summary', array( &$this, 'add_custom_html' ), 15 );
}
Answer the question
In order to leave comments, you need to log in
Remove the ampersand before this array( &$this, 'add_custom_html' )
Check if your class is included and if the constructor is called
Add scope public
to your hook handler function.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question