PluginProbe
Tiered Pricing Table for WooCommerce / 7.1.1
Tiered Pricing Table for WooCommerce v7.1.1
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
tier-pricing-table / src / Addons / PluginsRecommendations / CancellationSurveysPlugin.php

CancellationSurveysPlugin.php in Tiered Pricing Table for WooCommerce 7.1.1, at src/Addons/PluginsRecommendations/CancellationSurveysPlugin.php

88 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Addons\PluginsRecommendations;
2
3 use TierPricingTable\Admin\Tips\Tip;
4
5 class CancellationSurveysPlugin extends Tip {
6
7 public function __construct() {
8 parent::__construct();
9
10 add_action( 'woocommerce_subscriptions_product_options_pricing', array( $this, 'render' ), 10, 1 );
11
12 add_filter( 'tiered_pricing_table/admin/tips/get_tip_by_slug', function ( $tip, $slug ) {
13 if ( $slug === $this->getSlug() ) {
14 return $this;
15 }
16
17 return $tip;
18 }, 10, 2 );
19 }
20
21 public function render() {
22
23 if ( $this->isSeen() ) {
24 return;
25 }
26
27 ?>
28 <div class="">
29 <div class="tiered-pricing-tip"
30 style="margin: 12px; padding: 10px; background: #fafafa; border: 1px solid #eeeeee; display: flex; gap: 10px; justify-content: space-between">
31 <div style="display:flex; gap: 10px; ">
32 <div style="color: #2272b1; margin: 0 5px;">
33 <span class="dashicons dashicons-admin-post"></span>
34 </div>
35 <div>
36
37 <div>
38 <strong>
39 <?php esc_html_e( 'Tip', 'tier-pricing-table' ); ?>:
40 </strong>
41 You can <b>increase retention for subscriptions</b> by offering discounts and
42 collecting feedback with surveys when customers consider canceling.
43 </div>
44
45 <div style="margin-top: 10px;">
46 Offer a discount to customers who are considering canceling their subscription. You can also
47 collect feedback from customers who have canceled their subscription to understand why they
48 left.
49 </div>
50
51 <div style="margin-top: 10px;">
52 <a target="_blank"
53 href="https://woocommerce.com/products/cancellation-survey-and-offers-for-woocommerce-subscriptions/">
54 <?php esc_html_e( 'Learn more', 'tier-pricing-table' ); ?>
55 <svg style="
56 width: 0.8rem;
57 height: 0.8rem;
58 stroke: currentColor;
59 fill: none;"
60 xmlns='http://www.w3.org/2000/svg'
61 stroke-width='10' stroke-dashoffset='0'
62 stroke-dasharray='0' stroke-linecap='round'
63 stroke-linejoin='round' viewBox='0 0 100 100'>
64 <polyline fill="none" points="40 20 20 20 20 90 80 90 80 60"/>
65 <polyline fill="none" points="60 10 90 10 90 40"/>
66 <line fill="none" x1="89" y1="11" x2="50" y2="50"/>
67 </svg>
68 </a>
69 </div>
70 </div>
71 </div>
72
73 <div style="white-space: nowrap;">
74 <a role="button" href="<?php echo esc_attr( $this->getMarkAsSeenURL() ); ?>"
75 class="tiered-pricing-tip-close-button">
76 &times; <?php esc_html_e( 'Hide this tip', 'tier-pricing-table' ); ?>
77 </a>
78 </div>
79 </div>
80 </div>
81 <?php
82 }
83
84 public function getSlug(): string {
85 return 'cancellation-surveys-recommendation';
86 }
87 }
88