WooCommerce 自定义”加入购物车”按钮

WooCommerce Add to Cart Customizer 是一款专业的 WooCommerce 扩展插件, 允许店主自定义”加入购物车”按钮的显示文本。支持定时变更、多语言、HTML和表情符号等功能。

<?php
/**
* Plugin Name: BeiduoFengou WooCommerce Add to Cart Customizer
* Plugin URI: https://beiduofengou.net/2024/01/15/woocommerce-add-to-cart-customizer/
* Description: A premium WooCommerce extension that lets you customize your Add to Cart button text with scheduling, A/B testing, and advanced styling options
* Version: 1.1.0
* Author: BeiduoFengou
* Author URI: https://beiduofengou.net
* Text Domain: bdf-custom-add-to-cart
* Domain Path: /languages
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Requires at least: 5.8
* Requires PHP: 7.4
* WC requires at least: 5.0
* WC tested up to: 8.0
*
* @package BeiduoFengou
* @author BeiduoFengou
* @link https://beiduofengou.net
*/

// 安全检查
if (!defined('ABSPATH')) {
exit('直接访问被禁止');
}

// 定义插件常量
define('BDF_CART_VERSION', '1.1.0');
define('BDF_CART_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('BDF_CART_PLUGIN_URL', plugin_dir_url(__FILE__));

// 加载主类
require_once BDF_CART_PLUGIN_DIR . 'includes/class-bdf-cart-customizer.php';

/**
* 插件初始化函数
*
* @since 1.0.0
* @return void
*/
function bdf_initialize_cart_customizer() {
// 检查WooCommerce是否已安装并激活
if (!class_exists('WooCommerce')) {
add_action('admin_notices', 'bdf_woocommerce_missing_notice');
return;
}

// 实例化主类
BDF_Cart_Customizer::get_instance();
}

/**
* WooCommerce未安装时显示通知
*
* @since 1.0.0
* @return void
*/
function bdf_woocommerce_missing_notice() {
$notice = sprintf(
'<div class="error"><p>%s</p></div>',
esc_html__('BeiduoFengou WooCommerce Add to Cart Customizer 需要安装并激活 WooCommerce 才能使用。', 'bdf-custom-add-to-cart')
);
echo wp_kses_post($notice);
}

/**
* 插件激活时的处理函数
*
* @since 1.0.0
* @return void
*/
function bdf_activate_cart_customizer() {
// 检查PHP版本
if (version_compare(PHP_VERSION, '7.4', '<')) {
deactivate_plugins(plugin_basename(__FILE__));
wp_die(
esc_html__('BeiduoFengou WooCommerce Add to Cart Customizer 需要 PHP 7.4 或更高版本。', 'bdf-custom-add-to-cart'),
'Plugin Activation Error',
array('back_link' => true)
);
}

// 创建默认设置
$default_settings = array(
'version' => BDF_CART_VERSION,
'single_product_text' => '',
'archive_product_text' => '',
'enable_scheduling' => false,
'enable_ab_testing' => false,
'custom_styles' => array(
'button_color' => '#96588a',
'button_hover_color' => '#7f4674',
'text_color' => '#ffffff',
'font_size' => '16px',
'padding' => '12px 20px',
'border_radius' => '3px'
)
);

if (!get_option('bdf_cart_settings')) {
add_option('bdf_cart_settings', $default_settings);
}

// 刷新重写规则
flush_rewrite_rules();
}

/**
* 插件停用时的处理函数
*
* @since 1.0.0
* @return void
*/
function bdf_deactivate_cart_customizer() {
// 清理定时任务
wp_clear_scheduled_hooks('bdf_daily_maintenance');
}

// 注册激活和停用钩子
register_activation_hook(__FILE__, 'bdf_activate_cart_customizer');
register_deactivation_hook(__FILE__, 'bdf_deactivate_cart_customizer');

// 初始化插件
add_action('plugins_loaded', 'bdf_initialize_cart_customizer', 10);

/**
* 添加插件设置链接
*
* @since 1.0.0
* @param array $links 插件操作链接数组
* @return array 修改后的链接数组
*/
function bdf_add_settings_link($links) {
$settings_link = sprintf(
'<a href="%s">%s</a>',
admin_url('admin.php?page=bdf-cart-settings'),
esc_html__('设置', 'bdf-custom-add-to-cart')
);
array_unshift($links, $settings_link);
return $links;
}
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'bdf_add_settings_link');

