| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Add To Cart Text — Option group definitions. |
| 5 |
* |
| 6 |
* Pure data file. Returns the option groups array |
| 7 |
* consumed by init_option_groups(). |
| 8 |
* |
| 9 |
* @package Merchant |
| 10 |
*/ |
| 11 |
|
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; // Exit if accessed directly |
| 14 |
} |
| 15 |
|
| 16 |
// Settings |
| 17 |
|
| 18 |
return array( |
| 19 |
array( |
| 20 |
'module' => Merchant_Add_To_Cart_Text::MODULE_ID, |
| 21 |
'title' => esc_html__( 'Simple Product', 'merchant' ), |
| 22 |
'fields' => array( |
| 23 |
array( |
| 24 |
'id' => 'simple_product_shop_label', |
| 25 |
'type' => 'text', |
| 26 |
'title' => esc_html__( 'Label', 'merchant' ), |
| 27 |
'default' => esc_html__( 'Add to cart', 'merchant' ), |
| 28 |
|
| 29 |
), |
| 30 |
array( |
| 31 |
'id' => 'simple_product_shop_label_info', |
| 32 |
'type' => 'info', |
| 33 |
/* Translators: 1. Link open tag 2. Link close tag */ |
| 34 |
'content' => sprintf( esc_html__( 'If you want to add a different label for each product, go to %1$sProducts%2$s, edit the desired product, set the label inside the metabox.', |
| 35 |
'merchant' ), |
| 36 |
'<a href="' . esc_url( admin_url( 'edit.php?post_type=product' ) ) . '">', |
| 37 |
'</a>' ), |
| 38 |
), |
| 39 |
|
| 40 |
array( |
| 41 |
'id' => 'simple_product_custom_single_label', |
| 42 |
'type' => 'switcher', |
| 43 |
'title' => __( 'Customize label on single product page', 'merchant' ), |
| 44 |
'default' => 0, |
| 45 |
'ai_meta' => array( |
| 46 |
'toggle_for' => 'simple_product_label', |
| 47 |
'usage_hint' => 'Enable this toggle before setting simple_product_label. When disabled, the shop label is used on single product pages as well.', |
| 48 |
), |
| 49 |
), |
| 50 |
|
| 51 |
array( |
| 52 |
'id' => 'simple_product_label', |
| 53 |
'type' => 'text', |
| 54 |
'title' => esc_html__( 'Label on single product page', 'merchant' ), |
| 55 |
'default' => esc_html__( 'Add to cart', 'merchant' ), |
| 56 |
'condition' => array( 'simple_product_custom_single_label', '==', '1' ), |
| 57 |
'ai_meta' => array( |
| 58 |
'toggled_by' => 'simple_product_custom_single_label', |
| 59 |
'usage_hint' => 'Add-to-cart button label on the single product page for simple products. Only active when simple_product_custom_single_label=1.', |
| 60 |
), |
| 61 |
), |
| 62 |
), |
| 63 |
), |
| 64 |
array( |
| 65 |
'module' => Merchant_Add_To_Cart_Text::MODULE_ID, |
| 66 |
'title' => esc_html__( 'Variable Product', 'merchant' ), |
| 67 |
'fields' => array( |
| 68 |
array( |
| 69 |
'id' => 'variable_product_shop_label', |
| 70 |
'type' => 'text', |
| 71 |
'title' => esc_html__( 'Label', 'merchant' ), |
| 72 |
'default' => esc_html__( 'Select options', 'merchant' ), |
| 73 |
|
| 74 |
), |
| 75 |
array( |
| 76 |
'id' => 'variable_product_shop_label_info', |
| 77 |
'type' => 'info', |
| 78 |
/* Translators: 1. Link open tag 2. Link close tag */ |
| 79 |
'content' => sprintf( esc_html__( 'If you want to add a different label for each product, go to %1$sProducts%2$s, edit the desired product, set the label inside the metabox.', |
| 80 |
'merchant' ), |
| 81 |
'<a href="' . esc_url( admin_url( 'edit.php?post_type=product' ) ) . '">', |
| 82 |
'</a>' ), |
| 83 |
), |
| 84 |
|
| 85 |
array( |
| 86 |
'id' => 'variable_product_custom_single_label', |
| 87 |
'type' => 'switcher', |
| 88 |
'title' => __( 'Customize label on single product page', 'merchant' ), |
| 89 |
'default' => 0, |
| 90 |
'ai_meta' => array( |
| 91 |
'toggle_for' => 'variable_product_label', |
| 92 |
'usage_hint' => 'Enable this toggle before setting variable_product_label. When disabled, the variable shop label is used on single product pages as well.', |
| 93 |
), |
| 94 |
), |
| 95 |
|
| 96 |
array( |
| 97 |
'id' => 'variable_product_label', |
| 98 |
'type' => 'text', |
| 99 |
'title' => esc_html__( 'Label on single product page', 'merchant' ), |
| 100 |
'default' => esc_html__( 'Add to cart', 'merchant' ), |
| 101 |
'condition' => array( 'variable_product_custom_single_label', '==', '1' ), |
| 102 |
'ai_meta' => array( |
| 103 |
'toggled_by' => 'variable_product_custom_single_label', |
| 104 |
'usage_hint' => 'Add-to-cart button label on the single product page for variable products. Only active when variable_product_custom_single_label=1.', |
| 105 |
), |
| 106 |
), |
| 107 |
), |
| 108 |
), |
| 109 |
array( |
| 110 |
'module' => Merchant_Add_To_Cart_Text::MODULE_ID, |
| 111 |
'title' => esc_html__( 'Out of Stock Product', 'merchant' ), |
| 112 |
'fields' => array( |
| 113 |
array( |
| 114 |
'id' => 'out_of_stock_custom_label', |
| 115 |
'type' => 'switcher', |
| 116 |
'title' => __( 'Alter the label text when the product is out of stock', 'merchant' ), |
| 117 |
'default' => 0, |
| 118 |
'ai_meta' => array( |
| 119 |
'toggle_for' => 'out_of_stock_shop_label', |
| 120 |
'usage_hint' => 'Enable this toggle before setting out_of_stock_shop_label. When enabled, out-of-stock products show a custom button label instead of the default.', |
| 121 |
), |
| 122 |
), |
| 123 |
array( |
| 124 |
'id' => 'out_of_stock_shop_label', |
| 125 |
'type' => 'text', |
| 126 |
'title' => esc_html__( 'Label', 'merchant' ), |
| 127 |
'default' => esc_html__( 'Out of stock', 'merchant' ), |
| 128 |
'condition' => array( 'out_of_stock_custom_label', '==', '1' ), |
| 129 |
'ai_meta' => array( |
| 130 |
'toggled_by' => 'out_of_stock_custom_label', |
| 131 |
'usage_hint' => 'Button label shown on out-of-stock products in the shop. Only active when out_of_stock_custom_label=1.', |
| 132 |
), |
| 133 |
), |
| 134 |
), |
| 135 |
), |
| 136 |
); |
| 137 |
|