add_action(‘woocommerce_order_status_completed’, ‘create_user_and_notify_on_order_completion_with_masterstudy’); function create_user_and_notify_on_order_completion_with_masterstudy($order_id) { $order = wc_get_order($order_id); $customer_email = $order->get_billing_email(); // Find user by email $user = get_user_by(’email’, $customer_email); if ($user) { // Existing user found, update ‘customer’ role if (!in_array(‘customer’, $user->roles)) { $user->add_role(‘customer’); } // Update order to…Continue reading
add_action(‘woocommerce_order_status_completed’, ‘create_user_and_notify_on_order_completion’); function create_user_and_notify_on_order_completion($order_id) { $order = wc_get_order($order_id); $customer_email = $order->get_billing_email(); // Find user by email $user = get_user_by(’email’, $customer_email); if ($user) { // Existing user found, update ‘customer’ role if (!in_array(‘customer’, $user->roles)) { $user->add_role(‘customer’); } // Update order to…Continue reading
function custom_woo_ce_extend_product_fields( $fields ) { $fields[] = array( ‘name’ => ‘my_custom_field’, ‘label’ => __( ‘My Custom Field’, ‘woo_ce’ ) ); return $fields; } add_filters( ‘woo_ce_product_fields’, ‘custom_woo_ce_extend_product_fields’ );Continue reading
function woo_ce_extend_product_item( $product, $product_id ) { $product->my_custom_field = get_post_meta( $product_id, ‘_my_custom_field’, true ); return $product; } add_filter( ‘woo_ce_product_item’, ‘custom_woo_ce_extend_product_item’, 10, 2 );Continue reading
function custom_woo_ce_email_contents( $content = ” ) { // Change the below text so whatever you prefer $content = ‘Please find attached your export ready to review.’; // wpautop() changes double line-breaks in the text into HTML paragraphs $content = wpautop(…Continue reading
function custom_woo_ce_order_fields( $fields ) { $fields[] = array( ‘name’ => ‘static_field’, ‘label’ => __( ‘Static Field’, ‘woo_ce’ ), ‘hover’ => __( ‘Static Field within functions.php’, ‘woo_ce’ ) ); return $fields; } add_filter( ‘woo_ce_order_fields’, ‘custom_woo_ce_order_fields’ ); function custom_woo_ce_order( $order, $order_id )…Continue reading
function custom_woo_ce_brand_term_taxonomy() { // Term Taxonomy of Brands used within your WooCommerce store, defaults to product_brand return ‘brand’; } add_filter( ‘woo_ce_brand_term_taxonomy’, ‘custom_woo_ce_brand_term_taxonomy’, 11 );Continue reading
function custom_woo_ce_cron_export_ftp_switch() { // ftp_put or ftp_fput return ‘ftp_fput’; } add_filter( ‘woo_ce_cron_export_ftp_switch’, ‘custom_woo_ce_cron_export_ftp_switch’ );Continue reading
function custom_trigger_scheduled_export_url() { $secret_key = ( isset( $_GET[‘secret_key’] ) ? sanitize_text_field( $_GET[‘secret_key’] ) : false ); if( empty( $secret_key ) ) { return; } if( $secret_key == ‘SECRET_KEY_PASSED_VIA_CRON’ ) { // This is the Post ID of the Scheduled Export…Continue reading
function custom_woo_ce_wc_price_decimal_sep() { // Override the default decimal separator in Store Exporter Deluxe return ‘,’; } add_filter( ‘woo_ce_wc_price_decimal_sep’, ‘custom_woo_ce_wc_price_decimal_sep’ );Continue reading