PluginProbe
seQura / 4.3.0
seQura v4.3.0
4.3.4 4.3.3 4.3.2 4.3.1 trunk 2.0.0 2.0.10 2.0.11 2.0.12 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 3.0.0 3.0.2 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 4.0.0 All 30 releases
sequra / templates / front / mini_widget.php

mini_widget.php in seQura 4.3.0, at templates/front/mini_widget.php

45 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Mini Widget template
4 *
5 * @package SeQura/WC
6 * @var array<string, string> $args The arguments. Must contain:
7 * - string 'product' The seQura payment method identifier.
8 * - string 'campaign' The seQura campaign identifier.
9 * - string 'dest' The CSS selector to place the widget.
10 * - string 'price' The CSS selector for the price.
11 * - string 'message' The message to show.
12 * - string 'message_below_limit' The message to show when the amount is below the limit.
13 * - int min_amount The minimum amount to show the widget.
14 * - ?int max_amount The maximum amount to show the widget.
15 */
16
17 defined( 'WPINC' ) || die;
18
19 // Check if the variables are defined.
20 if ( ! isset(
21 $args['product'],
22 $args['campaign'],
23 $args['dest'],
24 $args['price'],
25 $args['message'],
26 $args['message_below_limit'],
27 $args['min_amount']
28 ) ) {
29 return;
30 }
31
32 //phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
33 ?>
34 <script type='text/javascript'>
35 SequraWidgetFacade.miniWidgets && SequraWidgetFacade.miniWidgets.push({
36 product: <?php echo wp_json_encode( $args['product'] ); ?>,
37 dest: <?php echo wp_json_encode( $args['dest'] ); ?>,
38 priceSel: <?php echo wp_json_encode( $args['price'] ); ?>,
39 campaign: <?php echo wp_json_encode( $args['campaign'] ); ?>,
40 message: <?php echo wp_json_encode( $args['message'] ); ?>,
41 messageBelowLimit: <?php echo wp_json_encode( $args['message_below_limit'] ); ?>,
42 minAmount: <?php echo wp_json_encode( $args['min_amount'] ); ?>,
43 maxAmount: <?php echo $args['max_amount'] ? wp_json_encode( $args['max_amount'] ) : 'null'; ?>
44 });
45 </script>