You must be logged in to see replies to this topic. Click here to login or register
Home › Forums › Plugins › WooCommerce Product Builder › Custom product attribute in modal product
Hi,
I’m trying to show some custom product attributes to each product within modal box. On woocommerce single product page works with following code snippet:
// CUSTOM PRODUCT ATTRIBUTE ALMONDS SORT
// On single product pages
add_action( ‘woocommerce_single_product_summary’, ‘product_attribute_sort’, 5 );
function product_attribute_sort(){
global $product;
$taxonomy = ‘pa_sort’;
$value = $product->get_attribute( $taxonomy );
if ( $value && $product->is_in_stock() ) {
$label = get_taxonomy( $taxonomy )->labels->singular_name;
echo ‘<div class=”nuts-sort”><span>сорт</span>’ . $value . ‘</div>’;
}
}
My prompt question is there a possibility with a slight adjustment of the above function to display some attributes.
Thanks in advance.
You must be logged in to see replies to this topic. Click here to login or register