Connect product options/add-cart, server cart checkout payloads, favorite/rebuy/receipt REST, and order-center actions without localStorage dual-read or hardcoded cart/orders URL hacks.
423 lines
26 KiB
PHP
423 lines
26 KiB
PHP
<?php
|
|
/**
|
|
* Template Name: AKSRT - Product Detail
|
|
* Template Post Type: page
|
|
*
|
|
* Enhanced: options selector, video gallery, params/services modal,
|
|
* review tab, favorites, related products, mobile tabbar (§6.10).
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
get_header();
|
|
|
|
$product_id = (int) ($_GET['product_id'] ?? 0);
|
|
if ($product_id <= 0) {
|
|
$product_id = (int) get_query_var('product_id', 0);
|
|
}
|
|
|
|
$shop = class_exists('AKSRT_Shop') ? AKSRT_Shop::get_instance() : null;
|
|
$product = function_exists('aksrt_get_product_page_view')
|
|
? aksrt_get_product_page_view($product_id)
|
|
: ($shop ? $shop->get_product_detail_view($product_id) : []);
|
|
|
|
$user_id = get_current_user_id();
|
|
$is_fav = $shop && $user_id > 0 ? $shop->is_favorite($user_id, $product_id) : false;
|
|
$options = $product['options'] ?? [];
|
|
$has_options = !empty($options);
|
|
$price_range = $product['price_range'] ?? [];
|
|
$params = $product['params'] ?? [];
|
|
$services = $product['services'] ?? [];
|
|
$pay_modo = $product['pay_modo'] ?? '0';
|
|
$scores = class_exists('AKSRT_Product_Review') ? AKSRT_Product_Review::get_instance()->get_product_scores($product_id) : [];
|
|
$reviews = class_exists('AKSRT_Product_Review') ? AKSRT_Product_Review::get_instance()->get_reviews($product_id, ['per_page' => 5]) : ['items' => [], 'total' => 0];
|
|
$author_id = (int) get_post_field('post_author', $product_id);
|
|
$author = $author_id > 0 ? get_userdata($author_id) : null;
|
|
?>
|
|
|
|
<main id="main-content" class="site-main content-shell" tabindex="-1">
|
|
<?php if (function_exists('aksrt_breadcrumbs')) { aksrt_breadcrumbs(); } ?>
|
|
|
|
<?php if (!empty($product)) : ?>
|
|
<div
|
|
class="aksrt-product-page container"
|
|
data-aksrt-product-page
|
|
data-product-id="<?php echo esc_attr((string) $product_id); ?>"
|
|
data-options='<?php echo esc_attr(wp_json_encode($options, JSON_UNESCAPED_UNICODE)); ?>'
|
|
data-base-price="<?php echo esc_attr((string) (($product['start_price'] ?? 0) > 0 ? $product['start_price'] : ($product['price'] ?? 0))); ?>"
|
|
data-base-stock="<?php echo esc_attr((string) ($product['stock'] ?? 0)); ?>"
|
|
data-pay-modo="<?php echo esc_attr((string) $pay_modo); ?>"
|
|
data-price-range="<?php echo !empty($price_range) && (($price_range['min'] ?? 0) !== ($price_range['max'] ?? 0)) ? '1' : '0'; ?>"
|
|
>
|
|
<div class="aksrt-product-page__layout">
|
|
<!-- Gallery -->
|
|
<section class="aksrt-product-page__gallery aksrt-product-page__panel">
|
|
<?php if (!empty($product['image'])) : ?>
|
|
<div class="aksrt-product-page__primary-image" data-aksrt-main-image>
|
|
<img src="<?php echo esc_url((string) $product['image']); ?>" alt="<?php echo esc_attr((string) ($product['title'] ?? '')); ?>" id="product-main-img">
|
|
</div>
|
|
<?php else : ?>
|
|
<div class="aksrt-product-page__placeholder">
|
|
<i class="fas fa-image" aria-hidden="true"></i>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
$gallery_items = (array) ($product['gallery'] ?? []);
|
|
$cover_videos = (array) (get_post_meta($product_id, '_aksrt_cover_videos', true) ?: []);
|
|
?>
|
|
<?php if (!empty($gallery_items) || !empty($cover_videos)) : ?>
|
|
<div class="aksrt-product-page__thumbs">
|
|
<?php foreach ($cover_videos as $video_url) : ?>
|
|
<button type="button" class="aksrt-product-page__thumb aksrt-product-page__thumb--video" data-aksrt-product-video="<?php echo esc_url($video_url); ?>">
|
|
<i class="fas fa-play-circle"></i>
|
|
</button>
|
|
<?php endforeach; ?>
|
|
<?php foreach ($gallery_items as $gallery_image) : ?>
|
|
<button type="button" class="aksrt-product-page__thumb" data-aksrt-product-thumb="<?php echo esc_url($gallery_image); ?>">
|
|
<img src="<?php echo esc_url($gallery_image); ?>" alt="">
|
|
</button>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</section>
|
|
|
|
<!-- Summary -->
|
|
<section class="aksrt-product-page__summary aksrt-product-page__panel">
|
|
<div class="aksrt-product-page__badges">
|
|
<?php if ($pay_modo === 'points') : ?>
|
|
<span class="aksrt-product-page__badge aksrt-product-page__badge--points"><?php esc_html_e('积分商品', 'aksrt'); ?></span>
|
|
<?php endif; ?>
|
|
<?php if (!empty($product['marketing']['headline'])) : ?>
|
|
<span class="aksrt-product-page__badge aksrt-product-page__badge--promo"><?php echo esc_html((string) $product['marketing']['headline']); ?></span>
|
|
<?php endif; ?>
|
|
<?php if (!empty($product['after_sale']['support_refund'])) : ?>
|
|
<span class="aksrt-product-page__badge"><?php esc_html_e('支持售后', 'aksrt'); ?></span>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<h1 class="aksrt-product-page__title"><?php echo esc_html((string) ($product['title'] ?? '')); ?></h1>
|
|
|
|
<!-- Price row with range support -->
|
|
<div class="aksrt-product-page__price-row">
|
|
<?php if ($has_options && !empty($price_range) && $price_range['min'] !== $price_range['max']) : ?>
|
|
<strong class="aksrt-product-page__price" data-aksrt-dynamic-price>
|
|
<?php echo $pay_modo === 'points' ? '' : '¥'; ?><?php echo esc_html(number_format($price_range['min'], 2)); ?> - <?php echo $pay_modo === 'points' ? '' : '¥'; ?><?php echo esc_html(number_format($price_range['max'], 2)); ?>
|
|
<?php if ($pay_modo === 'points') : ?><small><?php esc_html_e('积分', 'aksrt'); ?></small><?php endif; ?>
|
|
</strong>
|
|
<?php else : ?>
|
|
<strong class="aksrt-product-page__price" data-aksrt-dynamic-price>
|
|
<?php echo $pay_modo === 'points' ? '' : '¥'; ?><?php echo esc_html(number_format((float) ($product['price'] ?? 0), 2)); ?>
|
|
<?php if ($pay_modo === 'points') : ?><small><?php esc_html_e('积分', 'aksrt'); ?></small><?php endif; ?>
|
|
</strong>
|
|
<?php endif; ?>
|
|
<span class="aksrt-product-page__sales"><?php printf(esc_html__('已售 %d', 'aksrt'), (int) ($product['sales'] ?? 0)); ?></span>
|
|
<?php if (!empty($scores['average'])) : ?>
|
|
<span class="aksrt-product-page__rating"><i class="fas fa-star"></i> <?php echo esc_html((string) $scores['average']); ?></span>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<?php if (!empty($product['excerpt'])) : ?>
|
|
<p class="aksrt-product-page__excerpt"><?php echo esc_html((string) $product['excerpt']); ?></p>
|
|
<?php endif; ?>
|
|
|
|
<div class="aksrt-product-page__service-strip">
|
|
<span><i class="fas fa-shield-alt"></i> <?php esc_html_e('主站统一交易保障', 'aksrt'); ?></span>
|
|
<span><i class="fas fa-box-open"></i> <?php esc_html_e('与内容主线共用卡片与购买节奏', 'aksrt'); ?></span>
|
|
</div>
|
|
|
|
<!-- Product options selector -->
|
|
<?php if ($has_options) : ?>
|
|
<div class="aksrt-product-page__options" data-aksrt-options-selector>
|
|
<?php foreach ($options as $group_idx => $group) : ?>
|
|
<div class="aksrt-product-page__option-group" data-group-index="<?php echo esc_attr((string) $group_idx); ?>">
|
|
<span class="aksrt-product-page__option-label"><?php echo esc_html((string) ($group['name'] ?? '')); ?></span>
|
|
<div class="aksrt-product-page__option-values aksrt-product-page__option-values--<?php echo esc_attr($group['view_mode'] ?? 'list'); ?>">
|
|
<?php foreach ((array) ($group['values'] ?? []) as $val) : ?>
|
|
<button type="button"
|
|
class="aksrt-product-page__option-btn"
|
|
data-option-group="<?php echo esc_attr((string) $group_idx); ?>"
|
|
data-option-label="<?php echo esc_attr((string) ($val['label'] ?? '')); ?>"
|
|
data-price-change="<?php echo esc_attr((string) ($val['price_change'] ?? 0)); ?>"
|
|
<?php if (!empty($val['image'])) : ?>data-option-image="<?php echo esc_url($val['image']); ?>"<?php endif; ?>
|
|
>
|
|
<?php if (($group['view_mode'] ?? '') === 'img' && !empty($val['image'])) : ?>
|
|
<img src="<?php echo esc_url($val['image']); ?>" alt="<?php echo esc_attr($val['label']); ?>">
|
|
<?php endif; ?>
|
|
<span><?php echo esc_html((string) ($val['label'] ?? '')); ?></span>
|
|
<?php if ((float) ($val['price_change'] ?? 0) !== 0.0) : ?>
|
|
<em><?php echo (float) $val['price_change'] > 0 ? '+' : ''; ?><?php echo esc_html(number_format((float) $val['price_change'], 2)); ?></em>
|
|
<?php endif; ?>
|
|
</button>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
<div class="aksrt-product-page__option-result" data-aksrt-option-result hidden>
|
|
<span data-aksrt-selected-labels></span>
|
|
<strong data-aksrt-resolved-price></strong>
|
|
<span data-aksrt-resolved-stock></span>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<!-- Meta info -->
|
|
<dl class="aksrt-product-page__meta">
|
|
<div>
|
|
<dt><?php esc_html_e('库存', 'aksrt'); ?></dt>
|
|
<dd data-aksrt-stock-display><?php
|
|
$stock_val = (int) ($product['stock'] ?? 0);
|
|
echo $stock_val <= -1 ? esc_html__('充足', 'aksrt') : esc_html((string) $stock_val);
|
|
?></dd>
|
|
</div>
|
|
<div>
|
|
<dt><?php esc_html_e('配送', 'aksrt'); ?></dt>
|
|
<dd><?php echo esc_html((string) (($product['shipping']['delivery_note'] ?? '') ?: __('标准配送', 'aksrt'))); ?></dd>
|
|
</div>
|
|
<div>
|
|
<dt><?php esc_html_e('运费', 'aksrt'); ?></dt>
|
|
<dd><?php
|
|
$ship_fee = (float) ($product['shipping']['fee'] ?? 0);
|
|
echo $ship_fee > 0 ? '¥' . esc_html(number_format($ship_fee, 2)) : esc_html__('包邮', 'aksrt');
|
|
?></dd>
|
|
</div>
|
|
</dl>
|
|
|
|
<!-- Params & Services quick links -->
|
|
<?php if (!empty($params)) : ?>
|
|
<button type="button" class="aksrt-product-page__info-trigger" data-aksrt-show-params>
|
|
<i class="fas fa-list-ul"></i> <?php esc_html_e('商品参数', 'aksrt'); ?> <i class="fas fa-chevron-right"></i>
|
|
</button>
|
|
<?php endif; ?>
|
|
<?php if (!empty($services)) : ?>
|
|
<button type="button" class="aksrt-product-page__info-trigger" data-aksrt-show-services>
|
|
<i class="fas fa-shield-alt"></i> <?php esc_html_e('服务保障', 'aksrt'); ?> <i class="fas fa-chevron-right"></i>
|
|
</button>
|
|
<?php endif; ?>
|
|
|
|
<!-- Purchase box -->
|
|
<div class="aksrt-product-page__purchase-box">
|
|
<label class="aksrt-product-page__field">
|
|
<span><?php esc_html_e('购买数量', 'aksrt'); ?></span>
|
|
<div class="aksrt-product-page__quantity">
|
|
<button type="button" class="aksrt-product-page__qty-btn" data-aksrt-qty-action="dec">-</button>
|
|
<input type="number" min="1" max="<?php echo esc_attr((string) max(1, $stock_val > 0 ? $stock_val : 999)); ?>" value="1" class="aksrt-product-page__qty-input" data-aksrt-quantity>
|
|
<button type="button" class="aksrt-product-page__qty-btn" data-aksrt-qty-action="inc">+</button>
|
|
</div>
|
|
</label>
|
|
|
|
<div class="aksrt-product-page__actions">
|
|
<?php if (is_user_logged_in() && !empty($product['purchase_enabled'])) : ?>
|
|
<button type="button" class="btn-outline btn-lg" data-aksrt-add-cart><?php esc_html_e('加入购物车', 'aksrt'); ?></button>
|
|
<button type="button" class="btn-primary btn-lg" data-aksrt-buy-now>
|
|
<?php echo $pay_modo === 'points' ? esc_html__('积分兑换', 'aksrt') : esc_html__('立即下单', 'aksrt'); ?>
|
|
</button>
|
|
<?php elseif (!is_user_logged_in()) : ?>
|
|
<a href="<?php echo esc_url(function_exists('aksrt_get_login_url') ? aksrt_get_login_url() : wp_login_url(get_permalink())); ?>" class="btn-primary btn-lg">
|
|
<?php esc_html_e('登录后购买', 'aksrt'); ?>
|
|
</a>
|
|
<?php else : ?>
|
|
<button type="button" class="btn-primary btn-lg" disabled><?php esc_html_e('暂不可购买', 'aksrt'); ?></button>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<!-- Auxiliary actions -->
|
|
<div class="aksrt-product-page__aux-actions">
|
|
<button type="button" class="aksrt-product-page__aux-btn<?php echo $is_fav ? ' is-active' : ''; ?>" data-aksrt-toggle-fav="<?php echo esc_attr((string) $product_id); ?>">
|
|
<i class="<?php echo $is_fav ? 'fas' : 'far'; ?> fa-heart"></i>
|
|
<?php esc_html_e('收藏', 'aksrt'); ?>
|
|
</button>
|
|
<button type="button" class="aksrt-product-page__aux-btn" data-aksrt-share>
|
|
<i class="fas fa-share-alt"></i> <?php esc_html_e('分享', 'aksrt'); ?>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Merchant info -->
|
|
<?php if ($author) : ?>
|
|
<div class="aksrt-product-page__merchant">
|
|
<img src="<?php echo esc_url(function_exists('aksrt_get_avatar_url') ? aksrt_get_avatar_url($author_id) : get_avatar_url($author_id)); ?>" alt="" class="aksrt-product-page__merchant-avatar">
|
|
<div>
|
|
<strong><?php echo esc_html($author->display_name); ?></strong>
|
|
<a href="<?php echo esc_url(get_author_posts_url($author_id)); ?>?tab=products" class="aksrt-product-page__merchant-link"><?php esc_html_e('进入店铺', 'aksrt'); ?></a>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</section>
|
|
</div>
|
|
|
|
<!-- Tabs: detail / reviews / custom -->
|
|
<div class="aksrt-product-page__tabs">
|
|
<nav class="aksrt-product-page__tab-nav">
|
|
<button class="aksrt-product-page__tab-btn is-active" data-aksrt-tab="detail"><?php esc_html_e('商品详情', 'aksrt'); ?></button>
|
|
<button class="aksrt-product-page__tab-btn" data-aksrt-tab="reviews">
|
|
<?php esc_html_e('评价', 'aksrt'); ?>
|
|
<?php if (($scores['total'] ?? 0) > 0) : ?>
|
|
<em>(<?php echo esc_html((string) $scores['total']); ?>)</em>
|
|
<?php endif; ?>
|
|
</button>
|
|
</nav>
|
|
|
|
<div class="aksrt-product-page__tab-panel is-active" data-aksrt-tab-panel="detail">
|
|
<div class="aksrt-product-page__content">
|
|
<?php echo wp_kses_post((string) ($product['content'] ?? '')); ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="aksrt-product-page__tab-panel" data-aksrt-tab-panel="reviews">
|
|
<?php if (!empty($scores['total'])) : ?>
|
|
<div class="aksrt-product-page__review-summary">
|
|
<strong class="aksrt-product-page__review-avg"><?php echo esc_html((string) ($scores['average'] ?? '0')); ?></strong>
|
|
<span class="aksrt-product-page__review-level"><?php echo esc_html((string) ($scores['level'] ?? '')); ?></span>
|
|
<div class="aksrt-product-page__review-counts">
|
|
<span><?php printf(esc_html__('好评 %d', 'aksrt'), (int) ($scores['good'] ?? 0)); ?></span>
|
|
<span><?php printf(esc_html__('差评 %d', 'aksrt'), (int) ($scores['bad'] ?? 0)); ?></span>
|
|
<span><?php printf(esc_html__('有图 %d', 'aksrt'), (int) ($scores['has_image'] ?? 0)); ?></span>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="aksrt-product-page__review-list" data-aksrt-review-list>
|
|
<?php foreach (($reviews['items'] ?? []) as $review) : ?>
|
|
<div class="aksrt-product-page__review-item">
|
|
<div class="aksrt-product-page__review-header">
|
|
<img src="<?php echo esc_url((string) ($review['user_avatar'] ?? '')); ?>" alt="" class="aksrt-product-page__review-avatar">
|
|
<span class="aksrt-product-page__review-name"><?php echo esc_html((string) ($review['user_name'] ?? '')); ?></span>
|
|
<span class="aksrt-product-page__review-date"><?php echo esc_html((string) ($review['date'] ?? '')); ?></span>
|
|
<span class="aksrt-product-page__review-stars">
|
|
<?php for ($s = 0; $s < 5; $s++) : ?>
|
|
<i class="<?php echo $s < (int) ($review['rating_average'] ?? 0) ? 'fas' : 'far'; ?> fa-star"></i>
|
|
<?php endfor; ?>
|
|
</span>
|
|
</div>
|
|
<p class="aksrt-product-page__review-text"><?php echo esc_html((string) ($review['content'] ?? '')); ?></p>
|
|
<?php if (!empty($review['images'])) : ?>
|
|
<div class="aksrt-product-page__review-images">
|
|
<?php foreach ((array) $review['images'] as $rimg) : ?>
|
|
<img src="<?php echo esc_url($rimg); ?>" alt="" class="aksrt-product-page__review-img">
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
|
|
<?php if (empty($reviews['items'])) : ?>
|
|
<p class="aksrt-product-page__review-empty"><?php esc_html_e('暂无评价', 'aksrt'); ?></p>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Related products -->
|
|
<?php
|
|
$related_query = new WP_Query([
|
|
'post_type' => 'aksrt_product',
|
|
'posts_per_page' => 6,
|
|
'post_status' => 'publish',
|
|
'post__not_in' => [$product_id],
|
|
'tax_query' => !empty($product['categories']) ? [[
|
|
'taxonomy' => 'aksrt_product_cat',
|
|
'field' => 'term_id',
|
|
'terms' => wp_list_pluck($product['categories'], 'term_id'),
|
|
]] : [],
|
|
'orderby' => 'rand',
|
|
]);
|
|
?>
|
|
<?php if ($related_query->have_posts()) : ?>
|
|
<section class="aksrt-product-page__related">
|
|
<h2><?php esc_html_e('相关推荐', 'aksrt'); ?></h2>
|
|
<div class="aksrt-product-page__related-grid">
|
|
<?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
|
|
<a href="<?php echo esc_url(get_permalink()); ?>" class="aksrt-product-page__related-card">
|
|
<?php $thumb = $shop ? $shop->resolve_main_image(get_the_ID()) : get_the_post_thumbnail_url(get_the_ID(), 'medium'); ?>
|
|
<?php if ($thumb) : ?>
|
|
<img src="<?php echo esc_url($thumb); ?>" alt="<?php the_title_attribute(); ?>" loading="lazy">
|
|
<?php endif; ?>
|
|
<h3><?php the_title(); ?></h3>
|
|
<strong>¥<?php echo esc_html(number_format((float) get_post_meta(get_the_ID(), '_aksrt_price', true), 2)); ?></strong>
|
|
</a>
|
|
<?php endwhile; wp_reset_postdata(); ?>
|
|
</div>
|
|
</section>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<!-- Params modal -->
|
|
<?php if (!empty($params)) : ?>
|
|
<div class="aksrt-modal" data-aksrt-params-modal hidden>
|
|
<div class="aksrt-modal__overlay"></div>
|
|
<div class="aksrt-modal__dialog">
|
|
<div class="aksrt-modal__header">
|
|
<h3><?php esc_html_e('商品参数', 'aksrt'); ?></h3>
|
|
<button type="button" class="aksrt-modal__close" data-aksrt-modal-close>×</button>
|
|
</div>
|
|
<div class="aksrt-modal__body">
|
|
<table class="aksrt-product-page__params-table">
|
|
<?php foreach ($params as $param) : ?>
|
|
<tr>
|
|
<th><?php echo esc_html((string) ($param['name'] ?? '')); ?></th>
|
|
<td><?php echo esc_html((string) ($param['value'] ?? '')); ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<!-- Services modal -->
|
|
<?php if (!empty($services)) : ?>
|
|
<div class="aksrt-modal" data-aksrt-services-modal hidden>
|
|
<div class="aksrt-modal__overlay"></div>
|
|
<div class="aksrt-modal__dialog">
|
|
<div class="aksrt-modal__header">
|
|
<h3><?php esc_html_e('服务保障', 'aksrt'); ?></h3>
|
|
<button type="button" class="aksrt-modal__close" data-aksrt-modal-close>×</button>
|
|
</div>
|
|
<div class="aksrt-modal__body">
|
|
<?php foreach ($services as $service) : ?>
|
|
<div class="aksrt-product-page__service-item">
|
|
<?php if (!empty($service['icon'])) : ?>
|
|
<img src="<?php echo esc_url($service['icon']); ?>" alt="" class="aksrt-product-page__service-icon">
|
|
<?php else : ?>
|
|
<i class="fas fa-check-circle"></i>
|
|
<?php endif; ?>
|
|
<div>
|
|
<strong><?php echo esc_html((string) ($service['name'] ?? '')); ?></strong>
|
|
<?php if (!empty($service['desc'])) : ?>
|
|
<p><?php echo esc_html((string) $service['desc']); ?></p>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<!-- Mobile purchase tabbar -->
|
|
<div class="aksrt-product-page__mobile-bar" data-aksrt-mobile-purchase>
|
|
<button type="button" class="aksrt-product-page__mobile-btn" data-aksrt-toggle-fav="<?php echo esc_attr((string) $product_id); ?>">
|
|
<i class="<?php echo $is_fav ? 'fas' : 'far'; ?> fa-heart"></i>
|
|
</button>
|
|
<button type="button" class="aksrt-product-page__mobile-btn" data-aksrt-add-cart>
|
|
<i class="fas fa-shopping-cart"></i>
|
|
</button>
|
|
<button type="button" class="aksrt-product-page__mobile-buy btn-primary" data-aksrt-buy-now>
|
|
<?php echo $pay_modo === 'points' ? esc_html__('积分兑换', 'aksrt') : esc_html__('立即购买', 'aksrt'); ?>
|
|
</button>
|
|
</div>
|
|
<?php else : ?>
|
|
<div class="aksrt-product-page container">
|
|
<div class="aksrt-product-page__empty">
|
|
<i class="fas fa-box-open" aria-hidden="true"></i>
|
|
<p><?php esc_html_e('商品不存在或已下架。', 'aksrt'); ?></p>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</main>
|
|
|
|
<?php get_footer(); ?>
|