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 not copy this line of code | |
add_filter('wt_pklist_alter_product_image_url', 'wt_pklist_alter_product_image_url_fn', 10, 4); | |
/** | |
* Filter to customize the product image URL in packing lists. | |
* | |
* This function allows you to set a custom image URL for a product. | |
* If a custom image URL is available, update the `$img_url` variable to use that URL. | |
* @return string The updated image URL to be used in the packing list. | |
*/ | |
function wt_pklist_alter_product_image_url_fn($img_url, $product_id, $variation_id, $parent_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 not add this line of code | |
add_filter('wf_pklist_alter_order_date', 'wt_pklist_change_order_date_format', 10, 3); | |
function wt_pklist_change_order_date_format($order_date, $template_type, $order) { | |
if ( is_object( $order ) ) { | |
$order_id = is_object($order) ? $order->get_id() : ''; | |
$order_date_format = 'd/m/y'; | |
$order_date = get_the_date( $order_date_format, $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 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 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 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 | |
$order_number = 123456; // Order number to search for | |
$args = array( | |
'limit' =>1, | |
array( | |
'key' => '_order_number', | |
'value' => $order_number, | |
'compare' => '=' | |
) | |
); |
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 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 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 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 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 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 ){ |
NewerOlder