Pay Per View conflict with Avada's Fusion Builder

Tried using Pay Per View to hide a selection of content that involves Avada's Fusion Builder shortcodes and it's not working. Tried both automatic excerpt and selection methods.

Staff Edit: More details on this have been added to linked intercom chat

  • Adam Czajczyk

    Hello Keya Digital,

    I hope you're well today and thank you for your question!

    I have tested this and the issue here is a bit more complex. Let me explain :slight_smile:

    The Fusion Builder layouts are built entirely with shortcodes. In WordPress, there are two types of shortcodes: self-closing and enclosing. The "self-closing" shortcode can be for example gallery shortcode that you use like this

    [gallery ids="71,28"]

    The "enclosing" shortcode is a "two-part" shortcode, like e.g. Fusion "text" shortcode:

    [fusion_text] here is some text [/fusion_text]

    "Layout building" shortcodes, in this case, are all of "enclosing" type. The Pay Per View shortcodes are also of that type. The issue is when shortcodes of this type become "mixed", so for example, one shortcode opens, then another one opens, then the first one closes and the second one closes. Example of "breaking" set of shortcodes

    [shortcode_a]  [shortcode_b] [/shortcode_a] [/shortcode_b]

    while this should work

    [shortcode_a] [shortcode_b] [/shortcode_b] [/shortcode_a].

    Per analogy, that's actually the same as with HTML tags. Something like this

    <div> <span> </div> </span>

    will most likely break the layout, while this won't

    <div> <span> </span> </div>

    I hope that makes sense so far. The problem here is that you do not fully control these shortcodes because Fusion Builder controls them and adds them where it thinks they are needed. Furthermore, even if you manually change them (remove some of them) and then just re-save post while the editor is in Fusion Builder mode, it will attempt to "make up" and add some shortcodes where it needs them.

    That's a bit confusing, I now, but it's not quite the PayPerView/Fusion Builder issue but rather the way shortcodes are handled by WordPress in general.

    Can we solve that? We can try but I must say I cannot guarantee that it will work well in a long run. It's worth giving a try though and I'm thinking of two alternative solutions here. First one would be to edit the code a bit. It's complex so let me try to explain this on the particular post from your site that you discussed with Tyler during the chat.

    First, you'll need to make sure that on post edit screen in "Pay Per View" section on the left the "Method" is set to "Use selection tool". To do this:
    - remove any PPV shortcodes from content
    - set that option
    - update post

    Then in Fusion Builder mode add shortcodes this way:

    - where you want to start the "paywall" add the "Text Block" element and there add only the first part of the PPV shortcode (example on the screenshot)

    - where you want to "end" the hidden part add only the last part of PPV shortcode

    Note please that in both cases I added that "Text block" element as the last element in column; make sure that it's either last or first but not in the middle;

    Now update post, switch to WP Editor by clicking on "Use Default Editor" and then switch to "Text" view (instead of visual). Find the PPV opening shortcode:

    and remove the surrounding [fusion_text] [/fusion_text] shortcodes, the move the closing [/fusion_builder_column] shortcode in front of PPV shortcode (see screenshot below and compare it with the one above):

    Once this is done, do the same with PPV "closing" shortcode ("[/ppw]":wink: and then save post while still text view of WP editor and NOT in Fusion Builder mode.

    While I tested this (with your post, copied from your site "as is":wink: on my test setup, it seemed to work fine. The downside is, unfortunately, that any change whatsoever that you do to the content of the post later may break it and you might need to go through this procedure again.

    However, there's a second way worth trying. Instead of protecting "all" with PPV, you might protect each "chunk" of content separately with the same PPV shortcode. What I mean is that if you got a content inside Fusion Core text block, wrap as small part of it as possible with PPV shortcode, making sure that no FC shortcodes got inside. Then do this for all other parts of content that you want to protect, just make sure that ID used in PPV shortcode is all the same along entire post.

    As a result, you should end up with working protection but with multiple PayPerView forms on that same post/page. Since the ID is the same, I think unlocking any of them should automatically unlock all of them. Furthermore, you could simply hide all PPV forms but first one on the page with this CSS (that can be added to "Avada -> Theme Options -> Custom CSS" page).

    Would you give it a try (especially the latter way) and let me know if it worked for you, please?

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.