Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ahoadon
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phạm Quang Huy
ahoadon
Commits
052f0aa4
Commit
052f0aa4
authored
Feb 10, 2020
by
Pham Huy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update price template
parent
9bb88d73
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
165 additions
and
15 deletions
+165
-15
hdv-huypq.css
wp-content/themes/ahoadonviet/css/hdv-huypq.css
+5
-0
price-tpl.php
wp-content/themes/ahoadonviet/template-parts/price-tpl.php
+160
-15
No files found.
wp-content/themes/ahoadonviet/css/hdv-huypq.css
View file @
052f0aa4
...
...
@@ -324,3 +324,8 @@ p.title-item-sidebar {
top
:
65%
;
right
:
2%
;
}
.bg-light-green
{
background
:
#56BC86
;
border-color
:
#56BC86
;
}
wp-content/themes/ahoadonviet/template-parts/price-tpl.php
View file @
052f0aa4
...
...
@@ -16,9 +16,22 @@ get_header();
<div
class=
"container"
>
<h2
class=
"prices-title"
>
BẢNG GIÁ PHẦN MỀM A HÓA ĐƠN
</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 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
=
12
;
$per_page
=
-
1
;
if
(
get_query_var
(
'taxonomy'
)
)
{
// If on a product taxonomy archive (category or tag)
$args
=
array
(
'post_type'
=>
'product'
,
...
...
@@ -27,6 +40,7 @@ get_header();
'orderby'
=>
'meta_value_num'
,
'order'
=>
'ASC'
,
'meta_key'
=>
'_price'
,
'product_cat'
=>
'goi-hoa-don'
,
'tax_query'
=>
array
(
array
(
'taxonomy'
=>
get_query_var
(
'taxonomy'
),
...
...
@@ -41,6 +55,7 @@ get_header();
'orderby'
=>
'meta_value_num'
,
'order'
=>
'ASC'
,
'meta_key'
=>
'_price'
,
'product_cat'
=>
'goi-hoa-don'
,
'posts_per_page'
=>
$per_page
,
'paged'
=>
get_query_var
(
'paged'
),
);
...
...
@@ -51,38 +66,168 @@ get_header();
// Standard loop
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
();
// 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>';
?>
<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
>
<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
();
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" ]') ?>
</
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
:
16
px
;
"> (Á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
:
0
px
">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment