Changeset 3336133
- Timestamp:
- 07/29/2025 04:53:44 PM (8 months ago)
- Location:
- printess-editor/trunk
- Files:
-
- 4 edited
-
includes/js/printessWoocommerce.js (modified) (2 diffs)
-
includes/printess-admin-settings.php (modified) (2 diffs)
-
printess.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
printess-editor/trunk/includes/js/printessWoocommerce.js
r3336068 r3336133 942 942 const currentProductOptions = getCurrentProductOptionValues(settings.product); 943 943 const currentVariant = getCurrentVariant(currentProductOptions, settings.product); 944 if (currentVariant && currentVariant.templateName && !currentVariant.templateIsMergeTemplate) {945 context.templateNameOrSaveToken = currentVariant.template Name;944 if (currentVariant && currentVariant.templateName) { 945 context.templateNameOrSaveToken = currentVariant.templateIsMergeTemplate ? settings.product.templateName : currentVariant.templateName; 946 946 } 947 947 //parse url settings and apply these … … 1036 1036 const selectedVariant = getCurrentVariant(getCurrentProductOptionValues(product), product); 1037 1037 const variantsHaveTemplateNames = product.variants && typeof product.variants.find((x) => x.templateName && !x.templateIsMergeTemplate) !== "undefined" ? true : false; 1038 if (selectedVariant != null && selectedVariant.templateName && !selectedVariant.templateIsMergeTemplate) {1039 templateName = selectedVariant.template Name;1038 if (selectedVariant != null && selectedVariant.templateName) { 1039 templateName = selectedVariant.templateIsMergeTemplate ? product.templateName : selectedVariant.templateName; 1040 1040 } 1041 1041 if (!templateName && !variantsHaveTemplateNames) { -
printess-editor/trunk/includes/printess-admin-settings.php
r3332749 r3336133 230 230 static function get_disable_basket_warning_on_unpersonalized_items() { 231 231 $setting = get_option( 'printess_disable_basket_warning_on_unpersonalized_items', false ); 232 233 if ( 'on' === $setting ) { 234 return true; 235 } 236 237 return false; 238 } 239 240 /** 241 * Returns true in case the form field values pulled in from ACF plugin should use the acf field name instead of its label 242 */ 243 static function get_use_acf_name_instead_of_label() { 244 $setting = get_option( 'printess_use_acf_name_instead_of_label', false ); 232 245 233 246 if ( 'on' === $setting ) { … … 1072 1085 ); 1073 1086 1087 register_setting( 1088 'printess-settings', 1089 'printess_use_acf_name_instead_of_label', 1090 array( 1091 'type' => 'boolean', 1092 'default' => false, 1093 ) 1094 ); 1095 1096 add_settings_field( 1097 'printess_use_acf_name_instead_of_label', 1098 __( 'Use names instead of labels for ACF fields', 'printess-editor' ), 1099 function() { 1100 $setting = get_option( 'printess_use_acf_name_instead_of_label', false ); 1101 $checked = ''; 1102 1103 if ( null === $setting || empty( $setting ) ) { 1104 $setting = false; 1105 } 1106 1107 if ( 'on' === $setting ) { 1108 $checked = 'checked'; 1109 } 1110 1111 ?> 1112 1113 <input type="checkbox" name="printess_use_acf_name_instead_of_label" <?php echo esc_html( $checked ); ?> > 1114 <?php 1115 }, 1116 'printess-settings', 1117 'printess_settings_section' 1118 ); 1119 1074 1120 add_menu_page( 1075 1121 'Printess', -
printess-editor/trunk/printess.php
r3336068 r3336133 5 5 * Plugin URI: https://printess.com/kb/integrations/woo-commerce/index.html 6 6 * Developer: Bastian Kröger (support@printess.com); Alexander Oser (support@printess.com) 7 * Version: 1.6.5 37 * Version: 1.6.54 8 8 * Author: Printess 9 9 * Author URI: https://printess.com … … 14 14 * Tested up to: 6.8 15 15 * 16 * Woo: 10000:92401 2dfsfhsf8429842386wdff234sfd16 * Woo: 10000:924013dfsfhsf8429842386wdff234sfd 17 17 * WC requires at least: 5.8 18 18 * WC tested up to: 9.8.2 … … 362 362 if(in_array("all", $filter_lookup) || in_array("description", $filter_lookup))$form_fields["Description"] = get_user_meta($user_id, 'description', true); 363 363 364 365 366 367 364 if(in_array("all", $filter_lookup) || in_array("billingfirstname", $filter_lookup))$form_fields["BillingFirstname"] = $customer->billing["first_name"]; 368 365 if(in_array("all", $filter_lookup) || in_array("billinglastname", $filter_lookup))$form_fields["BillingLastname"] = $customer->billing["last_name"]; … … 394 391 395 392 if(null !== $acf_fields && false !== $acf_fields && is_array($acf_fields)) { 393 $acf_label_property = PrintessAdminSettings::get_use_acf_name_instead_of_label() ? "name" : "label"; 394 396 395 foreach($acf_fields as $key => &$field) { 397 if(is_array($field) && array_key_exists( "label", $field) && array_key_exists("value", $field) && (in_array("all", $filter_lookup) || in_array(strtolower($field["label"]), $filter_lookup))) {398 $form_fields[$field[ "label"]] = $field["value"];396 if(is_array($field) && array_key_exists($acf_label_property, $field) && array_key_exists("value", $field) && (in_array("all", $filter_lookup) || in_array(strtolower($field[$acf_label_property]), $filter_lookup))) { 397 $form_fields[$field[$acf_label_property]] = $field["value"]; 399 398 } 400 399 } -
printess-editor/trunk/readme.txt
r3336068 r3336133 296 296 = 1.6.53 = 297 297 - Added support for merge templates inside variants 298 299 = 1.6.54 = 300 - Added option to use ACF field names instead of labels while assigning form field values 301 - Fixed variant option to use given template name as merge template for variants where not all variants use the template name as merge template
Note: See TracChangeset
for help on using the changeset viewer.