This file contains hidden or 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 a message above the login / register form on my-account page. | |
| */ | |
| function wb_login_message() { | |
| if ( get_option( 'woocommerce_enable_myaccount_registration' ) == 'yes' ) { | |
| ?> | |
| <div class="woocommerce-info"> | |
| <p><?php esc_html_e( 'Returning customers login. New users register for next time so you can:' ); ?></p> | |
| <ul> | |
| <li><?php esc_html_e( 'View your order history' ); ?></li> |
This file contains hidden or 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
| /** | |
| * Apply a coupon for minimum cart total. | |
| */ | |
| function wb_add_coupon_notice() { | |
| $cart_total = WC()->cart->get_subtotal(); | |
| $minimum_amount = 50; | |
| $currency_code = get_woocommerce_currency(); | |
| wc_clear_notices(); |
This file contains hidden or 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 Custom currency name and currency symbol. | |
| */ | |
| function wb_add_my_currency( $currencies ) { | |
| $currencies['ABC'] = __( 'Currency name', 'woocommerce' ); | |
| return $currencies; | |
| } | |
| add_filter( 'woocommerce_currencies', 'wb_add_my_currency' ); | |
| /** |
This file contains hidden or 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
| /** | |
| * Send an email each time an order with coupon(s) is completed. | |
| * The email contains coupon(s) used during checkout process. | |
| */ | |
| function wb_woo_email_order_coupons( $order_id ) { | |
| $order = new WC_Order( $order_id ); | |
| if ( $order->get_used_coupons() ) { | |
| $to = 'youremail@yourcompany.com'; |
This file contains hidden or 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
| /* | |
| * goes in theme functions.php or a custom plugin. | |
| * | |
| * Subject filters: | |
| * woocommerce_email_subject_new_order | |
| * woocommerce_email_subject_customer_processing_order | |
| * woocommerce_email_subject_customer_completed_order | |
| * woocommerce_email_subject_customer_invoice | |
| * woocommerce_email_subject_customer_note | |
| * woocommerce_email_subject_low_stock |
This file contains hidden or 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
| /** | |
| * Adjust the quantity input values. | |
| */ | |
| function wb_woocommerce_quantity_input_args( $args, $product ) { | |
| if ( is_singular( 'product' ) ) { | |
| $args['input_value'] = 2; // Starting value (we only want to affect product pages, not cart). | |
| } | |
| $args['max_value'] = 80; // Maximum value. | |
| $args['min_value'] = 2; // Minimum value. | |
| $args['step'] = 2; // Quantity steps. |
This file contains hidden or 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 | |
| /** | |
| * Plugin Name: WooCommerce <enter name> Gateway | |
| * Plugin URI: https://wbcomdesigns.com/ | |
| * Description: Extends WooCommerce with an <enter name> gateway. | |
| * Version: 1.0 | |
| * Author: Wbcomdesigns | |
| * Author URI: https://wbcomdesigns.com/ | |
| */ | |
| function wb_woocommerce_gateway_name_init() { |
This file contains hidden or 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 a new country to countries list. | |
| */ | |
| function wb_add_my_country( $countries ) { | |
| $new_countries = array( | |
| 'NIRE' => __( 'Northern Ireland', 'woocommerce' ), | |
| ); | |
| return array_merge( $countries, $new_countries ); | |
| } |