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

Premium Content Buttons Block: Subscribe Button Does Not Appear #49103

Closed
joweber123 opened this issue Jan 21, 2021 · 3 comments · Fixed by Automattic/jetpack#22446
Closed

Premium Content Buttons Block: Subscribe Button Does Not Appear #49103

joweber123 opened this issue Jan 21, 2021 · 3 comments · Fixed by Automattic/jetpack#22446
Assignees
Labels
Payments: before Woo A good candidate to tackle before Woo transition Premium Content Controlling specific content for paying site visitors. [Pri] Normal Triaged To be used when issues have been triaged. [Type] Bug [Type] Feature Request Feature requests

Comments

@joweber123
Copy link

Steps to reproduce the behavior

Steps to reproduce the behavior:

  1. Add a Premium Content Buttons block to a page.
  2. View the page as a logged-out user.

What I expected to happen

I expected to see both buttons appear on the page. One to subscribe to the site and the other to login.

What actually happened

On a page where I am logged out of WordPress.com, I am only seeing a login button.

Context

Browser / OS version

Firefox/Chrome/Edge/Safari - OS Big Sir

Does this happen on simple or atomic sites or both?

I can reproduce this on both Atomic and Simple.

Is there any console output or error text?

No console errors.

Level of impact (Does it block purchases? Does it affect more than just one site?)

I have so far only tested this on multiple of my own test sites.

Video:

I've recorded a quick demonstration to show what I am seeing on my end as well - https://d.pr/v/FLQ28M

Markup on 2021-01-21 at 16:30:57

@joweber123 joweber123 changed the title Premium Content buttons: Subscribe Button Does Not Appear Premium Content Buttons Block: Subscribe Button Does Not Appear Jan 21, 2021
@rosepajaroja
Copy link

A similar issue occurred on this site lovewisewomenministries.org.

(It's resolved now.)

@JoshuaGoode JoshuaGoode added Premium Content Controlling specific content for paying site visitors. Needs triage Ticket needs to be triaged labels Jun 1, 2021
@JoshuaGoode
Copy link

A similar issue occurred on this site lovewisewomenministries.org.

(It's resolved now.)

We're still discussing the instance mentioned above internally at p9F6qB-6Yd-p2 as there are additional posts that are having this issue. Seems like it's not consistent. The Subscribe button isn't hidden as it isn't present in the HTML -- so it appears it's not being generated at all.

@JoshuaGoode
Copy link

JoshuaGoode commented Jun 1, 2021

After review, confirming this can happen on both Simple and Atomic sites.

In the example Atomic request, p9F6qB-6Yd-p2, the user had ~42 posts with a Premium content block set to a specific plan ID. Let's say it was ID 123.

If we inspect the post in the code view, we can see the following bits of lines spread out within the block.

First, for the main parent Premium content block:
<!-- wp:premium-content/container {"selectedPlanId":123}

Then for the subscription button:
<div class="wp-block-premium-content-buttons wp-block-buttons"><!-- wp:jetpack/recurring-payments {"planId":123} -->

However, none of the current plans on the site matched that ID.

It seems the user might have deleted the plan that the blocks were set to.

Resolution

To resolve, they need to edit the posts, select the parent Premium content block, and set it to an active subscription plan.

Reproduction

To reproduce, we need to force the Premium content block into a state where it doesn't have a plan selected or the plan it has selected in its code no longer exists.

To do this, we can create some posts with the Premium content block and set it to a specific plan.

Then, go to My Sites > Tools > Earn > Collect payments > Payment plans and delete that plan.

That should place the block in a state where it thinks it still has a plan ID set but that plan doesn't actually exist and a Subscribe button cannot be rendered on the front end. No plan to Subscribe to.

Next Steps

Perhaps we could add a notice in the editor that the block isn't set to use an active plan. The editor view doesn't indicate an invalid plan is selected and shows a preview of the Subscribe button.

The only thing close to an indicator is the fact that the plan selection button doesn't display a plan. If it is working, a plan price would appear.

image

I failed to include it in my screenshot, but if the user then clicks on that empty plan selection button they will see a list of plans and it does appear a plan is selected.

@synora synora added Triaged To be used when issues have been triaged. [Type] Feature Request Feature requests and removed Needs triage Ticket needs to be triaged labels Jun 4, 2021
@artpi artpi added the Payments: before Woo A good candidate to tackle before Woo transition label Jan 6, 2022
@BogdanUngureanu BogdanUngureanu self-assigned this Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Payments: before Woo A good candidate to tackle before Woo transition Premium Content Controlling specific content for paying site visitors. [Pri] Normal Triaged To be used when issues have been triaged. [Type] Bug [Type] Feature Request Feature requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants