wcv_custom_user_shiping_fields

Description

apply_filters( 'wcv_custom_user_shiping_fields', array( $attributes ) )

Parameters (1) (array)

Sample

array( 
  'shipping_address' => array( 
    'title'   => __( 'Store Shipping Address', 'wcvendors-pro' ),   
    'fields'  => array( 
      '_wcv_shipping_address1' => array(
        'label'       => __( 'Address 1', 'wcvendors-pro' ),
        'description' => '', 
        'field_type'  => 'shipping_address'
      ),
      '_wcv_shipping_address2' => array(
        'label'       => __( 'Address 2', 'wcvendors-pro' ),
        'description' => '', 
        'field_type'  => 'shipping_address'
      ),
      '_wcv_shipping_city' => array(
        'label'       => __( 'City', 'wcvendors-pro' ),
        'description' => '', 
        'field_type'  => 'shipping_address'
      ),
      '_wcv_shipping_postcode' => array(
        'label'       => __( 'Postcode', 'wcvendors-pro' ),
        'description' => '', 
        'field_type'  => 'shipping_address'
      ),
      '_wcv_shipping_country' => array(
        'label'       => __( 'Country', 'wcvendors-pro' ),
        'description' => '', 
        'field_type'  => 'shipping_address', 
        'class'       => 'js_field-country',
        'type'        => 'select',
        'options'     => array( '' => __( 'Select a country…', 'wcvendors-pro' ) ) + WC()->countries->get_allowed_countries()
      ),
      '_wcv_shipping_state' => array(
        'label'       => __( 'State/County', 'wcvendors-pro' ),
        'description' => __( 'State/County or state code', 'wcvendors-pro' ),
        'class'       => 'js_field-state', 
        'field_type'  => 'shipping_address', 
      ),
      '_wcv_store_phone' => array(
        'label'       => __( 'Telephone', 'wcvendors-pro' ),
        'description' => '', 
        'field_type'  => 'shipping_address', 
      ),
    ), 
  ),
  'shipping_general' => array( 
    'title'   => __( 'Store Shipping General', 'wcvendors-pro' ),   
    'fields'  => array( 
      '_wcv_vendor_product_handling_fee' => array(
        'label'       => __( 'Product handling fee', 'wcvendors-pro' ),
        'description' => 'The product handling fee, this can be overridden on a per product basis. Amount (5.00) or Percentage (5%).', 
        'value'     => $vendor_shipping[ 'product_handling_fee' ], 
        'field_type'  => 'shipping'
      ),
      '_wcv_vendor_shipping_policy' => array(
        'label'       => __( 'Shipping policy', 'wcvendors-pro' ),
        'description' => '', 
        'value'     => $vendor_shipping[ 'shipping_policy' ], 
        'field_type'  => 'shipping', 
        'type'      => 'textarea', 
      ),
      '_wcv_vendor_return_policy' => array(
        'label'       => __( 'Return policy', 'wcvendors-pro' ),
        'description' => '', 
        'value'     => $vendor_shipping[ 'return_policy' ], 
        'field_type'  => 'shipping', 
        'type'      => 'textarea', 
      ),
      '_wcv_vendor_shipping_from'   => array(
        'label'       => __( 'Shipping from', 'wcvendors-pro' ),
        'description' => '',
        'type'        => 'select',
        'options'     => array( 'store_address' => __( 'Store Address', 'wcvendors-pro' ), 'other' => __( 'Other', 'wcvendors-pro' ) ), 
        'value'     => $vendor_shipping[ 'shipping_from' ], 
      ),
      '_wcv_shipping_type' => array(
        'label'       => __( 'Shipping type', 'wcvendors-pro' ),
        'description' => 'You can override the global setting for shipping type for this vendor.', 
        'field_type'  => 'shipping', 
        'type'      => 'select', 
        'class'     => 'wcv-shipping-type', 
        'options'     => array_merge( array( '' => '' ), self::shipping_types() ), 
      ),
    ),    
  ), 
  'shipping_flat_rate' => array( 
    'title'     => __( 'Store Flat Rate Shipping', 'wcvendors-pro' ),   
    'field_class' => 'wcv-shipping-rates wcv-shipping-flat', 
    'fields'    => array( 
      '_wcv_vendor_national' => array(
        'label'       => __( 'National shipping fee', 'wcvendors-pro' ),
        'description' => 'The default shipping fee within your country, this can be overridden on a per product basis.', 
        'value'     => $vendor_shipping[ 'national' ], 
        'field_type'  => 'shipping'
      ),
      '_wcv_vendor_national_free' => array(
        'label'       => __( 'Free national shipping', 'wcvendors-pro' ),
        'description' => '', 
        'value'     => $vendor_shipping[ 'national_free' ], 
        'type'      => 'checkbox',
        'field_type'  => 'shipping'
      ),
      '_wcv_vendor_national_qty_override' => array(
        'label'       => __( 'Charge Once', 'wcvendors-pro' ),
        'description' => 'Charge once per product for national shipping, even if more than one is purchased.', 
        'value'     => $vendor_shipping[ 'national_qty_override' ], 
        'type'      => 'checkbox', 
        'field_type'  => 'shipping', 
      ),
      '_wcv_vendor_national_disable' => array(
        'label'       => __( 'Disable national shipping', 'wcvendors-pro' ),
        'description' => '', 
        'value'     => $vendor_shipping[ 'national_disable' ], 
        'type'      => 'checkbox', 
        'field_type'  => 'shipping', 
      ),
      '_wcv_vendor_international' => array(
        'label'       => __( 'International shipping fee', 'wcvendors-pro' ),
        'description' => 'The default shipping fee within your country, this can be overridden on a per product basis.', 
        'value'     => $vendor_shipping[ 'international' ], 
        'field_type'  => 'shipping'
      ),
      '_wcv_vendor_international_free' => array(
        'label'       => __( 'Free international shipping', 'wcvendors-pro' ),
        'description' => '', 
        'value'     => $vendor_shipping[ 'international_free' ], 
        'type'      => 'checkbox',
        'field_type'  => 'shipping'
      ),
      '_wcv_vendor_international_qty_override' => array(
        'label'       => __( 'Charge Once', 'wcvendors-pro' ),
        'description' => 'Charge once per product for international shipping, even if more than one is purchased.', 
        'value'     => $vendor_shipping[ 'international_qty_override' ], 
        'type'      => 'checkbox', 
        'field_type'  => 'shipping', 
      ),
      '_wcv_vendor_international_disable' => array(
        'label'       => __( 'Disable international shipping', 'wcvendors-pro' ),
        'description' => '', 
        'value'     => $vendor_shipping[ 'international_disable' ], 
        'type'      => 'checkbox', 
        'field_type'  => 'shipping', 
      ),
    ), 
  ),
)

 

Usage Examples

To run the filter, copy this sample

$array_val = apply_filters( 'wcv_custom_user_shiping_fields', array( $attributes ) )
  if ( ! empty( $array_val ) ) {

    // what has been modified...

}

To make a callback function, copy this sample

// the filter wcv_custom_user_shiping_fields callback
function filter_wcv_custom_user_shiping_fields( $param ) ) {
  // do your thing here :-) ... 

  return $array_val;
}
add_filter( 'wcv_custom_user_shiping_fields', 'filter_wcv_custom_user_shiping_fields', 10, 1 );

To remove the filter, copy this sample

 //remove the filter
remove_filter( 'wcv_custom_user_shiping_fields', 'filter_wcv_custom_user_shiping_fields', 10, 1 );

Defined

This filter is defined in the following source file(s)

  • wcvendors-pro/admin/class-wcvendors-pro-shipping-controller.php line 221
    return $fields = apply_filters( 'wcv_custom_user_shiping_fields', array(

filters

Updated on January 7, 2017

Was this article helpful?