• Hi Michael,

    Thanks for the great plugin.

    Just seeing if there is a way to show subscription items custom post meta on the edit order screen in the same way it is supported to see order item meta.

    At the moment, we’re manually obtaining the subscription item meta using write_log() and get_post_meta() instead of using this plugins ability to output this information on the subscription edit screen.

    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @jamergin, sure thing. Can you help me out with the data structure for the Subscription Order Items, are they stored like Order Refunds as a separate Custom Post Type linked by Parent or as a Order Item type?

    Thread Starter jamergin

    (@jamergin)

    Hi Michael,

    Thanks for the prompt response and I apologise for my delayed response.

    We are using a combination of WC Subscriptions, WC Memberships and WC Teams for Memberships plugins.

    Subscriptions use the shop_subscription post type. As far as I can tell, the data structure is identical to orders except trigger renewal orders based on the product data.

    Below is a sample of the subscription item data from one of the subscriptions:

    array (
      'id' => 30928,
      'order_id' => 82514,
      'name' => 'Teams Membership',
      'product_id' => 75065,
      'variation_id' => 75066,
      'quantity' => 1,
      'tax_class' => '',
      'subtotal' => '35.454545',
      'subtotal_tax' => '3.55',
      'total' => '35.454545',
      'total_tax' => '3.55',
      'taxes' => 
      array (
        'total' => 
        array (
          1 => '3.545455',
        ),
        'subtotal' => 
        array (
          1 => '3.545455',
        ),
      ),
      'meta_data' => 
      array (
        0 => 
        WC_Meta_Data::__set_state(array(
           'current_data' => 
          array (
            'id' => 244890,
            'key' => 'billing-frequency',
            'value' => 'Monthly',
          ),
           'data' => 
          array (
            'id' => 244890,
            'key' => 'billing-frequency',
            'value' => 'Monthly',
          ),
        )),
        1 => 
        WC_Meta_Data::__set_state(array(
           'current_data' => 
          array (
            'id' => 244891,
            'key' => 'team-size',
            'value' => '1 User',
          ),
           'data' => 
          array (
            'id' => 244891,
            'key' => 'team-size',
            'value' => '1 User',
          ),
        )),
        2 => 
        WC_Meta_Data::__set_state(array(
           'current_data' => 
          array (
            'id' => 244892,
            'key' => 'team_name',
            'value' => 'Team Name Pty Ltd',
          ),
           'data' => 
          array (
            'id' => 244892,
            'key' => 'team_name',
            'value' => 'Team Name Pty Ltd',
          ),
        )),
        3 => 
        WC_Meta_Data::__set_state(array(
           'current_data' => 
          array (
            'id' => 244893,
            'key' => '_wc_memberships_for_teams_team_uid',
            'value' => 'team_608e5979d89eb8.46801316',
          ),
           'data' => 
          array (
            'id' => 244893,
            'key' => '_wc_memberships_for_teams_team_uid',
            'value' => 'team_608e5979d89eb8.46801316',
          ),
        )),
        4 => 
        WC_Meta_Data::__set_state(array(
           'current_data' => 
          array (
            'id' => 244901,
            'key' => '_wc_memberships_for_teams_team_id',
            'value' => '82515',
          ),
           'data' => 
          array (
            'id' => 244901,
            'key' => '_wc_memberships_for_teams_team_id',
            'value' => '82515',
          ),
        )),
      ),
    )
    

    For further context, we are using WC Teams for Memberships plugin. As the WC Teams for Memberships plugin does not support the migration of existing users out of the box and, as a manual process is too tedious and time-consuming for thousands of users, we had to write our own migration method which basically updates the users subscription by removing the previous membership product and adding the new teams membership product depending on certain criteria.

    We could not work out why renewal orders were not triggering. After contacting the support for WC Teams for Memberships, they advised we were missing additional item meta (_wc_memberships_for_teams_team_id, _wc_memberships_for_teams_team_uid) for the teams product (not detailed in their documentation) to tie it to a subscription for the renewals to trigger.

    While we could write the item meta to a log to check for this data, WC Teams for Memberships support recommended your plugin to us to review the order and subscription item meta for the products to check if some additional meta was being added, although I do not think they realised your plugin only displayed the product item meta for orders and not subscriptions. While we found this feature much faster and very useful to review the orders, we could not review the subscriptions.

    We have since completed the migration, however this would still benefit us and no doubt other users using subscriptions to review product meta so I figured it would be worth raising this with you for consideration.

    Hope this helps!

    Cheers

    • This reply was modified 3 years, 6 months ago by jamergin.
    • This reply was modified 3 years, 6 months ago by jamergin.
    • This reply was modified 3 years, 6 months ago by jamergin.
    • This reply was modified 3 years, 6 months ago by jamergin.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show Subscription Items custom Post meta on the Edit Order screen’ is closed to new replies.