From d6238c49ee4dc33b0df99cd43a719f1fcc0d5ed5 Mon Sep 17 00:00:00 2001 From: tikkhun Date: Thu, 6 Nov 2025 17:26:47 +0800 Subject: [PATCH] =?UTF-8?q?docs(frontend):=20=E5=B0=86=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=92=A9=E5=AD=90=E6=B3=A8=E9=87=8A=E7=BF=BB=E8=AF=91=E4=B8=BA?= =?UTF-8?q?=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../class-yoone-product-bundles-frontend.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/frontend/class-yoone-product-bundles-frontend.php b/includes/frontend/class-yoone-product-bundles-frontend.php index 7b0fce5..b75a9e6 100644 --- a/includes/frontend/class-yoone-product-bundles-frontend.php +++ b/includes/frontend/class-yoone-product-bundles-frontend.php @@ -23,22 +23,22 @@ class Yoone_Product_Bundles_Frontend { * 设置所有与前端相关的钩子。 */ public function setup_hooks() { - // Handle the custom add-to-cart process for bundles + // 处理混装产品的自定义“添加到购物车”流程 add_filter('woocommerce_add_to_cart_validation', array($this, 'process_bundle_add_to_cart'), 10, 3); - // When a bundle container is removed, remove its children. + // 当混装容器被移除时,移除其子项目 add_action('woocommerce_cart_item_removed', array($this, 'remove_bundle_children'), 10, 2); - // Hide the "remove" link for child items in the cart. + // 隐藏购物车中子项目的“移除”链接 add_filter('woocommerce_cart_item_remove_link', array($this, 'hide_child_remove_link'), 10, 2); - // In the cart, show which bundle a child item belongs to. + // 在购物车中,显示子项目所属的混装产品 add_filter('woocommerce_get_item_data', array($this, 'display_child_bundle_link'), 10, 2); - // Add a body class to the bundle product page for easier styling. + // 为混装产品页面添加 body class,以便于样式化 add_filter('body_class', array($this, 'filter_body_class')); - // Replace the default "Add to Cart" button with our custom form. + // 用我们的自定义表单替换默认的“添加到购物车”按钮 add_action('woocommerce_single_product_summary', array($this, 'remove_default_add_to_cart_for_bundle'), 29); add_action('woocommerce_single_product_summary', array($this, 'render_bundle_add_to_cart_form'), 30); }