This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class WPDeskHideOutOfStockInRelated { | |
public function hooks() { | |
add_action( 'woocommerce_after_single_product_summary', array( $this, 'add_filter' ), 19 ); | |
add_action( 'woocommerce_after_single_product_summary', array( $this, 'remove_filter' ), 21 ); | |
} | |
public function add_filter() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_order_number', 'wpdesk_woocommerce_order_number_prefix_suffix', 20 ); | |
function wpdesk_woocommerce_order_number_prefix_suffix( $order_id ) { | |
$prefix = 'X/'; | |
$suffix = '/Y'; | |
$new_order_id = $prefix . $order_id . $suffix; | |
return $new_order_id; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php do_action( 'woocommerce_thankyou', $order_id ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php do_action( 'woocommerce_thankyou', $order_id ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_form_field_args', 'my_woocommerce_form_field_args', 10, 3 ); | |
function my_woocommerce_form_field_args( $args, $key, $value ) { | |
if ( $args['type'] == 'checkbox' ) { | |
$args['label'] = '<span>' . $args['label'] . '</span>'; | |
} | |
return $args; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'flexible_checkout_fields_validate_billing_test_validate', 'flexible_checkout_fields_validate_billing_test_validate' ); | |
function flexible_checkout_fields_validate_billing_test_validate( $value ) { | |
if ( $value != '1' ) { | |
wc_add_notice( 'Test validate must equals 1!', 'error' ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_dequeue_css() { | |
wp_dequeue_style( 'jquery-ui-style' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'my_dequeue_css', 100 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'allegro_shortcode_wpautop', '__return_true' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'allegro_shortcode_wpautop', '__return_true' ); |