Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Created November 17, 2015 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save digitalchild/9fe913cd140931a0cc6b to your computer and use it in GitHub Desktop.
Save digitalchild/9fe913cd140931a0cc6b to your computer and use it in GitHub Desktop.
Add a custom field to the store settings page for WCVendors Pro
<?php
// Put this into your themes function.php
/**
* Create a custom field for the store settings page to output a bank name.
*/
function store_bank_details( $store_id ){
if ( class_exists( 'WCVendors_Pro' ) ){
// Bank Name
WCVendors_Pro_Form_Helper::input( array(
'post_id' => $store_id,
'id' => '_wcv_custom_settings_bankname',
'label' => __( 'Bank Name', 'wcvendors-pro' ),
'placeholder' => __( 'First Bank', 'wcvendors-pro' ),
'desc_tip' => 'true',
'description' => __( 'Your local bank name', 'wcvendors-pro' ),
'type' => 'text',
)
);
}
}
?>
<?php // Add the following on the store-settings.php template ?>
<?php store_bank_details( $store_id ); ?>
@juancarlosqr
Copy link

Hi, something important to mention here:

The right action name to hook into this is wcv_pro_store_settings_saved because the action wcvendors_shop_settings_saved described in the doc from this gist doesn't work for the PRO plugin.
Usage:

add_action( 'wcv_pro_store_settings_saved', 'SAVING_FUNCTION_NAME_HERE' );

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment