Commit 14eea73a authored by Quan Nguyen's avatar Quan Nguyen

commit code 22/06 9h

parent cb2d2518
This diff is collapsed.
......@@ -71,92 +71,85 @@ class RRCKiotvietWcProduct
// Get product ID from SKU if created during the importation.
if (empty($data['id']) && !empty($data['sku'])) {
$product_id = wc_get_product_id_by_sku($data['sku']);
$id1 = "ID: " . $product_id;
$this->check_update_product_by_config($data);
if ($product_id) {
$data['id'] = $product_id;
}
}
$object = $this->get_product_object($data);
$id1 = empty($data['id']) . " and " . !empty($data['sku']) . " and " . $data['simple'];
// return (empty($data['id']) && !empty($data['sku']));
return $id1;
// $object = $this->get_product_object($data);
// if ($object->get_status() == "trash") {
// $data['status'] = "trash";
// }
if ($object->get_status() == "trash") {
$data['status'] = "trash";
}
// if (is_wp_error($object)) {
// return $object;
// }
if (is_wp_error($object)) {
return $object;
}
// if ('external' === $object->get_type()) {
// unset($data['manage_stock'], $data['stock_status'], $data['backorders'], $data['low_stock_amount']);
// }
if ('external' === $object->get_type()) {
unset($data['manage_stock'], $data['stock_status'], $data['backorders'], $data['low_stock_amount']);
}
// if ('variation' === $object->get_type()) {
// if (isset($data['status']) && -1 === $data['status']) {
// $data['status'] = 0; // Variations cannot be drafts - set to private.
// }
// }
if ('variation' === $object->get_type()) {
if (isset($data['status']) && -1 === $data['status']) {
$data['status'] = 0; // Variations cannot be drafts - set to private.
}
}
// if ('importing' === $object->get_status()) {
// $object->set_status('publish');
// $object->set_slug('');
// }
if ('importing' === $object->get_status()) {
$object->set_status('publish');
$object->set_slug('');
}
// $result = $object->set_props(array_diff_key($data, array_flip(array('meta_data', 'raw_image_id', 'raw_gallery_image_ids', 'raw_attributes'))));
$result = $object->set_props(array_diff_key($data, array_flip(array('meta_data', 'raw_image_id', 'raw_gallery_image_ids', 'raw_attributes'))));
// if (is_wp_error($result)) {
// throw new Exception($result->get_error_message());
// }
if (is_wp_error($result)) {
throw new Exception($result->get_error_message());
}
// if ('variation' === $object->get_type()) {
// $this->set_variation_data($object, $data);
// } else {
// $this->set_product_data($object, $data);
// }
if ('variation' === $object->get_type()) {
$this->set_variation_data($object, $data);
} else {
$this->set_product_data($object, $data);
}
// $this->set_image_data($object, $data);
//$this->set_image_data($object, $data);
// $this->set_meta_data($object, $data);
$this->set_meta_data($object, $data);
// $object = apply_filters('woocommerce_product_import_pre_insert_product_object', $object, $data);
$object = apply_filters('woocommerce_product_import_pre_insert_product_object', $object, $data);
// $object->save();
$object->save();
// //Store stock location
// if($data['manage_stock'] == 1) {
// $this->set_stock_location_data($data, $object->get_id());
// } else {
// update_post_meta($object->get_id(), "_stock_status", "instock");
// }
//Store stock location
if($data['manage_stock'] == 1) {
$this->set_stock_location_data($data, $object->get_id());
} else {
update_post_meta($object->get_id(), "_stock_status", "instock");
}
// if ($data['kvProductType'] == "thue-bao"){
// //enable sub
if ($data['kvProductType'] == "thue-bao"){
//enable sub
// //enable gift
//enable gift
// //set min/max ship
//set min/max ship
// //set frequency
//set frequency
// //set image
//set image
// //create variation
// $this->create_variation_product($object, $data);
// }
//create variation
$this->create_variation_product($object, $data);
}
// // change status when update product trash
// do_action('woocommerce_product_import_inserted_product_object', $object, $data);
// change status when update product trash
do_action('woocommerce_product_import_inserted_product_object', $object, $data);
// return $object->get_id();
return $object->get_id();
} catch (Exception $e) {
return new WP_Error('woocommerce_product_importer_error', $e->getMessage(), array('status' => $e->getCode()));
}
......@@ -707,6 +700,10 @@ class RRCKiotvietWcProduct
$product->update_meta_data($meta['key'], $meta['value']);
}
}
//Save addtion product data
$product->update_meta_data('allowsSale', $data['allowsSale']);
$product->update_meta_data('isRewardPoint', $data['isRewardPoint']);
}
protected function get_attachment_id_from_url($url, $product_id)
......@@ -1138,18 +1135,18 @@ class RRCKiotvietWcProduct
public function productSimple($product)
{
$productSimple = $product;//$this->import_product($product);
// if (!is_wp_error($productSimple)) {
// $this->insertProductMap([
// 'product_id' => $productSimple,
// 'product_kv_id' => $product['kv_id'],
// 'data_raw' => json_encode($product, JSON_UNESCAPED_UNICODE),
// 'parent' => 0,
// 'retailer' => $this->retailer,
// 'created_at' => rrc_kiotviet_sync_get_current_time(),
// 'status' => 1
// ]);
// }
$productSimple = $this->import_product($product);
if (!is_wp_error($productSimple)) {
$this->insertProductMap([
'product_id' => $productSimple,
'product_kv_id' => $product['kv_id'],
'data_raw' => json_encode($product, JSON_UNESCAPED_UNICODE),
'parent' => 0,
'retailer' => $this->retailer,
'created_at' => rrc_kiotviet_sync_get_current_time(),
'status' => 1
]);
}
return $productSimple;
}
......
......@@ -317,8 +317,8 @@ class Rrc_Kiotviet_Sync_Service_Product
$data['category_ids'] = array(!empty($categorySync[$data['category_kv']]) ? $categorySync[$data['category_kv']] : []);
if ($updateProduct) {
$id = $this->update($data);
array_push($result, $id);
// $id = $this->update($data);
// array_push($result, $id);
} else {
$id = $this->add($data);
array_push($result, $id);
......
......@@ -19,10 +19,9 @@ function productLocation(branchIDParams) {
$(".product-detail.product-type-simple form :input").prop("disabled", true);
$(".product-detail.product-type-simple .stock.in-stock").hide();
$(".product-detail.product-type-simple .location-detail .message").text("");
$(".product-detail.product-type-simple .location-detail .branch").text("");
return ;
}else if (branchIDParams) {
$(".product-detail.product-type-simple .location-detail .branch").text("");
return;
} else if (branchIDParams) {
branchID = branchIDParams;
} else {
branchID = localStorage.getItem("address_branch_id_saved");
......@@ -34,10 +33,16 @@ function productLocation(branchIDParams) {
branchID = branchID.replace(regexWord, "");
}
if($(".product-detail.product-type-simple .slw_item_stock_location option:selected").attr("disabled") !== "disabled"){
$(".product-detail.product-type-simple .slw_item_stock_location option").removeAttr("selected");
if (
$(
".product-detail.product-type-simple .slw_item_stock_location option:selected"
).attr("disabled") !== "disabled"
) {
$(
".product-detail.product-type-simple .slw_item_stock_location option"
).removeAttr("selected");
}
$(
".product-detail.product-type-simple .slw_item_stock_location option[value=" +
branchID +
......@@ -56,14 +61,13 @@ function productLocation(branchIDParams) {
).prop("selectedIndex");
if (indexQualityStock === 0) {
$(".product-detail.product-type-simple form").submit(function () {
return false;
});
$(".product-detail.product-type-simple form :input").prop("disabled", true);
$(".product-detail.product-type-simple .stock.in-stock").hide();
$(".product-detail.product-type-simple .location-detail .message").text("");
$(".product-detail.product-type-simple .location-detail .branch").text("");
$(".product-detail.product-type-simple .location-detail .branch").text("");
} else {
$(".product.product-detail .product-detail__notification").hide();
......@@ -97,9 +101,12 @@ function productLocation(branchIDParams) {
".product-detail.product-type-simple .product-detail__notification-delivery"
).addClass("d-none");
} else {
$(".product-detail.product-type-simple .location-detail .message").text("");
$(".product-detail.product-type-simple .location-detail .branch").text("");
$(".product-detail.product-type-simple .location-detail .message").text(
""
);
$(".product-detail.product-type-simple .location-detail .branch").text(
""
);
$(".product-detail.product-type-simple .stock.in-stock").text(
$(".modal-visible .product_at").text() +
" " +
......@@ -359,6 +366,9 @@ function handleSelectDistrict(
localStorage.setItem("branch_list", branchList.html());
onDistrictChange();
$("#modalLocation .modal-body .modal-error").addClass(
"invisible"
);
} else if (r == -1) {
// Shiping other list branch
$('select[name="calc_other_shipping_provinces"]').removeClass("d-none");
......@@ -574,7 +584,6 @@ function handleSelectDistrict(
let branchID = listBranchAddress.eq(0).attr("id");
let addressTo = await fetchMovies(detailAddress);
for (let i = 0; i < listBranchAddress.length; i++) {
let latData = listBranchAddress.eq(i).attr("data-lat");
let lngData = listBranchAddress.eq(i).attr("data-lng");
......@@ -595,7 +604,9 @@ function handleSelectDistrict(
}
if (smallestDistance < 100000) {
$("#modalLocation .modal-body .modal-error").addClass("invisible");
$("#modalLocation .modal-body .modal-error").addClass(
"invisible"
);
localStorage.setItem("address_branch_id_saved", branchID);
localStorage.setItem("address_available", true);
if (
......@@ -608,7 +619,9 @@ function handleSelectDistrict(
"invisible"
);
localStorage.removeItem("address_branch_id_saved");
if ($(".product.product-detail.product-type-simple ").length > 0) {
if (
$(".product.product-detail.product-type-simple ").length > 0
) {
productLocation("notAvailable");
}
}
......
$(document).ready(function () {
// Add border to selected item
const subsSelectSection = $('.subs__select-section');
subsSelectSection.each(function () {
const items = $(this).find('.subs__item-container')
items.click(function () {
items.each(function () {
$(this).removeClass('subs__item-container--selected');
});
$(this).addClass('subs__item-container--selected');
});
});
// input
const inputAttributePaBag = $('input[name="attribute_pa_bag"]');
const inputVariationId = $('input[name="variation_id"]');
const inputFrequency = $('input[name="frequency"]');
const inputNumOfBag = $('input[name="num_of_bag"]');
const totalPrice = $('#totalPrice');
const btnContinue = $('#btnContinue');
const totalSection = $('#total');
const formCheckOut = $('form.js-form-checkout').first();
const summaryBag = $('#summaryBag');
const summaryBagTitle = summaryBag.find('.subs__text--primary');
const summaryBagDesc = summaryBag.find('.subs__text--secondary');
const summaryFreq = $('#summaryFreq');
const summaryFreqTitle = summaryFreq.find('.js-freq');
const selectBag = $('#selectBag');
const bags = selectBag.find('.subs__item-container');
const selectFrequency = $('#selectFrequency');
const frequencies = selectFrequency.find('.subs__item-container');
btnContinue.click(function () {
selectBag.addClass('d-none');
selectFrequency.removeClass('d-none');
$(this).addClass('d-none');
});
bags.click(function () {
const title = $(this).find('.subs__text--primary').text().trim();
const desc = $(this).find('.subs__text--secondary').text().trim();
const price = $(this).data('price');
summaryBagTitle.text(title);
summaryBagDesc.text(desc);
totalPrice.text(price);
summaryBag.removeClass('d-none');
btnContinue.removeClass('d-none');
totalSection.removeClass('d-none');
inputAttributePaBag.val($(this).data('slug'));
inputVariationId.val($(this).data('id'));
inputNumOfBag.val($(this).data('num-of-bag'));
});
frequencies.click(function () {
const title = $(this).find('.subs__text--primary').text().trim().toLowerCase();
summaryFreqTitle.text(title);
summaryFreq.removeClass('d-none');
formCheckOut.removeClass('d-none');
inputFrequency.val($(this).data('value'));
});
});
......@@ -277,10 +277,15 @@ function rangrangcoffee_scripts() {
wp_enqueue_script( 'product-detail', get_template_directory_uri() . "/assets/js/product-detail.js", array(), 'all' );
}
// TODO: Not use
if ( is_page_template( 'templates/template-selection-subscription-plan.php' ) ) {
wp_enqueue_script( 'coffee-sub', get_template_directory_uri() . "/assets/js/coffee-sub.js", array(), 'all' );
}
if ( is_page_template( 'templates/template-select-coffee-subscription.php' ) ) {
wp_enqueue_script( 'coffee-sub', get_template_directory_uri() . "/assets/js/select-coffee-subscription.js", array(), 'all' );
}
if ( is_page_template( 'templates/template-gift-details.php' ) ) {
wp_enqueue_script( 'gift-sub', get_template_directory_uri() . "/assets/js/gift-sub.js", array(), 'all' );
}
......
......@@ -44,7 +44,7 @@ get_header();
<?php endif; ?>
<div class="w-30 brew-guides-detail__right">
<h6 class="font-weight-bold text-uppercase"><?php pll_e( "what you'll need" ); ?> </h6>
<!-- <h6 class="font-weight-bold text-uppercase"><?php pll_e( "what you'll need" ); ?> </h6> -->
<?php
$rows = get_field( 'you_will_need' ); ?>
<?php if ( $rows ) { ?>
......@@ -68,8 +68,8 @@ get_header();
<h6 class="font-weight-bold text-uppercase"><?php pll_e( "have questions" ) ?> </h6>
<p class="brew-guides-detail__text--sidebar-content">
<?php pll_e( "Ask our experts at" ) ?>
<a href="mailto:support@rangrangcoffee.vn?subject=Suport" title="Email Support"
class="brew-guides-detail--link">support@rangrangcoffee.vn</a>
<a href="mailto:<?php the_field('support_link'); ?>?subject=Suport" title="Email Support"
class="brew-guides-detail--link"><?php the_field('support_link'); ?></a>
</p>
<?php if ( is_active_sidebar( 'sidebar-right' ) ) : ?>
<?php get_sidebar( 'sidebar-right' ); ?>
......
......@@ -11,7 +11,8 @@ get_header(); ?>
<main id="primary" class="site-main">
<?php while ( have_posts() ) {
the_post();
$btn_html = '<a class="text-uppercase btn-custom btn-primary d-block mv-auto" href="/job-apply/?job_id=' . get_the_ID() . '">' . pll__( 'apply for this job' ) . '</a>';
$permalink_job_apply = get_the_permalink(pll_get_post(get_page_by_path('job-apply')->ID));
$btn_html = '<a class="text-uppercase btn-custom btn-primary d-block mv-auto" href="' . $permalink_job_apply . '?job_id=' . get_the_ID() . '">' . pll__( 'apply for this job' ) . '</a>';
?>
<div class="container job-container my-5">
<div class="row justify-content-center">
......
<?php
/**
* Template Name: Select coffee subscription Template
*
* Template for selecting coffee subscription
*
* @package Rang_Rang_Coffee
*/
get_header();
?>
<?php
// https://coffee-shop.dev/select-coffee-subscription/?product_id=1765
$product_id = isset( $_GET['product_id'] ) ? absint( $_GET['product_id'] ) : null;
if (!$product_id) {
echo "<script>window.location.href='" . home_url() . "';</script>";
}
$product = wc_get_product( $product_id );
// Check product is subscribable
$is_enable_subscription = get_field( 'enable_subscription', $product_id );
function tscs_input_hidden( $name, $value ) { ?>
<input type="hidden" name="<?php echo $name; ?>" value="<?php echo $value; ?>">
<?php
}
function tscs_render_bag( $product ) {
if ( $product instanceof WC_Product ) {
$price = $product->get_price();
$bag_types = get_field( 'bag_types', $product->get_id() );
foreach ( $bag_types as $bag_type ) {
$num_of_bag = absint( $bag_type['num_of_bag'] );
$image_url = $bag_type['bag_image']['sizes']['thumbnail'];
$text_primary = $num_of_bag . ' ' . rrc_plural( pll__( 'bag' ), pll__( 'bags' ), $num_of_bag );
$real_price = $price * $num_of_bag;
$currency_symbol = get_woocommerce_currency_symbol();
?>
<div class="col-md-6 col-12 p-2">
<div class="subs__item-container"
data-id="0"
data-price="<?php echo "$real_price$currency_symbol" ?>"
data-num-of-bag="<?php echo $num_of_bag ?>">
<img class="subs__item-img" src="<?php echo $image_url ?>" alt="<?php _e( $text_primary . ' image' ) ?>">
<h5 class="subs__text--primary"><?php echo $text_primary ?> </h5>
<!-- <p class="subs__text--secondary">desc</p> -->
<!-- <p class="subs__text--price"><?php echo wc_price( $real_price ) ?></p> -->
</div>
</div>
<?php
}
}
}
function tscs_render_frequency( $product_id ) {
$data_to_render = array(
array(
'value' => '1',
'name' => 'every week',
'image' => 'everyweek',
),
array(
'value' => '2',
'name' => 'every other week',
'image' => 'everyotherweek',
),
array(
'value' => '3',
'name' => 'every 3 weeks',
'image' => 'every3week',
),
array(
'value' => '4',
'name' => 'every 4 weeks',
'image' => 'every4week',
),
);
foreach ( $data_to_render as $value ) {
$img_name = $value['image'];
$img_url = get_theme_file_uri( "/assets/img/weeks/$img_name.svg" );
?>
<div class="col-md-6 col-12 p-2">
<div class="subs__item-container" data-value="<?php echo $value['value']; ?>">
<img class="subs__item-img" src="<?php echo $img_url; ?>" alt="*">
<h5 class="subs__text--primary"><?php echo $value['name']; ?></h5>
</div>
</div>
<?php
}
}
?>
<main id="primary" class="site-main">
<?php if ( $is_enable_subscription ) { ?>
<section class="subs">
<div class="container my-5">
<div class="row">
<div class="col-12 col-md-8 order-1 order-md-0 my-3 subs__container-select">
<!-- select bag -->
<div class="subs__select-section" id="selectBag">
<h2
class="subs__title mt-0 mb-3"><?php pll_e( "How many bag(s) per shipment?" ) ?></h2>
<div class="row px-3">
<?php tscs_render_bag( $product ); ?>
</div>
</div>
<!-- select freq -->
<div class="subs__select-section d-none" id="selectFrequency">
<h2
class="subs__title mt-0 mb-3"><?php pll_e( "How often do you need more coffee?" ) ?></h2>
<div class="row px-3">
<?php tscs_render_frequency( $product_id ); ?>
</div>
</div>
</div>
<!-- Summary -->
<div class="col-12 col-md-4 order-0 order-md-1 my-3 subs__container-summary">
<h3 class="subs__title mt-0 mb-3"> <?php pll_e( 'Subscription Summary' ); ?> </h3>
<!-- section summary -->
<div class="subs__section-summary">
<div class="subs__text--tertiary"><?php pll_e( 'coffee type' ); ?></div>
<div class="d-flex justify-content-between my-2">
<h4 class="subs__text--primary my-0"><?php echo esc_html( $product->get_title() ); ?></h4>
<a
href="<?php echo get_the_permalink( pll_get_post( get_page_by_path( 'coffee-subscriptions' )->ID ) ) ?>"
class="custom-link"><?php pll_e( 'Change' ); ?></a>
</div>
<p class="subs__text--secondary mb-2">
<?php echo esc_html( $product->get_short_description() ); ?>
</p>
</div>
<!-- / section summary -->
<!-- summary bag -->
<div class="subs__section-summary d-none" id="summaryBag">
<div class="subs__text--tertiary"><?php pll_e( 'bag(s)' ); ?></div>
<div class="d-flex justify-content-between my-2">
<h4 class="subs__text--primary my-0">.</h4>
<a class="custom-link"
href="<?php echo $_SERVER['REQUEST_URI']; ?>"><?php pll_e( 'Change' ); ?></a>
</div>
<p class="subs__text--secondary mb-2">.</p>
</div>
<!-- summary freq -->
<div class="subs__section-summary d-none" id="summaryFreq">
<div class="subs__text--tertiary"><?php pll_e( 'frequency' ); ?></div>
<div class="d-flex justify-content-between my-2">
<h4 class="subs__text--primary my-0 js-freq">.</h4>
</div>
<p class="subs__text--secondary mb-2">
<?php pll_e( "We will mail out your first shipment" ) ?>
<b><?php echo rrc_tomorrow_date(); ?></b> <?php pll_e( "and" ) ?> <span
class="js-freq">.</span> <?php pll_e( "thereafter" ) ?>
</p>
</div>
<div class="d-none" id="total">
<hr class="mx-0"/>
<div class="d-flex justify-content-between mb-4 d-none">
<div>
<div class="subs__text--primary"><?php pll_e( "Total Per Shipment" ) ?></div>
<div class="subs__text--secondary"><?php pll_e( "shipping included" ) ?></div>
</div>
<div class="subs__text--price font-nomal" id="totalPrice">.</div>
</div>
</div>
<button class="btn-custom btn-primary w-100 d-none" id="btnContinue"><?php pll_e( "Continue" ) ?></button>
<form
action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>"
class="mt-2 js-form-checkout d-none"
enctype="multipart/form-data" method="post">
<?php
// tscs_input_hidden( 'product_id', $product_id );
tscs_input_hidden( 'quantity', 1 );
tscs_input_hidden( 'add-to-cart', $product_id );
tscs_input_hidden( 'order_type', 'coffee_subscription' );
tscs_input_hidden( 'frequency', '' );
tscs_input_hidden( 'num_of_bag', '' );
?>
<!-- num_of_month -->
<div class="form-group">
<label class="f16 mb-2" for="num-of-month"><?php pll_e( "Month(s)" ) ?></label>
<select name="num_of_month" class="form-control" id="num-of-month">
<option value="1"><?php echo "1 " . pll__( "Month" ) ?></option>
<option value="3"><?php echo "3 " . pll__( "Months" ) ?></option>
<option value="6"><?php echo "6 " . pll__( "Months" ) ?></option>
<option value="12"><?php echo "12 " . pll__( "Months" ) ?></option>
</select>
</div>
<button type="submit" class="btn-custom btn-primary w-100">
<?php pll_e( "Proceed To Checkout" ) ?>
</button>
<p class="subs__text--secondary mt-1 mb-0"><?php pll_e( "Pause, skip, or cancel anytime" ) ?></p>
</form>
</div>
</div>
</div>
</section>
<?php } else { ?>
<div class="container my-4">
<div class="text-center">
<h3><?php pll_e( "This product not enable subscription" ); ?></h3>
<a href="<?php echo pll_home_url() ?>" class="btn-outline text-uppercase mt-4"><?php pll_e( "Home" ); ?></a>
</div>
</div>
<?php } ?>
</main>
<?php
get_footer();
......@@ -37,80 +37,12 @@ if (isset($_GET['search'])) {
?>
<div class="col-lg-7 col-12 order-1 order-lg-0 d-none d-md-block">
<ul class="sub-nav__menu d-flex ">
<li class="sub-nav__menu-item all"><a href="<?php echo $url ?>">
<?php pll_e('Shop all') ?>
</a></li>
<?php
$product_categories_less = array_slice($product_categories, 0, 3);
$product_categories_more = array();
foreach ($product_categories_less as $key => $category) {
if ($category_slug_params === $category->slug) {
?>
<li class='sub-nav__menu-item active'>
<a href="<?php echo $url ?>?type=<?php echo $category->slug ?>">
<?php echo $category->name ?>
</a>
</li>
<?php
} else {
?>
<li class="sub-nav__menu-item">
<a href="<?php echo $url ?>?type=<?php echo $category->slug ?>">
<?php echo $category->name ?>
</a>
</li>
<?php
}
}
?>
<?php
if (count($product_categories) > 3) {
$product_categories_more = array_slice($product_categories, 3);
?>
<li class="sub-nav__menu-item ">
<div class="dropdown dropdown-custom d-lg-inline-block sub-nav__menu-more ">
<div class=" dropdown-toggle position-relative " data-toggle="dropdown">
<?php pll_e('More') ?>
</div>
<ul class="dropdown-menu">
<?php
foreach ($product_categories_more as $key => $category) {
?>
<li>
<a href="<?php echo $url ?>?type=<?php echo $category->slug ?>">
<?php echo $category->name ?>
</a>
</li>
<?php
}
?>
</ul>
</div>
</li>
<?php } ?>
</ul>
</div>
<div class="col-lg-5 col-12 order-0 order-lg-1">
<div class="d-flex align-items-center justify-content-lg-end justify-content-center">
<form role="search" method="get" class="sub-nav__search" action="<?php echo wc_get_page_permalink('shop'); ?>">
<i class="fal fa-search"></i>
<?php
if (isset($_GET['search'])) {
?>
<input type="search" name="search" value="<?php echo $product_name_params ?> " placeholder="<?php pll_e('Search Store') ?>" />
<?php
} else {
?>
<input type="search" name="search" placeholder="<?php pll_e('Search Store') ?>" />
<?php
}
?>
</form>
<?php
......
......@@ -66,7 +66,7 @@ if ( ! isset( $_GET['urlFrom'] ) ) {
} else {
?>
<script>
window.location.href = '/shop';
window.location.href = "<?php echo wc_get_page_permalink( 'shop' ); ?>";
</script>
<?php
} ?>
......@@ -182,7 +182,6 @@ $longitude_list = get_meta_value_term_meta( '_longitude' );
</div>
<div class="col-12 d-none">
<ul class="list-branch-address">
<?php
foreach (
......
......@@ -28,7 +28,95 @@ $longitude_list = get_meta_value_term_meta('_longitude');
$product_id = $product->get_id();
?>
<div class="sub-nav__modal modal fade" id="modalLocation">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header align-items-center justify-content-between">
<div class="space"></div>
<div class="text-center font-bold">
<?php pll_e('Choose a delivery area') ?>
</div>
<div class="btn-cancel" data-dismiss="modal">
<i class="fal fa-times"></i>
</div>
</div>
<div class="modal-body text-left">
<p>
<?php pll_e('Choose a branch near you for convenient delivery. If there is no branch near you, please choose another.') ?>
</p>
<div class="modal-notification text-gray-1">
<b><?php pll_e('Note') ?> </b><?php pll_e('The system only accepts transportation to a radius of') ?>
<?php echo get_theme_mod('text_distance_setting'); ?>km
<div class="modal-error invisible text-error">
<?php pll_e('Your area is not available') ?>
</div>
</div>
<div class="form-wrap mb-4 ">
<div class="form-group mb-1">
<select name="calc_shipping_branch_provices" class="d-none" required="">
<?php
foreach ($list_address as $address) {
$longitude = "";
$latidude = "";
foreach ($latitude_list as $item) {
if ($item->term_id === $address->term_id) {
$latidude = $item->meta_value;
}
}
foreach ($longitude_list as $item) {
if ($item->term_id === $address->term_id) {
$longitude = $item->meta_value;
}
}
?>
<option id="b<?php echo $address->term_id ?>" data-lng="<?php echo $longitude ?>" data-lat="<?php echo $latidude ?>" value="<?php echo $address->meta_value ?>">
<?php echo $address->meta_value ?>
</option>
<?php
}
?>
</select>
</div>
<div class="form-group">
<select name="calc_shipping_provinces" required="">
<option value=""><?php pll_e('Province / City') ?></option>
</select>
</div>
<div class="form-group">
<select name="calc_other_shipping_provinces" class="d-none" required="">
<option value=""><?php pll_e('Other Province / City') ?> </option>
</select>
</div>
<div class="form-group">
<select name="calc_shipping_district" required="">
<option value=""><?php pll_e('District') ?></option>
</select>
</div>
<div class="form-group">
<select name="calc_shipping_branch" required="" class="d-none">
<option value=""><?php pll_e('Branch') ?></option>
</select>
</div>
</div>
<div class="modal-visible d-none">
<div class="province"><?php pll_e('Province / City') ?></div>
<div class="other_province"> <?php pll_e('Other Province / City') ?></div>
<div class="district"><?php pll_e('District') ?></div>
<div class="branch"><?php pll_e('Branch') ?></div>
<div class="other"><?php pll_e('Other') ?></div>
<div class="order_delivered"><?php pll_e('Order delivered from branch:') ?></div>
<div class="product_at"><?php pll_e('Products are out of stock at the branch') ?></div>
<div class="number_product"><?php pll_e('Number of products in stock:') ?></div>
</div>
</div>
</div>
</div>
</div>
<div id="product-<?php the_ID(); ?>" <?php wc_product_class('container product-detail mt-5', $product); ?>>
<p class="f16 text-center font-italic mb-4">
</p>
......@@ -104,21 +192,51 @@ $product_id = $product->get_id();
*/
do_action('woocommerce_single_product_summary');
?>
<div class="product-detail__notification-delivery d-none">
<span><?php pll_e('Please change') ?> </span>
<span class="text-underline" data-toggle="modal" data-target="#modalLocation">
<?php pll_e('your delivery branch') ?>
</span>
</div>
<div class="product-detail__notification text-error ">
<span><?php pll_e('Please select') ?> </span>
<span class="area" data-toggle="modal" data-target="#modalLocation">
<?php pll_e('your delivery area') ?>
</span>
</div>
<div class="location-detail">
<span class="message"></span>
<span class="branch"></span>
</div>
</div>
<div class="col-12 d-none">
<ul class="list-branch-address">
<?php
foreach ($list_address as $address) {
?>
<li id="b<?php echo $address->term_id ?>"><?php echo $address->meta_value ?></li>
<?php
}
?>
</ul>
</div>
</div>
<div class="col-12">
<?php
/**
* Hook: woocommerce_after_single_product_summary.
*
* @hooked woocommerce_output_product_data_tabs - 10
* @hooked woocommerce_upsell_display - 15
* @hooked woocommerce_output_related_products - 20
*/
do_action('woocommerce_after_single_product_summary');
?>
</div>
</div>
</div>
<div class="col-12">
<?php
/**
* Hook: woocommerce_after_single_product_summary.
*
* @hooked woocommerce_output_product_data_tabs - 10
* @hooked woocommerce_upsell_display - 15
* @hooked woocommerce_output_related_products - 20
*/
do_action('woocommerce_after_single_product_summary');
?>
</div>
<?php do_action('woocommerce_after_single_product'); ?>
\ No newline at end of file
</div>
<?php do_action('woocommerce_after_single_product'); ?>
\ No newline at end of file
......@@ -49,7 +49,7 @@ $category = wp_get_post_terms($post->ID, 'product_cat');
<div class="row">
<?php
$current_page = 0;
$MAX_PER_PAGE = 4;
$MAX_PER_PAGE = 10;
$url = strtok($_SERVER["REQUEST_URI"], '?');
$url_page_item = $url . "?page-store=";
if (isset($_GET['page-store'])) {
......
2021-10-20T09:55:15+00:00 ERROR Error getting remote inbox notification data feed
2021-10-20T09:55:15+00:00 ERROR WP_Error Object
(
[errors] => Array
(
[http_request_failed] => Array
(
[0] => cURL error 60: SSL certificate problem: certificate has expired
)
)
[error_data] => Array
(
)
[additional_data:protected] => Array
(
)
)
2021-10-20T09:55:15+00:00 ERROR Error getting remote inbox notification data feed
2021-10-20T09:55:15+00:00 ERROR WP_Error Object
(
[errors] => Array
(
[http_request_failed] => Array
(
[0] => cURL error 60: SSL certificate problem: certificate has expired
)
)
[error_data] => Array
(
)
[additional_data:protected] => Array
(
)
)
2021-10-22T02:05:35+00:00 ERROR Error getting remote inbox notification data feed
2021-10-22T02:05:35+00:00 ERROR WP_Error Object
(
[errors] => Array
(
[http_request_failed] => Array
(
[0] => cURL error 60: SSL certificate problem: certificate has expired
)
)
[error_data] => Array
(
)
[additional_data:protected] => Array
(
)
)
2021-10-22T02:05:35+00:00 ERROR Error getting remote inbox notification data feed
2021-10-22T02:05:35+00:00 ERROR WP_Error Object
(
[errors] => Array
(
[http_request_failed] => Array
(
[0] => cURL error 60: SSL certificate problem: certificate has expired
)
)
[error_data] => Array
(
)
[additional_data:protected] => Array
(
)
)
2021-10-22T02:16:18+00:00 ERROR Error getting remote inbox notification data feed
2021-10-22T02:16:18+00:00 ERROR WP_Error Object
(
[errors] => Array
(
[http_request_failed] => Array
(
[0] => cURL error 60: SSL certificate problem: certificate has expired
)
)
[error_data] => Array
(
)
[additional_data:protected] => Array
(
)
)
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