Git Product home page Git Product logo

somewherewarm / woocommerce-subscribe-all-the-things Goto Github PK

View Code? Open in Web Editor NEW
151.0 46.0 51.0 833 KB

Experimental mini-extension for WooCommerce Subscriptions that explored the possibility of adding subscription plans to non-subscription product types. Now available on WooCommerce.com as "All Products For WooCommerce Subscriptions".

Home Page: https://woocommerce.com/products/all-products-for-woocommerce-subscriptions/?aff=46147&cid=5699243

CSS 3.97% PHP 84.13% JavaScript 10.77% Shell 1.13%
woocommerce-subscriptions woocommerce

woocommerce-subscribe-all-the-things's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

woocommerce-subscribe-all-the-things's Issues

Handling of scheme ids

Ref - #25

@thenbrent Opening this to discuss about the way scheme IDs are handled. I feel this might be a bit of an annoyance for the active user base:

this requires product level subscription schemes to be resaved to continue to work

Also, it might be wise to keep the door open for dynamically modifying the id later on, in case we add extra settings that need to find their way into the id (sync?).

Adding to the 1.1 milestone.

List of beta testers

Just putting down some names/emails for beta testers as they come up so I don't lose them

Possible Important Bug Found - Any product with subscription options fails in the cart

I'm still looking into this problem but for some reason, the cart item data is not being added or at least I think is not being added and the item price appears like so: 10,00€ / Array.

I also get an error reported in wp-content/plugins/woocommerce-subscriptions/includes/class-wc-subscriptions-product.php on line 382

I'm not sure what is causing this but I wanted to report this before we mark v1.1.0 for release.

Nothing has been filtered out and I have tried without my extension and the results remained the same.

Below is my WC system status report.

I appreciate any feedback.

Thank you.

### WordPress Environment ###

Home URL: http://localhost/dev
Site URL: http://localhost/dev
WC Version: 2.5.5
Log Directory Writable: ✔
WP Version: 4.5.3
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: ✔
Language: en_US

### Server Environment ###

Server Info: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
PHP Version: 5.4.7
PHP Post Max Size: 256 MB
PHP Time Limit: 6000
PHP Max Input Vars: 1000
SUHOSIN Installed: –
MySQL Version: 5.5.27
Max Upload Size: 256 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✕ wp_remote_post() failed. PayPal IPN won't work with your server. Contact your hosting provider. Error: Airplane Mode is enabled
Remote Get: ✕ wp_remote_get() failed. The WooCommerce plugin updater won't work with your server. Contact your hosting provider. Error: Airplane Mode is enabled
WCS_DEBUG: ✔ 

                             No
Subscriptions Mode: ✔ 

                             Live

### Database ###

WC Database Version: 2.5.5
: 
woocommerce_sessions: ✔
woocommerce_api_keys: ✔
woocommerce_attribute_taxonomies: ✔
woocommerce_termmeta: ✔
woocommerce_downloadable_product_permissions: ✔
woocommerce_order_items: ✔
woocommerce_order_itemmeta: ✔
woocommerce_tax_rates: ✔
woocommerce_tax_rate_locations: ✔

### Active Plugins (33) ###

Query Monitor: by John Blackbourn – 2.11.4
Airplane Mode: by Andrew Norcross – 0.0.6
Debug Bar Extender: by Thorsten Ott
Automattic – 0.5
Debug Bar Shortcodes: by Juliette Reinders Folmer – 2.0.3
Debug Bar: by wordpressdotorg – 0.8.4
Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 2.2.6
WP REST API: by WP REST API Team – 2.0-beta13.1
Rewrite Rule Testing: by Matthew Boynes – 0.1.1
Shiny Updates: by the WordPress team – 2-20160618
Simply Show Hooks: by  – 1.1.1
Storefront Beta Tester: by Sébastien Dumont – 1.0.2
Vulnerable Plugin Checker: by Storm Rockwell – 0.2.4
What The File: by Never5 – 1.5.3
WooCommerce Coming Soon: by Sebs Studio – 1.0.1
WooCommerce Composite Products: by WooThemes – 3.6.6
WooCommerce Dev Helper: by SkyVerge – 0.3.0
WooCommerce Display Products by Tags: by Sebs Studio – 1.0.0
WooCommerce Match Box: by Sebastien Dumont – 1.0.0 Beta
WooCommerce Mix and Match: by WooThemes – 1.1.4
WooCommerce My Licences: by Sebs Studio – 1.0.1
WooCommerce Photos Product Tab: by Sebs Studio – 2.1.2
Skip One for WooCommerce Subscriptions: by Animals Code – 1.0.0 Alpha
WooCommerce Subscribe All the Things: by Prospress Inc. – 1.1.0
WooCommerce Subscribe to All the Things - Sign up and Trial Addon: by Sébastien Dumont – 1.0.0 Beta
WooCommerce Subscription Shortcodes: by Sébastien Dumont – 1.0.0 Beta
WooCommerce Subscriptions: by Prospress Inc. – 2.0.15
WooCommerce Variation Swatches and Photos: by Lucas Stark – 2.1.4
WooCommerce Video Product Tab: by Sebs Studio – 2.3.1
WooCommerce: by WooThemes – 2.5.5
WordPress Importer: by wordpressdotorg – 0.6.1
WP Maintrainer: by Author name – 1.0.0
WP Notification Center: by Never5 – 1.0.1
WP Rollback: by WordImpress – 1.3

