PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.8
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.8
2.3.2 2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 All 60 releases
merchant / templates / modules / free-gifts / widget-contents.php

widget-contents.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 1.8, at templates/modules/free-gifts/widget-contents.php

55 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template for displaying the free gifts module widget contents
4 *
5 * @var $args array template args
6 *
7 * @since 1.0
8 */
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit; // Exit if accessed directly
12 }
13
14 $settings = isset( $args['settings'] ) ? $args['settings'] : array();
15 ?>
16
17 <?php foreach ( $args['offers'] as $offer ): ?>
18 <?php if ( $args['cart_total'] < $offer['amount'] ) : ?>
19 <div class="merchant-free-gifts-widget-offer">
20 <div class="merchant-free-gifts-widget-offer-label">
21 <?php
22 $amount = wc_price( $offer['amount'] - $args['cart_total'] );
23 echo isset( $settings['spending_text'] )
24 ? wp_kses( str_replace(
25 '{amount}',
26 $amount,
27 sanitize_text_field( Merchant_Translator::translate( $settings['spending_text'] ) )
28 ), merchant_kses_allowed_tags( ['bdi'] ) )
29 : wp_kses(
30 /* Translators: 1. Amount */
31 sprintf( __( 'Spend %s more to receive this free gift!', 'merchant' ), $amount ),
32 merchant_kses_allowed_tags( ['bdi'] )
33 ); ?>
34 </div>
35 <div class="merchant-free-gifts-widget-offer-product">
36 <?php echo wp_kses_post( $offer['product']['image'] ); ?>
37 <div class="merchant-free-gifts-widget-offer-product-contents">
38 <p class="woocommerce-loop-product__title">
39 <a class="merchant-free-gifts-widget-offer-product-title" href="<?php echo esc_url( $offer['product']['permalink'] ); ?>" target="_blank">
40 <?php echo esc_html( $offer['product']['title'] ); ?>
41 </a>
42 </p>
43 <div class="merchant-free-gifts-widget-offer-product-price price">
44 <del>
45 <?php echo wp_kses( wc_price( $offer['product']['price'] ), merchant_kses_allowed_tags( array( 'bdi' ) ) ); ?>
46 </del>
47 <strong class="merchant-free-gifts-widget-offer-product-free">
48 <?php echo isset( $settings['free_text'] ) ? esc_html( Merchant_Translator::translate( $settings['free_text'] ) ) : esc_html__( 'Free', 'merchant' ) ?>
49 </strong>
50 </div>
51 </div>
52 </div>
53 </div>
54 <?php endif; ?>
55 <?php endforeach; ?>