WhatsApp Button to WooCommerce Single Product Pages

/** * Enqueue script and styles for child theme */ function woodmart_child_enqueue_styles() { wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array( ‘woodmart-style’ ), woodmart_get_theme_info( ‘Version’ ) ); } add_action( ‘wp_enqueue_scripts’, ‘woodmart_child_enqueue_styles’, 10010 ); define(‘ALLOW_UNFILTERED_UPLOADS’, true); function add_whatsapp_buttonlux() { ?> // Please enter…Continue reading

Display WPForm data in a post

/** * Custom shortcode to display WPForms form entries in table view. * * Basic usage: [wpforms_entries_table id=”FORMID”]. * * Possible shortcode attributes: * id (required) Form ID of which to show entries. * user User ID, or “current” to…Continue reading

hide_discount_code_field_for_specific_levels

function hide_discount_code_field_for_specific_levels($show) { global $pmpro_level; if( in_array( $pmpro_level->id, array(1,2,3,4,5,6) ) ) { $show = false; } return $show; } add_filter(‘pmpro_show_discount_code’, ‘hide_discount_code_field_for_specific_levels’);Continue reading

custom_remove_userregistration_admin_bar_links

function custom_remove_ur_admin_bar_links( $wp_admin_bar ) { $wp_admin_bar->remove_menu(‘user-registration-menu’); $wp_admin_bar->remove_menu(‘ur-edit-form’); $wp_admin_bar->remove_menu(‘user-registration-all-forms’); $wp_admin_bar->remove_menu(‘user-registration-add-new’); $wp_admin_bar->remove_menu(‘user-registration-settings’); $wp_admin_bar->remove_menu(‘user-registration-docs’); } // The priority should be higher than the one used by the plugin. add_action( ‘user_registration_top_admin_bar_menu’, ‘custom_remove_ur_admin_bar_links’, 1000 );Continue reading

MemberPress: Replace Country Code with Country Name

function mepr_replace_country_code_with_country_name ( $address, $user ) { $countries = require( MEPR_I18N_PATH . ‘/countries.php’ ); $addr1 = get_user_meta( $user->ID, ‘mepr-address-one’, true ); $addr2 = get_user_meta( $user->ID, ‘mepr-address-two’, true ); $city = get_user_meta( $user->ID, ‘mepr-address-city’, true ); $state = get_user_meta( $user->ID, ‘mepr-address-state’,…Continue reading

AS Upsell – March 28 2024

function as_upsell_shortcode() { $product_ids = array(18516, 31026, 31016,33988,34011,34017,51689,5179,51682,51684); // Updated product IDs ob_start(); echo ‘ ‘; echo ‘ ‘; foreach ($product_ids as $product_id) { $product = wc_get_product($product_id); if ($product) { echo ‘ ‘; // Image container echo ‘ ‘; echo…Continue reading

Net Price Display 27/03/2024

function display_custom_prices_table_inside_additional_information_tab() { global $product; if (current_user_can(‘shop_manager’) || current_user_can(‘administrator’)) { if (is_product()) { $table_content = ”; $total_profit = 0; $total_net_price = 0; $total_current_price = 0; $table_content .= “ Profit / Loss Sheet Product SKU Net Price Current Price RRP Price…Continue reading

Net Price Display 27/03/2024

function display_custom_prices_table_inside_additional_information_tab() { global $product; if (current_user_can(‘shop_manager’) || current_user_can(‘administrator’)) { if (is_product()) { $table_content = ”; $total_profit = 0; $total_net_price = 0; $total_current_price = 0; $table_content .= “ Profit / Loss Sheet Product SKU Net Price Current Price RRP Price…Continue reading