includes/class-bdf-cart-customizer.php

相关文章: WooCommerce 快速下单插件

<?php
/**
* BeiduoFengou WooCommerce Add to Cart Customizer 主类
*
* @package BeiduoFengou
* @subpackage WooCommerce Add to Cart Customizer
* @author BeiduoFengou
* @copyright 2024-2025 BeiduoFengou
* @license GPL-2.0+
* @version 1.1.0
* @link https://beiduofengou.net
* @since 1.0.0
*/

// 如果直接访问此文件,则退出
if (!defined('ABSPATH')) {
exit('禁止直接访问');
}

/**
* 插件主类
*
* @since 1.0.0
*/
class BDF_Cart_Customizer {
/**
* 单例实例
*
* @since 1.0.0
* @access private
* @var BDF_Cart_Customizer
*/
private static $instance = null;

/**
* 插件设置
*
* @since 1.0.0
* @access private
* @var array
*/
private $settings;

/**
* 插件版本号
*
* @since 1.1.0
* @access private
* @var string
*/
private $version = '1.1.0';

/**
* 获取单例实例
*
* @since 1.0.0
* @access public
* @return BDF_Cart_Customizer
*/
public static function get_instance() {
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
}

/**
* 构造函数
*
* @since 1.0.0
* @access private
*/
private function __construct() {
$this->settings = get_option('bdf_cart_settings', array());
$this->init_hooks();
}

/**
* 初始化钩子
*
* @since 1.0.0
* @access private
*/
private function init_hooks() {
// 基础钩子
add_action('init', array($this, 'load_textdomain'));
add_action('plugins_loaded', array($this, 'check_dependencies'));

// 管理界面钩子
if (is_admin()) {
add_action('admin_menu', array($this, 'add_admin_menu'));
add_action('admin_init', array($this, 'register_settings'));
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
add_action('admin_notices', array($this, 'admin_notices'));
}

// 前端钩子
add_filter('woocommerce_product_single_add_to_cart_text', array($this, 'customize_single_add_to_cart_text'), 20);
add_filter('woocommerce_product_add_to_cart_text', array($this, 'customize_archive_add_to_cart_text'), 20);
add_action('wp_enqueue_scripts', array($this, 'frontend_enqueue_scripts'));

// 定时任务钩子
add_action('bdf_daily_maintenance', array($this, 'daily_maintenance'));
}

/**
* 加载文本域
*
* @since 1.0.0
* @access public
*/
public function load_textdomain() {
load_plugin_textdomain(
'bdf-custom-add-to-cart',
false,
dirname(plugin_basename(BDF_CART_PLUGIN_DIR)) . '/languages'
);
}

/**
* 检查依赖
*
* @since 1.1.0
* @access public
*/
public function check_dependencies() {
if (!class_exists('WooCommerce')) {
add_action('admin_notices', array($this, 'woocommerce_missing_notice'));
return false;
}
return true;
}

/**
* 添加管理菜单
*
* @since 1.0.0
* @access public
*/
public function add_admin_menu() {
$capability = 'manage_woocommerce';

// 主菜单
add_menu_page(
__('BeiduoFengou 购物车定制', 'bdf-custom-add-to-cart'),
__('购物车定制', 'bdf-custom-add-to-cart'),
$capability,
'bdf-cart-settings',
array($this, 'render_settings_page'),
'dashicons-cart',
58
);

// 子菜单
$this->add_submenu_pages($capability);
}

/**
* 添加子菜单页面
*
* @since 1.1.0
* @access private
* @param string $capability 权限
*/
private function add_submenu_pages($capability) {
$submenus = array(
array(
'parent_slug' => 'bdf-cart-settings',
'page_title' => __('基本设置', 'bdf-custom-add-to-cart'),
'menu_title' => __('基本设置', 'bdf-custom-add-to-cart'),
'capability' => $capability,
'menu_slug' => 'bdf-cart-settings',
'callback' => array($this, 'render_settings_page')
),
array(
'parent_slug' => 'bdf-cart-settings',
'page_title' => __('定时设置', 'bdf-custom-add-to-cart'),
'menu_title' => __('定时设置', 'bdf-custom-add-to-cart'),
'capability' => $capability,
'menu_slug' => 'bdf-cart-scheduling',
'callback' => array($this, 'render_scheduling_page')
),
array(
'parent_slug' => 'bdf-cart-settings',
'page_title' => __('高级功能', 'bdf-custom-add-to-cart'),
'menu_title' => __('高级功能', 'bdf-custom-add-to-cart'),
'capability' => $capability,
'menu_slug' => 'bdf-cart-advanced',
'callback' => array($this, 'render_advanced_page')
)
);

foreach ($submenus as $submenu) {
add_submenu_page(
$submenu['parent_slug'],
$submenu['page_title'],
$submenu['menu_title'],
$submenu['capability'],
$submenu['menu_slug'],
$submenu['callback']
);
}
}

/**
* 注册设置
*
* @since 1.0.0
* @access public
*/
public function register_settings() {
register_setting(
'bdf_cart_settings',
'bdf_cart_settings',
array($this, 'sanitize_settings')
);

// 添加设置区域
add_settings_section(
'bdf_basic_settings',
__('基本按钮文本设置', 'bdf-custom-add-to-cart'),
array($this, 'render_basic_section'),
'bdf-cart-settings'
);

// 添加设置字段
$this->add_settings_fields();
}

/**
* 添加设置字段
*
* @since 1.1.0
* @access private
*/
private function add_settings_fields() {
$fields = array(
'single_product_text' => array(
'title' => __('单品页按钮文本', 'bdf-custom-add-to-cart'),
'desc' => __('设置单个商品页面的"加入购物车"按钮文本', 'bdf-custom-add-to-cart'),
'type' => 'text'
),
'archive_product_text' => array(
'title' => __('商品列表页按钮文本', 'bdf-custom-add-to-cart'),
'desc' => __('设置商品列表页面的"加入购物车"按钮文本', 'bdf-custom-add-to-cart'),
'type' => 'text'
),
'enable_scheduling' => array(
'title' => __('启用定时功能', 'bdf-custom-add-to-cart'),
'desc' => __('开启后可以设置在特定时间显示不同的按钮文本', 'bdf-custom-add-to-cart'),
'type' => 'checkbox'
)
);

foreach ($fields as $id => $field) {
add_settings_field(
$id,
$field['title'],
array($this, 'render_field'),
'bdf-cart-settings',
'bdf_basic_settings',
array(
'id' => $id,
'desc' => $field['desc'],
'type' => $field['type']
)
);
}
}

/**
* 渲染字段
*
* @since 1.0.0
* @access public
* @param array $args 字段参数
*/
public function render_field($args) {
$id = $args['id'];
$type = $args['type'];
$value = isset($this->settings[$id]) ? $this->settings[$id] : '';

switch ($type) {
case 'text':
printf(
'<input type="text" id="%1$s" name="bdf_cart_settings[%1$s]" value="%2$s" class="regular-text">',
esc_attr($id),
esc_attr($value)
);
break;

case 'checkbox':
printf(
'<input type="checkbox" id="%1$s" name="bdf_cart_settings[%1$s]" value="1" %2$s>',
esc_attr($id),
checked(1, $value, false)
);
break;
}

if (!empty($args['desc'])) {
printf('<p class="description">%s</p>', esc_html($args['desc']));
}
}

/**
* 渲染基本设置说明
*
* @since 1.0.0
* @access public
*/
public function render_basic_section() {
echo '<p>' . esc_html__('在这里配置"加入购物车"按钮的基本显示文本。支持HTML标签和表情符号。', 'bdf-custom-add-to-cart') . '</p>';
}

/**
* 渲染设置页面
*
* @since 1.0.0
* @access public
*/
public function render_settings_page() {
if (!current_user_can('manage_woocommerce')) {
wp_die(__('您没有足够的权限访问此页面', 'bdf-custom-add-to-cart'));
}
?>
<div class="wrap bdf-settings-wrap">
<h1><?php echo esc_html(get_admin_page_title()); ?></h1>
<form method="post" action="options.php">
<?php
settings_fields('bdf_cart_settings');
do_settings_sections('bdf-cart-settings');
submit_button();
?>
</form>
</div>
<?php
}

/**
* 渲染定时设置页面
*
* @since 1.1.0
* @access public
*/
public function render_scheduling_page() {
if (!current_user_can('manage_woocommerce')) {
wp_die(__('您没有足够的权限访问此页面', 'bdf-custom-add-to-cart'));
}

// 定时设置页面的具体实现
require_once BDF_CART_PLUGIN_DIR . 'views/scheduling-page.php';
}

/**
* 渲染高级功能页面
*
* @since 1.1.0
* @access public
*/
public function render_advanced_page() {
if (!current_user_can('manage_woocommerce')) {
wp_die(__('您没有足够的权限访问此页面', 'bdf-custom-add-to-cart'));
}

// 高级功能页面的具体实现
require_once BDF_CART_PLUGIN_DIR . 'views/advanced-page.php';
}

/**
* 加载管理界面资源
*
* @since 1.0.0
* @access public
* @param string $hook_suffix 当前页面的钩子后缀
*/
public function admin_enqueue_scripts($hook_suffix) {
if (strpos($hook_suffix, 'bdf-cart') === false) {
return;
}

wp_enqueue_style(
'bdf-admin-styles',
BDF_CART_PLUGIN_URL . 'assets/css/admin.css',
array(),
$this->version
);

wp_enqueue_script(
'bdf-admin-scripts',
BDF_CART_PLUGIN_URL . 'assets/js/admin.js',
array('jquery', 'wp-color-picker'),
$this->version,
true
);

wp_localize_script('bdf-admin-scripts', 'bdfCartAdmin', array(
'ajaxUrl' => admin_url('admin-ajax.php'),
'nonce' => wp_create_nonce('bdf_cart_nonce'),
'strings' => array(
'confirmDelete' => __('确定要删除这个定时计划吗?', 'bdf-custom-add-to-cart'),
'saved' => __('设置已保存', 'bdf-custom-add-to-cart'),
'error' => __('保存设置时发生错误', 'bdf-custom-add-to-cart')
)
));
}

/**
* 自定义商品列表页面加入购物车按钮文本
*
* @since 1.0.0
* @access public
* @param string $text 原文本
* @return string
*/
public function customize_archive_add_to_cart_text($text) {
// 检查是否启用定时功能
if (!empty($this->settings['enable_scheduling'])) {
$scheduled_text = $this->get_scheduled_text();
if ($scheduled_text) {
return $scheduled_text;
}
}

// 使用列表页面设置的文本
if (!empty($this->settings['archive_product_text'])) {
return wp_kses_post($this->settings['archive_product_text']);
}

return $text;
}

/**
* 获取当前时间段的定时文本
*
* @since 1.1.0
* @access private
* @return string|false
*/
private function get_scheduled_text() {
if (empty($this->settings['scheduled_texts'])) {
return false;
}

$current_time = current_time('timestamp');

foreach ($this->settings['scheduled_texts'] as $schedule) {
$start_time = strtotime($schedule['start_date'] . ' ' . $schedule['start_time']);
$end_time = strtotime($schedule['end_date'] . ' ' . $schedule['end_time']);

if ($current_time >= $start_time && $current_time <= $end_time) {
return wp_kses_post($schedule['text']);
}
}

return false;
}

/**
* 加载前端资源
*
* @since 1.1.0
* @access public
*/
public function frontend_enqueue_scripts() {
if (!is_shop() && !is_product() && !is_product_category()) {
return;
}

// 如果启用了自定义样式
if (!empty($this->settings['custom_styles'])) {
wp_add_inline_style(
'woocommerce-inline',
$this->generate_custom_styles()
);
}
}

/**
* 生成自定义样式
*
* @since 1.1.0
* @access private
* @return string
*/
private function generate_custom_styles() {
$styles = $this->settings['custom_styles'];
$css = '';

if (!empty($styles['button_color'])) {
$css .= ".single_add_to_cart_button,
.add_to_cart_button {
background-color: {$styles['button_color']} !important;
}";
}

if (!empty($styles['button_hover_color'])) {
$css .= ".single_add_to_cart_button:hover,
.add_to_cart_button:hover {
background-color: {$styles['button_hover_color']} !important;
}";
}

return $css;
}

/**
* 清理设置数据
*
* @since 1.0.0
* @access public
* @param array $input 输入数据
* @return array
*/
public function sanitize_settings($input) {
$sanitized = array();

// 基本文本设置
if (isset($input['single_product_text'])) {
$sanitized['single_product_text'] = wp_kses_post($input['single_product_text']);
}

if (isset($input['archive_product_text'])) {
$sanitized['archive_product_text'] = wp_kses_post($input['archive_product_text']);
}

// 定时功能设置
$sanitized['enable_scheduling'] = !empty($input['enable_scheduling']);

if (isset($input['scheduled_texts']) && is_array($input['scheduled_texts'])) {
foreach ($input['scheduled_texts'] as $index => $schedule) {
if (empty($schedule['start_date']) || empty($schedule['end_date'])) {
continue;
}

$sanitized['scheduled_texts'][$index] = array(
'start_date' => sanitize_text_field($schedule['start_date']),
'end_date' => sanitize_text_field($schedule['end_date']),
'start_time' => sanitize_text_field($schedule['start_time']),
'end_time' => sanitize_text_field($schedule['end_time']),
'text' => wp_kses_post($schedule['text'])
);
}
}

// 自定义样式设置
if (isset($input['custom_styles']) && is_array($input['custom_styles'])) {
$sanitized['custom_styles'] = array(
'button_color' => sanitize_hex_color($input['custom_styles']['button_color']),
'button_hover_color' => sanitize_hex_color($input['custom_styles']['button_hover_color']),
'text_color' => sanitize_hex_color($input['custom_styles']['text_color']),
'font_size' => $this->sanitize_unit_value($input['custom_styles']['font_size']),
'padding' => $this->sanitize_unit_value($input['custom_styles']['padding']),
'border_radius' => $this->sanitize_unit_value($input['custom_styles']['border_radius'])
);
}

return $sanitized;
}

/**
* 验证带单位的值
*
* @since 1.1.0
* @access private
* @param string $value 输入值
* @return string
*/
private function sanitize_unit_value($value) {
$value = trim($value);
if (preg_match('/^[\d.]+(px|em|rem|%)?$/', $value)) {
return $value;
}
return '';
}

/**
* 每日维护任务
*
* @since 1.1.0
* @access public
*/
public function daily_maintenance() {
// 清理过期的定时计划
if (!empty($this->settings['scheduled_texts'])) {
$current_time = current_time('timestamp');
foreach ($this->settings['scheduled_texts'] as $index => $schedule) {
$end_time = strtotime($schedule['end_date'] . ' ' . $schedule['end_time']);
if ($current_time > $end_time) {
unset($this->settings['scheduled_texts'][$index]);
}
}
update_option('bdf_cart_settings', $this->settings);
}

// 清理缓存
wp_cache_delete('bdf_cart_settings', 'options');
}

/**
* 显示管理通知
*
* @since 1.1.0
* @access public
*/
public function admin_notices() {
// 检查WooCommerce版本
if (defined('WC_VERSION') && version_compare(WC_VERSION, '5.0', '<')) {
?>
<div class="notice notice-warning">
<p><?php esc_html_e('BeiduoFengou WooCommerce Add to Cart Customizer 推荐使用 WooCommerce 5.0 或更高版本以获得最佳体验。', 'bdf-custom-add-to-cart'); ?></p>
</div>
<?php
}

// 检查是否需要升级数据库
if ($this->needs_db_upgrade()) {
?>
<div class="notice notice-info">
<p><?php esc_html_e('BeiduoFengou WooCommerce Add to Cart Customizer 需要更新数据库结构。', 'bdf-custom-add-to-cart'); ?></p>
<p><a href="<?php echo esc_url(wp_nonce_url(add_query_arg('do_bdf_upgrade', 'true'), 'bdf_upgrade_db')); ?>" class="button button-primary"><?php esc_html_e('立即更新', 'bdf-custom-add-to-cart'); ?></a></p>
</div>
<?php
}
}

/**
* 检查是否需要升级数据库
*
* @since 1.1.0
* @access private
* @return boolean
*/
private function needs_db_upgrade() {
$installed_version = get_option('bdf_cart_version');
return version_compare($installed_version, $this->version, '<');
}

/**
* 获取插件设置
*
* @since 1.1.0
* @access public
* @param string $key 设置键名
* @param mixed $default 默认值
* @return mixed
*/
public function get_setting($key, $default = false) {
return isset($this->settings[$key]) ? $this->settings[$key] : $default;
}

/**
* 更新插件设置
*
* @since 1.1.0
* @access public
* @param string $key 设置键名
* @param mixed $value 设置值
* @return boolean
*/
public function update_setting($key, $value) {
$this->settings[$key] = $value;
return update_option('bdf_cart_settings', $this->settings);
}
}

