This commit is contained in:
nguyen dung
2022-02-18 16:43:41 +07:00
commit 39b8cb3612
4470 changed files with 1378320 additions and 0 deletions

View File

@@ -0,0 +1,106 @@
<?php
/**
* Checkout Form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 3.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$wrapper_classes = array();
$row_classes = array();
$main_classes = array();
$sidebar_classes = array();
$layout = get_theme_mod( 'checkout_layout' );
if ( ! $layout ) {
$sidebar_classes[] = 'has-border';
}
if ( $layout == 'simple' ) {
$sidebar_classes[] = 'is-well';
}
$wrapper_classes = implode( ' ', $wrapper_classes );
$row_classes = implode( ' ', $row_classes );
$main_classes = implode( ' ', $main_classes );
$sidebar_classes = implode( ' ', $sidebar_classes );
do_action( 'woocommerce_before_checkout_form', $checkout );
// If checkout registration is disabled and not logged in, the user cannot checkout.
if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) ) );
return;
}
// Social login.
if ( flatsome_option( 'facebook_login_checkout' ) && get_option( 'woocommerce_enable_myaccount_registration' ) == 'yes' && ! is_user_logged_in() ) {
wc_get_template( 'checkout/social-login.php' );
}
?>
<form name="checkout" method="post" class="checkout woocommerce-checkout <?php echo esc_attr( $wrapper_classes ); ?>" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data">
<div class="row pt-0 <?php echo esc_attr( $row_classes ); ?>">
<div class="large-7 col <?php echo esc_attr( $main_classes ); ?>">
<?php if ( $checkout->get_checkout_fields() ) : ?>
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
<div id="customer_details">
<div class="clear">
<?php do_action( 'woocommerce_checkout_billing' ); ?>
</div>
<div class="clear">
<?php do_action( 'woocommerce_checkout_shipping' ); ?>
</div>
</div>
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
<?php endif; ?>
</div>
<div class="large-5 col">
<?php flatsome_sticky_column_open( 'checkout_sticky_sidebar' ); ?>
<div class="col-inner <?php echo esc_attr( $sidebar_classes ); ?>">
<div class="checkout-sidebar sm-touch-scroll">
<?php do_action( 'woocommerce_checkout_before_order_review_heading' ); ?>
<h3 id="order_review_heading"><?php esc_html_e( 'Your order', 'woocommerce' ); ?></h3>
<?php do_action( 'woocommerce_checkout_before_order_review' ); ?>
<div id="order_review" class="woocommerce-checkout-review-order">
<?php do_action( 'woocommerce_checkout_order_review' ); ?>
</div>
<?php do_action( 'woocommerce_checkout_after_order_review' ); ?>
</div>
</div>
<?php flatsome_sticky_column_close( 'checkout_sticky_sidebar' ); ?>
</div>
</div>
</form>
<?php do_action( 'woocommerce_after_checkout_form', $checkout ); ?>

View File

@@ -0,0 +1,42 @@
<?php
/**
* Checkout coupon form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-coupon.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 3.4.4
*/
defined( 'ABSPATH' ) || exit;
if ( ! wc_coupons_enabled() ) { // @codingStandardsIgnoreLine.
return;
}
?>
<div class="woocommerce-form-coupon-toggle">
<?php wc_print_notice( apply_filters( 'woocommerce_checkout_coupon_message', __( 'Have a coupon?', 'woocommerce' ) . ' <a href="#" class="showcoupon">' . __( 'Click here to enter your code', 'woocommerce' ) . '</a>' ), 'notice' ); ?>
</div>
<form class="checkout_coupon woocommerce-form-coupon has-border is-dashed" method="post" style="display:none">
<p><?php esc_html_e( 'If you have a coupon code, please apply it below.', 'woocommerce' ); ?></p>
<div class="coupon">
<div class="flex-row medium-flex-wrap">
<div class="flex-col flex-grow">
<input type="text" name="coupon_code" class="input-text" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" id="coupon_code" value="" />
</div>
<div class="flex-col">
<button type="submit" class="button expand" name="apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>"><?php esc_html_e( 'Apply coupon', 'woocommerce' ); ?></button>
</div>
</div>
</div>
</form>

View File

