Adding a Custom Field for Products (snippet 2)

‘text’, ‘post_id’ => $object_id, ‘id’ => ‘wcv_custom_product_ingredients’, ‘label’ => __( ‘Ingredients’, ‘wcvendors-pro’ ), ‘placeholder’ => __( ‘Ingredients’, ‘wcvendors-pro’ ), ‘desc_tip’ => ‘true’, ‘description’ => __( ‘The product ingredients’, ‘wcvendors-pro’ ), ) ); ?>Continue reading

Adding a Custom Field for Products (snippet 1)

$object_id, ‘id’ => ‘wcv_custom_product_ingredients’, ‘label’ => __( ‘Ingredients’, ‘wcvendors-pro’ ), ‘placeholder’ => __( ‘Ingredients’, ‘wcvendors-pro’ ), ‘desc_tip’ => ‘true’, ‘description’ => __( ‘The product ingredients’, ‘wcvendors-pro’ ), ) ); ?>Continue reading

Validation System

// Add this to your themes functions.php add_filter( ‘wcv_product_sku’, ‘wcv_product_sku’ ); function wcv_product_sku( $field ){ $field[ ‘custom_attributes’ ] = array( ‘required’ => “”, ‘data-parsley-error-message’ => ‘SKU is required’ ); return $field; }Continue reading

Custom Product Edit Templates

get_title() : ”; $product_description = ( isset( $product ) && null !== $product ) ? $post->post_content : ”; $product_short_description = ( isset( $product ) && null !== $product ) ? $post->post_excerpt : ”; $post_status = ( isset( $product ) &&…Continue reading

Override Partial Path

add_filter( ‘wcvendors_pro_dashboard_open_path’, ‘wcv_override_dashboard_open_path’ ); function wcv_override_dashboard_open_path( $path ){ $path = get_stylesheet_directory(). ‘/wc-vendors/partials/wcvendors-pro-dashboard-open.php’; return $path; }Continue reading

Paystack Split Payments Integrations Flowchart (snippet 3)

public function process_split_payment( $order ) { $vendors_due = WCV_Vendors::get_vendor_dues_from_order( $order, false ); $sub_accounts = array(); foreach ( $vendors_due as $vendor_id => $products ) { $_vendor_account = get_user_meta( $vendor_id, ‘_paystack_sub_account_code’, true ); $sub_accounts[] = array( ‘subaccount’ => $_vendor_account, ‘share’ => $calculated_share,…Continue reading