### Settings ###

Force SSL: –
Currency: EUR (€)
Currency Position: right
Thousand Separator: 
Decimal Separator: ,
Number of Decimals: 2

### API ###

API Enabled: ✔
API Version: 3.1.0

### WC Pages ###

Shop Base: #7 - /shop/
Cart: #8 - /cart/
Checkout: #9 - /checkout/
My Account: #10 - /my-account/

### Taxonomies ###

Product Types: booking (booking)
bundle (bundle)
composite (composite)
external (external)
grouped (grouped)
mix and match (mix-and-match)
simple (simple)
subscription (subscription)
variable (variable)
variable subscription (variable-subscription)


### Theme ###

Name: Storefront
Version: 2.0.5
Author URL: https://woocommerce.com/
Child Theme: ✕ – If you're modifying WooCommerce on a parent theme you didn't build personally
then we recommend using a child theme. See: How to create a child theme

WooCommerce Support: ✔

### Templates ###

Overrides: –

Different shipping options for subscribed items

I'm loving this extension, it really fills a huge gap in Woocommerce functionality.

I'm wondering is there any way to identify regular items that are converted to subscriptions in cart so you can apply different shipping rules?

With regular WC Subscriptions you'd have to create a whole separate subscription product and could just assign it a shipping class...but naturally that doesn't work for this.

If I wanted to have converted subscription items ship for free...would you have any idea how I might begin to approach that?

I've been playing around with checking the products in the cart and I found that WC_Subscriptions_Product::is_subscription() returns false when I loop through the product id's of converted subscriptions, but oddly enough I found that WC_Subscriptions_Cart::cart_contains_subscription() returns true when a converted subscription is present.

Any tips or advice would be greatly appreciated!

Product Data panel - No Subscriptions Tab

Hello and Thank You for this mini plugin!
I have been trying to accomplish this the long way by linking and grouping.
I have uploaded and activated the the plugin, but I am not seeing the same options as shown in your set-up screenshots. I have Woo Subscriptions current version over the required 2.0. Woo is also current and up to date. Is there something I might have missed in my set up....or possibly I did not download the most current version of the mini plugin.(I used the large button link at the top right.) I have a Subscriptions "checkbox" along the top and I also have "subscriptions simple" and "subscriptions variable" in the product type drop down. I am not sure if this will help in identifying the issue.
This will be an amazing addition for my client, but if you view the screenshot attached, I do not have the same options as others. Any advice is greatly appreciated.
heirloom-subscription-screenshot

Addons doesn't apply to subscriptions

@franticpsyx Hello Sir! I would like to ask if there's any way that the add-ons will be applied if I choose the subscription? Because for now it applies to One-time Purchases only. My idea is that the optional addons will be applied on the initial payment only.

Support One Time Shipping

How comes this is not yet available and what is needed to support it?

I assume we would put it in the same place as the default subscription product types under "Shipping" as it would apply to all subscription schemes.

One Time Shipping

To me, I see the schemes are only for the pricing and billing conditions.

@thenbrent @franticpsyx Do you both agree?

Additional subscription scheme settings

In its current state, the mini-extension is missing the following sub settings from the product-level subscription scheme UI:

  • trial length
  • trial period
  • sign up fee

It's also missing the "Limit Subscription" setting, and the "Synchronise Renewals" setting.

These are obviously important, but since we rely on Subs core for all associated functionality, adding these in should be a trivial matter once everything else gets reviewed.

Cart doesn't differentiate between StAtT products on different schemes

Setup:

  • product with 2 different schemes: "every week" and "every 4 weeks"
  • add 1 x product with "every week" to the cart
  • add 1 x product with "every 4 weeks" to the cart

Expected:

  • 1 x "every week" product
  • 1 x "every 4 weeks" product

Actual:

  • in the cart, see that it is 2 x "every week"

Simple Product, Single Sub Option, Forced Subscription

Simple Product, Single Sub Option, Forced Subscription

@franticpsyx Found another bug... I think. Could you check to see if this is correct and if you get the same?

I created a new simple product and only added one subscription option with a price override of 50 and enabled force subscription. Nothing else.

No "Add to Cart" button shows.

Add subscription information in price strings

Products with subscription schemes defined at product-level should display some related information, possibly embedded in the price string.

This should be necessary when the "Force subscription" setting is checked, in which case the product is no different to a vanilla Sub-type product.

When more than 1 subscription scheme is defined at product-level, we'll need to somehow summarize that info.

Question for using Product Bundles & Subscribe to All the Things

First off, apologies if this is not the right place to post this/ask this. Not familiar with proper GitHub etiquette :)

Currently using Product Bundles and Subscribe to All the Things on a staging site. Right now one of my set up goes like this 4 week subscription, 5% discount, and you get to choose from a variety of meal choices to make up your bundle.

I don't know if this is possible already and I'm missing something (entirely the likely scenario) , but when I log in as the customer who has placed this subscription, my only option is to "cancel" the subscription in "my account". What I would like to do is change the meal types that make up my product bundle, and even increase the quantity as well, without having to cancel the whole thing (and of course raise/lower the price the customer would be billed every month).

Is this possible already?

Thank you in advance!

Cart Subscription Discounts

Hello,

Is it possible to add discounts to the Subscribe to Cart settings like in the individual product subscription settings?

This would be an excellent feature.

Thanks,

FCP

Discount for subscription not working?

Hi,

I have successfully built a few subscriptions on my staging site, using Subscriptions, Product Bundles, Tabular Layout and Min/Max and here it's working and show the discount:

https://staging.doyoueveneatbro.com/product/subscription-test-2/

