docs(frontend): 将前端钩子注释翻译为中文

This commit is contained in:
tikkhun 2025-11-06 17:26:47 +08:00
parent eda86d4d68
commit d6238c49ee
1 changed files with 6 additions and 6 deletions

View File

@ -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);
}