@@ -0,0 +1,34 @@
<?php
function flatsome_checkout_breadcrumb_class( $endpoint ) {
$classes = array();
if ( $endpoint == 'cart' && is_cart() ||
$endpoint == 'checkout' && is_checkout() && ! is_wc_endpoint_url( 'order-received' ) ||
$endpoint == 'order-received' && is_wc_endpoint_url( 'order-received' ) ) {
$classes[] = 'current';
} else {
$classes[] = 'hide-for-small';
}
return implode( ' ', $classes );
}
$steps = get_theme_mod( 'cart_steps_numbers', 0 );
?>
<nav class="breadcrumbs flex-row flex-row-start checkout-breadcrumbs text-left medium-text-center is-large <?php echo get_theme_mod( 'cart_steps_case', 'uppercase' ); ?>">
<i class="icon-lock op-5"></i>
<a href="<?php echo esc_url( wc_get_cart_url() ); ?>" class="<?php echo flatsome_checkout_breadcrumb_class( 'cart' ); ?>">
<?php if ( $steps ) echo '<span class="breadcrumb-step hide-for-small">1</span>'; ?>
<?php esc_html_e( 'Shopping Cart', 'flatsome' ); ?>
</a>
<span class="divider hide-for-small"><?php echo get_flatsome_icon( 'icon-angle-right' ); ?></span>
<a href="<?php echo esc_url( wc_get_checkout_url() ); ?>" class="<?php echo flatsome_checkout_breadcrumb_class( 'checkout' ); ?>">
<?php if ( $steps ) echo '<span class="breadcrumb-step hide-for-small">2</span>'; ?>
<?php esc_html_e( 'Checkout details', 'flatsome' ); ?>
</a>
<span class="divider hide-for-small"><?php echo get_flatsome_icon( 'icon-angle-right' ); ?></span>
<a href="#" class="no-click <?php echo flatsome_checkout_breadcrumb_class( 'order-received' ); ?>">
<?php if ( $steps ) echo '<span class="breadcrumb-step hide-for-small">3</span>'; ?>
<?php esc_html_e( 'Order Complete', 'flatsome' ); ?>
</a>
</nav>

View File

@@ -0,0 +1,37 @@
<?php
function flatsome_checkout_breadcrumb_class($endpoint){
$classes = array();
if($endpoint == 'cart' && is_cart() ||
$endpoint == 'checkout' && is_checkout() && !is_wc_endpoint_url('order-received') ||
$endpoint == 'order-received' && is_wc_endpoint_url('order-received')) {
$classes[] = 'current';
} else{
$classes[] = 'hide-for-small';
}
return implode(' ', $classes);
}
$steps = get_theme_mod('cart_steps_numbers', 0);
?>
<div class="checkout-page-title page-title">
<div class="page-title-inner flex-row medium-flex-wrap container">
<div class="flex-col flex-grow medium-text-center">
<nav class="breadcrumbs flex-row flex-row-center heading-font checkout-breadcrumbs text-center strong <?php echo get_theme_mod('cart_steps_size','h2'); ?> <?php echo get_theme_mod('cart_steps_case','uppercase'); ?>">
<a href="<?php echo esc_url( wc_get_cart_url() ); ?>" class="<?php echo flatsome_checkout_breadcrumb_class('cart'); ?>">
<?php if($steps) { echo '<span class="breadcrumb-step hide-for-small">1</span>'; } ?>
<?php _e('Shopping Cart', 'flatsome'); ?>
</a>
<span class="divider hide-for-small"><?php echo get_flatsome_icon('icon-angle-right');?></span>
<a href="<?php echo esc_url( wc_get_checkout_url() ); ?>" class="<?php echo flatsome_checkout_breadcrumb_class('checkout') ?>">
<?php if($steps) { echo '<span class="breadcrumb-step hide-for-small">2</span>'; } ?>
<?php _e('Checkout details', 'flatsome'); ?>
</a>
<span class="divider hide-for-small"><?php echo get_flatsome_icon('icon-angle-right');?></span>
<a href="#" class="no-click <?php echo flatsome_checkout_breadcrumb_class('order-received'); ?>">
<?php if($steps) { echo '<span class="breadcrumb-step hide-for-small">3</span>'; } ?>
<?php _e('Order Complete', 'flatsome'); ?>
</a>
</nav>
</div>
</div>
</div>

View File