I copied the same thing when making a new type of subscription to be everyday and no matter what I put in the discount field (and I've made sure everything else is the same as the 3 other successful ones I built) I cannot get it to show a discount.

https://staging.doyoueveneatbro.com/product/every-day-testing-subscription-renewal/

And the successful ones I built, don't show any number in the discount field anymore. Very confused on what I'm doing differently/incorrectly.

Thanks in advance for your help!

No Subscription tab for variable products?

I am using Composite products to bundle a bunch of variable products together. On our staging site, trying to use this plugin with subscriptions & composite products. The readme says to create a simple/variable product then go to the subscriptions tab on that product.

I see it for the Simple product, but even after I save a variable product and add attributes, etc. I still don't see the subscriptions tab?

My end result is to try and attach a variable subscription to a composite product. Seeing if this will work for me since I need to force a subscription with a composite product purchase.

Can't Save Options

Seems to be an amazing plugin! I can't seem to save the options on cart based or individual. Everything seems to function, (dropdown options etc.) but when I save, the page reloads as if it saved but nothing happens. It defaults to "array"

Any help would be greatly appreciated

Error on plugin activation

First off i'm using your WC Subscriptions plugin on Wordpress 4.3.1 and Subscribe to all things 1.0.1. As soon as I activate the plugin and the page refreshes to show activation success, I get this error,

Fatal error: Can't use function return value in write context in /home/cafecartel/public_html/wp-content/plugins/woocommerce-subscribe-to-all-the-things-1.0.1/includes/class-wcsatt-display.php on line 161

I'm trying to put together a subscription based site for physical coffee products and i'm lost with this. I'm also using Composite Products and Product Bundles extensions if that matters.

Possibility of Subscribe Cart applied only to certain Category or Products

Hello,

This is a radical idea / issue that we are faced with that we are solving 60% with WCSAT plugin and the Subscribe Cart feature.

Due to the fact that our custom coded payment gateway subscription plugin / and really all others, cannot manage multiple subscriptions created by the WCSAT applied to Product Bundles without a major upgrade to WC Subscriptions 2.0 and reworking your payment gateway we have come up with the following...

We use the Subscribe Cart feature to combine all our Subscription products in the Cart under one Subscription and Recurring value. We even apply discounts using WC Coupons and custom code. It works great --- except now ANY and ALL products get a subscription discount. The same subscr / discount that we apply to our subscription products.

The standard WC Subscr plugin controls to turn on / off Mixed Content no longer work. It looks like WCSAT plugin negates it.

We have now have subscription products and non-subscr products that need 2 separate carts or sessions to control the actual costs of the products.

Question???

Is there a way to make the WC Subscrib Mixed Content controls work again? What code in the WCSAT plugin is making this void?

Is there a way to apply Subscribe Cart to only a specific Category of Products?

Any and all thoughts / comments are welcomed.

Thanks,

-fcp

Discount not working

Don't know if it's only my case but when I try to add a percentage discount to product I receive a message on the product page that says that it is not possible to buy the product

Plugin Title + Distribution Discussion

What's it going to be?

At this point, I am leaning towards "WooCommerce Add-on Subscriptions".

Searching for "woocommerce add-on subscriptions" doesn't yield any powerful relevant results. Makes sense, since there's no such thing (yet).

Feel free to make suggestions once you have played with it.

@thenbrent

Undefined index: subscription_pricing_method

This error is on the single product page and when a composite product is in the cart only.

If you had a composite product in the cart and then removed it, the error is gone.

Undefined index: subscription_pricing_method

The file and line number this is related to: includes/class-wcsatt-integrations.php#L401

Subscription options on Composite Product

Hi,

When i try to add a second subscription option on a Composite Product, the front-end displays an unordered list instead of a dropdown.

Thanks

WP: 4.4.2
WooCommerce: 2.5.2
WooCommerce Composite Products: 3.5.4
WooCommerce Subscribe All the Things: 1.0.2
WooCommerce Subscriptions: 2.0.9

Integration with Bundles, Composites and MnM (ongoing)

  • Bundled items should inherit any subscription schemes defined at container level (even when they have their own product-level schemes).
  • Bundled items that are sub-type products should prevent any subs schemes at container level from working. If a bundle contains a sub-type product, it shouldn't be possible to define subs options at container level.
  • Show a notice when attempting to create container-level subs options and the bundle contains sub-type products.
  • When subs options are defined at container-level, do not display options at bundled-item-level.
  • Fix totals shown in product-details subscription options when bundle has price overrides ( #20 ).
  • Ideally, support SATT products in Bundles, Composites, etc.

Possibility to add Product Bundle to Cart via URL??

Hello,

We are using Subscribe to All Things successfully with Product Bundles. We can create Bundles and Subscription levels. Now we are trying to add a Product Bundle / Subscription via a URL string.

We can get the Parent Product and Total price in the Cart, but not the Child Products.

Here are a few of our attempts...

https://www.staging5.website.com/?post_type=product&add-to-cart=4089&bundled_items=1979,148&quantity=2,3

https://www.staging5.website.com/?post_type=product&add-to-cart=4089&variation_id=1979&quantity=1&&variation_id=148&quantity=2

Is this possible?

If not how can we do this via a button on our site?

Thanks

FCP

Composite Product Discounts & Free Shipping Options

Based on my experiments and research, it seems that as of right now, this plugin does not support subscription discounts on variable products that are subordinate to a composite product. Is that correct? Every time I try to change the price for various subscription time-periods for the child variable product, the plugin does not recognize the price difference (be it a % difference or a static "Override Product" price difference).

Also, is there any plan or thought process around offering a "Free Shipping" toggle for any product that is bought with subscription?

Variable products support

Currently we do not allow subscription schemes to be defined for variable products -- when we do it, we could make this work at variation level, or we could simply ignore variations and use the existing "Subscriptions" tab to define subscription schemes at parent level.

Simple Product on Sale with Subscription Options

@thenbrent and @franticpsyx I noticed that if a simple product that is on sale has subscription options, the price on the subscriptions are still taking a percentage of the regular price not the sale price.

Simple Product on Sale with Subscription Options

Should it not inherit the sale price of the product when it is on sale and provide a discount percentage from that?

Subscribe-to-cart functionality

All the infrastructure for this is already in place - the only task left seems to be the processing/saving of subscription schemes defined via WooCommerce > Settings > Subscriptions.

Calling WCS_ATT_Cart::convert_to_sub() by itself throws fatal error

WCS_ATT_Cart::convert_to_sub( 'cart_item_key' );

Fatal error: Cannot use string offset as an array in /site/wp-content/plugins/woocommerce-subscribe-all-the-things/includes/class-wcsatt-cart.php on line 168. Output triggered in /site/wp-content/plugins/query-monitor/collectors/php_errors.php on line 137

Problem Changing Shipping Method in Cart & Checkout with Bundled Product Subscriptions

Hello,

First I would like to say thanks for all the work that is going into this plugin. I do however have an issue that I have been troubleshooting for the last 4 weeks and I have narrowed it down to this plugin. Ill provide the details below.

NOTE: I will gladly donate $100 towards the development team for anyone that can help me fix this problem!

Environment Details:

Wordpress Version: 4.5.3
Woocommerce Version: 2.6.2
Subscribe All Things Version: (Just pulled master again today - 7/18/16)
Theme: EXCEPTION (latest version: https://themeforest.net/item/exception-responsive-multipurpose-wordpress-theme/10399551-RAYS) NOTE: I have changed to the default WP theme and the issue still appears so I believe it is not related to the theme

Plugins In Use (those that affect this scenario)

  • Woocommerce
  • Woocommerce Memberships (1.6.3)
  • Woocommerce Product Bundles Min/Max Items (1.0.1)
  • Woocommerce Product Bundles (4.14.5)
  • Woocommerce UPS Shipping (3.1.3)
  • Woocommerce USPS Shipping (4.3.3)
  • Woocommerce Subscribe All the Things
  • Woocommerce Subscriptions (2.0.17)

Problem

On a website that I am developing (www.rocksolidtraining.com), if you add a subscription product to the cart, when viewing the cart and the checkout pages, you can see the different shipment options that are available. However, if you change the radio button for these options to select a different one, you will see that:

  1. The Grand Total for the order does increase
  2. However the Reoccurring shipping total does not change
  3. And the radio button goes back to the default option (the first in the list)

Subscription Product Overview

The subscription products are bundled products. The bundle contains a woocommerce membership product and a variable number of physical products (based on the subscription level choosen).

Steps to Recreate the Problem

  1. Navigate to: https://rocksolidtraining.com/product/rock-solid-training-novice-subscription/
  2. Select One of the Physical products (one physical product is included with this bundle)
  3. Click the Add to Cart button at the bottom
  4. On the cart page notice that there are multiple shipping options available.
  5. Change the shipping option
  6. Notice that though the total price changes, the shipment option radio button list does not reflect the change.
  7. Go to the checkout page and notice that the shipment option that you choose on the cart page is not saved here. This is the same when you proceed to PayPal for payment.

Troubleshooting Steps Already Taken

I have tried a number of different things to diagnose this problem and they have led me to believe that this plugin is causing it. The things I have tried are:

  1. Checked for JS Errors - There are none that effect this
  2. Checked for theme conflicts - The issue appears even on the default theme
  3. Checked for other plugin conflicts - The issue exists until I disable the Subscribe All The Things Plugin
  4. Debug - Ran debugger and noticed no errors being thrown

Please contact me at the email below if you need access to the website. josh[at]xray-studios[dot]com

I really appreciate you taking a look at this!

Coupons not working properly

I've noticed coupons don't appear to work when SATT is combined with Composite Products (not sure if that affects other product types also).

I've tried the options including "Basket % Discount" and "Recurring Product % Discount" and they both appear to have different issues.

Case 1

Setup

  1. Create a composite product with price X. On Shipping options select an option that incurs a shipping cost. On subscription options set "subscription price" to "override product" and set a price (the other option produces the same results). Set the "Free Trial" option to something.
  2. Create a coupon of type "Basket % Discount". Set coupon amount to 0 or 100 (doesn't make a difference on the actual result). Select the "grant free shipping" option.
  3. On WooCommerce shipping options ensure the free shipping option is enabled and the "require a valid coupon" is selected,
  4. Go to the product page, add it to cart and go to checkout to apply the coupon.
  5. The total is 0 + shipping cost (due to free trial). The recurring total is X.
  6. Apply the coupon

Expected Result

Once the coupon is applied, the free shipping option should be enabled.

Actual Result

An error is shown with the message "Sorry, this coupon is only valid for an initial payment and the cart does not require an initial payment."

Notes

  1. If you remove the subscription options from the product and try to buy it as one-off, the same coupon can be applied normally.
  2. The coupon value doesn't seem to affect the end result.
  3. I would imagine that if you set coupon value to 100% and remove the free shipping option, you would still end up with free shipping, but might be wrong on this.

Case 2

Setup

  1. Duplicate the product of Case 1.
  2. Create a coupon of type "Recurring Product % Discount". Set a value.
  3. Go to the product page, add it to cart and go to checkout to apply the coupon.
  4. The total is 0 + shipping cost (due to free trial). The recurring total is X.
  5. Apply the coupon.

Expected Result

Once the coupon is applied, the recurring price should be updated depending on the discount of the coupon.

Actual Result

The coupon is applied, but the recurring price remains the same (X).

Am i wrong on my configuration and expectations or is this a bug?

Confusion with frequency setting

From @buckneri on #1 (comment)

The frequency setting for monthly/daily/yearly doesn't make sense.

When you set Monthly it tallies the price and sets it to a monthly payment.
Yearly should do the same and multiply by 12 instead it just charges the same amount once per year.

This may be the designed functionality, but i'm at a loss for what product you would sell for $50/month but give the customer the option to only pay $50 per year($5/month) for the same thing. (services for example, would be monthly but give a discount for annual payment, but that annual payment would not be less than monthly it would be monthly x 12 - discount)

Quantity update in cart fails

I noticed that you can not update the quantity of an item unless you change the subscription scheme as well.

I'm not sure if this is affected by having more than one subscription scheme option for the product or not but simply changing the quantity does not work on a simple product with subscription scheme options.

Potential bug found - abandoned cart - when customer goes back to pay, creates additional products in cart

I have a scenario where I am entering in manual orders for customers who have come into a winery and want to join a wine club which I have set up as a subscription product for a composite product using this "Subscribe all the things" mini extension.

They pay for the first wine cub order through the til at the winery, and later have to be added to the website. In order to get around the fact that they have already paid for their order, but wanting to capture their payment details, I put in the order and then apply a 100% coupon discount which makes the order total zero.

At this stage, we proceed to the credit card payment details. Unfortunately my client did not capture the three digit code at the back of the credit card, so instead, we abandon the cart at this stage, and send the client an email, asking them to login and complete their payment details.

This works well on the my account page - it shows a pending order of zero dollars and gives them a "pay" button. The problem happens when they hit the pay button - instead of just seeing the composite product that was set up as a subscription and having an order total of zero, new products are added to the order (as per the screen shot).
https://www.dropbox.com/s/92yeft231yth3u7/CC%20Estate%20-%20My%20Account%20with%20Pending%20Payment.png?dl=0

https://www.dropbox.com/s/84xj8s0b9xt0nds/CC%20Estate%20-%20After%20Clicking%20Pay%20Button.png?dl=0

I did create a ticket at woothemes (ticket id 425975) with login credentials but they suggested I submit my bug here.

Subscription switching - choose between attached sub schemes

Here's something of a grander scale.

Add support for:

  • Subscriptions schemes switching
  • Changing the subscribed content of product types such as Bundles and Composites (may require integration on their side)
  • Cart subscription management (and switching)

I am not sure if all these WC Subscriptions features need to be ported to SAtT at this time, or if at all.

If WC Subscriptions ever absorbs the SAtT workflow, all these things will be easier to port, but my guess is that we'll need quite a bit of infrastracture in WC Subs to decouple all the subscription switching logic from the Grouped/Variable sub types.

'Invalid recurring shipping method.' and new WC Subscriptions v2.0.14

After upgrading to WC Subscriptions v2.0.14 we are getting this error 'Invalid recurring shipping method.' for simple products that have a subscription option using WSATT plugin. It seems WC Subscriptions v2.0.14 adds a validation in the file 'wp-content/plugins/woocommerce-subscriptions/includes/class-wc-subscriptions-cart.php' function 'validate_recurring_shipping_methods()' that adds some sort of validation on shipping but fails on WSATT subscription products. For now I have downgraded WC Subscriptions but a fix is preferable of course.

Integration with Variable Products

I know integration with Variable Products has been brought up before.
Was just wondering if it's possible yet, or not?
I know there is a "Variable Subscription" option, but we want to be able to have a variable product with a standard price, and also a subscription option.

Thanks in advance.

SATT Products API

Objective

Currently, most logic and data needed for "converting" WC_Product objects to subscription-enabled objects are scattered all over the place, for instance:

  1. scheme data is only accessible from post meta, while
  2. the active subscription scheme id is stored only in the cart item array
  3. subscription details are stored as object properties by WCS

(1) and (2), as well as all associated logic for "converting" a product to a subscription in the cart is currently implemented using static functions, simply organized in suitably named classes.

Obviously, we need a more formal, object-oriented way to:

  • manage the subscription schemes available with a WC product,
  • access its subscription status/details (regardless of its type) and
  • convert its subscription state,

not only in cart context, but in a way that's more tightly integrated with the WC_Product class.

Ideal Case

Ideally, if this would all be part of WC core, the Abstract Product class would include properties and methods to handle the "Subscription Nature" of a product internally, and set any properties associated with it (billing periods, intervals, trial, prices, sign up prices, etc) when converting from/to a non-recurring billing state to a recurring one.

This would allow a product to freely switch between states, while existing methods could ideally take this into account and modify their output, for instance:

  • get_price and other price getters could modify the returned value depending on the price(s) associated with the active scheme, if set, otherwise return the standard non-recurring (one-off) price.
  • get_price_html could try to generate an output based on the active subscription (if set), otherwise return something meaningful based on a stored min_price_subscription_scheme.

From a cart perspective, this core-embedded handling would allow WC to set the active subscription scheme with the item session data, and "convert" it when instantiating the product class, similar to how products are instantiated using their product_id alone - only we'd have an additional subscription_scheme_id to pass to the constructor.

From an order perspective, get_product_from_item would use a similar method to instantiate the object using a subscription_scheme_id field stored in the line item.

This would allow products to have a dual nature - the Subscription and the Product, distinct from one another but unified in the same object.

(Do we agree with this as a utopian solution to start with?)

Possible Solutions

What's the closest we can get to our Utopia, if we agree we accept it as such?

  • Somehow dynamically add properties and methods to all instantiated products on init. If PHP was JS, we would have likely intervened with the Abstract Product prototype, or appended "methods" and "properties" at some point during run time. I don't think we have this option.
  • Rely on our ability to dynamically add properties to the Abstract Product (magic methods are already there). Use a separate object to manage the Subscription nature of the product, possibly embedded in every product instance as a property (we'll need a wc_get_product filter to do this), or follow a "hybrid" approach, with static functions under a WCS_ATT_Product class accepting the product as a parameter with all "Subscription"-related data stored as properties of the WC product object (much like how WC Subs does it, I think?).
  • Instead of adding properties to existing WC Product objects, somehow come up with a way to "wrap" the WC Product objects into a new WCS_ATT_Product object on instantiation, and then 1) add all management logic on the wrapper and 2) override the behaviour of existing product methods at will, possibly depending on the type of the wrapped product. I have just started to explore the idea in https://github.com/Prospress/woocommerce-subscribe-all-the-things/tree/oop - it's far from being implemented to actually do the heavy-lifting, but the "wrapping" idea seems to be a viable workaround (unless I am missing something). There are some caveats, for instance if you have code relying on things like the instanceof an instantiated WC product I suspect lots of things might break. Similarly, we might have issues with cloning of such products.

The advantage of the 1st (impossible with PHP?) and 3rd solutions is that we can do away with the need to declare filters in order to change the output of WC product methods, since the wrapper object operates as a filter always firing last, which is what we want here. The oop branch explores this concept by embedding get_price_html into the wrapper object.

We are still some distance away from the Utopia, in the sense that we'll still need to "manually" call methods on our wrapper object when cart session data has loaded, in order to set the object subscription state and use get_product_from_item to do the same with products instantiated from order items. But overall, the "wrapper object" solution is a possible way to unify the Subscription + Product natures in a true OOP manner.

Scheme Storage

We currently store schemes as serialized meta, which is probably far from ideal. One solution we could explore is to use a custom post type for this, possibly also using the parent_id db field to point to the product id that a subscription scheme belongs to. All scheme data, such as billing details, prices and other options could be stored as post meta of the new subscription_scheme post type.

@thenbrent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.