-
Notifications
You must be signed in to change notification settings - Fork 41
Add new upsells in Lite for missing Pro features #2570
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
Merged
Merged
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
cd0f322
Add new upsells in Lite for missing Pro features
AbdiTolesa d64fb0c
Update upsell modal title for read only feature
AbdiTolesa 2870c5b
Gray out upsell elements
AbdiTolesa ea5af86
Add before/after contents upsell
AbdiTolesa 1ad7daa
Add check for field types before showing upsells for certain features
AbdiTolesa f5aafd2
Add field checks for upsell
AbdiTolesa ca859f4
Add upsell for autocomplete and visibility features
AbdiTolesa ca3ffd2
Add Upsell for Create with AI feature
AbdiTolesa d96ec8b
Update list of fields to show upsell modal
AbdiTolesa 12263ff
Make phrase for create with ai upsell label plural
AbdiTolesa 2904617
Rebuild files
AbdiTolesa 6b6aa68
Merge master
AbdiTolesa 501319c
Merge master
AbdiTolesa d069ca5
Fix unit test and workflow errors
AbdiTolesa 446ef47
Refactor code
AbdiTolesa 81cf3a2
Simplify code
AbdiTolesa e0583d7
Merge branch 'master' into issue-5873
Crabcyborg 5c2f6fc
Clean up view files to have less PHP in them
AbdiTolesa 0fd879e
Merge branch 'issue-5873' of https://github.com/Strategy11/formidable…
AbdiTolesa b3060bd
Move out AI upseller markup to a separate view file
AbdiTolesa b2edc1d
Use to show conditional action button
AbdiTolesa 1bb9741
Clean up code a bit
AbdiTolesa 9b671ef
Merge branch 'master' into issue-5873
Crabcyborg 14593b0
Try using render_ai_generate_options_button
AbdiTolesa c0104a2
Refactor render_ai_generate_options_button to make it versatile
AbdiTolesa e766a67
Fix merge conflict and merge master
AbdiTolesa 8463a79
Add array element existense check
AbdiTolesa 08746e3
Try fixing all PHPCS errors
AbdiTolesa f2e5ec5
Address more code quality issues
AbdiTolesa 2c4de92
Make Create with AI upsell button style consistent with the real one
AbdiTolesa 49c0b85
Merge branch 'master' into issue-5873
Crabcyborg 6518900
Remove function param not needed
AbdiTolesa ac4cca7
Merge branch 'issue-5873' of https://github.com/Strategy11/formidable…
AbdiTolesa 3b6f310
Fix conflict with formidable_admin.js
AbdiTolesa e970eba
Remove unused var
AbdiTolesa cd24b74
Merge branch 'master' into issue-5873
Crabcyborg aad2427
Move files around and cut down functiona rgs
AbdiTolesa 397ae34
Merge branch 'issue-5873' of https://github.com/Strategy11/formidable…
AbdiTolesa 76472f4
Shorten code
AbdiTolesa eb87c82
Fix copy paste error
AbdiTolesa e97e5d5
Apply ifelse to ternary operator
AbdiTolesa b287cdb
Fix potential bug
AbdiTolesa 4b9b483
Merge branch 'master' into issue-5873
Crabcyborg e10ff02
Fix missing upgrade modal buttons attributes
AbdiTolesa b491da7
Merge branch 'issue-5873' of https://github.com/Strategy11/formidable…
AbdiTolesa 9a7f2d1
Merge master
AbdiTolesa 70748ff
Fix PHPCS errors
AbdiTolesa 2966a6f
Merge branch 'master' into issue-5873
Crabcyborg 28fa3e1
Add unique kb links and make sure utm params are set properly for all…
AbdiTolesa 821389c
Fix code style errors
AbdiTolesa 56a3256
Merge branch 'master' into issue-5873
Crabcyborg 479b498
Merge branch 'issue-5873' of https://github.com/Strategy11/formidable…
Crabcyborg 9e2ba34
Run phpcbf
Crabcyborg 312f880
Move upsell elements html atts inside a Pro check
AbdiTolesa 2710acf
Merge branch 'issue-5873' of https://github.com/Strategy11/formidable…
AbdiTolesa fd39154
Merge branch 'master' into issue-5873
Crabcyborg c48b759
Add missing empty line before css rule
AbdiTolesa 5ffc956
Merge branch 'issue-5873' of https://github.com/Strategy11/formidable…
AbdiTolesa d14c009
Merge branch 'master' into issue-5873
Crabcyborg 4e714dd
Merge branch 'master' into issue-5873
Crabcyborg ea21cca
Apply new sniff
Crabcyborg 656970a
Fix merge conflicts and rebuild assets
AbdiTolesa dc2fde3
Merge branch 'issue-5873' of https://github.com/Strategy11/formidable…
AbdiTolesa 901f090
Enable Before/After content based upsell in Quantity and Total fields
AbdiTolesa 3a973c2
Shuffle order of upsell feature elements
AbdiTolesa cd40f6b
Merge branch 'master' into issue-5873
Crabcyborg 49a3e23
Add typo exception
Crabcyborg 9b9e2a0
Fix unique setting is always readonly
Crabcyborg 49f23ab
Use an early exit and only check the unique setting if pro is installed
Crabcyborg 52c479c
Go back to just calling the function
Crabcyborg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| <?php | ||
| if ( ! defined( 'ABSPATH' ) ) { | ||
| die( 'You are not allowed to call this page directly.' ); | ||
| } | ||
|
|
||
| /** | ||
| * Helper class for displaying upsell controls. | ||
| * | ||
| * @since x.x | ||
| */ | ||
| class FrmSettingsUpsellHelper { | ||
| /** | ||
| * @since x.x | ||
| * | ||
| * @param array $field | ||
| * | ||
| * @return array | ||
| */ | ||
| public static function get_unique_element_atts( $field ) { | ||
| $unique_element_atts = array( | ||
| 'type' => 'checkbox', | ||
| 'name' => 'field_options[unique_' . $field['id'] . ']', | ||
| 'id' => 'frm_uniq_field_' . $field['id'], | ||
| 'value' => '1', | ||
| 'class' => 'frm_mark_unique', | ||
| ); | ||
|
|
||
| if ( FrmAppHelper::pro_is_installed() ) { | ||
| if ( ! empty( $field['unique'] ) ) { | ||
| $unique_element_atts['checked'] = 'checked'; | ||
| } | ||
| return $unique_element_atts; | ||
| } | ||
|
|
||
| $unique_element_atts['data-upgrade'] = __( 'Unique fields', 'formidable' ); | ||
| $unique_element_atts['disabled'] = '1'; | ||
| $unique_element_atts['readonly'] = '1'; | ||
|
|
||
| return $unique_element_atts; | ||
| } | ||
|
|
||
| /** | ||
| * @since x.x | ||
| * | ||
| * @param array $field | ||
| * | ||
| * @return array | ||
| */ | ||
| public static function get_read_only_element_atts( $field ) { | ||
| $read_only_element_atts = array( | ||
| 'type' => 'checkbox', | ||
| 'name' => 'field_options[read_only_' . $field['id'] . ']', | ||
| 'id' => 'frm_read_only_field_' . $field['id'], | ||
| 'value' => '1', | ||
| ); | ||
AbdiTolesa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if ( ! empty( $field['read_only'] ) ) { | ||
| $read_only_element_atts['checked'] = 'checked'; | ||
| } | ||
|
|
||
| if ( ! FrmAppHelper::pro_is_installed() ) { | ||
| $read_only_element_atts['data-upgrade'] = __( 'Read only fields', 'formidable' ); | ||
| $read_only_element_atts['disabled'] = '1'; | ||
| } | ||
|
|
||
| return $read_only_element_atts; | ||
| } | ||
|
|
||
| /** | ||
| * @since x.x | ||
| * | ||
| * @param array $atts | ||
| * @param string $utm_content | ||
| * @param string $upgrade_text | ||
| * @param string $kb_slug | ||
| * | ||
| * @return array | ||
| */ | ||
| public static function add_upgrade_modal_atts( $atts, $utm_content, $upgrade_text, $kb_slug = '' ) { | ||
| if ( empty( $atts['class'] ) ) { | ||
| $atts['class'] = ''; | ||
| } | ||
|
|
||
| $atts['class'] .= ' frm_show_upgrade'; | ||
| $atts['data-medium'] = 'lite'; | ||
| $atts['data-content'] = $utm_content; | ||
| $atts['data-upgrade'] = $upgrade_text; | ||
| $atts['data-learn-more'] = 'https://formidableforms.com/knowledgebase' . $kb_slug; | ||
|
|
||
| return $atts; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
classes/views/frm-fields/back-end/upsell/ai-upsell-button.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?php | ||
| if ( ! defined( 'ABSPATH' ) ) { | ||
| die( 'You are not allowed to call this page directly.' ); | ||
| } | ||
| /** | ||
| * @since x.x | ||
AbdiTolesa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| */ | ||
| FrmFieldsHelper::render_ai_generate_options_button( | ||
| array( | ||
| 'show_pill' => true, | ||
| 'button_text' => __( 'Create with AI', 'formidable' ), | ||
| 'class' => 'frm-form-templates-create-button frm-flex-box frm-items-center frm_show_upgrade', | ||
| 'upgrade_text' => __( 'Create with AI', 'formidable' ), | ||
| ) | ||
| ); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <?php | ||
| if ( ! defined( 'ABSPATH' ) ) { | ||
| die( 'You are not allowed to call this page directly.' ); | ||
| } | ||
| /** | ||
| * @since x.x | ||
AbdiTolesa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * | ||
| * @var array $field | ||
| */ | ||
| ?> | ||
| <p class="frm6 frm_form_field frm_show_upgrade"> | ||
| <label class="frm-h-stack-xs" id="for_field_options_autocomplete_<?php echo absint( $field['id'] ); ?>" for="field_options_autocomplete_<?php echo absint( $field['id'] ); ?>"> | ||
| <span><?php esc_html_e( 'Autocomplete', 'formidable' ); ?></span> | ||
| <?php | ||
| FrmAppHelper::tooltip_icon( | ||
| __( 'The autocomplete attribute asks the browser to attempt autocompletion, based on user history.', 'formidable' ), | ||
| array( | ||
| 'data-placement' => 'right', | ||
| 'class' => 'frm-flex', | ||
| ) | ||
| ); | ||
| ?> | ||
| </label> | ||
| <select <?php FrmAppHelper::array_to_html_params( $autocomplete_upsell_atts, true ); ?>> | ||
| <option value=""><?php esc_html_e( '— Select —' ); ?></option> | ||
AbdiTolesa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </select> | ||
| </p> | ||
34 changes: 34 additions & 0 deletions
34
classes/views/frm-fields/back-end/upsell/before-after-contents.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <?php | ||
| if ( ! defined( 'ABSPATH' ) ) { | ||
| die( 'You are not allowed to call this page directly.' ); | ||
| } | ||
| /** | ||
| * @since x.x | ||
AbdiTolesa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * | ||
| * @var array $field | ||
| */ | ||
| ?> | ||
| <p class="frm_form_field frm6"> | ||
| <label class="frm-h-stack-xs frm_show_upgrade" for="prepend_<?php echo absint( $field['id'] ); ?>"> | ||
| <span><?php esc_html_e( 'Before Input', 'formidable' ); ?></span> | ||
| <?php | ||
| FrmAppHelper::tooltip_icon( | ||
| __( 'A value entered here will show directly before the input box in the form.', 'formidable' ), | ||
| array( | ||
| 'data-placement' => 'right', | ||
| 'class' => 'frm-flex', | ||
| ) | ||
| ); | ||
| ?> | ||
| </label> | ||
|
|
||
| <input id="prepend_<?php echo absint( $field['id'] ); ?>" <?php FrmAppHelper::array_to_html_params( $before_after_content_upsell_atts, true ); ?>/> | ||
| </p> | ||
|
|
||
| <p class="frm_form_field frm6"> | ||
| <label for="append_<?php echo absint( $field['id'] ); ?>" class="frm_show_upgrade"> | ||
| <?php esc_html_e( 'After Input', 'formidable' ); ?> | ||
| </label> | ||
|
|
||
| <input id="append_<?php echo absint( $field['id'] ); ?>" <?php FrmAppHelper::array_to_html_params( $before_after_content_upsell_atts, true ); ?>/> | ||
| </p> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.