Single Vendor Purchase

// Limit checkout to a single vendor store add_action( ‘woocommerce_add_to_cart_validation’, ‘limit_single_vendor_to_cart’, 10, 3 ); function limit_single_vendor_to_cart( $valid, $product_id, $quantity ) { $vendor_id = get_post_field( ‘post_author’, $product_id ); // loop through the cart to check each vendor id foreach ( WC()->cart->get_cart()…Continue reading

Product Expiry For Woo

/** * Add support for Product Expiry for WooCommerce Plugin */ if ( class_exists( ‘WOO_Product_Expiry’) ){ /** * Add fields to the product edit form under prices */ function wcv_pefwc_add_fields( $post_id ){ // Expiry date field. $expiry_date = get_post_meta( $post_id,…Continue reading

Download Manager

/** * Stop Download Manager frontend script from loading on the Pro dashboard. * */ function wcv_dequeue_wpdm_script() { $dashboard_page_id = (array) get_option( ‘wcvendors_dashboard_page_id’, array() ); foreach ( $dashboard_page_id as $page_id ) { if ( is_page( $page_id ) ) { wp_dequeue_script(…Continue reading

AIO Dashboard

/** * Disable All In One SEO on the vendor dashboard. */ add_filter( ‘aioseo_disable’, ‘wcv_aioseo_disable_term_output’ ); function wcv_aioseo_disable_term_output( $disabled ) { $current_page_id = get_the_ID(); if ( wcv_is_dashboard_page( $current_page_id ) ){ return true; } return false; }Continue reading

Elementor Store Headers

// Add the woocommerce_before_main_content to the elementor wc-archive-products widget add_action( ‘elementor/widget/render_content’, function( $content, $widget ) { if ( ‘wc-archive-products’ === $widget->get_name() ) { // Run the hooks without outputting the code that `do_action` will want to do ob_start(); do_action(‘woocommerce_before_main_content’); $beforeMainContent…Continue reading

Min-Max Product Price (with decimal support)

add_filter( ‘wcv_product_price’, ‘price_min_max’ ); function price_min_max( $args ) { $args[‘custom_attributes’] = array( ‘min’ => 3.2, ‘max’ => 200.21, ‘step’ => 0.01, ‘data-parsley-type’ => ‘number’, ‘data-parsley-range-message’ => __( ‘Price must be between 3.2 and 200.01’, ‘wcvendors-pro’ ), ‘pattern’ => ‘[0-9]+([\.,][0-9]+)?’, ‘type’…Continue reading

Goolge Tag

window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag(‘js’, new Date()); gtag(‘config’, ‘AW-1070680417’);Continue reading

Microsoft Advertising Tag

(function(w,d,t,r,u) { var f,n,i; w[u]=w[u]||[],f=function() { var o={ti:”343072545″, enableAutoSpaTracking: true}; o.q=w[u],w[u]=new UET(o),w[u].push(“pageLoad”) }, n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function() { var s=this.readyState; s&&s!==”loaded”&&s!==”complete”||(f(),n.onload=n.onreadystatechange=null) }, i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i) }) (window,document,”script”,”//bat.bing.com/bat.js”,”uetq”);Continue reading