Changeset 3455477
- Timestamp:
- 02/06/2026 02:51:56 PM (13 days ago)
- Location:
- printess-editor/trunk
- Files:
-
- 4 edited
-
includes/js/printessWoocommerce.js (modified) (2 diffs)
-
languages/printess-editor.pot (modified) (33 diffs)
-
printess.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
printess-editor/trunk/includes/js/printessWoocommerce.js
r3453876 r3455477 512 512 ret = variants[0]; 513 513 } 514 } 515 return ret; 516 }; 517 const getInvalidVariantOption = function (productOptionValues, product) { 518 let ret = null; 519 const attributeLookup = getAttributeLookup(product, true); 520 const variantSpecificValues = []; 521 const attributeValuesUsedInVariants = {}; 522 if (product.variants) { 523 product.variants.forEach((variant) => { 524 if (variant.attributes) { 525 for (const key in variant.attributes) { 526 if (variant.attributes.hasOwnProperty(key)) { 527 if (!attributeValuesUsedInVariants[key]) { 528 attributeValuesUsedInVariants[key] = {}; 529 } 530 attributeValuesUsedInVariants[key][variant.attributes[key]] = true; 531 } 532 } 533 } 534 ; 535 }); 536 } 537 const mapValue = (name, value) => { 538 let mappedValue = value; 539 let attribute = null; 540 if (attributeLookup[name]) { 541 attribute = attributeLookup[name]; 542 } 543 if (!attribute) { 544 for (const key in attributeLookup) { 545 if (attributeLookup.hasOwnProperty(key)) { 546 if (attributeLookup[key].name === key || attributeLookup[key].key === key) { 547 attribute = attributeLookup[key]; 548 break; 549 } 550 } 551 } 552 if (attribute && attribute.valueKeys && attribute.valueKeys.length > 0) { 553 for (let i = 0; i < attribute.values.length; ++i) { 554 if (attribute.values[i] === value && attribute.valueKeys.length > i) { 555 mappedValue = attribute.valueKeys[i]; 556 break; 557 } 558 } 559 } 560 } 561 return mappedValue; 562 }; 563 for (const name in productOptionValues) { 564 const value = mapValue(name, productOptionValues[name]); 565 if (productOptionValues.hasOwnProperty(name) && attributeLookup[name] && attributeLookup[name].usedForVariants && attributeValuesUsedInVariants[attributeLookup[name].key] && attributeValuesUsedInVariants[attributeLookup[name].key][value]) { 566 if (!attributeLookup[name].valueKeys || attributeLookup[name].valueKeys.includes(value)) { 567 variantSpecificValues.push({ key: attributeLookup[name].key, value: value }); 568 } 569 } 570 } 571 if (product.variants) { 572 let variants = product.variants; 573 variantSpecificValues.forEach((vSv) => { 574 variants = variants.filter((variant) => { 575 return variant.attributes[vSv.key] === vSv.value; 576 }); 577 if (variants.length <= 0 && !ret) { 578 ret = vSv.key; 579 } 580 }); 514 581 } 515 582 return ret; … … 1241 1308 const productValues = getCurrentProductOptionValues(settings.product); 1242 1309 const variant = getCurrentVariant(productValues, settings.product); 1310 if (!variant && settings.product.variants && settings.product.variants.length > 0) { 1311 const invalidVariantOptionName = getInvalidVariantOption(productValues, settings.product); 1312 if (invalidVariantOptionName) { 1313 alert(printessSettings?.userMessages && printessSettings.userMessages["unableToSaveChangesDueToInvalidVariant"] ? printessSettings.userMessages["unableToSaveChangesDueToInvalidVariant"].replace("{0}", invalidVariantOptionName) : ("Unable to save changes due to invalid value for " + invalidVariantOptionName)); 1314 return; 1315 } 1316 } 1243 1317 if (printessSettings.editorMode === "admin") { 1244 1318 saveAdminSaveToken(saveToken, thumbnailUrl); -
printess-editor/trunk/languages/printess-editor.pot
r3411102 r3455477 4 4 "Project-Id-Version: Printess Editor\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 202 5-12-04 14:59+0000\n"6 "POT-Creation-Date: 2026-02-06 14:21+0000\n" 7 7 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 8 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 21 21 msgstr "" 22 22 23 #: printess.php:22 0723 #: printess.php:2216 24 24 msgid "account page" 25 25 msgstr "" … … 47 47 msgstr "" 48 48 49 #: printess.php:21 5449 #: printess.php:2163 50 50 msgid "Approve and send to production." 51 51 msgstr "" … … 55 55 msgstr "" 56 56 57 #: printess.php:34 8457 #: printess.php:3493 58 58 msgid "Available until" 59 59 msgstr "" … … 72 72 msgstr "" 73 73 74 #: printess.php:28 2874 #: printess.php:2837 75 75 msgid "Could not find line item or product..." 76 76 msgstr "" 77 77 78 #: printess.php:5 65 printess.php:280178 #: printess.php:573 printess.php:2810 79 79 msgid "Customize" 80 80 msgstr "" … … 101 101 msgstr "" 102 102 103 #: printess.php:34 84 printess.php:3520103 #: printess.php:3493 printess.php:3529 104 104 msgid "Delete" 105 105 msgstr "" … … 109 109 msgstr "" 110 110 111 #: printess.php:17 72 printess.php:2008 printess.php:2468 printess.php:3768111 #: printess.php:1781 printess.php:2017 printess.php:2477 printess.php:3777 112 112 msgid "Design Name" 113 113 msgstr "" … … 133 133 msgstr "" 134 134 135 #: printess.php:34 84135 #: printess.php:3493 136 136 msgid "Display name" 137 137 msgstr "" 138 138 139 #: includes/printess- admin-settings.php:1415140 #: includes/printess- product-helpers.php:382139 #: includes/printess-product-helpers.php:382 140 #: includes/printess-admin-settings.php:1415 141 141 msgid "Do not use" 142 142 msgstr "" … … 146 146 msgstr "" 147 147 148 #: printess.php:35 21148 #: printess.php:3530 149 149 msgid "Do you really want to delete the design {0}?" 150 150 msgstr "" … … 164 164 msgstr "" 165 165 166 #: printess.php:22 49 printess.php:3484 printess.php:3516 printess.php:3571166 #: printess.php:2258 printess.php:3493 printess.php:3525 printess.php:3580 167 167 msgid "Edit" 168 168 msgstr "" 169 169 170 #: printess.php:20 89170 #: printess.php:2098 171 171 msgid "Edit Customer Design" 172 172 msgstr "" 173 173 174 #: printess.php:20 79174 #: printess.php:2088 175 175 msgid "Edit save token" 176 176 msgstr "" … … 204 204 msgstr "" 205 205 206 #: printess.php:20 82206 #: printess.php:2091 207 207 msgid "Expires On:" 208 208 msgstr "" 209 209 210 #: printess.php:217 0210 #: printess.php:2179 211 211 msgid "Form field" 212 212 msgstr "" … … 228 228 msgstr "" 229 229 230 #: printess.php:20 67230 #: printess.php:2076 231 231 msgid "Invalid save token" 232 232 msgstr "" 233 233 234 #: printess.php:30 85234 #: printess.php:3094 235 235 msgid "Is merge template" 236 236 msgstr "" … … 256 256 msgstr "" 257 257 258 #: printess.php:17 76258 #: printess.php:1785 259 259 msgid "Line item id" 260 260 msgstr "" 261 261 262 #: printess.php:21 07262 #: printess.php:2116 263 263 msgid "Line item id:" 264 264 msgstr "" 265 265 266 #: printess.php:29 15266 #: printess.php:2924 267 267 msgid "Loading editor..." 268 268 msgstr "" … … 284 284 msgstr "" 285 285 286 #: printess.php:35 42286 #: printess.php:3551 287 287 msgid "Next" 288 288 msgstr "" … … 293 293 msgstr "" 294 294 295 #: printess.php:34 54295 #: printess.php:3463 296 296 msgid "No saved designs yet" 297 297 msgstr "" 298 298 299 #: printess.php:34 05299 #: printess.php:3414 300 300 msgid "Not logged in" 301 301 msgstr "" … … 305 305 msgstr "" 306 306 307 #: printess.php:18 52307 #: printess.php:1861 308 308 msgid "Open" 309 309 msgstr "" 310 310 311 #: printess.php:17 67311 #: printess.php:1776 312 312 msgid "Open design" 313 313 msgstr "" … … 325 325 msgstr "" 326 326 327 #: printess.php:20 37327 #: printess.php:2046 328 328 msgid "Original Save token:" 329 329 msgstr "" … … 363 363 msgstr "" 364 364 365 #: printess.php:17 41365 #: printess.php:1750 366 366 msgid "Personalized products" 367 367 msgstr "" 368 368 369 #: printess.php:5 13369 #: printess.php:520 370 370 msgid "Please close this window or tab." 371 371 msgstr "" 372 372 373 #: printess.php:22 06373 #: printess.php:2215 374 374 msgid "Please copy & paste the shop and service tokens from your" 375 375 msgstr "" … … 379 379 msgstr "" 380 380 381 #: printess.php:51 0381 #: printess.php:517 382 382 msgid "Please provide a display name." 383 383 msgstr "" … … 387 387 msgstr "" 388 388 389 #: printess.php:35 38389 #: printess.php:3547 390 390 msgid "Previous" 391 391 msgstr "" … … 399 399 msgstr "" 400 400 401 #: printess.php:21 16401 #: printess.php:2125 402 402 msgid "Printess Error Details" 403 403 msgstr "" 404 404 405 #: printess.php:21 64405 #: printess.php:2173 406 406 msgid "Printess Form Fields" 407 407 msgstr "" 408 408 409 #: printess.php:21 22 printess.php:2130 printess.php:2138409 #: printess.php:2131 printess.php:2139 printess.php:2147 410 410 msgid "Printess Production Files" 411 411 msgstr "" … … 416 416 msgstr "" 417 417 418 #: printess.php:21 56418 #: printess.php:2165 419 419 msgid "Processing." 420 420 msgstr "" 421 421 422 #: printess.php:17 56 printess.php:1923422 #: printess.php:1765 printess.php:1932 423 423 msgid "Product" 424 424 msgstr "" 425 425 426 #: printess.php:34 84426 #: printess.php:3493 427 427 msgid "Product name" 428 428 msgstr "" 429 429 430 #: printess.php:18 24430 #: printess.php:1833 431 431 msgid "Product thumbnail" 432 432 msgstr "" … … 448 448 msgstr "" 449 449 450 #: printess.php:21 04450 #: printess.php:2113 451 451 msgid "Reproduce item" 452 452 msgstr "" … … 460 460 msgstr "" 461 461 462 #: printess.php:22 13462 #: printess.php:2222 463 463 msgid "Save Settings" 464 464 msgstr "" 465 465 466 #: printess.php:20 53466 #: printess.php:2062 467 467 msgid "Save token:" 468 468 msgstr "" … … 472 472 msgstr "" 473 473 474 #: printess.php:31 43 printess.php:3473474 #: printess.php:3152 printess.php:3482 475 475 msgid "Saved Designs" 476 476 msgstr "" … … 480 480 msgstr "" 481 481 482 #: printess.php:29 14482 #: printess.php:2923 483 483 msgid "Saving design and redirecting back to order detail page..." 484 484 msgstr "" 485 485 486 #: printess.php:51 2486 #: printess.php:519 487 487 msgid "Saving design to your list of saved designs" 488 488 msgstr "" … … 492 492 msgstr "" 493 493 494 #: printess.php:34 76494 #: printess.php:3485 495 495 msgid "Search" 496 496 msgstr "" 497 497 498 #: printess.php:34 74498 #: printess.php:3483 499 499 msgid "Search for name" 500 500 msgstr "" … … 504 504 msgstr "" 505 505 506 #: printess.php:19 18506 #: printess.php:1927 507 507 msgid "Shipping" 508 508 msgstr "" 509 509 510 #: printess.php:16 53 printess.php:1763 printess.php:1928510 #: printess.php:1662 printess.php:1772 printess.php:1937 511 511 msgid "Shipping status" 512 512 msgstr "" … … 541 541 msgstr "" 542 542 543 #: printess.php:30 85543 #: printess.php:3094 544 544 msgid "Template name" 545 545 msgstr "" 546 546 547 #: printess.php:30 86547 #: printess.php:3095 548 548 msgid "Template name or merge template" 549 549 msgstr "" … … 591 591 msgstr "" 592 592 593 #: printess.php:51 1593 #: printess.php:518 594 594 msgid "There was an error while trying to save your design" 595 595 msgstr "" 596 596 597 #: printess.php:248 0597 #: printess.php:2489 598 598 msgid "This item was edited. Consider removing it from your cart." 599 599 msgstr "" 600 600 601 #: printess.php:34 84601 #: printess.php:3493 602 602 msgid "Thumbnail" 603 603 msgstr "" … … 607 607 msgstr "" 608 608 609 #: printess.php:16 32 printess.php:1759 printess.php:1925609 #: printess.php:1641 printess.php:1768 printess.php:1934 610 610 msgid "Tracking" 611 611 msgstr "" 612 612 613 #: printess.php:16 16 printess.php:1783 printess.php:1938613 #: printess.php:1625 printess.php:1792 printess.php:1947 614 614 msgid "Tracking link" 615 msgstr "" 616 617 #: printess.php:521 618 msgid "Unable to save changes due to invalid value for {0}." 615 619 msgstr "" 616 620 … … 630 634 msgstr "" 631 635 632 #: printess.php:17 68636 #: printess.php:1777 633 637 msgid "Valid until" 634 638 msgstr "" 635 639 636 #: printess.php:21 71640 #: printess.php:2180 637 641 msgid "Value" 638 642 msgstr "" 639 643 640 #: printess.php:1 594644 #: printess.php:1603 641 645 msgid "View thumbnail in new window." 642 646 msgstr "" … … 667 671 msgstr "" 668 672 669 #: printess.php:38 05673 #: printess.php:3814 670 674 msgid "" 671 675 "You just added a personalized product without any personalization. Please " -
printess-editor/trunk/printess.php
r3453876 r3455477 5 5 * Plugin URI: https://printess.com/kb/integrations/woo-commerce/index.html 6 6 * Developer: Bastian Kröger ([email protected]); Alexander Oser ([email protected]) 7 * Version: 1.6.7 57 * Version: 1.6.76 8 8 * Author: Printess 9 9 * Author URI: https://printess.com … … 14 14 * Tested up to: 6.9 15 15 * 16 * Woo: 10000:92403 2dfsfhsf8429842386wdff234sfd16 * Woo: 10000:924033dfsfhsf8429842386wdff234sfd 17 17 * WC requires at least: 5.8 18 18 * WC tested up to: 10.4.3 … … 518 518 "saveError": <?php echo wp_json_encode( __( 'There was an error while trying to save your design', 'printess-editor' ) ); ?>, 519 519 "savingDesign": <?php echo wp_json_encode( __( 'Saving design to your list of saved designs', 'printess-editor' ) ); ?>, 520 "closeWindow": <?php echo wp_json_encode( __( 'Please close this window or tab.', 'printess-editor' ) ); ?> 520 "closeWindow": <?php echo wp_json_encode( __( 'Please close this window or tab.', 'printess-editor' ) ); ?>, 521 "unableToSaveChangesDueToInvalidVariant": <?php echo wp_json_encode( __( 'Unable to save changes due to invalid value for {0}.', 'printess-editor' ) ); ?> 521 522 }; 522 523 … … 3547 3548 <?php } ?> 3548 3549 3549 <?php if ( 1 === $current_page && count( $saved_designs ) === $per_page ) { ?>3550 <?php if ( 1 <= $current_page && count( $saved_designs ) >= $per_page ) { ?> 3550 3551 <a class="woocommerce-button woocommerce-button--next woocommerce-Button woocommerce-Button--next button wp-element-button printess-Button-next" href="<?php echo esc_attr( $next_url ); ?>"><?php echo esc_html__( 'Next', 'printess-editor' ); ?></a> 3551 3552 <?php } ?> -
printess-editor/trunk/readme.txt
r3453876 r3455477 5 5 Tested up to: 6.9 6 6 WC Tested up to: 10.4.3 7 Stable tag: 1.6.7 57 Stable tag: 1.6.76 8 8 Requires PHP: 8.1 9 9 License: GPLv2 or later … … 377 377 = 1.6.75 = 378 378 - Fixed bug in save dialog that triggered a considerable amount of add design calls on WooCommerce in case the user pressed enter inside the save dialog instead of clicking on the save button. This could result in older versions being saved and double entries inside the list of saved designs on the user account page. 379 380 = 1.6.76 = 381 - Added error message when clicking on save in case ther current product page does not have a valid variant set (e.g. if there are issues with price relevant form fields) 382 - Fixed pager inside the customer view of saved designs so that the next page button is also displayed if the current dispalyed page is larger than 1
Note: See TracChangeset
for help on using the changeset viewer.