• Hello developers,

    I have one strange issue, I have woocommerce subscription plugin in my site. I checked how user-subscription syncs. I created script to import subscriptions from CSV and I found that in usermeta table, there is one meta_key called “wp_woocommerce_subscriptions”, in that, data is stored in fixed format, the format is looking like:

    a:1:{s:9:"9999_4050";a:11:{s:10:"product_id";s:4:"4050";s:9:"order_key";s:19:"order_51fa4f4503365";s:8:"order_id";i:9999;s:10:"start_date";s:19:"2012-09-06 00:00:00";s:11:"expiry_date";i:0;s:8:"end_date";i:0;s:6:"status";s:6:"active";s:17:"trial_expiry_date";i:0;s:15:"failed_payments";i:0;s:18:"completed_payments";a:1:{i:0;s:19:"2012-09-06 00:00:30";}s:16:"suspension_count";i:0;}}

    in the first line there is “9999_4050” is combination of two ids, first one is orderid, second is subscriptiotype’s post id.
    It is working for me until the first id remains to 4 digit, but when it becomes 5 digits say “10000_4050”, the record not showing on subscriptions listing.

    can anyone tell me how this structure filter and how can I resolve my issue? Please help me to get rid of this.

    Thanks,
    Nirav

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello Nirav

    On the search for a solution to import existing subscriptions in a CSV, I came across your post. The serialized array contains keys (the combination of orderid and subscription type’s id). Now if the array gets serialized, this key is saved as

    ... s:9:"9999_4050"; ...

    if the orderid is higher, then the length of the string changes:

    ... s:10:"10000_4050"; ...

    Maybe this can help you.

    I need to import subscriptions into my woocommerce environment. How did you achieve this? Which tables are involved? In my user-meta-table, I could not find any records with the key “wp_woocommerce_subscriptions”.

    Thanks for your help

    uruk

    Hi, I’m also looking for a way to import subscriptions into Woo Commerce, preferably using a .csv.

    Are they any plugins available? OP, do you have any tips?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘woocommerce import subsciptions issue’ is closed to new replies.