Commit df4a43a5 by Pham Huy

update form checkout

parent 99e2ed22
......@@ -67,11 +67,23 @@ ul#menu-main-menu li:nth-child(1) {
ul#menu-main-menu li:nth-last-child(1) {
border-radius: 0px 4px 4px 0px;
}
ul#menu-main-menu li ul li:nth-child(1) {
border-radius: 4px 4px 0px 0px;
}
ul#menu-main-menu li ul li:nth-last-child(1) {
border-radius: 0px 0px 4px 4px;
}
ul#menu-main-menu li {
padding: 10px 0px;
text-transform: uppercase !important;
}
ul#menu-main-menu li ul li {
padding: 5px 0px;
}
ul#menu-main-menu li.current-menu-item a{
color: #FFFFFF !important;
border-right: 1px solid #ED2027;
......@@ -80,6 +92,15 @@ ul#menu-main-menu li.current-menu-item{
background-color: #ED2027;
}
ul#menu-main-menu li ul li a {
padding: 5px 15px;
text-align: center;
border-right: none;
}
ul#menu-main-menu li ul.sub-menu{
border-radius: 4px;
}
ul#menu-main-menu li a {
color:#576077;
font-family: Montserrat-Regular;
......@@ -513,7 +534,10 @@ ul#menu-main-menu li a:hover {
font-weight: bold;
}
.tpl-hoadon{
width: 80%;
width: 90%;
}
#content .width-100{
width: 100%;
}
#footer-content {
......
......@@ -987,4 +987,55 @@ add_action( 'after_setup_theme', 'ahoadon_add_woocommerce_support' );
// }
// add_action( 'woocommerce_before_shop_loop', 'woocommerce_product_category', 100 );
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
\ No newline at end of file
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
/**
* Add custom field to the checkout page
*/
add_action('woocommerce_before_checkout_billing_form', 'mst_checkout_field');
function mst_checkout_field($checkout) {
echo '<div id="mst_checkout_field">';
woocommerce_form_field('mst_checkout_field', array(
'type' => 'text',
'required' => true,
'class' => array(
'mst-field form-row-wide'
) ,
'label' => __('Mã số thuế') ,
'placeholder' => __('Nhập mã số thuế') ,
) ,
$checkout->get_value('mst_checkout_field'));
echo '<i id="search-taxcode" class="fa fa-search"></i></div>';
}
/**
* Update the value given in custom field
*/
add_action('woocommerce_checkout_update_order_meta', 'custom_checkout_field_update_order_meta');
function custom_checkout_field_update_order_meta($order_id) {
if (!empty($_POST['mst_checkout_field'])) {
add_post_meta( $order_id, __('Mã số thuế'), sanitize_text_field( $_POST ['mst_checkout_field'] ) );
// update_post_meta($order_id, __('Mã số thuế'),sanitize_text_field($_POST['mst_checkout_field']));
}
}
/**
* Remove postcode field
*/
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_postcode']);
return $fields;
}
// add_filter( 'woocommerce_add_to_cart_validation', 'wc_limit_one_per_order', 10, 2 );
// function wc_limit_one_per_order( $passed_validation) {
// if ( WC()->cart->get_cart_contents_count() >= 1 ) {
// wc_add_notice( __( 'This product cannot be purchased with other products. Please, empty your cart first and then add it again.', 'woocommerce' ), 'error' );
// return false;
// }
// return $passed_validation;
// }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment