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 | |
require_once('wp-load.php'); | |
global $wpdb; | |
$str = "SELECT post_id, meta_value FROM {$wpdb->prefix}postmeta WHERE meta_key = '_regular_price'"; | |
$arrRes = $wpdb->get_results($str); | |
foreach ($arrRes as $key => $value) { | |
update_post_meta( $value->post_id, '_price', $value->meta_value); |
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 | |
/** | |
* Display field value on the order edit page | |
*/ | |
add_action( 'woocommerce_admin_order_data_after_billing_address', 'wdt_delivery_date_admin_order_meta', 10, 1 ); | |
function wdt_delivery_date_admin_order_meta($order){ | |
global $wpdb; | |
$strSelect = "SELECT meta_key FROM {$wpdb->prefix}postmeta WHERE post_id = '" . $order->get_id() . "' AND meta_key LIKE '_wdt_slot_%'"; |
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
/* | |
* This code will add subtotal to edit order admin woocommerce. | |
* Author: WooExtend | |
* Date: 13-02-2018 | |
*/ | |
add_action( 'woocommerce_admin_order_totals_after_discount', 'vp_add_sub_total', 10, 1); | |
function vp_add_sub_total( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
?><tr> | |
<td class="label">Subtotal:</td> |