Support

Account

Home Forums Backend Issues (wp-admin) adding a field group to admin page

Solving

adding a field group to admin page

  • I’m a complete newbie to ACF. Have managed to create a field group that displays it’s output as extra information on a single product page. Pickup info, Availability (where the products can be delivered to) and delivery lead time. Currently have this field group location showing when post type is equal to product (when editing a single product so this info can be added on a product-by-product basis), but wish to make the field group a global set for a range of products – I hope this makes sense.

    The output looks like this:

    Pickup: Can pick up from 3 locations, Sydney, Melbourne, Brisbane
    Availability: Australia wide
    Delivery Time: 3-5 days

    example page: https://biddit.co/product/835x505mm-handmade-1-5mm-stainless-steel-undermount-topmount-kitchen-sink-with-square-waste/

    We use the Yith Multi Vendor plugin allowing for vendors to list their own products. They have a page within wp-admin to enter their vendor tag, their shop name and so on. We’d like to be able to display this field group on this page

    wp-admin/admin.php?page=yith_vendor_settings

    so the vendor can outline globally this info for all their products. Is this possible?

    It would be great to gone step further and allow for any input entered to also be able to be overridden in the edit-product page, having the field group displaying as it is now with the fields defaulting to the info provided in the vendor page initially if required.

  • This reply has been marked as private.
  • thank you for responding.

    if you go to

    you will see down the right hand side some info outlined:

    Pickup: Pick up not available
    Availability: Australia wide
    Delivery Time: 3-5 days
    SKU: JMX-14
    Category: Kitchen Sinks
    Brand: Serrano Australia

    we have the created the first three items (Pickup, Availability, Delivery time) using ACF where the vendor adds this info for this product on the edit product page in wp-admin.

    They have to do this individually for every item.

    We would like it so they can enter the info only once to show for all their products.

    They would enter it in the page they use to enter their other vendor info: wp-admin/admin.php?page=yith_vendor_settings

  • Hi @mancer

    ACF PRO has a feature that allows you to create options pages on the backend, but it won’t be able to alter or modify existing options pages. What you can do with this feature is to create a sub-options page where your vendor can input the data. To learn more about this, please check this page: https://www.advancedcustomfields.com/resources/options-page/.

    After that, you can add a true/false field on the product that will let your vendor choose if they want to override the data in the options page or not. You can also use the conditional logic to hide the extra information fields if they don’t want to override it.

    To make it unique for each vendor, you can set the ‘post_id’ in the options page. Maybe something like this:

    'post_id' => 'options_user_' . get_current_user_id(),

    Then you can get the value like this:

    get_field( 'field_name', options_user_' . get_current_user_id() );

    I hope this makes sense 🙂

  • this sounds great! – I will sign up now and let you know how I go

  • okay – I’ve got the new menu option called ‘Delivery info’ showing in wp-admin for me… but not for user type ‘vendor’.

    How can I achieve this?

  • Hi @mancer

    You need to set the capability option for the options page. For example, if you want to show the options page to users with ‘read’ capability, you can use this code:

    acf_add_options_page(array(
        ...
        'capability' => 'read',
        ...
    ));

    This page should give you more idea about it: https://www.advancedcustomfields.com/resources/acf_add_options_page/.

    I hope this helps 🙂

  • This reply has been marked as private.
  • Hi @mancer

    If you want to hire a developer to help you out with it, I usually recommend looking for one on https://studio.envato.com/ or https://www.upwork.com/.

    I hope this helps 🙂

  • There isn’t anyone that you can suggest…. I don’t really want to have to go through the whole freelance process.

    Might just have to give it a miss.

  • Hi @mancer

    I’m afraid not. If you want, you can also check https://codeable.io/.

    Regarding your issue, each role usually has capabilities that are set to it. You can try User Role Editor plugin to check it. Usually, most roles have the ‘read’ capability, so adding 'capability' => 'read', option should show the options to your vendor (if they have the ‘read’ capability).

    If you want to learn about WordPress capabilities, please check this page: https://codex.wordpress.org/Roles_and_Capabilities.

    Hope this helps 🙂

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

The topic ‘adding a field group to admin page’ is closed to new replies.