Changeset 2913184
- Timestamp:
- 05/16/2023 06:43:48 PM (3 years ago)
- Location:
- datafeedr-woocommerce-importer
- Files:
-
- 6 edited
- 1 copied
-
tags/1.3.6 (copied) (copied from datafeedr-woocommerce-importer/trunk)
-
tags/1.3.6/datafeedr-woocommerce-importer.php (modified) (10 diffs)
-
tags/1.3.6/filters.php (modified) (6 diffs)
-
tags/1.3.6/readme.txt (modified) (2 diffs)
-
trunk/datafeedr-woocommerce-importer.php (modified) (10 diffs)
-
trunk/filters.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
datafeedr-woocommerce-importer/tags/1.3.6/datafeedr-woocommerce-importer.php
r2901932 r2913184 10 10 Requires PHP: 7.4 11 11 Requires at least: 3.8 12 Tested up to: 6.2.1- alpha13 Version: 1.3. 512 Tested up to: 6.2.1-RC1 13 Version: 1.3.6 14 14 15 15 WC requires at least: 3.0 16 WC tested up to: 7. 016 WC tested up to: 7.7 17 17 18 18 Datafeedr WooCommerce Importer plugin … … 43 43 * Define constants. 44 44 */ 45 define( 'DFRPSWC_VERSION', '1.3. 5' );45 define( 'DFRPSWC_VERSION', '1.3.6' ); 46 46 define( 'DFRPSWC_DB_VERSION', '1.2.0' ); 47 47 define( 'DFRPSWC_URL', plugin_dir_url( __FILE__ ) ); … … 174 174 ?> 175 175 176 <div class="error">177 <p>178 <strong style="color:#E44532;"><?php _e( 'URGENT - ACTION REQUIRED!', DFRPSWC_DOMAIN ); ?></strong>179 180 <br/>176 <div class="error"> 177 <p> 178 <strong style="color:#E44532;"><?php _e( 'URGENT - ACTION REQUIRED!', DFRPSWC_DOMAIN ); ?></strong> 179 180 <br/> 181 181 182 182 <?php … … 187 187 ?> 188 188 189 <br/>189 <br/> 190 190 191 191 <?php … … 195 195 ?> 196 196 197 <br/>198 199 <a class="button button-primary button-large" style="margin-top: 6px" href="<?php echo $url; ?>">197 <br/> 198 199 <a class="button button-primary button-large" style="margin-top: 6px" href="<?php echo $url; ?>"> 200 200 <?php _e( 'Update Now', 'dfrpswc_integration' ); ?> 201 </a>202 </p>203 </div>201 </a> 202 </p> 203 </div> 204 204 205 205 <?php … … 282 282 * @return array 283 283 */ 284 function dfrpswc_get_default_options() {284 function dfrpswc_get_default_options(): array { 285 285 return [ 286 286 'button_text' => 'Buy Now', … … 290 290 'target_single' => '_blank', 291 291 'target_loop' => '_blank', 292 'display_sku' => 'yes', 292 293 ]; 293 294 } … … 334 335 __( 'Format Prices', 'dfrpswc_integration' ), 335 336 'dfrpswc_format_price_field', 337 'dfrpswc_options-page', 338 'dfrpswc_general_settings' 339 ); 340 341 add_settings_field( 342 'dfrpswc_display_sku', 343 __( 'Display SKU', 'dfrpswc_integration' ), 344 'dfrpswc_display_sku_field', 336 345 'dfrpswc_options-page', 337 346 'dfrpswc_general_settings' … … 423 432 424 433 /** 434 * Display SKU field. 435 */ 436 function dfrpswc_display_sku_field(): void { 437 $options = dfrpswc_get_options(); 438 $value = $options['display_sku']; 439 $yes = 'yes'; 440 $no = 'no'; 441 $selected_yes = checked( $yes, $value, false ); 442 $selected_no = checked( $no, $value, false ); 443 444 echo '<input type="radio" class="regular-text" name="dfrpswc_options[display_sku]" value="' . esc_attr( $yes ) . '" ' . $selected_yes . ' /> ' . ucfirst( $yes ); 445 echo ' <input type="radio" class="regular-text" name="dfrpswc_options[display_sku]" value="' . esc_attr( $no ) . '" ' . $selected_no . ' /> ' . ucfirst( $no ); 446 echo '<p class="description">'; 447 esc_html_e( 'By default, Datafeedr\'s unique product ID will appear on your single product pages.', 'dfrpswc_integration' ); 448 echo '<br/>'; 449 echo __( '- Select "Yes" to continue displaying the product ID. (default)', 'dfrpswc_integration' ); 450 echo '<br/>'; 451 echo __( '- Select "No" to hide the SKU.', 'dfrpswc_integration' ); 452 echo '<br/>'; 453 printf( '<a href="%s" target="_blank" rel="noopener">%s</a>', 454 'https://datafeedrapi.helpscoutdocs.com/article/164-remove-sku-from-single-product-page', 455 esc_html__( 'Learn More', 'dfrpswc_integration' ) 456 ); 457 echo '</p>'; 458 } 459 460 /** 425 461 * Set the rel attribute for the buy button on the single product page. 426 462 */ … … 484 520 if ( $key === 'format_price' ) { 485 521 $new_input['format_price'] = $value === 'yes' ? 'yes' : 'no'; 522 } 523 524 if ( $key === 'display_sku' ) { 525 $new_input['display_sku'] = in_array( $value, [ 'yes', 'no' ], true ) ? $value : 'yes'; 486 526 } 487 527 -
datafeedr-woocommerce-importer/tags/1.3.6/filters.php
r2705769 r2913184 153 153 'description' => '', 154 154 'fields' => [ 155 'button_text' => [ 155 'format_price' => [ 156 'label' => __( 'Format Prices', 'dfrpswc_integration' ), 157 'value' => ! empty( $options['format_price'] ) ? ucfirst( $options['format_price'] ) : '—', 158 'debug' => ! empty( $options['format_price'] ) ? $options['format_price'] : '—', 159 ], 160 'display_sku' => [ 161 'label' => __( 'Display SKU', 'dfrpswc_integration' ), 162 'value' => ! empty( $options['display_sku'] ) ? ucfirst( $options['display_sku'] ) : '—', 163 'debug' => ! empty( $options['display_sku'] ) ? $options['display_sku'] : '—', 164 ], 165 'button_text' => [ 156 166 'label' => __( 'Button Text', 'dfrpswc_integration' ), 157 'value' => isset( $options['button_text'] ) && ! empty( $options['button_text'] ) ? $options['button_text'] : '—', 158 ], 159 'format_price' => [ 160 'label' => __( 'Format Prices', 'dfrpswc_integration' ), 161 'value' => isset( $options['format_price'] ) && ! empty( $options['format_price'] ) ? ucfirst( $options['format_price'] ) : '—', 162 'debug' => isset( $options['format_price'] ) && ! empty( $options['format_price'] ) ? $options['format_price'] : '—', 167 'value' => ! empty( $options['button_text'] ) ? $options['button_text'] : '—', 168 ], 169 'rel_loop' => [ 170 'label' => __( 'Loop Page rel', 'dfrpswc_integration' ), 171 'value' => ! empty( $options['rel_loop'] ) ? $options['rel_loop'] : '—', 172 ], 173 'rel_single' => [ 174 'label' => __( 'Single Product Page rel', 'dfrpswc_integration' ), 175 'value' => ! empty( $options['rel_single'] ) ? $options['rel_single'] : '—', 176 ], 177 'target_loop' => [ 178 'label' => __( 'Loop Page target', 'dfrpswc_integration' ), 179 'value' => ! empty( $options['target_loop'] ) ? $options['target_loop'] : '—', 180 ], 181 'target_single' => [ 182 'label' => __( 'Single Product Page target', 'dfrpswc_integration' ), 183 'value' => ! empty( $options['target_single'] ) ? $options['target_single'] : '—', 163 184 ], 164 185 ] … … 206 227 * Set the rel attribute for the Buy Button on Single Product Pages. 207 228 * 229 * @param string $product_type 230 * 231 * @param string $rel 232 * 233 * @return string 208 234 * @since 1.2.58 209 235 * 210 * @param string $product_type211 *212 * @param string $rel213 *214 * @return string215 236 */ 216 237 function dfrpswc_single_product_button_rel( string $rel, string $product_type ) { … … 225 246 * Set the rel attribute for the Buy Button in the Loop. 226 247 * 248 * @param WC_Product $product 249 * 250 * @param array $args 251 * 252 * @return array 227 253 * @since 1.2.58 228 254 * 229 * @param WC_Product $product230 *231 * @param array $args232 *233 * @return array234 255 */ 235 256 function dfrpswc_loop_button_rel( array $args, WC_Product $product ) { … … 246 267 * Set the target attribute for the Buy Button on Single Product Pages. 247 268 * 269 * @param string $product_type 270 * 271 * @param string $rel 272 * 273 * @return string 248 274 * @since 1.2.58 249 275 * 250 * @param string $product_type251 *252 * @param string $rel253 *254 * @return string255 276 */ 256 277 function dfrpswc_single_product_button_target( string $target, string $product_type ) { … … 265 286 * Set the target attribute for the Buy Button in the Loop. 266 287 * 288 * @param WC_Product $product 289 * 290 * @param array $args 291 * 292 * @return array 293 * 267 294 * @since 1.2.58 268 *269 * @param WC_Product $product270 *271 * @param array $args272 *273 * @return array274 295 * 275 296 */ … … 283 304 284 305 add_filter( 'woocommerce_loop_add_to_cart_args', 'dfrpswc_loop_button_target', 10, 2 ); 306 307 /** 308 * Remove "SKU" from WooCommerce single product details page. 309 * 310 * @param bool $boolean 311 * 312 * @return bool 313 * @since 1.3.6 314 */ 315 function dfrpswc_display_sku( bool $boolean ): bool { 316 317 if ( ! is_single() ) { 318 return $boolean; 319 } 320 321 if ( $boolean === false ) { 322 return $boolean; 323 } 324 325 return dfrpswc_get_option( 'display_sku', 'yes' ) === 'yes'; 326 } 327 328 add_filter( 'wc_product_sku_enabled', 'dfrpswc_display_sku' ); -
datafeedr-woocommerce-importer/tags/1.3.6/readme.txt
r2901932 r2913184 8 8 Requires PHP: 7.4 9 9 Requires at least: 3.8 10 Tested up to: 6.2.1- alpha11 Stable tag: 1.3. 510 Tested up to: 6.2.1-RC1 11 Stable tag: 1.3.6 12 12 13 13 Import products from the Datafeedr API into your WooCommerce store. … … 200 200 == Changelog == 201 201 202 = 1.3.6 - 2023/05/16 = 203 * Created option to disable SKU from appearing on Single Product Pages (WordPress Admin Area > Product Sets > WC Importer > Display SKU) 204 202 205 = 1.3.5 - 2023/04/20 = 203 206 * Updated tested up to values -
datafeedr-woocommerce-importer/trunk/datafeedr-woocommerce-importer.php
r2901932 r2913184 10 10 Requires PHP: 7.4 11 11 Requires at least: 3.8 12 Tested up to: 6.2.1- alpha13 Version: 1.3. 512 Tested up to: 6.2.1-RC1 13 Version: 1.3.6 14 14 15 15 WC requires at least: 3.0 16 WC tested up to: 7. 016 WC tested up to: 7.7 17 17 18 18 Datafeedr WooCommerce Importer plugin … … 43 43 * Define constants. 44 44 */ 45 define( 'DFRPSWC_VERSION', '1.3. 5' );45 define( 'DFRPSWC_VERSION', '1.3.6' ); 46 46 define( 'DFRPSWC_DB_VERSION', '1.2.0' ); 47 47 define( 'DFRPSWC_URL', plugin_dir_url( __FILE__ ) ); … … 174 174 ?> 175 175 176 <div class="error">177 <p>178 <strong style="color:#E44532;"><?php _e( 'URGENT - ACTION REQUIRED!', DFRPSWC_DOMAIN ); ?></strong>179 180 <br/>176 <div class="error"> 177 <p> 178 <strong style="color:#E44532;"><?php _e( 'URGENT - ACTION REQUIRED!', DFRPSWC_DOMAIN ); ?></strong> 179 180 <br/> 181 181 182 182 <?php … … 187 187 ?> 188 188 189 <br/>189 <br/> 190 190 191 191 <?php … … 195 195 ?> 196 196 197 <br/>198 199 <a class="button button-primary button-large" style="margin-top: 6px" href="<?php echo $url; ?>">197 <br/> 198 199 <a class="button button-primary button-large" style="margin-top: 6px" href="<?php echo $url; ?>"> 200 200 <?php _e( 'Update Now', 'dfrpswc_integration' ); ?> 201 </a>202 </p>203 </div>201 </a> 202 </p> 203 </div> 204 204 205 205 <?php … … 282 282 * @return array 283 283 */ 284 function dfrpswc_get_default_options() {284 function dfrpswc_get_default_options(): array { 285 285 return [ 286 286 'button_text' => 'Buy Now', … … 290 290 'target_single' => '_blank', 291 291 'target_loop' => '_blank', 292 'display_sku' => 'yes', 292 293 ]; 293 294 } … … 334 335 __( 'Format Prices', 'dfrpswc_integration' ), 335 336 'dfrpswc_format_price_field', 337 'dfrpswc_options-page', 338 'dfrpswc_general_settings' 339 ); 340 341 add_settings_field( 342 'dfrpswc_display_sku', 343 __( 'Display SKU', 'dfrpswc_integration' ), 344 'dfrpswc_display_sku_field', 336 345 'dfrpswc_options-page', 337 346 'dfrpswc_general_settings' … … 423 432 424 433 /** 434 * Display SKU field. 435 */ 436 function dfrpswc_display_sku_field(): void { 437 $options = dfrpswc_get_options(); 438 $value = $options['display_sku']; 439 $yes = 'yes'; 440 $no = 'no'; 441 $selected_yes = checked( $yes, $value, false ); 442 $selected_no = checked( $no, $value, false ); 443 444 echo '<input type="radio" class="regular-text" name="dfrpswc_options[display_sku]" value="' . esc_attr( $yes ) . '" ' . $selected_yes . ' /> ' . ucfirst( $yes ); 445 echo ' <input type="radio" class="regular-text" name="dfrpswc_options[display_sku]" value="' . esc_attr( $no ) . '" ' . $selected_no . ' /> ' . ucfirst( $no ); 446 echo '<p class="description">'; 447 esc_html_e( 'By default, Datafeedr\'s unique product ID will appear on your single product pages.', 'dfrpswc_integration' ); 448 echo '<br/>'; 449 echo __( '- Select "Yes" to continue displaying the product ID. (default)', 'dfrpswc_integration' ); 450 echo '<br/>'; 451 echo __( '- Select "No" to hide the SKU.', 'dfrpswc_integration' ); 452 echo '<br/>'; 453 printf( '<a href="%s" target="_blank" rel="noopener">%s</a>', 454 'https://datafeedrapi.helpscoutdocs.com/article/164-remove-sku-from-single-product-page', 455 esc_html__( 'Learn More', 'dfrpswc_integration' ) 456 ); 457 echo '</p>'; 458 } 459 460 /** 425 461 * Set the rel attribute for the buy button on the single product page. 426 462 */ … … 484 520 if ( $key === 'format_price' ) { 485 521 $new_input['format_price'] = $value === 'yes' ? 'yes' : 'no'; 522 } 523 524 if ( $key === 'display_sku' ) { 525 $new_input['display_sku'] = in_array( $value, [ 'yes', 'no' ], true ) ? $value : 'yes'; 486 526 } 487 527 -
datafeedr-woocommerce-importer/trunk/filters.php
r2705769 r2913184 153 153 'description' => '', 154 154 'fields' => [ 155 'button_text' => [ 155 'format_price' => [ 156 'label' => __( 'Format Prices', 'dfrpswc_integration' ), 157 'value' => ! empty( $options['format_price'] ) ? ucfirst( $options['format_price'] ) : '—', 158 'debug' => ! empty( $options['format_price'] ) ? $options['format_price'] : '—', 159 ], 160 'display_sku' => [ 161 'label' => __( 'Display SKU', 'dfrpswc_integration' ), 162 'value' => ! empty( $options['display_sku'] ) ? ucfirst( $options['display_sku'] ) : '—', 163 'debug' => ! empty( $options['display_sku'] ) ? $options['display_sku'] : '—', 164 ], 165 'button_text' => [ 156 166 'label' => __( 'Button Text', 'dfrpswc_integration' ), 157 'value' => isset( $options['button_text'] ) && ! empty( $options['button_text'] ) ? $options['button_text'] : '—', 158 ], 159 'format_price' => [ 160 'label' => __( 'Format Prices', 'dfrpswc_integration' ), 161 'value' => isset( $options['format_price'] ) && ! empty( $options['format_price'] ) ? ucfirst( $options['format_price'] ) : '—', 162 'debug' => isset( $options['format_price'] ) && ! empty( $options['format_price'] ) ? $options['format_price'] : '—', 167 'value' => ! empty( $options['button_text'] ) ? $options['button_text'] : '—', 168 ], 169 'rel_loop' => [ 170 'label' => __( 'Loop Page rel', 'dfrpswc_integration' ), 171 'value' => ! empty( $options['rel_loop'] ) ? $options['rel_loop'] : '—', 172 ], 173 'rel_single' => [ 174 'label' => __( 'Single Product Page rel', 'dfrpswc_integration' ), 175 'value' => ! empty( $options['rel_single'] ) ? $options['rel_single'] : '—', 176 ], 177 'target_loop' => [ 178 'label' => __( 'Loop Page target', 'dfrpswc_integration' ), 179 'value' => ! empty( $options['target_loop'] ) ? $options['target_loop'] : '—', 180 ], 181 'target_single' => [ 182 'label' => __( 'Single Product Page target', 'dfrpswc_integration' ), 183 'value' => ! empty( $options['target_single'] ) ? $options['target_single'] : '—', 163 184 ], 164 185 ] … … 206 227 * Set the rel attribute for the Buy Button on Single Product Pages. 207 228 * 229 * @param string $product_type 230 * 231 * @param string $rel 232 * 233 * @return string 208 234 * @since 1.2.58 209 235 * 210 * @param string $product_type211 *212 * @param string $rel213 *214 * @return string215 236 */ 216 237 function dfrpswc_single_product_button_rel( string $rel, string $product_type ) { … … 225 246 * Set the rel attribute for the Buy Button in the Loop. 226 247 * 248 * @param WC_Product $product 249 * 250 * @param array $args 251 * 252 * @return array 227 253 * @since 1.2.58 228 254 * 229 * @param WC_Product $product230 *231 * @param array $args232 *233 * @return array234 255 */ 235 256 function dfrpswc_loop_button_rel( array $args, WC_Product $product ) { … … 246 267 * Set the target attribute for the Buy Button on Single Product Pages. 247 268 * 269 * @param string $product_type 270 * 271 * @param string $rel 272 * 273 * @return string 248 274 * @since 1.2.58 249 275 * 250 * @param string $product_type251 *252 * @param string $rel253 *254 * @return string255 276 */ 256 277 function dfrpswc_single_product_button_target( string $target, string $product_type ) { … … 265 286 * Set the target attribute for the Buy Button in the Loop. 266 287 * 288 * @param WC_Product $product 289 * 290 * @param array $args 291 * 292 * @return array 293 * 267 294 * @since 1.2.58 268 *269 * @param WC_Product $product270 *271 * @param array $args272 *273 * @return array274 295 * 275 296 */ … … 283 304 284 305 add_filter( 'woocommerce_loop_add_to_cart_args', 'dfrpswc_loop_button_target', 10, 2 ); 306 307 /** 308 * Remove "SKU" from WooCommerce single product details page. 309 * 310 * @param bool $boolean 311 * 312 * @return bool 313 * @since 1.3.6 314 */ 315 function dfrpswc_display_sku( bool $boolean ): bool { 316 317 if ( ! is_single() ) { 318 return $boolean; 319 } 320 321 if ( $boolean === false ) { 322 return $boolean; 323 } 324 325 return dfrpswc_get_option( 'display_sku', 'yes' ) === 'yes'; 326 } 327 328 add_filter( 'wc_product_sku_enabled', 'dfrpswc_display_sku' ); -
datafeedr-woocommerce-importer/trunk/readme.txt
r2901932 r2913184 8 8 Requires PHP: 7.4 9 9 Requires at least: 3.8 10 Tested up to: 6.2.1- alpha11 Stable tag: 1.3. 510 Tested up to: 6.2.1-RC1 11 Stable tag: 1.3.6 12 12 13 13 Import products from the Datafeedr API into your WooCommerce store. … … 200 200 == Changelog == 201 201 202 = 1.3.6 - 2023/05/16 = 203 * Created option to disable SKU from appearing on Single Product Pages (WordPress Admin Area > Product Sets > WC Importer > Display SKU) 204 202 205 = 1.3.5 - 2023/04/20 = 203 206 * Updated tested up to values
Note: See TracChangeset
for help on using the changeset viewer.