PluginProbe
seQura / 3.0.0
seQura v3.0.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 / widget.php

widget.php in seQura 3.0.0, at templates/front/widget.php

48 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 * 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 'alt_price' The CSS selector for the alternative price.
12 * - string 'is_alt_price' The CSS selector to determine if the product has an alternative price.
13 * - string 'reg_amount' The registration amount.
14 * - string 'theme' The theme to use.
15 */
16
17 defined( 'WPINC' ) || die;
18
19 // Check if the variables are defined.
20 if ( ! isset(
21 $args['product'],
22 $args['dest'],
23 $args['theme'],
24 $args['reverse'],
25 $args['campaign'],
26 $args['price'],
27 $args['alt_price'],
28 $args['is_alt_price'],
29 $args['reg_amount']
30 ) ) {
31 return;
32 }
33 //phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
34 ?>
35
36 <script type='text/javascript'>
37 SequraWidgetFacade.widgets && SequraWidgetFacade.widgets.push({
38 product: "<?php echo esc_js( $args['product'] ); ?>",
39 dest: "<?php echo wp_strip_all_tags( $args['dest'] ); ?>",
40 theme: "<?php echo esc_js( $args['theme'] ); ?>",
41 reverse: "<?php echo esc_js( $args['reverse'] ); ?>",
42 campaign: "<?php echo esc_js( $args['campaign'] ); ?>",
43 priceSel: "<?php echo wp_strip_all_tags( $args['price'] ); ?>",
44 variationPriceSel: "<?php echo wp_strip_all_tags( $args['alt_price'] ); ?>",
45 isVariableSel: "<?php echo wp_strip_all_tags( $args['is_alt_price'] ); ?>",
46 registrationAmount: "<?php echo esc_js( $args['reg_amount'] ); ?>",
47 });
48 </script>