@@ -0,0 +1,58 @@
<!DOCTYPE html>
<!--[if lte IE 9 ]>
<html class="ie lt-ie9" <?php language_attributes(); ?>> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html <?php language_attributes(); ?>> <!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>"/>
<link rel="profile" href="http://gmpg.org/xfn/11"/>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"/>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="main-content" class="site-main" style="max-width:1000px; margin:60px auto 60px auto;">
<div id="main" class="page-wrapper box-shadow page-checkout" style="padding:15px 30px 15px;">
<div class="focused-checkout-logo text-center" style="padding-top: 30px; padding-bottom: 30px;">
<div id="logo" class="logo"><?php get_template_part( 'template-parts/header/partials/element', 'logo' ); ?></div>
</div>
<div class="container">
<div class="top-divider full-width"></div>
</div>
<div class="focused-checkout-header pb">
<?php wc_get_template( 'checkout/header.php' ); ?>
</div>
<div class="row">
<div id="content" class="large-12 col" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php wc_print_notices(); ?>
<?php the_content(); ?>
<?php endwhile; // end of the loop. ?>
</div>
</div>
</div>
<div class="focused-checkout-footer">
<?php get_template_part( 'template-parts/footer/footer', 'absolute' ); ?>
</div>
</div>
</div>
<?php wp_footer(); ?>
</body>
</html>

View File

@@ -0,0 +1,48 @@
<!DOCTYPE html>
<!--[if lte IE 9 ]>
<html class="ie lt-ie9" <?php language_attributes(); ?>> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html <?php language_attributes(); ?>> <!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>"/>
<link rel="profile" href="http://gmpg.org/xfn/11"/>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"/>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="main-content" class="site-main">
<div id="main" class="page-checkout-simple">
<div id="content" role="main">
<div class="container">
<?php while ( have_posts() ) : the_post(); ?>
<div class="cart-header text-left medium-text-center">
<div id="logo" class="logo"><?php get_template_part( 'template-parts/header/partials/element', 'logo' ); ?></div>
<?php wc_get_template( 'checkout/header-small.php' ); ?>
</div>
<?php wc_print_notices(); ?>
<?php the_content(); ?>
<?php endwhile; // end of the loop. ?>
</div>
</div>
</div>
<div class="focused-checkout-footer">
<?php get_template_part( 'template-parts/footer/footer', 'absolute' ); ?>
</div>
</div>
</div>
<?php wp_footer(); ?>
</body>
</html>

View File

@@ -0,0 +1,18 @@
<?php
// Default checkout layout
get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
wc_get_template( 'checkout/header.php' );
echo '<div class="cart-container container page-wrapper page-checkout">';
wc_print_notices();
the_content();
echo '</div>';
?>
<?php endwhile; // end of the loop. ?>
<?php get_footer(); ?>

View File

