Answer the question
In order to leave comments, you need to log in
Advanced Custom Fields - How to validate and display the relevant fields?
Collected the manager part of data entry based on fields from Advanced Custom Fields. But there is a problem with displaying data on the site for users.
Task.
There are 4 kinds of goods; Linoleum, tiles, carpets, carpet.
Each product has its own information.
Depending on the choice of the manager, the necessary fields for filling open.
The manager chooses Linoleum - fields are opened for him to fill in the data on linoleum.
Selects Tile - Tile Data.
I did this:
Displaying fields in the admin panel according to conditional logic.
add_action( 'woocommerce_product_meta_start', 'my_custom_action' );
function my_custom_action() {
if ('Коммерческий' == get_the_field('type') ) {
echo 'Вид: ' . the_field('linoleum_vid');
echo '<p>';
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question