Commit 052f0aa4 by Pham Huy

update price template

parent 9bb88d73
...@@ -324,3 +324,8 @@ p.title-item-sidebar { ...@@ -324,3 +324,8 @@ p.title-item-sidebar {
top: 65%; top: 65%;
right: 2%; right: 2%;
} }
.bg-light-green{
background: #56BC86;
border-color: #56BC86;
}
...@@ -16,9 +16,22 @@ get_header(); ...@@ -16,9 +16,22 @@ get_header();
<div class="container"> <div class="container">
<h2 class="prices-title">BẢNG GIÁ PHẦN MỀM A HÓA ĐƠN</h2> <h2 class="prices-title">BẢNG GIÁ PHẦN MỀM A HÓA ĐƠN</h2>
<div class="row"> <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 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 <?php
// Products per page // Products per page
$per_page = 12; $per_page = -1;
if ( get_query_var( 'taxonomy' ) ) { // If on a product taxonomy archive (category or tag) if ( get_query_var( 'taxonomy' ) ) { // If on a product taxonomy archive (category or tag)
$args = array( $args = array(
'post_type' => 'product', 'post_type' => 'product',
...@@ -27,6 +40,7 @@ get_header(); ...@@ -27,6 +40,7 @@ get_header();
'orderby' => 'meta_value_num', 'orderby' => 'meta_value_num',
'order' => 'ASC', 'order' => 'ASC',
'meta_key' => '_price', 'meta_key' => '_price',
'product_cat' => 'goi-hoa-don',
'tax_query' => array( 'tax_query' => array(
array( array(
'taxonomy' => get_query_var( 'taxonomy' ), 'taxonomy' => get_query_var( 'taxonomy' ),
...@@ -41,6 +55,7 @@ get_header(); ...@@ -41,6 +55,7 @@ get_header();
'orderby' => 'meta_value_num', 'orderby' => 'meta_value_num',
'order' => 'ASC', 'order' => 'ASC',
'meta_key' => '_price', 'meta_key' => '_price',
'product_cat' => 'goi-hoa-don',
'posts_per_page' => $per_page, 'posts_per_page' => $per_page,
'paged' => get_query_var( 'paged' ), 'paged' => get_query_var( 'paged' ),
); );
...@@ -51,38 +66,168 @@ get_header(); ...@@ -51,38 +66,168 @@ get_header();
// Standard loop // Standard loop
if ( $products->have_posts() ) : if ( $products->have_posts() ) :
$stt = 0;
$fee_start = get_option('ext_cst_amount') ? get_option('ext_cst_amount') : 0;
?>
<tbody>
</pre>
<?php
while ( $products->have_posts() ) : $products->the_post(); while ( $products->have_posts() ) : $products->the_post();
// Your new HTML markup goes here // Your new HTML markup goes here
global $product; global $product;
global $wp; 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>'; // echo '<br /><a href="'.get_permalink().'">' . woocommerce_get_product_thumbnail().' '.get_the_title().'</a>';
?> ?>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4"> <tr>
<div class="card text-center box-price wow flipInY"> <th scope="row"class="text-center"><?=$stt?></th>
<h2 class="card-header"><?php the_title(); ?></h2> <td><?php the_title(); ?></td>
<article class="card-body"> <td class="text-right"><?php echo number_format($product->price, 0, ',', '.')?></td>
<p class="card-text">Số hóa đơn</p> <?php if($stt == 1) {?>
<h5 class="card-title"><?php echo number_format($product->get_attribute( 'so-luong-hoa-don' ),0,",","."); ?></h5> <td rowspan="<?=$product_cat->count?>" class="text-right" style="display: table-cell;vertical-align: middle;"><?=number_format($fee_start, 0, ',', '.')?></td>
<p class="card-text">Giá tiền</p> <td class="text-right"><?php echo number_format($product->price + $fee_start, 0, ',', '.')?></td>
<p class="card-money"><?php echo $product->get_price_html()?></p> <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">Mua ngay</a> <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>
<?php //echo do_shortcode('[add_to_cart id="'.$product->ID.'" style="border-right:1px solid #ccc"]')?> </td></tr>
</article> <?php continue; } ?>
</div> <td class="text-right"><?php echo number_format($product->price + $fee_start, 0, ',', '.')?></td>
</div> <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 <?php
endwhile; endwhile;
wp_reset_postdata(); wp_reset_postdata();
endif;
?> ?>
</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" ]') ?> <?php //echo do_shortcode('[products limit="12" columns="3" ]') ?>
</div> </div>
<div class="row text-center price_fee"> <div class="row text-center price_fee">
<div class="col-xs-12 col-sm-12 col-md-12"> <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 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> <p>Phí chưa bao gồm VAT 10%</p>
</div> </div>
</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> </div>
</section> </section>
<section class="container-fluid" style="padding: 0px"> <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