Plugin Directory

Changeset 3392144


Ignore:
Timestamp:
11/08/2025 11:07:07 AM (5 months ago)
Author:
getatomx
Message:

Release 2.0.3

Location:
atomx-services/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • atomx-services/trunk/atomx-services.php

    r3391373 r3392144  
    44 * Plugin URI: https://dev.get-atomx.com/docs/en/purchase-verify-wp-wc
    55 * Description: Generation of purchase codes/tokens for AtomX extension (or based on AtomX) for products and subscriptions
    6  * Version: 2.0.2
     6 * Version: 2.0.3
    77 * Author: AtomX
    88 * Author URI: https://get-atomx.com
  • atomx-services/trunk/includes/Admin/class-atomx-wcs-admin.php

    r3391373 r3392144  
    270270                        <option value=""><?php esc_html_e('-- Select Product --', 'atomx-services'); ?></option>
    271271                    </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
    272277                </td>
    273278            </tr>
  • atomx-services/trunk/includes/Domain/class-atomx-wcs-subscriptions.php

    r3391373 r3392144  
    129129    }
    130130
    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) {
    136132        $special_options = get_option('atomx_settings_special_options');
    137133        if (empty($special_options['field_auth_user_key_options'])) {
     
    140136
    141137        $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 
    148138        $txt = isset($options['field_header_prefix_subs']) ? $options['field_header_prefix_subs'] : '';
    149139        $sub_ids = array(
     
    153143        );
    154144
    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();
    162146
    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            }
    165153
    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) {
    178160                    ?>
    179161                    <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>
    182164                    </tr>
    183165                    <?php
     166                    $counter++;
    184167                }
     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
    185175            }
    186176        }
  • atomx-services/trunk/readme.txt

    r3391373 r3392144  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 2.0.2
     7Stable tag: 2.0.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    9494== Changelog ==
    9595
     96= 2.0.3 =
     97* Subscription page view token fixes
     98
    9699= 2.0.0 =
    97100* Complete refactoring with OOP structure
Note: See TracChangeset for help on using the changeset viewer.