assets/css/admin.css

/* BeiduoFengou WooCommerce Add to Cart Customizer Admin Styles */
.bdf-settings-wrap {
margin: 20px 0;
padding: 20px;
background: #fff;
border: 1px solid #ccd0d4;
box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.bdf-settings-header {
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 1px solid #eee;
}

.bdf-settings-header h1 {
margin: 0;
color: #23282d;
font-size: 24px;
font-weight: 400;
}

.bdf-settings-content {
max-width: 800px;
}

.bdf-field-row {
margin-bottom: 20px;
}

.bdf-field-row label {
display: block;
margin-bottom: 8px;
font-weight: 600;
}

.bdf-field-row input[type="text"] {
width: 100%;
max-width: 400px;
}

.bdf-schedule-item {
background: #f9f9f9;
border: 1px solid #e5e5e5;
margin-bottom: 15px;
padding: 15px;
position: relative;
}

.bdf-schedule-item .remove-schedule {
position: absolute;
right: 10px;
top: 10px;
color: #a00;
text-decoration: none;
}

.bdf-schedule-item .remove-schedule:hover {
color: #dc3232;
}

.bdf-schedule-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
}

/* 响应式样式 */
@media screen and (max-width: 782px) {
.bdf-schedule-grid {
grid-template-columns: 1fr;
}
}

