Allow Subscriptions Product on BOGO and Add Product Search Field

add_filter( ‘acfw_product_search_allowed_types’ , ‘acfw_search_add_support_for_subscription_products’ ); function acfw_search_add_support_for_subscription_products( $product_types ) { $product_types[] = ‘subscription’; $product_types[] = ‘variable-subscription’; $product_types[] = ‘subscription_variation’; return $product_types; }Continue reading

Override Wholesale Price Text Per Wholesale Role

add_filter(‘wwp_filter_wholesale_price_title_text’, ‘wholesale_price_text’, 10, 1); function wholesale_price_text($text) { global $wc_wholesale_prices; $user_wholesale_role = $wc_wholesale_prices->wwp_wholesale_roles->getUserWholesaleRole(); if (!empty($user_wholesale_role)) { // To Switch wholesale price text depending on wholesale role switch ($user_wholesale_role[0]) { case ‘wholesale_customer’: return ‘Wholesale Price:’; // Add more role keys case ‘wholesale_bronze’:…Continue reading

Prevent Wholesale Customer to Add Product to the Cart If The Product is Low on Stock

// Prevent wholesale customer to add to cart if the product is low on stock add_filter(‘woocommerce_is_purchasable’, ‘wwpp_disable_cart_lowstock’, 10, 2 ); add_filter(‘woocommerce_variation_is_purchasable’, ‘wwpp_disable_cart_lowstock’, 10, 2 ); function wwpp_disable_cart_lowstock( $purchasable, $product ) { global $wc_wholesale_prices_premium; $user_wholesale_role = $wc_wholesale_prices_premium->wwpp_wholesale_roles->getUserWholesaleRole(); if( !empty( $user_wholesale_role )…Continue reading

Untitled Snippet

add_filter( ‘aioseo_robots_meta’, ‘aioseo_filter_robots_meta’ ); function aioseo_filter_robots_meta( $attributes ) { $url = home_url( $_SERVER[‘REQUEST_URI’] ); if (strpos($url,’product_search=’) !== false) { $attributes[‘index’] = “noindex”; }; return $attributes; }Continue reading

Allow ico Files Upload

/*——————————————— TYPE MIME ICO par HP MC&C ———————————————-*/ function allow_ico_mime_types( $mimes ){ $mimes[‘ico’] = ‘image/x-icon’; return $mimes; } add_filter( ‘upload_mimes’, ‘allow_ico_mime_types’ );Continue reading