Skip to content

Commit a8b627f

Browse files
Widget v4 (#23)
1 parent 3f4dc4c commit a8b627f

File tree

7 files changed

+213
-85
lines changed

7 files changed

+213
-85
lines changed

plugin/aplazame.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ class WC_Aplazame_Install {
327327
'description' => 'Compra primero y paga después con <a href="https://aplazame.com" target="_blank">Aplazame</a>.',
328328
'product_default_instalments' => '',
329329
'cart_default_instalments' => '',
330+
'product_widget_primary_color' => '#334bff',
331+
'cart_widget_primary_color' => '#334bff',
332+
'product_widget_layout' => 'horizontal',
333+
'cart_widget_layout' => 'horizontal',
334+
'widget_legacy' => 'no',
330335
);
331336

332337
public static function upgrade() {
@@ -356,11 +361,8 @@ public static function upgrade() {
356361
if ( isset( $aplazame->settings['title_instalments'] ) ) {
357362
$aplazame->settings['title'] = $aplazame->settings['title_instalments'];
358363
}
359-
if ( ! isset( $aplazame->settings['title'] ) ) {
360-
$aplazame->settings['title'] = self::$defaultSettings['title'];
361-
}
362-
if ( ! isset( $aplazame->settings['description'] ) ) {
363-
$aplazame->settings['description'] = self::$defaultSettings['description'];
364+
if ( ! isset( $aplazame->settings['widget_legacy'] ) ) {
365+
$aplazame->settings['widget_legacy'] = 'yes';
364366
}
365367
self::save_settings( $aplazame->settings );
366368

plugin/classes/wc-aplazame-gateway.php

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function init_form_fields() {
203203
),
204204
'sandbox' => array(
205205
'type' => 'checkbox',
206-
'title' => __( 'Test mode (Sandbox)' ),
206+
'title' => __( 'Test mode (Sandbox)', 'aplazame' ),
207207
'description' => __( 'Determines if the module is on Sandbox mode', 'aplazame' ),
208208
'label' => __( 'Turn on Sandbox', 'aplazame' ),
209209
),
@@ -215,8 +215,14 @@ public function init_form_fields() {
215215
'required' => '',
216216
),
217217
),
218-
'instalments_section' => array(
219-
'title' => __( 'Flexible financing', 'aplazame' ),
218+
'widget_legacy' => array(
219+
'type' => 'checkbox',
220+
'title' => 'Widget legacy',
221+
'description' => __( 'Use widget legacy instead new widget', 'aplazame' ),
222+
'label' => __( 'Turn on widget legacy', 'aplazame' ),
223+
),
224+
'payment_section' => array(
225+
'title' => __( 'Payment method title and description', 'aplazame' ),
220226
'type' => 'title',
221227
'description' => '',
222228
),
@@ -266,6 +272,25 @@ public function init_form_fields() {
266272
'description' => __( 'Show legal notice in product widget', 'aplazame' ),
267273
'label' => __( 'Show legal notice', 'aplazame' ),
268274
),
275+
'product_widget_primary_color' => array(
276+
'type' => 'text',
277+
'css' => 'width:100px;',
278+
'class' => 'colorpick',
279+
'title' => __( 'Primary color', 'aplazame' ),
280+
'description' => __( 'Primary color hexadecimal code for product widget (only new widget)', 'aplazame' ),
281+
'default' => WC_Aplazame_Install::$defaultSettings['product_widget_primary_color'],
282+
'placeholder' => WC_Aplazame_Install::$defaultSettings['product_widget_primary_color'],
283+
),
284+
'product_widget_layout' => array(
285+
'type' => 'select',
286+
'title' => __( 'Layout', 'aplazame' ),
287+
'description' => __( 'Layout of product widget (only new widget)', 'aplazame' ),
288+
'options' => array(
289+
'horizontal' => 'Horizontal',
290+
'vertical' => 'Vertical',
291+
),
292+
'default' => WC_Aplazame_Install::$defaultSettings['product_widget_layout'],
293+
),
269294
'quantity_selector' => array(
270295
'type' => 'text',
271296
'title' => __( 'Product quantity CSS selector', 'aplazame' ),
@@ -317,6 +342,25 @@ public function init_form_fields() {
317342
'description' => __( 'Show legal notice in cart widget', 'aplazame' ),
318343
'label' => __( 'Show legal notice', 'aplazame' ),
319344
),
345+
'cart_widget_primary_color' => array(
346+
'type' => 'text',
347+
'css' => 'width:100px;',
348+
'class' => 'colorpick',
349+
'title' => __( 'Primary color', 'aplazame' ),
350+
'description' => __( 'Primary color hexadecimal code for cart widget (only new widget)', 'aplazame' ),
351+
'default' => WC_Aplazame_Install::$defaultSettings['cart_widget_primary_color'],
352+
'placeholder' => WC_Aplazame_Install::$defaultSettings['cart_widget_primary_color'],
353+
),
354+
'cart_widget_layout' => array(
355+
'type' => 'select',
356+
'title' => __( 'Layout', 'aplazame' ),
357+
'description' => __( 'Layout of cart widget (only new widget)', 'aplazame' ),
358+
'options' => array(
359+
'horizontal' => 'Horizontal',
360+
'vertical' => 'Vertical',
361+
),
362+
'default' => WC_Aplazame_Install::$defaultSettings['cart_widget_layout'],
363+
),
320364
'button_section' => array(
321365
'title' => __( 'Button', 'aplazame' ),
322366
'type' => 'title',
909 Bytes
Binary file not shown.

plugin/i18n/languages/aplazame.po

Lines changed: 73 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
msgid ""
22
msgstr ""
33
"Report-Msgid-Bugs-To: https://github.com/aplazame/woocommerce\n"
4-
"POT-Creation-Date: 2021-01-14 09:42+0000\n"
4+
"POT-Creation-Date: 2021-02-10 11:50+0000\n"
55
"Language: es_ES\n"
66
"MIME-Version: 1.0\n"
77
"Content-Type: text/plain; charset=UTF-8\n"
@@ -77,143 +77,179 @@ msgstr "Clave API privada"
7777
msgid "Aplazame API Private Key"
7878
msgstr "Clave API privada de Aplazame"
7979

80-
#: classes/wc-aplazame-gateway.php:219
81-
msgid "Flexible financing"
82-
msgstr "Pago a plazos"
80+
#: classes/wc-aplazame-gateway.php:221
81+
msgid "Use widget legacy instead new widget"
82+
msgstr "Usa el widget legacy en lugar del nuevo widget"
83+
84+
#: classes/wc-aplazame-gateway.php:222
85+
msgid "Turn on widget legacy"
86+
msgstr "Activar widget legacy"
8387

8488
#: classes/wc-aplazame-gateway.php:225
89+
msgid "Payment method title and description"
90+
msgstr "Título y descripción del método de pago"
91+
92+
#: classes/wc-aplazame-gateway.php:231
8593
msgid "Title"
8694
msgstr "Título"
8795

88-
#: classes/wc-aplazame-gateway.php:226
96+
#: classes/wc-aplazame-gateway.php:232
8997
msgid "Payment method title"
9098
msgstr "Título del método de pago"
9199

92-
#: classes/wc-aplazame-gateway.php:231
100+
#: classes/wc-aplazame-gateway.php:237
93101
msgid "Description"
94102
msgstr "Descripción"
95103

96-
#: classes/wc-aplazame-gateway.php:232
104+
#: classes/wc-aplazame-gateway.php:238
97105
msgid "Payment method description"
98106
msgstr "Descripción del método de pago"
99107

100-
#: classes/wc-aplazame-gateway.php:240
108+
#: classes/wc-aplazame-gateway.php:246
101109
msgid "Product widget"
102110
msgstr "Widget del producto"
103111

104-
#: classes/wc-aplazame-gateway.php:246 classes/wc-aplazame-gateway.php:298
112+
#: classes/wc-aplazame-gateway.php:252 classes/wc-aplazame-gateway.php:323
105113
msgid "Place to show"
106114
msgstr "Lugar a mostrar"
107115

108-
#: classes/wc-aplazame-gateway.php:247
116+
#: classes/wc-aplazame-gateway.php:253
109117
msgid "Widget place on product page"
110118
msgstr "Lugar del widget en la página del producto"
111119

112-
#: classes/wc-aplazame-gateway.php:249 classes/wc-aplazame-gateway.php:301
120+
#: classes/wc-aplazame-gateway.php:255 classes/wc-aplazame-gateway.php:326
113121
msgid "~ Not show ~"
114122
msgstr "~ No mostrar ~"
115123

116-
#: classes/wc-aplazame-gateway.php:250
124+
#: classes/wc-aplazame-gateway.php:256
117125
msgid "Before add to cart button"
118126
msgstr "Antes del botón de añadir al carrito"
119127

120-
#: classes/wc-aplazame-gateway.php:251
128+
#: classes/wc-aplazame-gateway.php:257
121129
msgid "After add to cart button"
122130
msgstr "Después del botón de añadir al carrito"
123131

124-
#: classes/wc-aplazame-gateway.php:252
132+
#: classes/wc-aplazame-gateway.php:258
125133
msgid "After summary"
126134
msgstr "Después del resumen"
127135

128-
#: classes/wc-aplazame-gateway.php:259 classes/wc-aplazame-gateway.php:310
136+
#: classes/wc-aplazame-gateway.php:265 classes/wc-aplazame-gateway.php:335
129137
msgid "Default instalments"
130138
msgstr "Cuotas por defecto"
131139

132-
#: classes/wc-aplazame-gateway.php:260
140+
#: classes/wc-aplazame-gateway.php:266
133141
msgid "Number of default instalments in product widget"
134142
msgstr "Número de cuotas por defecto en el widget del producto"
135143

136-
#: classes/wc-aplazame-gateway.php:261 classes/wc-aplazame-gateway.php:312
144+
#: classes/wc-aplazame-gateway.php:267 classes/wc-aplazame-gateway.php:337
137145
msgid "Optional (only numbers)"
138146
msgstr "Opcional (solo números)"
139147

140-
#: classes/wc-aplazame-gateway.php:265 classes/wc-aplazame-gateway.php:316
148+
#: classes/wc-aplazame-gateway.php:271 classes/wc-aplazame-gateway.php:341
141149
msgid "Legal notice"
142150
msgstr "Texto legal"
143151

144-
#: classes/wc-aplazame-gateway.php:266
152+
#: classes/wc-aplazame-gateway.php:272
145153
msgid "Show legal notice in product widget"
146154
msgstr "Mostrar texto legal en el widget del producto"
147155

148-
#: classes/wc-aplazame-gateway.php:267 classes/wc-aplazame-gateway.php:318
156+
#: classes/wc-aplazame-gateway.php:273 classes/wc-aplazame-gateway.php:343
149157
msgid "Show legal notice"
150158
msgstr "Mostrar texto legal"
151159

152-
#: classes/wc-aplazame-gateway.php:271
160+
#: classes/wc-aplazame-gateway.php:279 classes/wc-aplazame-gateway.php:349
161+
msgid "Primary color"
162+
msgstr "Color principal"
163+
164+
#: classes/wc-aplazame-gateway.php:280
165+
msgid "Primary color hexadecimal code for product widget (only new widget)"
166+
msgstr ""
167+
"Código hexadecimal del color principal para el widget del producto (sólo "
168+
"nuevo widget)"
169+
170+
#: classes/wc-aplazame-gateway.php:286 classes/wc-aplazame-gateway.php:356
171+
msgid "Layout"
172+
msgstr "Disposición"
173+
174+
#: classes/wc-aplazame-gateway.php:287
175+
msgid "Layout of product widget (only new widget)"
176+
msgstr "Disposición del widget del producto (sólo nuevo widget)"
177+
178+
#: classes/wc-aplazame-gateway.php:296
153179
msgid "Product quantity CSS selector"
154180
msgstr "Selector CSS del número de unidades del producto"
155181

156-
#: classes/wc-aplazame-gateway.php:272
182+
#: classes/wc-aplazame-gateway.php:297
157183
msgid "CSS selector pointing to product quantity"
158184
msgstr "Selector CSS para obtener la cantidad de producto"
159185

160-
#: classes/wc-aplazame-gateway.php:277
186+
#: classes/wc-aplazame-gateway.php:302
161187
msgid "Product price CSS selector"
162188
msgstr "Selector CSS del precio del producto"
163189

164-
#: classes/wc-aplazame-gateway.php:278
190+
#: classes/wc-aplazame-gateway.php:303
165191
msgid "CSS selector pointing to product price"
166192
msgstr "Selector CSS para obtener el precio del producto"
167193

168-
#: classes/wc-aplazame-gateway.php:283
194+
#: classes/wc-aplazame-gateway.php:308
169195
msgid "Variable product price CSS selector"
170196
msgstr "Selector CSS del precio variable del producto"
171197

172-
#: classes/wc-aplazame-gateway.php:284
198+
#: classes/wc-aplazame-gateway.php:309
173199
msgid "CSS selector pointing to variable product price"
174200
msgstr "Selector CSS para obtener el precio variable del producto"
175201

176-
#: classes/wc-aplazame-gateway.php:292
202+
#: classes/wc-aplazame-gateway.php:317
177203
msgid "Cart widget"
178204
msgstr "Widget del carrito"
179205

180-
#: classes/wc-aplazame-gateway.php:299
206+
#: classes/wc-aplazame-gateway.php:324
181207
msgid "Widget place on cart page"
182208
msgstr "Lugar del widget en la página del carrito"
183209

184-
#: classes/wc-aplazame-gateway.php:302
210+
#: classes/wc-aplazame-gateway.php:327
185211
msgid "Before cart totals"
186212
msgstr "Antes del total"
187213

188-
#: classes/wc-aplazame-gateway.php:303
214+
#: classes/wc-aplazame-gateway.php:328
189215
msgid "After cart totals"
190216
msgstr "Después del total"
191217

192-
#: classes/wc-aplazame-gateway.php:311
218+
#: classes/wc-aplazame-gateway.php:336
193219
msgid "Number of default instalments in cart widget"
194220
msgstr "Número de cuotas por defecto en el widget del carrito"
195221

196-
#: classes/wc-aplazame-gateway.php:317
222+
#: classes/wc-aplazame-gateway.php:342
197223
msgid "Show legal notice in cart widget"
198224
msgstr "Mostrar texto legal en el widget del carrito"
199225

200-
#: classes/wc-aplazame-gateway.php:321
226+
#: classes/wc-aplazame-gateway.php:350
227+
msgid "Primary color hexadecimal code for cart widget (only new widget)"
228+
msgstr ""
229+
"Código hexadecimal del color principal para el widget del carrito (sólo "
230+
"nuevo widget)"
231+
232+
#: classes/wc-aplazame-gateway.php:357
233+
msgid "Layout of cart widget (only new widget)"
234+
msgstr "Disposición del widget del carrito (sólo nuevo widget)"
235+
236+
#: classes/wc-aplazame-gateway.php:365
201237
msgid "Button"
202238
msgstr "Botón"
203239

204-
#: classes/wc-aplazame-gateway.php:327
240+
#: classes/wc-aplazame-gateway.php:371
205241
msgid "Button Selector"
206242
msgstr "Selector del botón"
207243

208-
#: classes/wc-aplazame-gateway.php:328
244+
#: classes/wc-aplazame-gateway.php:372
209245
msgid "Aplazame Button CSS Selector"
210246
msgstr "Selector CSS del botón de pago con Aplazame"
211247

212-
#: classes/wc-aplazame-gateway.php:336
248+
#: classes/wc-aplazame-gateway.php:380
213249
msgid "Button Image"
214250
msgstr "Imagen del botón"
215251

216-
#: classes/wc-aplazame-gateway.php:337
252+
#: classes/wc-aplazame-gateway.php:381
217253
msgid "Aplazame Button Image that you want to show"
218254
msgstr "Imagen del botón de pago con Aplazame que quieres mostrar"
219255

0 commit comments

Comments
 (0)