feat(shop): wire product/cart widget zones and extra sidebars
Render shop_product top/sidebar/bottom and cart fluid areas; register shop home/order sidebar slots for zibll shop layout parity.
This commit is contained in:
@@ -407,11 +407,15 @@ trait SetupPart1 {
|
||||
|
||||
// ── Shop widget areas (§6.9) ──
|
||||
$shop_widgets = [
|
||||
'shop_home_top_fluid' => ['商城首页 · 顶部通栏', '商城首页顶部全宽区域。'],
|
||||
'shop_home_sidebar' => ['商城首页 · 侧栏', '商城首页侧栏区域。'],
|
||||
'shop_product_top_fluid' => ['商品详情页 · 顶部通栏', '商品详情页顶部全宽区域。'],
|
||||
'shop_product_sidebar' => ['商品详情页 · 侧栏', '商品详情页侧栏区域(PC 端)。'],
|
||||
'shop_product_bottom_fluid' => ['商品详情页 · 底部通栏', '商品详情页底部全宽区域。'],
|
||||
'shop_cart_top_fluid' => ['购物车页 · 顶部通栏', '购物车页顶部全宽区域。'],
|
||||
'shop_cart_bottom_fluid' => ['购物车页 · 底部通栏', '购物车页底部全宽区域。'],
|
||||
'shop_order_top_fluid' => ['订单页 · 顶部通栏', '订单中心顶部全宽。'],
|
||||
'shop_order_bottom_fluid' => ['订单页 · 底部通栏', '订单中心底部全宽。'],
|
||||
];
|
||||
foreach ($shop_widgets as $sid => $meta) {
|
||||
register_sidebar([
|
||||
|
||||
@@ -34,7 +34,10 @@ $address_book = is_array($cart_view['address_book'] ?? null) ? $cart_view['addre
|
||||
?>
|
||||
|
||||
<main id="main-content" class="site-main content-shell" tabindex="-1">
|
||||
<?php if (function_exists('aksrt_breadcrumbs')) { aksrt_breadcrumbs(); } ?>
|
||||
<?php if (is_active_sidebar('shop_cart_top_fluid')) : ?>
|
||||
<div class="aksrt-fluid-widget aksrt-fluid-widget--shop"><?php dynamic_sidebar('shop_cart_top_fluid'); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (function_exists('aksrt_breadcrumbs')) { aksrt_breadcrumbs(); } ?>
|
||||
|
||||
<div
|
||||
class="aksrt-cart-page container"
|
||||
@@ -283,4 +286,7 @@ $address_book = is_array($cart_view['address_book'] ?? null) ? $cart_view['addre
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php if (is_active_sidebar('shop_cart_bottom_fluid')) : ?>
|
||||
<div class="aksrt-fluid-widget aksrt-fluid-widget--shop"><?php dynamic_sidebar('shop_cart_bottom_fluid'); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php get_footer(); ?>
|
||||
|
||||
@@ -38,11 +38,15 @@ $author = $author_id > 0 ? get_userdata($author_id) : null;
|
||||
?>
|
||||
|
||||
<main id="main-content" class="site-main content-shell content-shell--stream content-shell--product" tabindex="-1">
|
||||
<?php if (is_active_sidebar('shop_product_top_fluid')) : ?>
|
||||
<div class="aksrt-fluid-widget aksrt-fluid-widget--shop"><?php dynamic_sidebar('shop_product_top_fluid'); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (function_exists('aksrt_breadcrumbs')) { aksrt_breadcrumbs(); } ?>
|
||||
|
||||
<?php if (!empty($product)) : ?>
|
||||
<div class="content-wrap container">
|
||||
<div class="content-layout content-layout--no-sidebar">
|
||||
<?php $has_shop_sidebar = is_active_sidebar('shop_product_sidebar'); ?>
|
||||
<div class="content-layout <?php echo $has_shop_sidebar ? 'content-layout--with-sidebar' : 'content-layout--no-sidebar'; ?>">
|
||||
<div class="content-layout__primary">
|
||||
<div
|
||||
class="aksrt-product-page"
|
||||
@@ -431,8 +435,16 @@ $author = $author_id > 0 ? get_userdata($author_id) : null;
|
||||
|
||||
</div><!-- .aksrt-product-page -->
|
||||
</div><!-- .content-layout__primary -->
|
||||
<?php if (!empty($has_shop_sidebar)) : ?>
|
||||
<aside class="content-layout__sidebar aksrt-shop-widget-zone">
|
||||
<?php dynamic_sidebar('shop_product_sidebar'); ?>
|
||||
</aside>
|
||||
<?php endif; ?>
|
||||
</div><!-- .content-layout -->
|
||||
</div><!-- .content-wrap -->
|
||||
<?php if (is_active_sidebar('shop_product_bottom_fluid')) : ?>
|
||||
<div class="aksrt-fluid-widget aksrt-fluid-widget--shop"><?php dynamic_sidebar('shop_product_bottom_fluid'); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Mobile purchase tabbar -->
|
||||
<div class="aksrt-product-page__mobile-bar" data-aksrt-mobile-purchase>
|
||||
|
||||
Reference in New Issue
Block a user