Commit 052f0aa4 by Pham Huy

update price template

parent 9bb88d73
......@@ -324,3 +324,8 @@ p.title-item-sidebar {
top: 65%;
right: 2%;
}
.bg-light-green{
background: #56BC86;
border-color: #56BC86;
}
......@@ -16,73 +16,218 @@ get_header();
<div class="container">
<h2 class="prices-title">BẢNG GIÁ PHẦN MỀM A HÓA ĐƠN</h2>
<div class="row">
<?php
// Products per page
$per_page = 12;
if ( get_query_var( 'taxonomy' ) ) { // If on a product taxonomy archive (category or tag)
$args = array(
'post_type' => 'product',
'posts_per_page' => $per_page,
'paged' => get_query_var( 'paged' ),
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_key' => '_price',
'tax_query' => array(
array(
'taxonomy' => get_query_var( 'taxonomy' ),
'field' => 'slug',
'terms' => get_query_var( 'term' ),
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<table class="table table-striped">
<thead>
<tr>
<th scope="col" width="7%" class="text-center">STT</th>
<th scope="col" width="30%" class="text-center">Gói hóa đơn</th>
<th scope="col" width="13%" class="text-center">Trị giá</th>
<th scope="col" width="10%" class="text-center">Phí khởi tạo</th>
<th scope="col" width="13%" class="text-center">Thành tiền (VNĐ)</th>
<th scope="col" width="12%" class="text-center"></th>
</tr>
</thead>
<?php
// Products per page
$per_page = -1;
if ( get_query_var( 'taxonomy' ) ) { // If on a product taxonomy archive (category or tag)
$args = array(
'post_type' => 'product',
'posts_per_page' => $per_page,
'paged' => get_query_var( 'paged' ),
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_key' => '_price',
'product_cat' => 'goi-hoa-don',
'tax_query' => array(
array(
'taxonomy' => get_query_var( 'taxonomy' ),
'field' => 'slug',
'terms' => get_query_var( 'term' ),
),
),
),
);
} else { // On main shop page
$args = array(
'post_type' => 'product',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_key' => '_price',
'posts_per_page' => $per_page,
'paged' => get_query_var( 'paged' ),
);
}
// Set the query
$products = new WP_Query( $args );
$home_url = home_url( $wp->request );
// Standard loop
if ( $products->have_posts() ) :
while ( $products->have_posts() ) : $products->the_post();
// Your new HTML markup goes here
global $product;
global $wp;
// echo '<br /><a href="'.get_permalink().'">' . woocommerce_get_product_thumbnail().' '.get_the_title().'</a>';
);
} else { // On main shop page
$args = array(
'post_type' => 'product',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_key' => '_price',
'product_cat' => 'goi-hoa-don',
'posts_per_page' => $per_page,
'paged' => get_query_var( 'paged' ),
);
}
// Set the query
$products = new WP_Query( $args );
$home_url = home_url( $wp->request );
// Standard loop
if ( $products->have_posts() ) :
$stt = 0;
$fee_start = get_option('ext_cst_amount') ? get_option('ext_cst_amount') : 0;
?>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="card text-center box-price wow flipInY">
<h2 class="card-header"><?php the_title(); ?></h2>
<article class="card-body">
<p class="card-text">Số hóa đơn</p>
<h5 class="card-title"><?php echo number_format($product->get_attribute( 'so-luong-hoa-don' ),0,",","."); ?></h5>
<p class="card-text">Giá tiền</p>
<p class="card-money"><?php echo $product->get_price_html()?></p>
<a href="<?php echo wc_get_cart_url() . do_shortcode('[add_to_cart_url id="'.$product->ID.'"]')?>" class="btn btn-primary">Mua ngay</a>
<?php //echo do_shortcode('[add_to_cart id="'.$product->ID.'" style="border-right:1px solid #ccc"]')?>
</article>
</div>
</div>
<tbody>
</pre>
<?php
endwhile;
wp_reset_postdata();
endif;
?>
<?php //echo do_shortcode('[products limit="12" columns="3" ]') ?>
while ( $products->have_posts() ) : $products->the_post();
// Your new HTML markup goes here
global $product;
global $wp;
$product_cat = get_term( $product->category_ids[0], 'product_cat' );
$stt++;
// echo '<br /><a href="'.get_permalink().'">' . woocommerce_get_product_thumbnail().' '.get_the_title().'</a>';
?>
<tr>
<th scope="row"class="text-center"><?=$stt?></th>
<td><?php the_title(); ?></td>
<td class="text-right"><?php echo number_format($product->price, 0, ',', '.')?></td>
<?php if($stt == 1) {?>
<td rowspan="<?=$product_cat->count?>" class="text-right" style="display: table-cell;vertical-align: middle;"><?=number_format($fee_start, 0, ',', '.')?></td>
<td class="text-right"><?php echo number_format($product->price + $fee_start, 0, ',', '.')?></td>
<td class="text-center">
<a href="<?php echo wc_get_cart_url() . do_shortcode('[add_to_cart_url id="'.$product->ID.'"]')?>" class="btn btn-primary bg-light-green">Mua ngay</a>
</td></tr>
<?php continue; } ?>
<td class="text-right"><?php echo number_format($product->price + $fee_start, 0, ',', '.')?></td>
<td class="text-center">
<a href="<?php echo wc_get_cart_url() . do_shortcode('[add_to_cart_url id="'.$product->ID.'"]')?>" class="btn btn-primary bg-light-green">Mua ngay</a>
</td>
</tr>
<?php
endwhile;
wp_reset_postdata();
?>
</tbody>
<?php else: ?>
<tbody>
<tr><td colspan="5">Chưa có gói hóa đơn nào!</td></tr>
</tbody>
<?php endif; ?>
</table>
</div>
<?php //echo do_shortcode('[products limit="12" columns="3" ]') ?>
</div>
<div class="row text-center price_fee">
<div class="col-xs-12 col-sm-12 col-md-12">
<p class="txt-red"> PHÍ KHỞI TẠO: 500.000 VNĐ </p>
<p style="font-size: 16px;"> (Áp dụng cho lần đầu tiên)</p>
<p>Phí chưa bao gồm VAT 10%</p>
</div>
</div>
<hr>
<h2 class="prices-title">BẢNG GIÁ GÓI CHỮ KÝ SỐ</h2>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<table class="table table-striped">
<thead>
<tr>
<!-- <th scope="col" width="7%" class="text-center">STT</th> -->
<th scope="col" width="30%" class="text-center">Gói Chữ ký số</th>
<th scope="col" width="13%" class="text-center">Giá dịch vụ</th>
<th scope="col" width="10%" class="text-center">Token</th>
<th scope="col" width="13%" class="text-center">Giá trước thuế</th>
<th scope="col" width="13%" class="text-center">VAT (10%)</th>
<th scope="col" width="13%" class="text-center">Thành tiền (VNĐ)</th>
<th scope="col" width="12%" class="text-center"></th>
</tr>
</thead>
<?php
// Products per page
$per_page = -1;
if ( get_query_var( 'taxonomy' ) ) { // If on a product taxonomy archive (category or tag)
$args = array(
'post_type' => 'product',
'posts_per_page' => $per_page,
'paged' => get_query_var( 'paged' ),
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_key' => '_price',
'product_cat' => 'chu-ky-so',
'tax_query' => array(
array(
'taxonomy' => get_query_var( 'taxonomy' ),
'field' => 'slug',
'terms' => get_query_var( 'term' ),
),
),
);
} else { // On main shop page
$args = array(
'post_type' => 'product',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_key' => '_price',
'product_cat' => 'chu-ky-so',
'posts_per_page' => $per_page,
'paged' => get_query_var( 'paged' ),
);
}
// Set the query
$products_digital = new WP_Query( $args );
$home_url = home_url( $wp->request );
// Standard loop
if ( $products_digital->have_posts() ) :
$stt_1 = 0;
$token = get_option('ext_cst_amount') ? get_option('ext_cst_amount') : 0;
?>
<tbody>
</pre>
<?php
while ( $products_digital->have_posts() ) : $products_digital->the_post();
// Your new HTML markup goes here
global $product;
global $wp;
// Get the prices
$price_excl_tax = wc_get_price_excluding_tax( $product ); // price without VAT
$price_incl_tax = wc_get_price_including_tax( $product ); // price with VAT
// echo "<pre>";
// print_r($product);
$product_cat = get_term( $product->category_ids[0], 'product_cat' );
$stt_1++;
?>
<tr>
<!-- <th scope="row"class="text-center"><?=$stt_1?></th> -->
<td><?php the_title(); ?></td>
<td class="text-right"><?php echo number_format($price_excl_tax, 0, ',', '.')?></td>
<?php if($stt_1 == 3){
$tax_amount = ($price_excl_tax)*10/100; // VAT amount?>
<td class="text-right"><?php echo number_format(0, 0, ',', '.')?></td>
<td class="text-right"><?php echo number_format($price_excl_tax, 0, ',', '.')?></td>
<td class="text-right"><?php echo number_format($tax_amount, 0, ',', '.')?></td>
<td class="text-right"><?php echo number_format($price_incl_tax, 0, ',', '.')?></td>
<?php }else{
$tax_amount = ($price_excl_tax+ $token)*10/100; // VAT amoun?>
<td class="text-right"><?php echo number_format($token, 0, ',', '.')?></td>
<td class="text-right"><?php echo number_format($price_excl_tax + $token, 0, ',', '.')?></td>
<td class="text-right"><?php echo number_format($tax_amount, 0, ',', '.')?></td>
<td class="text-right"><?php echo number_format($price_incl_tax + $token, 0, ',', '.')?></td>
<?php }?>
<td class="text-center">
<a href="<?php echo wc_get_cart_url() . do_shortcode('[add_to_cart_url id="'.$product->ID.'"]')?>" class="btn btn-primary bg-light-green" >Mua ngay</a>
</td>
</tr>
<?php
endwhile;
wp_reset_postdata();
?>
</tbody>
<?php else: ?>
<tbody>
<tr><td colspan="5">Chưa có gói Chữ ký số nào!</td></tr>
</tbody>
<?php endif; ?>
</table>
</div>
<?php //echo do_shortcode('[products limit="12" columns="3" ]') ?>
</div>
</div>
</section>
<section class="container-fluid" style="padding: 0px">
......
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