Skip to content
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

feat(ugc): automated WC products for self-serve listings #117

Merged
merged 4 commits into from
Sep 13, 2021

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Sep 10, 2021

All Submissions:

Changes proposed in this Pull Request:

Takes the first step toward self-serve listings with some automated WooCommerce products to help facilitate single purchase or subscription-based listings.

The following products are included to start, but all of these are subject to change based on publisher feedback. The default prices and planned behavior are also subject to change pending publisher feedback.

  • Single Listing: Users can purchase a single listing of any type (Event, Generic, Marketplace, or Place).
    • Intended behavior (not yet implemented): Once a user purchases a single listing, they can edit their listing in the block editor and submit it for editorial review. Once approved and published by a staff member, the listing is live for 30 days. If they want to extend the life of the listing, the user can purchase another single listing and resubmit the same listing or create a new listing, or purchase a subscription.
  • Monthly Subscription: Users can purchase a monthly subscription. This entitles the user to a single listing of any type which will be live for the duration of the subscription.
    • Intended behavior (not yet implemented): The subscription should have a minimum purchase period of 6 months (or 1 year?). The single listing tied to their subscription purchase is considered the user's "primary" listing. They may make purchases of single listings during their subscription to publish additional listings which will remain live during the subscription period. These listings are associated with the primary listing via the Related Content feature.
  • Add-on: Featured Listing: This is an optional add-on which can be applied to either a single listing or a subscription at the point of purchase only.
    • Intended behavior (not yet implemented): Purchasing this will apply "featured" status to the primary listing item created during checkout. The Featured status will remain as long as the primary listing is live. For subscriptions, this will charge an additional monthly fee for the duration of the subscription.
  • Add-on: Premium Subscription: This is an optional add-on which can be applied to a subscription.
    • Intended behavior (not yet implemented): This product will let the subscriber create up to five (subject to change) additional listings of any type per month of active subscription, all of which are associated with the user's primary listing via Related Content, and all of which will receive Featured status for 30 days after publishing.

Note: Taking a cue from the long/ongoing projects in Newspack Plugin, I'm going to start pushing smaller, partial functionality to master for the larger self-serve/UGC listings milestone. Because it's incomplete and not fully tested, this functionality will be gated behind a WP config constant NEWSPACK_LISTINGS_DEV_MODE, so unless this constant is defined and true, these PRs shouldn't behave any differently compared to master.

How to test the changes in this Pull Request:

  1. After checking out this branch, plugin behavior at first should be unchanged from master.
  2. Ensure you have WooCommerce and its Subscriptions extension active.
  3. Add define( 'NEWSPACK_LISTINGS_DEV_MODE', true ); to your wp-config.php.
  4. After adding the environment constant, visit the Products menu in WP admin.
  5. Confirm that the following products have been automatically generated by the plugin:

Screen Shot 2021-09-10 at 2 50 49 PM

  1. Go to Listings > Settings in WP admin. Confirm that the settings page is now divided into several sections, with a new "Self-Serve Listings" section at the bottom:

Screen Shot 2021-09-10 at 2 44 40 PM

  1. Update the price values of these settings and save. Confirm that in the WooCommerce Products menu, the prices of each product is automatically updated to match Listings plugin settings.
  2. Temporarily deactivate WooCommerce and confirm that the Listings plugin continues to work, but without the additional "Self-Serve Listings" settings. Note that the Listings products will not be deleted if the Listings or WC plugins are deactivated, so that we don't lose purchase histories in that event.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dkoo dkoo added this to the Self-Serve Listings milestone Sep 10, 2021
@dkoo dkoo requested a review from a team September 10, 2021 20:49
@dkoo dkoo self-assigned this Sep 10, 2021
@dkoo dkoo added [Status] Needs Review enhancement New feature or request labels Sep 10, 2021
Copy link
Member

@adekbadek adekbadek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected, left some suggestions.

includes/class-newspack-listings-products.php Outdated Show resolved Hide resolved
newspack-listings.php Outdated Show resolved Hide resolved
@dkoo dkoo merged commit 6a44d86 into master Sep 13, 2021
@dkoo dkoo deleted the feat/init-self-serve-listings branch September 13, 2021 18:16
matticbot pushed a commit that referenced this pull request Sep 14, 2021
# [2.5.0-alpha.1](v2.4.0...v2.5.0-alpha.1) (2021-09-14)

### Features

* **ugc:** automated WC products for self-serve listings ([#117](#117)) ([6a44d86](6a44d86))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.5.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Sep 21, 2021
# [2.5.0](v2.4.0...v2.5.0) (2021-09-21)

### Bug Fixes

* editor crash when switching months in event dates block ([#123](#123)) ([cee0d53](cee0d53))
* fatal error when WooCommerce Subscriptions is not active ([#122](#122)) ([16ac166](16ac166))

### Features

* feature extensions from gdg ([#120](#120)) ([b2c3cc8](b2c3cc8))
* **ugc:** automated WC products for self-serve listings ([#117](#117)) ([6a44d86](6a44d86))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants