How to show Woocommerce custom fields (select options) front-end?
-
I have created a Woocommerce custom field using the code below.
woocommerce_wp_select(
array(
‘id’ => ‘_select’,
‘label’ => __( ‘My Select Field’, ‘woocommerce’ ),
‘options’ => array(
‘one’ => __( ‘Option 1’, ‘woocommerce’ ),
‘two’ => __( ‘Option 2’, ‘woocommerce’ ),
‘three’ => __( ‘Option 3’, ‘woocommerce’ )
)
)
);I was able to show the value front-end.
<?php echo get_post_meta (get_the_ID(),’_select’,true); ?>But what I wanted to achieve is to display @front-end the select options field not the value.
Any inputs would very much appreciated.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to show Woocommerce custom fields (select options) front-end?’ is closed to new replies.