@@ -0,0 +1,23 @@
<div class="text-left social-login pb-half pt-half">
<?php if ( is_nextend_facebook_login() && get_option( 'woocommerce_enable_myaccount_registration' ) == 'yes' && ! is_user_logged_in() ) :
$facebook_url = add_query_arg( array( 'loginSocial' => 'facebook' ), wp_login_url() );
?>
<a href="<?php echo esc_url( $facebook_url ); ?>" class="button social-button large facebook circle" data-plugin="nsl" data-action="connect" data-redirect="current" data-provider="facebook" data-popupwidth="475" data-popupheight="175">
<i class="icon-facebook"></i>
<span><?php _e( 'Login with <strong>Facebook</strong>', 'flatsome' ); ?></span>
</a>
<?php endif; ?>
<?php if ( is_nextend_google_login() && get_option( 'woocommerce_enable_myaccount_registration' ) == 'yes' && ! is_user_logged_in() ) :
$google_url = add_query_arg( array( 'loginSocial' => 'google' ), wp_login_url() );
?>
<a href="<?php echo esc_url( $google_url ); ?>" class="button social-button large google-plus circle" data-plugin="nsl" data-action="connect" data-redirect="current" data-provider="google" data-popupwidth="600" data-popupheight="600">
<i class="icon-google-plus"></i>
<span><?php _e( 'Login with <strong>Google</strong>', 'flatsome' ); ?></span>
</a>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,44 @@
<?php
/**
* Checkout terms and conditions area.
*
* @package WooCommerce/Templates
* @version 3.4.0
*/
defined( 'ABSPATH' ) || exit;
if ( apply_filters( 'woocommerce_checkout_show_terms', true ) && function_exists( 'wc_terms_and_conditions_checkbox_enabled' ) ) {
do_action( 'woocommerce_checkout_before_terms_and_conditions' );
?>
<div class="woocommerce-terms-and-conditions-wrapper">
<?php
/**
* Terms and conditions hook used to inject content.
*
* @since 3.4.0.
* @hooked wc_checkout_privacy_policy_text() Shows custom privacy policy text. Priority 20.
* @hooked wc_terms_and_conditions_page_content() Shows t&c page content. Priority 30.
*/
do_action( 'woocommerce_checkout_terms_and_conditions' );
?>
<?php if ( wc_terms_and_conditions_checkbox_enabled() ) : ?>
<p class="form-row validate-required">
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
<input type="checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" name="terms" <?php checked( apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) ), true ); // WPCS: input var ok, csrf ok. ?> id="terms" />
<?php if ( $link_style = get_theme_mod( 'checkout_terms_and_conditions' ) ) : ?>
<span class="woocommerce-terms-and-conditions-checkbox-text"><?php flatsome_terms_and_conditions_checkbox_text( $link_style ); ?></span>&nbsp;<span class="required">*</span>
<?php else : ?>
<span class="woocommerce-terms-and-conditions-checkbox-text"><?php wc_terms_and_conditions_checkbox_text(); ?></span>&nbsp;<span class="required">*</span>
<?php endif; ?>
</label>
<input type="hidden" name="terms-field" value="1" />
</p>
<?php endif; ?>
</div>
<?php
do_action( 'woocommerce_checkout_after_terms_and_conditions' );
}

View File

@@ -0,0 +1,103 @@
<?php
/**
* Thankyou page
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 3.7.0
*/
defined( 'ABSPATH' ) || exit;
?>
<div class="row">
<?php if ( $order ) :
do_action( 'woocommerce_before_thankyou', $order->get_id() ); ?>
<?php if ( $order->has_status( 'failed' ) ) : ?>
<div class="large-12 col order-failed">
<p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed"><?php esc_html_e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p>
<p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions">
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php esc_html_e( 'Pay', 'woocommerce' ); ?></a>
<?php if ( is_user_logged_in() ) : ?>
<a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php esc_html_e( 'My account', 'woocommerce' ); ?></a>
<?php endif; ?>
</p>
</div>
<?php else : ?>
<div class="large-7 col">
<?php
$get_payment_method = $order->get_payment_method();
$get_order_id = $order->get_id();
?>
<?php do_action( 'woocommerce_thankyou_' . $get_payment_method, $get_order_id ); ?>
<?php do_action( 'woocommerce_thankyou', $get_order_id ); ?>
</div>
<div class="large-5 col">
<div class="is-well col-inner entry-content">
<p class="success-color woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><strong><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), $order ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong></p>
<ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details">
<li class="woocommerce-order-overview__order order">
<?php esc_html_e( 'Order number:', 'woocommerce' ); ?>
<strong><?php echo $order->get_order_number(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
</li>
<li class="woocommerce-order-overview__date date">
<?php esc_html_e( 'Date:', 'woocommerce' ); ?>
<strong><?php echo wc_format_datetime( $order->get_date_created() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
</li>
<?php if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?>
<li class="woocommerce-order-overview__email email">
<?php esc_html_e( 'Email:', 'woocommerce' ); ?>
<strong><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
</li>
<?php endif; ?>
<li class="woocommerce-order-overview__total total">
<?php esc_html_e( 'Total:', 'woocommerce' ); ?>
<strong><?php echo $order->get_formatted_order_total(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
</li>
<?php
$payment_method_title = $order->get_payment_method_title();
if ( $payment_method_title ) :
?>
<li class="woocommerce-order-overview__payment-method method">
<?php esc_html_e( 'Payment method:', 'woocommerce' ); ?>
<strong><?php echo wp_kses_post( $payment_method_title ); ?></strong>
</li>
<?php endif; ?>
</ul>
<div class="clear"></div>
</div>
</div>
<?php endif; ?>
<?php else : ?>
<p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), null ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
<?php endif; ?>
</div>