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

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

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

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

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

How to Exclude a Plan from the Signup Page?

function hide_specific_membership_plan( $query_args ) { $user_id = get_current_user_id(); if ( ! $user_id ) { return; } $user_data = get_userdata( $user_id ); $user_roles = $user_data->roles; if ( in_array( ‘subscriber’, $user_roles ) ) { //Post ids that you want to hide $exclude_posts…Continue reading