/* 品牌色彩 */
.bdf-primary-button {
background: #96588a;
border-color: #96588a;
color: #fff;
padding: 8px 16px;
}

.bdf-primary-button:hover {
background: #7f4674;
border-color: #7f4674;
}

assets/js/admin.js
/* BeiduoFengou WooCommerce Add to Cart Customizer Admin Scripts */
jQuery(document).ready(function($) {
// 初始化颜色选择器
$('.bdf-color-picker').wpColorPicker();

// 添加新的定时计划
$('.add-schedule').on('click', function(e) {
e.preventDefault();

var template = $('#schedule-template').html();
var count = $('.bdf-schedule-item').length;
template = template.replace(/\{index\}/g, count);

$('.schedule-container').append(template);

// 重新初始化新添加项的日期选择器
$('.bdf-schedule-item:last').find('.date-picker').datepicker({
dateFormat: 'yy-mm-dd'
});
});

// 删除定时计划
$(document).on('click', '.remove-schedule', function(e) {
e.preventDefault();

if (confirm('确定要删除这个定时计划吗?')) {
$(this).closest('.bdf-schedule-item').slideUp(300, function() {
$(this).remove();
});
}
});

// 表单提交前验证
$('form.bdf-settings-form').on('submit', function(e) {
var hasError = false;
$('.bdf-schedule-item').each(function() {
var $item = $(this);
var startDate = $item.find('.start-date').val();
var endDate = $item.find('.end-date').val();

if (startDate && endDate) {
if (new Date(startDate) > new Date(endDate)) {
alert('结束日期必须晚于开始日期');
hasError = true;
return false;
}
}
});

if (hasError) {
e.preventDefault();
}
});

// 实时预览功能
$('.bdf-text-preview').on('input', function() {
var previewText = $(this).val() || '加入购物车';
$('.bdf-preview-button').text(previewText);
});
});

