Support

Account

Home Forums ACF PRO ACF Conditional dokan issue

Solved

ACF Conditional dokan 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‘;
    }

  • I’m having the same problem. I have created 2 rules for an advance custom field to only appear on products and those that equal a specific category. Like yourself, it functions as expected with woocommerce for the admin side but not with dokan for the seller upload form. The field is appearing despite my conditions set.

    I only want this field group to show on Dokans seller product upload if they’ve selected a particular category.

    I’m quite new to all this so assume you’re talking to simpliest person lol. Any help gratefully received

  • Hi Lindyloo,

    we actually solved the problem. The problem we had was that we used ACF and ACF Pro as plugins to get the results.

    The simple solution was that we needed the plugin “ACF for Dokan Pro” – this apparently is a third party plugin designed to work with Dokan.

    Have a try to see if this is also the solution for you. Hope it helps!

  • Hey Chris,

    Thanks for getting back to me. I’m using ACF and ACF for Dokan. I haven’t got the pro version.

    So should I not be using the standard ACF plugin in conjunction with ACF for Dokan?

    I’ve seen other people with the same problem as me post comments here though and the response was to use some js but as a newbie there wasn’t enough detail in the response to know exactly what to do with the js snippet offered and the thread got closed 🙁

    Really hope I can get this resolved so I can press on with my project

  • Scrap that last question about whether I should be using acf Dokan on its own. I just deactivated the standard advanced custom fields plugin and can see acf Dokan can’t function without it.

    I’ve looked if there’s another plugin acf Dokan with “pro” on the end as you described but it only brings up acf Dokan so I assume I have the right software. I have Dokan pro but I haven’t activated the key as i’m on a temporary domain at the moment.

    I’m totally confused, as yours works but on other threads I could see someone was given advice to place some js somewhere but it was a bit vague for me to understand.

  • Hi @lindyloo1234,

    I can only describe what works for us. This is the combination we work with:
    -ACF for Dokan
    -ACF for Dokan PRO
    -Advanced Custom Fields Pro

    As far as I know the ACF for Dokan Pro plugin is a third party plugin by krazyplugins.

    In the past as we just had the “normal” ACF for Dokan plugin in combination with the Advanced custom fields Pro plugin we had the issue which is described in this post. After purchasing the Pro version of ACF for Dokan and activating it with the key it worked as we wanted.

    Hope this helped you!

  • You’ve been a great help Chris. After my pounding headache had subsided I returned to my research in this area and discovered you’re right … Krazyplugin author has indeed brought out a pro version to their acf for Dokan… wow so confusing with all these similar names.🤯 I went ahead and bought it direct as it doesn’t appear listed in wordpress plugin directory. Its still not working correctly but reading up it seems the developer Nayem has a reputation for being helpful. And with you outlining the same problem i’m feeling reassured I have bought the right plugin and the support is there to hopefully get it sorted. Thanks very much for steering me in the right direction.

  • aha… activating the key. I’m assuming this is for acf for Dokan pro you mean? And not Dokan pro.

    Perhaps that’s why it wasn’t working for me late last night. So can I activate the key even if it’s on a temporary domain? Because I know with Dokan pro you can’t do that.

    Thanks again!

  • Great! Yes it is confusing at the beginning but with working through it you get a good understanding of how things work – same was it for me. Yes indeed – krazyplugin have a superb support don´t be afraid to reach out to them. They helped me a lot and were very patient even with stupid beginner questions 🙂 Enjoy!

  • Yes right activating the key for ACF for Dokan pro. I am not aware of it working or not on a temporary domain. We used it directly in live mode.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.