PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 1.10.3
Subscriptions for WooCommerce with Stripe Recurring Payments v1.10.3
2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 All 61 releases
subscription / includes / Admin / views / delivery-preview.php

delivery-preview.php in Subscriptions for WooCommerce with Stripe Recurring Payments 1.10.3, at includes/Admin/views/delivery-preview.php

289 lines 10.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Delivery Schedules page — interactive preview with sample data (shown when Pro is not active).
4 *
5 * @package SpringDevs\Subscription\Admin
6 */
7
8 defined( 'ABSPATH' ) || exit;
9
10 $upgrade_url = 'https://wpsubscription.co/?utm_source=plugin&utm_medium=admin&utm_campaign=upgrade_pro';
11 $currency = function_exists( 'get_woocommerce_currency_symbol' ) ? get_woocommerce_currency_symbol() : '$';
12
13 $dummy_deliveries = array(
14 array(
15 'id' => 301,
16 'subscription_id' => 1042,
17 'product' => 'Monthly Wellness Box',
18 'customer' => 'Sarah Johnson',
19 'email' => 'sarah.j@example.com',
20 'status' => 'waiting',
21 'ship_on' => '2026-06-10',
22 'shipped_on' => '',
23 'address' => '42 Maple Street, Boston, MA 02101',
24 ),
25 array(
26 'id' => 302,
27 'subscription_id' => 1087,
28 'product' => 'Annual Premium Plan',
29 'customer' => 'Marcus Williams',
30 'email' => 'marcus.w@example.com',
31 'status' => 'shipped',
32 'ship_on' => '2026-05-15',
33 'shipped_on' => '2026-05-16',
34 'address' => '18 Oak Avenue, Chicago, IL 60601',
35 ),
36 array(
37 'id' => 303,
38 'subscription_id' => 1103,
39 'product' => 'Basic Weekly Kit',
40 'customer' => 'Emma Clarke',
41 'email' => 'emma.c@example.com',
42 'status' => 'in_process',
43 'ship_on' => '2026-06-07',
44 'shipped_on' => '',
45 'address' => '7 Pine Road, Austin, TX 78701',
46 ),
47 array(
48 'id' => 304,
49 'subscription_id' => 1155,
50 'product' => 'Monthly Wellness Box',
51 'customer' => 'Linda Zhao',
52 'email' => 'linda.z@example.com',
53 'status' => 'waiting',
54 'ship_on' => '2026-06-12',
55 'shipped_on' => '',
56 'address' => '99 Birch Lane, Seattle, WA 98101',
57 ),
58 array(
59 'id' => 305,
60 'subscription_id' => 1189,
61 'product' => 'Starter Bundle',
62 'customer' => 'James O\'Brien',
63 'email' => 'j.obrien@example.com',
64 'status' => 'cancelled',
65 'ship_on' => '2026-05-28',
66 'shipped_on' => '',
67 'address' => '15 Cedar Blvd, Miami, FL 33101',
68 ),
69 );
70
71 $badge_map = array(
72 'waiting' => array(
73 'mod' => 'pending',
74 'label' => __( 'Waiting', 'subscription' ),
75 ),
76 'in_process' => array(
77 'mod' => 'active',
78 'label' => __( 'In Process', 'subscription' ),
79 ),
80 'shipped' => array(
81 'mod' => 'active',
82 'label' => __( 'Shipped', 'subscription' ),
83 ),
84 'cancelled' => array(
85 'mod' => 'cancelled',
86 'label' => __( 'Cancelled', 'subscription' ),
87 ),
88 );
89
90 $month_options = array(
91 array(
92 'value' => '',
93 'label' => __( 'All Dates', 'subscription' ),
94 ),
95 array(
96 'value' => '2026-06',
97 'label' => 'June 2026',
98 ),
99 array(
100 'value' => '2026-05',
101 'label' => 'May 2026',
102 ),
103 array(
104 'value' => '2026-04',
105 'label' => 'April 2026',
106 ),
107 );
108 ?>
109
110 <div class="wp-subscription-admin-content list-page subscrpt-subs-list">
111
112 <!-- Disclaimer banner -->
113 <div style="background:#fffbeb;border:1px solid #fcd34d;border-radius:8px;padding:12px 16px;margin-bottom:20px;display:flex;align-items:flex-start;gap:10px;">
114 <svg width="18" height="18" fill="none" viewBox="0 0 24 24" stroke="#d97706" style="flex-shrink:0;margin-top:1px;" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
115 <p style="margin:0;font-size:13px;color:#92400e;line-height:1.5;">
116 <strong><?php esc_html_e( 'Preview with sample data.', 'subscription' ); ?></strong>
117 <?php esc_html_e( 'This page shows example data to illustrate the feature.', 'subscription' ); ?>
118 <a href="<?php echo esc_url( $upgrade_url ); ?>" target="_blank" rel="noreferrer noopener" style="color:#b45309;font-weight:600;text-decoration:underline;"><?php esc_html_e( 'Upgrade to Pro', 'subscription' ); ?></a>
119 <?php esc_html_e( 'to manage real delivery schedules.', 'subscription' ); ?>
120 </p>
121 </div>
122
123 <!-- Page header -->
124 <div style="margin-bottom:20px;">
125 <h1 style="font-size:1.375rem;font-weight:700;color:var(--wpsubs-text);margin:0 0 6px;line-height:1.2;"><?php esc_html_e( 'Delivery Schedules', 'subscription' ); ?></h1>
126 <p style="font-size:13px;color:var(--wpsubs-text-muted);margin:0 0 12px;line-height:1.5;"><?php esc_html_e( 'Track and manage subscription delivery schedules.', 'subscription' ); ?></p>
127 <div style="border-top:1px dashed #d0d3d7;"></div>
128 </div>
129
130 <!-- Toolbar -->
131 <div class="wpsubs-toolbar" style="margin-top:0;">
132 <?php
133 wpsubs_render_adv_select(
134 array(
135 'name' => 'subscrpt_status',
136 'value' => '',
137 'placeholder' => __( 'All Statuses', 'subscription' ),
138 'align' => 'left',
139 'options' => array(
140 array(
141 'value' => '',
142 'label' => __( 'All Statuses', 'subscription' ),
143 ),
144 array(
145 'value' => 'waiting',
146 'label' => __( 'Waiting', 'subscription' ),
147 ),
148 array(
149 'value' => 'in_process',
150 'label' => __( 'In Process', 'subscription' ),
151 ),
152 array(
153 'value' => 'shipped',
154 'label' => __( 'Shipped', 'subscription' ),
155 ),
156 array(
157 'value' => 'cancelled',
158 'label' => __( 'Cancelled', 'subscription' ),
159 ),
160 ),
161 )
162 );
163 wpsubs_render_adv_select(
164 array(
165 'name' => 'date_filter',
166 'value' => '',
167 'placeholder' => __( 'All Dates', 'subscription' ),
168 'align' => 'left',
169 'options' => $month_options,
170 )
171 );
172 ?>
173 <div class="wpsubs-search">
174 <div class="wpsubs-input-wrap wpsubs-input-wrap--icon-l">
175 <svg class="wpsubs-input-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-4.35-4.35M17 11A6 6 0 105 11a6 6 0 0012 0z"/></svg>
176 <input type="search" class="wpsubs-input" placeholder="<?php esc_attr_e( 'Search by subscription ID...', 'subscription' ); ?>" disabled style="cursor:not-allowed;" />
177 </div>
178 </div>
179 <button type="button" class="wpsubs-btn wpsubs-btn--outline" disabled style="cursor:not-allowed;opacity:0.6;"><?php esc_html_e( 'Filter', 'subscription' ); ?></button>
180 <div class="wpsubs-toolbar__spacer"></div>
181 <?php
182 wpsubs_render_adv_select(
183 array(
184 'name' => 'per_page',
185 'value' => '20',
186 'placeholder' => '20 per page',
187 'align' => 'right',
188 'options' => array(
189 array(
190 'value' => '10',
191 'label' => __( '10 per page', 'subscription' ),
192 ),
193 array(
194 'value' => '20',
195 'label' => __( '20 per page', 'subscription' ),
196 ),
197 array(
198 'value' => '50',
199 'label' => __( '50 per page', 'subscription' ),
200 ),
201 array(
202 'value' => '100',
203 'label' => __( '100 per page', 'subscription' ),
204 ),
205 ),
206 )
207 );
208 ?>
209 <button type="button" class="wpsubs-btn wpsubs-btn--outline" disabled style="cursor:not-allowed;opacity:0.6;">
210 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/></svg>
211 <?php esc_html_e( 'Print Addresses', 'subscription' ); ?>
212 </button>
213 </div>
214
215 <div class="wpsubs-table-card">
216 <table class="wpsubs-table">
217 <thead>
218 <tr>
219 <th class="wpsubs-col--check">
220 <input type="checkbox" class="wpsubs-checkbox" disabled />
221 </th>
222 <th><?php esc_html_e( 'Subscription', 'subscription' ); ?></th>
223 <th><?php esc_html_e( 'Customer', 'subscription' ); ?></th>
224 <th><?php esc_html_e( 'Status', 'subscription' ); ?></th>
225 <th class="wpsubs-col--nowrap"><?php esc_html_e( 'Shipping On', 'subscription' ); ?></th>
226 <th class="wpsubs-col--nowrap"><?php esc_html_e( 'Shipped On', 'subscription' ); ?></th>
227 <th><?php esc_html_e( 'Delivery Info', 'subscription' ); ?></th>
228 </tr>
229 </thead>
230 <tbody>
231 <?php foreach ( $dummy_deliveries as $delivery ) : ?>
232 <?php
233 $name_parts = array_values( array_filter( explode( ' ', $delivery['customer'] ) ) );
234 $initials = '';
235 foreach ( array_slice( $name_parts, 0, 2 ) as $part ) {
236 $initials .= strtoupper( $part[0] );
237 }
238 $color_slot = ord( strtolower( $initials[0] ?? 'a' ) ) % 8;
239 $badge = $badge_map[ $delivery['status'] ] ?? array(
240 'mod' => 'pending',
241 'label' => $delivery['status'],
242 );
243 ?>
244 <tr>
245 <td class="wpsubs-col--check">
246 <input type="checkbox" class="wpsubs-checkbox" disabled />
247 </td>
248 <td>
249 <span class="wpsubs-cell-title" style="font-weight:600;"><?php echo esc_html( $delivery['product'] ); ?></span>
250 <span class="wpsubs-cell-id">#<?php echo esc_html( $delivery['subscription_id'] ); ?></span>
251 </td>
252 <td>
253 <div class="wpsubs-customer">
254 <div class="wpsubs-avatar" data-color="<?php echo (int) $color_slot; ?>"><?php echo esc_html( $initials ); ?></div>
255 <div class="wpsubs-customer__info">
256 <span class="wpsubs-customer__name"><?php echo esc_html( $delivery['customer'] ); ?></span>
257 <span class="wpsubs-customer__sub"><?php echo esc_html( $delivery['email'] ); ?></span>
258 </div>
259 </div>
260 </td>
261 <td>
262 <span class="wpsubs-badge wpsubs-badge--<?php echo esc_attr( $badge['mod'] ); ?>"><?php echo esc_html( $badge['label'] ); ?></span>
263 </td>
264 <td class="wpsubs-col--nowrap">
265 <span class="wpsubs-cell-title" style="font-weight:400;"><?php echo esc_html( $delivery['ship_on'] ); ?></span>
266 </td>
267 <td class="wpsubs-col--nowrap">
268 <?php if ( $delivery['shipped_on'] ) : ?>
269 <span class="wpsubs-cell-title" style="font-weight:400;"><?php echo esc_html( $delivery['shipped_on'] ); ?></span>
270 <?php else : ?>
271 <span style="color:var(--wpsubs-text-subtle);">&#8212;</span>
272 <?php endif; ?>
273 </td>
274 <td>
275 <span class="wpsubs-cell-id"><?php echo esc_html( $delivery['address'] ); ?></span>
276 </td>
277 </tr>
278 <?php endforeach; ?>
279 </tbody>
280 </table>
281 </div>
282
283 </div>
284
285 <?php
286 $modal_title = __( 'Unlock Delivery Schedules', 'subscription' );
287 $modal_desc = __( 'Delivery Schedules requires WPSubscription Pro. Unlock advanced features, priority support, and more with WPSubscription Pro.', 'subscription' );
288 require __DIR__ . '/pro-upgrade-modal.php';
289