Form Helper (snippet 4)

WCVendors_Pro_Form_Helper::textarea( apply_filters( ‘wcv_product_description’, array( ‘post_id’ => $post_id, ‘id’ => ‘post_content’, ‘label’ => __( ‘Product description’, ‘wcvendors-pro’ ), ‘value’ => $product_description, ‘placeholder’ => __( ‘Please add a full description of your product here’, ‘wcvendors-pro’ ), ‘custom_attributes’ => $custom_attributes, ) ) );Continue reading

Form Helper (snippet 3)

add_action( ‘wcvendors_settings_after_seller_info’, ‘checkbox_check’ ); function checkbox_check(){ $key = ‘_wcv_custom_settings_checkbox3’; $value = get_user_meta( get_current_user_id(), $key, true ); WCVendors_Pro_Form_Helper::input( apply_filters( $key, array( ‘id’ => $key, ‘label’ => __( ‘Fairtrade’, ‘wcvendors-pro’ ), ‘type’ => ‘checkbox’, ‘desc_tip’ => true, ‘value’ => $value, ‘description’ =>…Continue reading

Form Helper (snippet 1)

WCVendors_Pro_Form_Helper::input( array( ‘post_id’ => $post_id, ‘id’ => ‘post_title’, ‘label’ => __( ‘Product Name’, ‘wcvendors-pro’ ), ‘value’ => $product_title, ) );Continue reading

Adding a Custom Field for Products (snippet 5)

add_action(‘woocommerce_product_meta_start’, ‘wcv_ingredients’, 2); function wcv_ingredients() { $output = get_post_meta( get_the_ID(), ‘wcv_custom_product_ingredients’, true ); // Change wcv_custom_product_ingredients to your meta key echo ‘Ingredients: ‘ . $output . ”; }Continue reading

Adding a Custom Field for Products (snippet 4)

// Output the custom ingredients as the last option on the general tab. add_action( ‘wcv_product_options_general_product_data’, ‘wcv_product_ingredients’ ); function wcv_product_ingredients( $object_id ){ WCVendors_Pro_Form_Helper::textarea( array( ‘post_id’ => $object_id, ‘id’ => ‘wcv_custom_product_ingredients’, ‘label’ => __( ‘Ingredients’, ‘wcvendors-pro’ ), ‘placeholder’ => __( ‘Ingredients’, ‘wcvendors-pro’…Continue reading

Adding a Custom Field for Products (snippet 3)

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

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