DOKAN ACF issue
-
Hello there,
I have browsed many threads and different sides to get this solved but with no solution so far.
We have a wordpress installation working with WooCommerce and Dokan.
Within our marketplace we want to seperate 2 different main categories with ACF PRO.So basically we want to add different fields for each category.
If a vendor chooses for example category “Industry” then 3 new fields should appear in the product creation page as well as on the product page itself after publishing the product.
If the vendor chooses category “Private” there should be 3 different fields than there would be when using category “Industry”.
Vendor Edits are allowed.
Right now, only in our backend this is working. When we as the admin create/edit a product the condition works perfectly fine and is also displayed on the page correctly.
Where it is not working is when the vendor creates/edits a product on front end. In the product creation page there are all fields shown no matter what category is chosen.
This is the code we used for displaying the fields on the product page:
add_action( ‘woocommerce_product_meta_end’, ‘acf_dokan_display_product_fields4’ ); function acf_dokan_display_product_fields4(){ echo ‘<p class=”productpdf”> <b>Model:</b> ‘ . get_field(‘model’, $post_id, true) . ‘ </p>’; } add_action( ‘woocommerce_product_meta_end’, ‘acf_dokan_display_product_fields5’ ); function acf_dokan_display_product_fields5(){ echo ‘<p class=”productpdf”> <b>Kategorie:</b> ‘ . get_field(‘kategorie’, $post_id, true) . ‘ </p>’; } add_action( ‘woocommerce_product_meta_end’, ‘acf_dokan_display_product_fields’ ); function acf_dokan_display_product_fields(){ echo ‘Produkt PDF Herunterladen‘; }
- The topic ‘DOKAN ACF issue’ is closed to new replies.