How can I put the following code at the end of my short product description? (WooCommerce)
<tbody class="table-hover">
<?php if ( get_field( 'platform' ) ): ?>
<tr>
<td class="text-left prd-platform ">Platform:</td>
<td class="text-left trd-platform">
<?php $terms = get_field('platform');
if( $terms ): ?>
<?php foreach( $terms as $term ): ?>
<a class="acflinkcls" href="<?php echo esc_url( get_term_link( $term ) ); ?>"><?php echo esc_html( $term->name ); ?></a>
<?php endforeach; ?>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
I want this code to be part of my short product description
Thanks for guiding me
2
Answers
It seems to me, you have two alternatives:
1: edit your
theme_name/woocommerce
or usechild_theme
. (Personally I prefer to use a child theme as a solution.)2: you may use
woocommerce_short_description
to add your code.3: add the following code in
functions.php
of your theme. you will seefunctions.php
in the following path:wp-content/teme_name/functions.php
Adding your custom text at the end of the short description content, (not for variable products):
Follow the URL below to resolve your issue:
Add Text under Single Product Short Description in Woocommerce