| @@ -7,12 +7,11 @@ | ||
| 7 | 7 | |
| 8 | 8 | use LassoLite\Classes\Amazon_Api; |
| 9 | 9 | use LassoLite\Classes\Config; |
| 10 | 10 | use LassoLite\Classes\Helper; |
| 11 | -use LassoLite\Classes\License; | |
| 12 | 11 | use LassoLite\Classes\Setting; |
| 13 | -use LassoLite\Admin\Constant; | |
| 14 | 12 | |
| 13 | + | |
| 15 | 14 | $lasso_options = Setting::get_settings(); |
| 16 | 15 | |
| 17 | 16 | $amazon_default_tracking_country = ! empty( $lasso_options['amazon_default_tracking_country'] ) |
| 18 | 17 | ? $lasso_options['amazon_default_tracking_country'] : '1'; |
| @@ -17,30 +16,15 @@ | ||
| 17 | 16 | $amazon_default_tracking_country = ! empty( $lasso_options['amazon_default_tracking_country'] ) |
| 18 | 17 | ? $lasso_options['amazon_default_tracking_country'] : '1'; |
| 19 | 18 | $countries_dd = Helper::get_countries_dd( $amazon_default_tracking_country ); |
| 20 | 19 | |
| 21 | -$amazon_tracking_id = $lasso_options['amazon_tracking_id'] ?? ''; | |
| 22 | -$amazon_access_key_id = $lasso_options['amazon_access_key_id'] ?? ''; | |
| 23 | -$amazon_secret_key = $lasso_options['amazon_secret_key'] ?? ''; | |
| 24 | -$amazon_creators_credential_id = $lasso_options['amazon_creators_credential_id'] ?? ''; | |
| 25 | -$amazon_creators_secret = $lasso_options['amazon_creators_secret'] ?? ''; | |
| 26 | -$amazon_creators_version = $lasso_options['amazon_creators_version'] ?? ''; | |
| 27 | -$amazon_creators_partner_tag = $lasso_options['amazon_creators_partner_tag'] ?? ''; | |
| 28 | -$auto_monetize_amazon = $lasso_options['auto_monetize_amazon'] ?? false; | |
| 20 | +$amazon_tracking_id = $lasso_options['amazon_tracking_id'] ?? ''; | |
| 21 | +$amazon_access_key_id = $lasso_options['amazon_access_key_id'] ?? ''; | |
| 22 | +$amazon_secret_key = $lasso_options['amazon_secret_key'] ?? ''; | |
| 29 | 23 | |
| 30 | 24 | $is_valid_tracking_id = empty( $amazon_tracking_id ) ? true : Amazon_Api::validate_tracking_id( $amazon_tracking_id ); |
| 31 | 25 | $tracking_id_class = $is_valid_tracking_id ? '' : ' invalid-field'; |
| 32 | 26 | $tracking_id_invalid_class = $is_valid_tracking_id ? ' d-none' : ''; |
| 33 | - | |
| 34 | -$amazon_pricing_daily = $lasso_options['amazon_pricing_daily'] ?? true; | |
| 35 | -$update_price_checked = $amazon_pricing_daily ? 'checked' : ''; | |
| 36 | - | |
| 37 | -$license_active = License::get_license_status(); | |
| 38 | -$class_license_active = $license_active ? '' : 'lasso-lite-disabled no-hint'; | |
| 39 | -$class_license_display = !empty( $license_active ) ? 'd-none' : ''; | |
| 40 | -$auto_upgrade_eligible_links = $lasso_options['auto_upgrade_eligible_links'] ?? true; | |
| 41 | - | |
| 42 | -$lite_account_cta_prefill_email = Helper::get_option( Constant::LASSO_ACCOUNT_EMAIL, '' ); | |
| 43 | 27 | ?> |
| 44 | 28 | |
| 45 | 29 | <?php Config::get_header(); ?> |
| 46 | 30 | |
| @@ -66,13 +50,13 @@ | ||
| 66 | 50 | <input type="text" name="amazon_tracking_id" id="amazon_tracking_id" class="form-control<?php echo $tracking_id_class; ?>" value="<?php echo esc_html( $amazon_tracking_id ) ?>" placeholder="tracking-20"> |
| 67 | 51 | <div id="tracking-id-invalid-msg" class="red<?php echo $tracking_id_invalid_class; ?>">This is an invalid Tracking ID</div> |
| 68 | 52 | </div> |
| 69 | 53 | <div class="form-group"> |
| 70 | - <label class="toggle m-0 mr-1"> | |
| 71 | - <input type="checkbox" name="amazon_pricing_daily" id="amazon_pricing_daily" <?php echo $update_price_checked; ?>> | |
| 54 | + <label class="toggle m-0 mr-1 lasso-lite-disabled no-hint"> | |
| 55 | + <input type="checkbox" disabled="disabled" checked> | |
| 72 | 56 | <span class="slider"></span> |
| 73 | 57 | </label> |
| 74 | - <label class="m-0">Update Amazon pricing daily</label> | |
| 58 | + <label class="m-0 lasso-lite-disabled no-hint">Update Amazon pricing daily</label> | |
| 75 | 59 | </div> |
| 76 | 60 | </section> |
| 77 | 61 | </div> |
| 78 | 62 | |
| @@ -79,18 +63,17 @@ | ||
| 79 | 63 | |
| 80 | 64 | <!-- AUTO MONETIZE AMAZON --> |
| 81 | 65 | <div class="white-bg rounded shadow p-4"> |
| 82 | 66 | <section> |
| 83 | - <p class="<?php echo $class_license_display ?>">Auto-Monetize Amazon Links is available with the Pro plan. <a href="<?php echo Constant::LASSO_CHECKOUT_URL_DEFAULT; ?>" target="_blank" class="purple underline">Click here to upgrade</a>.</p> | |
| 84 | - <h3 class="<?php echo $class_license_active ?>">Auto-Monetize Amazon Links</h3> | |
| 85 | - <p class="<?php echo $class_license_active ?>">Automatically monetize all current and future Amazon links with your Tracking ID and and added to your affiliate dashboard.</p> | |
| 67 | + <h3 class="lasso-lite-disabled no-hint">Auto-Monetize Amazon Links</h3> | |
| 68 | + <p class="lasso-lite-disabled no-hint">Automatically monetize all current and future Amazon links with your Tracking ID and and added to your affiliate dashboard.</p> | |
| 86 | 69 | |
| 87 | 70 | <p> |
| 88 | - <label class="toggle m-0 mr-1"> | |
| 89 | - <input type="checkbox" name="auto_monetize_amazon" id="auto_monetize_amazon" <?php echo $auto_monetize_amazon ? 'checked' : ''; ?>> | |
| 71 | + <label class="toggle m-0 mr-1 lasso-lite-disabled no-hint"> | |
| 72 | + <input type="checkbox" disabled="disabled"> | |
| 90 | 73 | <span class="slider"></span> |
| 91 | 74 | </label> |
| 92 | - <label class="m-0">Enable Amazon Auto-Monetization</label> | |
| 75 | + <label class="m-0 lasso-lite-disabled no-hint">Enable Amazon Auto-Monetization</label> | |
| 93 | 76 | </p> |
| 94 | 77 | <p class="text-danger amazon-error"></p> |
| 95 | 78 | </section> |
| 96 | 79 | <section> |
| @@ -109,14 +92,13 @@ | ||
| 109 | 92 | </div> |
| 110 | 93 | </div> |
| 111 | 94 | |
| 112 | 95 | <div class="col-lg"> |
| 113 | - <div class="white-bg rounded shadow p-4 mb-lg-0 mb-5 amazon-api-card"> | |
| 96 | + <div class="white-bg rounded shadow p-4 mb-lg-0 mb-5"> | |
| 97 | + <!-- PRODUCT API --> | |
| 114 | 98 | <section> |
| 115 | - <h3 class="d-inline-block align-middle mr-2">Amazon Product Data API</h3> | |
| 116 | - <a href="https://support.getlasso.co/en/articles/3182308-how-to-set-up-amazon-creators-api-credentials-with-lasso" target="_blank" rel="noopener noreferrer" class="btn btn-sm learn-btn mb-2"> | |
| 117 | - <i class="far fa-info-circle"></i> Learn | |
| 118 | - </a> | |
| 99 | + <h3>Amazon Product API</h3> | |
| 100 | + <p>If you want to use the Amazon API for product data, here's how to get your <a href="https://support.getlasso.co/en/articles/3182308-how-to-get-your-amazon-product-api-keys" target="_blank" class="purple underline">API keys from Amazon</a>.</p> | |
| 119 | 101 | |
| 120 | 102 | <div class="form-group"> |
| 121 | 103 | <label data-tooltip="Select your Amazon Associates locale."><strong>Default Tracking ID</strong> <i class="far fa-info-circle light-purple"></i></label> |
| 122 | 104 | <?php echo $countries_dd; ?> |
| @@ -121,61 +103,17 @@ | ||
| 121 | 103 | <label data-tooltip="Select your Amazon Associates locale."><strong>Default Tracking ID</strong> <i class="far fa-info-circle light-purple"></i></label> |
| 122 | 104 | <?php echo $countries_dd; ?> |
| 123 | 105 | </div> |
| 124 | 106 | |
| 125 | - <div class="amazon-paapi-fields"> | |
| 126 | - <p>If you want to use the Amazon API for product data, here's how to get your <a href="https://support.getlasso.co/en/articles/3182308-how-to-get-your-amazon-product-api-keys" target="_blank" class="purple underline">API keys from Amazon</a>.</p> | |
| 127 | - <p class="<?php echo $class_license_display; ?>">You can get Amazon product names, images, and pricing without an API key with the <a href="<?php echo Constant::LASSO_CHECKOUT_URL_DEFAULT; ?>" target="_blank" class="purple underline">Lasso Pro plan</a>.</p> | |
| 128 | - | |
| 129 | - <div class="form-group mb-4"> | |
| 130 | - <label><strong>Access Key ID</strong></label> | |
| 131 | - <input type="text" name="amazon_access_key_id" id="amazon_access_key_id" class="form-control" value="<?php echo esc_html( $amazon_access_key_id ); ?>" placeholder="Access Key ID"> | |
| 132 | - </div> | |
| 133 | - | |
| 134 | - <div class="form-group mb-4"> | |
| 135 | - <label><strong>Secret Key</strong></label> | |
| 136 | - <input type="text" name="amazon_secret_key" id="amazon_secret_key" class="form-control" value="<?php echo esc_html( $amazon_secret_key ); ?>" placeholder="Secret Key"> | |
| 137 | - </div> | |
| 107 | + <div class="form-group mb-4"> | |
| 108 | + <label><strong>Access Key ID</strong></label> | |
| 109 | + <input type="text" name="amazon_access_key_id" id="amazon_access_key_id" class="form-control" value="<?php echo esc_html( $amazon_access_key_id ) ?>" placeholder="Access Key ID"> | |
| 138 | 110 | </div> |
| 139 | 111 | |
| 140 | - <div class="amazon-creators-fields d-none"> | |
| 141 | - <p>If you want to use the Amazon Creators API for product data, here's how to get your <a href="https://support.getlasso.co/en/articles/3182308-how-to-set-up-amazon-creators-api-credentials-with-lasso" target="_blank" class="purple underline">Creators API credentials from Amazon</a>.</p> | |
| 142 | - <p class="<?php echo $class_license_display; ?>">You can get Amazon product names, images, and pricing without an API key with the <a href="<?php echo Constant::LASSO_CHECKOUT_URL_DEFAULT; ?>" target="_blank" class="purple underline">Lasso Pro plan</a>.</p> | |
| 143 | - | |
| 144 | - <div class="form-group mb-4"> | |
| 145 | - <label><strong>Credential ID</strong></label> | |
| 146 | - <input type="password" name="amazon_creators_credential_id" id="amazon_creators_credential_id" class="form-control" value="<?php echo esc_html( $amazon_creators_credential_id ); ?>" placeholder="amzn1.application-oa2-client.xxxxx"> | |
| 147 | - </div> | |
| 148 | - | |
| 149 | - <div class="form-group mb-4"> | |
| 150 | - <label><strong>Secret</strong></label> | |
| 151 | - <input type="password" name="amazon_creators_secret" id="amazon_creators_secret" class="form-control" value="<?php echo esc_html( $amazon_creators_secret ); ?>" placeholder="client-secret"> | |
| 152 | - </div> | |
| 153 | - | |
| 154 | - <div class="form-row"> | |
| 155 | - <div class="form-group col-12 col-md-8 mb-4"> | |
| 156 | - <label><strong>Partner tag</strong></label> | |
| 157 | - <input type="text" name="amazon_creators_partner_tag" id="amazon_creators_partner_tag" class="form-control" value="<?php echo esc_html( $amazon_creators_partner_tag ); ?>" placeholder="yourtag-20"> | |
| 158 | - </div> | |
| 159 | - | |
| 160 | - <div class="form-group col-12 col-md-4 mb-4"> | |
| 161 | - <label><strong>Version</strong></label> | |
| 162 | - <input type="text" name="amazon_creators_version" id="amazon_creators_version" class="form-control" value="<?php echo esc_html( $amazon_creators_version ); ?>" placeholder="3.1"> | |
| 163 | - </div> | |
| 164 | - </div> | |
| 165 | - | |
| 166 | - <div class="form-group mb-3 text-right"> | |
| 167 | - <button type="button" class="btn btn-sm btn-lasso-lite-verify-amazon-creators">Validate</button> | |
| 168 | - </div> | |
| 112 | + <div class="form-group mb-4"> | |
| 113 | + <label><strong>Secret Key</strong></label> | |
| 114 | + <input type="text" name="amazon_secret_key" id="amazon_secret_key" class="form-control" value="<?php echo esc_html( $amazon_secret_key ) ?>" placeholder="Secret Key"> | |
| 169 | 115 | </div> |
| 170 | - | |
| 171 | - <div class="form-group"> | |
| 172 | - <label class="toggle m-0 mr-1"> | |
| 173 | - <input type="checkbox" id="lasso-amazon-api-use-creators" class="amazon-api-mode-toggle"> | |
| 174 | - <span class="slider"></span> | |
| 175 | - </label> | |
| 176 | - <label class="m-0" for="lasso-amazon-api-use-creators">Use Creators API</label> | |
| 177 | - </div> | |
| 178 | 116 | </section> |
| 179 | 117 | |
| 180 | 118 | <div class="form-group"> |
| 181 | 119 | <label class="toggle m-0 mr-1 lasso-lite-disabled no-hint"> |
| @@ -191,25 +129,8 @@ | ||
| 191 | 129 | <span class="slider"></span> |
| 192 | 130 | </label> |
| 193 | 131 | <label class="m-0 lasso-lite-disabled no-hint">Show Discount Pricing</label> |
| 194 | 132 | </div> |
| 195 | - | |
| 196 | - <div class="form-group"> | |
| 197 | - <label class="toggle m-0 mr-1"> | |
| 198 | - <input type="checkbox" name="auto_upgrade_eligible_links" id="auto_upgrade_eligible_links" <?php echo $auto_upgrade_eligible_links ? 'checked' : ''; ?>> | |
| 199 | - <span class="slider"></span> | |
| 200 | - </label> | |
| 201 | - <label class="m-0"> | |
| 202 | - Auto-upgrade Eligible Links | |
| 203 | - <a | |
| 204 | - href="https://getlasso.co/features/affiliate-plus/" | |
| 205 | - target="_blank" | |
| 206 | - rel="noopener noreferrer" | |
| 207 | - data-tooltip="Learn more" | |
| 208 | - class="ml-1" | |
| 209 | - ><i class="far fa-info-circle light-purple"></i></a> | |
| 210 | - </label> | |
| 211 | - </div> | |
| 212 | 133 | </div> |
| 213 | 134 | </div> |
| 214 | 135 | |
| 215 | 136 | </div> |
| @@ -222,19 +143,6 @@ | ||
| 222 | 143 | </div> |
| 223 | 144 | </form> |
| 224 | 145 | </div> |
| 225 | 146 | </section> |
| 226 | -<?php | |
| 227 | -echo Helper::include_with_variables( | |
| 228 | - SIMPLE_URLS_DIR . '/admin/views/modals/lite-account-existing-login.php', | |
| 229 | - array( | |
| 230 | - 'prefill_email' => $lite_account_cta_prefill_email, | |
| 231 | - ) | |
| 232 | -); | |
| 233 | -?> | |
| 234 | -<?php | |
| 235 | -// Amazon notices: keep legacy banner UX (click row / X to dismiss) on default-template-jsrender.html. | |
| 236 | -// Lite-account CTA only uses default-template-amz-html-jsrender.html (row is not a collapse trigger; link is real <a>). | |
| 237 | -echo Helper::wrapper_js_render( 'default-template-notification-amz', Helper::get_path_views_folder() . '/notifications/default-template-jsrender.html' ); | |
| 238 | -echo Helper::wrapper_js_render( 'default-template-notification-amz-html', Helper::get_path_views_folder() . '/notifications/default-template-amz-html-jsrender.html' ); | |
| 239 | -?> | |
| 147 | +<?php echo Helper::wrapper_js_render( 'default-template-notification-amz', Helper::get_path_views_folder() . '/notifications/default-template-jsrender.html' )?> | |
| 240 | 148 | <?php Config::get_footer(); ?> |