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 // Do not copy this line of code | |
| add_filter('woocommerce_email_footer_text', function($footer_text){ | |
| $site_url = site_url(); | |
| $site_name = get_bloginfo('name','display'); | |
| $footer_text = str_replace( | |
| '{site_title}', | |
| '<a href="' . esc_url($site_url) . '" target="_blank" >' . esc_html($site_name) . '</a>', | |
| $footer_text | |
| ); | |
| return $footer_text; |
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 // Do not copy this line of code | |
| add_action("wt_woocommerce_checkout_order_created", "wt_woocommerce_checkout_order_creat", 10, 2); | |
| function wt_woocommerce_checkout_order_creat($order, $checkout_post){ | |
| $obj = new LpcPickupSelection(); | |
| if (!$order->has_shipping_method('lpc_relay')) { | |
| return; | |
| } | |
| $shipping = array(); | |
| $pickupData = $obj->getCurrentPickUpLocationInfo(); | |
| if(isset($pickupData['adresse1']) && !empty($pickupData['adresse1'])){ |
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 //Do not copy this line of code | |
| $ordernid = '12345'; //order number | |
| // Check if HPOS is enabled | |
| if (get_option('woocommerce_custom_orders_table_enabled') === 'yes') { | |
| global $wpdb; | |
| $order_id = $wpdb->get_var( | |
| $wpdb->prepare( | |
| "SELECT order_id FROM {$wpdb->prefix}wc_orders_meta | |
| WHERE meta_key = %s AND meta_value = %s LIMIT 1", | |
| '_order_number', |
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 //Do not copy this line of code | |
| add_action("admin_init", "wt_disconnect_app"); | |
| function wt_disconnect_app(){ | |
| if(isset($_REQUEST['page']) && "wt_stripe_menu" === sanitize_text_field($_REQUEST['page']) && isset($_REQUEST['action']) && "delete_app" === sanitize_text_field($_REQUEST['action'])){ | |
| delete_transient("wtst_refresh_token_calling"); | |
| //Sandobx tokens | |
| delete_option("wt_stripe_account_id_test"); | |
| delete_option("wt_stripe_access_token_test"); | |
| delete_option("wt_stripe_refresh_token_test"); |
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 //Do not copy this line of code | |
| add_action("wp_footer", "wt_customize_stripe_icons"); | |
| function wt_customize_stripe_icons(){ | |
| ?><style type="text/css"> | |
| #payment .payment_methods li img { | |
| float: right; | |
| } | |
| @media only screen and (max-width: 480px) { |
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 //Do not copy this line of code | |
| add_action('init', 'remove_order_status_changed_order_number', 15); | |
| function remove_order_status_changed_order_number() { | |
| if (class_exists('Wt_Advanced_Order_Number')) { | |
| foreach ($GLOBALS['wp_filter']['woocommerce_order_status_changed']->callbacks as $priority => $hooks) { | |
| foreach ($hooks as $hook_id => $hook) { | |
| if (is_array($hook['function']) && is_object($hook['function'][0])) { | |
| $object = $hook['function'][0]; |
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 //Do not copy this line of code | |
| add_action('woocommerce_thankyou', 'set_order_status_on_hold', 10, 1); | |
| function set_order_status_on_hold($order_id) { | |
| // Get the order object | |
| $order = wc_get_order($order_id); | |
| // Check if the order exists and if the payment method is your custom one | |
| if ($order && $order->get_payment_method() === 'eh_stripe_pay') { | |
| // Set the order status to 'on-hold' | |
| $order->update_status('on-hold', __('Order status set to on hold by custom payment method.', 'payment_gateway_stripe_and_woocommerce_integration')); |
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 //Do no copy this line of code | |
| //Currency converter function | |
| if(! function_exists('convert_curcy_price')){ | |
| function convert_curcy_price( $price, $selected_currency, $previous_currency='') { | |
| if(class_exists('WOOMULTI_CURRENCY_F') && method_exists('WOOMULTI_CURRENCY_F_Data','get_ins')){ | |
| $curcy_currency_settings = WOOMULTI_CURRENCY_F_Data::get_ins(); | |
| $currency_list = $curcy_currency_settings->get_list_currencies(); | |
| $force_convert = false; | |
| if( ''!== $previous_currency && $previous_currency !== $selected_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
| <?php //Do not copy this line of code | |
| add_filter('wt_pklist_alter_currency_symbol', 'wt_pklist_alter_currency_symbol_fun', 9999, 5); | |
| function wt_pklist_alter_currency_symbol_fun($wc_currency_symbol, $symbols, $user_currency, $order, $price) { | |
| if ( $order instanceof WC_Order ) { | |
| $currency = $order->get_currency(); | |
| $symbols = get_woocommerce_currency_symbols(); | |
| return $symbols[$currency] ?? $wc_currency_symbol; | |
| } |
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 //Do not copy this line of code | |
| add_filter('wf_pklist_alter_shipping_from_address', 'wt_pklist_alter_from_addr', 10, 3); | |
| function wt_pklist_alter_from_addr($fromaddress, $template_type, $order) { | |
| if ( 'shippinglabel' === $template_type ) { | |
| // Define address fields to remove from the "From" address | |
| $address_fields = [ | |
| 'address_line1', | |
| 'address_line2', | |
| 'city', |