languages/bdf-custom-add-to-cart.pot

# Copyright (C) 2024 BeiduoFengou
# This file is distributed under the same license as the BeiduoFengou WooCommerce Add to Cart Customizer plugin.
msgid ""
msgstr ""
"Project-Id-Version: BeiduoFengou WooCommerce Add to Cart Customizer 1.1.0\n"
"Report-Msgid-Bugs-To: https://beiduofengou.net/support\n"
"POT-Creation-Date: 2024-02-15 09:25:04+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2024-MO-DA HO:MI+ZONE\n"
"Last-Translator: BeiduoFengou <[email protected]>\n"
"Language-Team: BeiduoFengou <[email protected]>\n"
"X-Generator: BeiduoFengou WooCommerce Add to Cart Customizer\n"

#: beiduofengou-custom-add-to-cart.php:89
msgid "BeiduoFengou WooCommerce Add to Cart Customizer 需要安装并激活 WooCommerce 才能使用。"
msgstr ""

#: includes/class-bdf-cart-customizer.php:156
msgid "BeiduoFengou 购物车定制"
msgstr ""

#: includes/class-bdf-cart-customizer.php:157
msgid "购物车定制"
msgstr ""

#: includes/class-bdf-cart-customizer.php:167
msgid "基本设置"
msgstr ""

#: includes/class-bdf-cart-customizer.php:175
msgid "定时设置"
msgstr ""

#: includes/class-bdf-cart-customizer.php:183
msgid "高级功能"
msgstr ""

#: includes/class-bdf-cart-customizer.php:205
msgid "基本按钮文本设置"
msgstr ""

#: includes/class-bdf-cart-customizer.php:214
msgid "单品页按钮文本"
msgstr ""

#: includes/class-bdf-cart-customizer.php:217
msgid "设置单个商品页面的\"加入购物车\"按钮文本"
msgstr ""

#: includes/class-bdf-cart-customizer.php:223
msgid "商品列表页按钮文本"
msgstr ""

#: includes/class-bdf-cart-customizer.php:226
msgid "设置商品列表页面的\"加入购物车\"按钮文本"
msgstr ""

常见问题解答

 

  1. 问:如何在不同页面使用不同的按钮文本?
    答:在基本设置中,您可以分别为单品页面和商品列表页面设置不同的文本。
  2. 问:是否支持表情符号?
    答:是的,您可以直接在文本中使用表情符号。

Leave a Comment