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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Insert title here</title> | |
<style> | |
h1 { | |
color:red; | |
} | |
.content { |
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 | |
$file = file_get_contents('http://www.vietcombank.com.vn/ExchangeRates/'); | |
//Lấy dữ liệu | |
$pattern = '#(?<=id="ctl00_Content_ExrateView">).*(?=</table>)#imsU'; | |
preg_match($pattern, $file, $match); | |
//Tạo mảng | |
$pattern = '#<td class="code">(.*)</td><td class="code">(.*)</td><td>(.*)</td><td>(.*)</td><td>(.*)</td>.*</tr>#imsU'; |
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 | |
if (! defined( 'ABSPATH' )) { | |
exit; | |
} | |
class WC_Request_Shipping_Quote_Method extends WC_Shipping_Method { | |
public function __construct( $instance_id = 0 ) { | |
$this->id = 'wooviet_shipping'; | |
$this->instance_id = absint( $instance_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 | |
global $wpdb; | |
$location_zone = $wpdb->get_results( | |
" | |
SELECT {$wpdb->prefix}woocommerce_shipping_zone_locations.location_code, {$wpdb->prefix}woocommerce_shipping_zone_methods.instance_id | |
FROM {$wpdb->prefix}woocommerce_shipping_zone_locations | |
INNER JOIN {$wpdb->prefix}woocommerce_shipping_zone_methods | |
ON {$wpdb->prefix}woocommerce_shipping_zone_locations.zone_id = {$wpdb->prefix}woocommerce_shipping_zone_methods.zone_id | |
" | |
, ARRAY_A ); |
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
$('#billing_country').val('VN'); | |
$('#billing_country').select2({ | |
disabled: 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
// In general settings | |
add_filter( 'woocommerce_general_settings', array( $this, 'add_VN_districts_in_general_settings' ) ); | |
public function add_VN_districts_in_general_settings( $settings ) { | |
$settings[3] = array( | |
'title' => __( 'City', 'woocommerce' ), | |
'desc' => __( 'The city in which your business is located.', 'woocommerce' ), | |
'id' => 'woocommerce_store_city', | |
'default' => '', | |
'type' => 'select', |
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 | |
$order = new WC_Order(206); // Order id | |
$billing_address = $order->get_address('billing'); | |
echo "<pre>"; | |
print_r($billing_address); | |
echo "</pre>"; | |
?> |
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 | |
/** | |
* Plugin Name: WC Apartment Number | |
* Plugin URI: https://github.com/longkt/wc-apartment-number | |
* Description: This plugin add new field "Apartment Number" for the billing address. | |
* Author: longnguyen | |
* Author URI: https://profiles.wordpress.org/longnguyen | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { |
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
<!DOCTYPE html> | |
<html <?php language_attributes(); ?>> | |
<head> | |
<meta charset="<?php bloginfo('charset'); ?>" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> | |
<?php wp_head(); ?> | |
</head> | |
<body <?php body_class(); ?>> |
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
// https://buddydev.com/hiding-users-on-buddypress-based-site/ | |
add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users_by_role' ); | |
function buddydev_exclude_users_by_role( $args ) { | |
//do not exclude in admin | |
if( is_admin() && ! defined( 'DOING_AJAX' ) ) { | |
return $args; | |
} | |
OlderNewer