How add php code in archive product woocommerce plugin

Viewed 50

I am trying to add code php after price (not on single product pages) but on shop pages and archive page woocommerce.

Code

<?php echo CFS()->get( 'name-code' ); ?>

This is the insert code from the Custom Field Suite plugin

Sincere thanks !

2 Answers

You can't just push PHP code into normal text editors etc... You need to find exact file that render those page's and write it in php file

I found a great solution Here is the result

function woocommerce_after_cat_price() {
    echo CFS()->get( 'name-code' );
}
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_after_cat_price', 10, 5 );
Related