Changeset 3392144
- Timestamp:
- 11/08/2025 11:07:07 AM (5 months ago)
- Location:
- atomx-services/trunk
- Files:
-
- 4 edited
-
atomx-services.php (modified) (1 diff)
-
includes/Admin/class-atomx-wcs-admin.php (modified) (1 diff)
-
includes/Domain/class-atomx-wcs-subscriptions.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
atomx-services/trunk/atomx-services.php
r3391373 r3392144 4 4 * Plugin URI: https://dev.get-atomx.com/docs/en/purchase-verify-wp-wc 5 5 * Description: Generation of purchase codes/tokens for AtomX extension (or based on AtomX) for products and subscriptions 6 * Version: 2.0. 26 * Version: 2.0.3 7 7 * Author: AtomX 8 8 * Author URI: https://get-atomx.com -
atomx-services/trunk/includes/Admin/class-atomx-wcs-admin.php
r3391373 r3392144 270 270 <option value=""><?php esc_html_e('-- Select Product --', 'atomx-services'); ?></option> 271 271 </select> 272 273 <p class="description"> 274 <?php esc_html_e('The list does not show items that have already been added.', 'atomx-services'); ?> 275 </p> 276 272 277 </td> 273 278 </tr> -
atomx-services/trunk/includes/Domain/class-atomx-wcs-subscriptions.php
r3391373 r3392144 129 129 } 130 130 131 public function display_subscription_code($order) { 132 if (!function_exists('wcs_get_subscriptions_for_order')) { 133 return; 134 } 135 131 public function display_subscription_code($subscription) { 136 132 $special_options = get_option('atomx_settings_special_options'); 137 133 if (empty($special_options['field_auth_user_key_options'])) { … … 140 136 141 137 $options = get_option('atomx_settings_subs', array()); 142 $subscriptions_ids = wcs_get_subscriptions_for_order($order->get_id(), array('order_type' => 'any'));143 144 if (!$subscriptions_ids) {145 return;146 }147 148 138 $txt = isset($options['field_header_prefix_subs']) ? $options['field_header_prefix_subs'] : ''; 149 139 $sub_ids = array( … … 153 143 ); 154 144 155 foreach ($subscriptions_ids as $subscription_id => $subscription_obj) { 156 foreach ($subscription_obj->get_items() as $item_id => $item_values) { 157 $product_id = $item_values->get_product_id(); 158 159 if (!in_array($product_id, $sub_ids)) { 160 continue; 161 } 145 $subscription_id = $subscription->get_id(); 162 146 163 $key = get_post_meta($subscription_id, '_atomx_subs_code'); 164 $product = wc_get_product($product_id); 147 foreach ($subscription->get_items() as $item_id => $item_values) { 148 $product_id = $item_values->get_product_id(); 149 150 if (!in_array($product_id, $sub_ids)) { 151 continue; 152 } 165 153 166 if (isset($key[0][$product_id]) && is_array($key[0][$product_id])) { 167 $counter = 1; 168 foreach ($key[0][$product_id] as $generated_cod) { 169 ?> 170 <tr> 171 <td><?php echo esc_html($txt . ' '); ?><strong><?php echo esc_html($product->get_name() . ' #' . $counter); ?></strong></td> 172 <td><?php echo $generated_cod ? esc_html($generated_cod) : 'No'; ?></td> 173 </tr> 174 <?php 175 $counter++; 176 } 177 } else { 154 $key = get_post_meta($subscription_id, '_atomx_subs_code'); 155 $product = wc_get_product($product_id); 156 157 if (isset($key[0][$product_id]) && is_array($key[0][$product_id])) { 158 $counter = 1; 159 foreach ($key[0][$product_id] as $generated_cod) { 178 160 ?> 179 161 <tr> 180 <td><?php echo esc_html($txt . ' '); ?><strong><?php echo esc_html($product->get_name() ); ?></strong></td>181 <td><?php echo isset($key[0][$product_id]) && $key[0][$product_id] ? esc_html($key[0][$product_id]) : 'No'; ?></td>162 <td><?php echo esc_html($txt . ' '); ?><strong><?php echo esc_html($product->get_name() . ' #' . $counter); ?></strong></td> 163 <td><?php echo $generated_cod ? esc_html($generated_cod) : 'No'; ?></td> 182 164 </tr> 183 165 <?php 166 $counter++; 184 167 } 168 } else { 169 ?> 170 <tr> 171 <td><?php echo esc_html($txt . ' '); ?><strong><?php echo esc_html($product->get_name()); ?></strong></td> 172 <td><?php echo isset($key[0][$product_id]) && $key[0][$product_id] ? esc_html($key[0][$product_id]) : 'No'; ?></td> 173 </tr> 174 <?php 185 175 } 186 176 } -
atomx-services/trunk/readme.txt
r3391373 r3392144 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 2.0. 27 Stable tag: 2.0.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 94 94 == Changelog == 95 95 96 = 2.0.3 = 97 * Subscription page view token fixes 98 96 99 = 2.0.0 = 97 100 * Complete refactoring with OOP structure
Note: See TracChangeset
for help on using the changeset viewer.