Home Forums WC Vendors Pro Support postmeta or usermeta?? Reply To: postmeta or usermeta??

#12024
Martin
Participant

ben, thx for your prompt replies, i really appreciate this!!!

well yes, 2 reasons:

1.) I found this unused pv_custom_commission_rate in the usermeta. it would just fill the database for no reason.

2.) I need the vendors to store more complex information and for this i need a repeater field. advanced custom fields (ACF) is a great way to accomplish this. so what i do is i am using a tabbed vendors settings page constructed by ACF. I have to tell ACF where to save this data to. I can choose between user meta or a post id but it couldn’t be both. I opted for usermeta (also most of your fields are saved there). What is also great about ACF that I can map WC Vendors metakeys to the fields, so they will be saved in the same location. This way I can replace WC Vendors settings tabs with the ACF field group.

here is how my store-settings.php template looks like:

<h3>Settings</h3>

<form method=”post” action=”” class=”wcv-form”>

<div class=”wcv-tabs top” data-prevent-url-change=”true”>

<?php
acf_form( array(
‘field_groups’ => array(169245),
‘form’ => false,
‘return’ => false,
‘post_id’ => ‘user_’.get_current_user_id()
) );
?>

</div>

<?php WCVendors_Pro_Store_Form::form_data(); ?>
<?php WCVendors_Pro_Store_Form::save_button( ‘Save Changes’); ?>

</form>