-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Imported variation subscriptions unable to use upgrade/downgrade to other variation's in product #142
Comments
Thanks for bringing this up @duttonw. WooCommerce Subscriptions does not allow customers to switch items unless the subscription has a last payment date. Unfortunately a last payment date doesn't exist on newly imported subscriptions that haven't renewed yet.. so we'll have to work out a way for store managers to get around this Some ideas:
I'm sure there's issues with implementing B) that im just not seeing yet. Any other ideas? |
The (minor) issue here is that the order needs to be for $0 to avoid throwing out report total. In which case, you have an order for $0, serving very little purpose.
The only issue is with proration. Should we use the subscription's current recurring total as the base for proration calculations? Or should we use $0? (because that's how much has actually been paid as far as Subscriptions/WC knows). |
How about, adding the most recent order to be included on the exporter which the importer can use to generate a backdated order with the correct values for that past order to when it was last renewed or started. This would not be of the current month and should have a note attached to say created by importer like the subscriptions. ?? Could this order that is created have a discount of the same amount but still allow proration as the payment or would this interfere with it? Of course there need to be a checkbox to include order data export or import that order details. On another note: I'll try and put together a pull request for this in the coming days/week unless someone else beats me to it. ;) |
A workaround and viable fix for issue woocommerce#142 added a filter to make up a date when the date return from the parent function is 0 and the subscription was imported. This will then allow switch subscriptions to work. Note: this may cause issues with free trials where no payment has been paid, testing is required to ensure it does not cause interference on those imported subscriptions.
@thenbrent i have tested this fix/workaround and it does all calculations on proration etc. Where the subscription is not that new/in trial. The last paid date is in the csv file but the plugin as it stands is passing this date to the update_dates function which just ensure its in the right order then drops it. Maybe in the future it would be faster to store against the subscription the last payment date so that we don't have to do that expensive order lookup. the reason i say expensive is that once you have a VERY long running subscription in the order of years where the renewal could be set to the week. it has all of these orders which it just finds and then drops. this more likely will need to be done with backward compatibility in mind as well as ensure we update that field when payments do go passed paid in the main plugin. |
Has there been an update on the work around for this problem? |
was migrating a website which had a standard subscription, i updated the product id's to match the new website product id's and added in the new meta-data key value pairs.
product_id:1568|name:Corporate |quantity:1|total:649.00|meta:sub-accounts=10|tax:0.00
this does not act like a variation subscription made with the front end vs this importer.
i've also tested a valid variation subscription export from the website, change the user to a new user and re-imported and the new subscription on the new user can't be upgraded/downgraded but the subscription/user it was exported from can.
i'll continue looking into this as i don't want to manually create all these subscriptions.
The text was updated successfully, but these errors were encountered: