Flexible Shipping for WooCommerce - Version 4.7.0

Version Description

  • 2021-07-20 =
  • Changed functionality for shipping integrations: DPD UK, InPost and others
  • Fixed free shipping label when negative cost calculated and set as 0 (zero)
Download this release

Release Info

Developer wpdesk
Plugin Icon 128x128 Flexible Shipping for WooCommerce
Version 4.7.0
Comparing to
See all releases

Code changes from version 4.6.1 to 4.7.0

Files changed (111) hide show
  1. assets/css/admin.css +1 -1
  2. assets/js/admin.js +0 -185
  3. assets/js/admin.min.js +1 -12
  4. classes/class-flexible-shipping-plugin.php +21 -24
  5. classes/{wp-wpdesk-fs-shipment/rate-notices → notices}/abstract-rate.php +0 -0
  6. classes/{wp-wpdesk-fs-shipment → notices}/admin-notices.php +0 -0
  7. classes/{wp-wpdesk-fs-shipment/rate-notices → notices}/interface-rate.php +0 -0
  8. classes/{wp-wpdesk-fs-shipment/rate-notices → notices}/rate-notice-implementation.php +0 -0
  9. classes/{wp-wpdesk-fs-shipment → notices}/rate-notice.php +0 -0
  10. classes/table-rate/bulk-actions.php +25 -17
  11. classes/table-rate/shipping-method.php +1 -3
  12. classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php +0 -124
  13. classes/wp-wpdesk-fs-shipment/label/class-labels-bulk-action-handler.php +0 -112
  14. classes/wp-wpdesk-fs-shipment/label/class-labels-file-creator.php +0 -104
  15. classes/wp-wpdesk-fs-shipment/label/class-labels-file-dispatcher.php +0 -31
  16. classes/wp-wpdesk-fs-shipment/label/class-single-label-file-dispatcher.php +0 -104
  17. classes/wp-wpdesk-fs-shipment/manifest/class-manifest.php +0 -214
  18. classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php +0 -327
  19. classes/wp-wpdesk-fs-shipment/manifest/functions.php +0 -62
  20. classes/wp-wpdesk-fs-shipment/manifest/interface-manifest.php +0 -37
  21. classes/wp-wpdesk-fs-shipment/manifest/views/column-actions.php +0 -2
  22. classes/wp-wpdesk-fs-shipment/manifest/views/column-number.php +0 -1
  23. classes/wp-wpdesk-fs-shipment/manifest/views/filter-form.php +0 -11
  24. classes/wp-wpdesk-fs-shipment/manifest/views/manifest-metabox.php +0 -55
  25. classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-provider-default.php +0 -80
  26. classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-providers-collection.php +0 -40
  27. classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-providers-factory.php +0 -27
  28. classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-response-data-appender.php +0 -69
  29. classes/wp-wpdesk-fs-shipment/rest-api/interface-rest-api-order-data-provider.php +0 -17
  30. classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php +0 -344
  31. classes/wp-wpdesk-fs-shipment/shipment/views/order-metabox.php +0 -9
  32. flexible-shipping.php +5 -5
  33. lang/flexible-shipping.pot +108 -325
  34. readme.txt +6 -2
  35. src/WPDesk/FS/Shipment/SubscriptionsIntegration.php +8 -7
  36. src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php +42 -42
  37. src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php +24 -8
  38. src/WPDesk/FS/TableRate/ShippingMethodSingle.php +22 -19
  39. src/WPDesk/FS/TableRate/ShippingMethodTrait.php +0 -28
  40. vendor/autoload.php +1 -1
  41. vendor/composer/autoload_classmap.php +36 -32
  42. vendor/composer/autoload_real.php +7 -7
  43. vendor/composer/autoload_static.php +41 -37
  44. vendor/composer/installed.json +38 -0
  45. vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/.gitignore +5 -0
  46. vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/CHANGELOG.md +11 -0
  47. vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/apigen.neon +27 -0
  48. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-cancel-shipment-exception.php +0 -0
  49. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-get-label-exception.php +0 -0
  50. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-label-not-available-exception.php +0 -0
  51. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-send-shipment-exception.php +0 -0
  52. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-shipment-plan-exceeded-exception.php +0 -0
  53. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-shipment-unable-to-create-tmp-file-exception.php +0 -0
  54. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php +0 -0
  55. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/label/class-integration-label-builder.php +0 -0
  56. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/label/interface-labels-builder.php +0 -0
  57. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/manifest/class-manifest-fs.php +0 -3
  58. vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/class-manifest.php +210 -0
  59. {classes → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/manifest/functions.php +0 -0
  60. vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/interface-manifest.php +31 -0
  61. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/shipment/class-shipment.php +0 -0
  62. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/shipment/functions.php +0 -0
  63. {classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/shipment/interface-shipment.php +0 -0
  64. vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/composer.json +34 -0
  65. vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/phpunit-integration.xml +28 -0
  66. vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/phpunit-unit.xml +21 -0
  67. vendor_prefixed/wpdesk/wp-code-sniffer/composer.json +1 -1
  68. vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/CommandProvider.php +2 -1
  69. vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareParallelCodeceptionTests.php +57 -0
  70. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-cancel-shipment-exception.php +10 -0
  71. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-get-label-exception.php +10 -0
  72. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-label-not-available-exception.php +10 -0
  73. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-send-shipment-exception.php +10 -0
  74. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-plan-exceeded-exception.php +10 -0
  75. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-unable-to-create-tmp-file-exception.php +10 -0
  76. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php +10 -0
  77. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/label/class-integration-label-builder.php +60 -0
  78. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/label/interface-labels-builder.php +36 -0
  79. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/class-manifest-fs.php +41 -0
  80. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/class-manifest.php +201 -0
  81. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/functions.php +53 -0
  82. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/interface-manifest.php +29 -0
  83. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/shipment/class-shipment.php +482 -0
  84. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/shipment/functions.php +149 -0
  85. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/shipment/interface-shipment.php +90 -0
  86. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/composer.json +32 -0
  87. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/assets/css/admin.css +81 -0
  88. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/assets/js/admin.js +173 -0
  89. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/composer.json +46 -0
  90. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Assets.php +73 -0
  91. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/CustomPostType.php +244 -0
  92. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsBulkActionHandler.php +108 -0
  93. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsFileCreator.php +105 -0
  94. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsFileDispatcher.php +34 -0
  95. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/SingleLabelFileDispatcher.php +95 -0
  96. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/CustomPostType.php +248 -0
  97. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/views/column-actions.php +17 -0
  98. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/views/column-number.php +12 -0
  99. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/views/filter-form.php +32 -0
  100. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/views/manifest-metabox.php +85 -0
  101. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Metabox/Ajax.php +63 -0
  102. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Order/AddShippingMetabox.php +103 -0
  103. {classes/wp-wpdesk-fs-shipment → vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Order}/views/html-order-add_shipping-metabox.php +21 -14
  104. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvider.php +18 -0
  105. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProviderDefault.php +71 -0
  106. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvidersCollection.php +41 -0
  107. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvidersFactory.php +28 -0
  108. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderResponseDataAppender.php +65 -0
  109. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/ShipmentFunctionality.php +135 -0
  110. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Subscriptions/SubscriptionsIntegration.php +99 -0
  111. vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/views/order-metabox.php +29 -0
assets/css/admin.css CHANGED
@@ -1 +1 @@
1
- .wpdesk-metabox{background-color:#fff;color:#000;padding:20px;border:2px solid #1d88d1;border-radius:5px;box-shadow:1px 1px 10px #ccc;background-image:url(../images/onboarding/arrows-blue@2x.png);background-size:70%;background-position:100% 100%;background-repeat:no-repeat;transition:all .2s ease-in-out}.wpdesk-metabox:hover{box-shadow:1px 1px 10px #999}.wpdesk-metabox .title{color:#333;margin-top:5px;line-height:1.3}.wpdesk-metabox .button-primary{border:2px solid #1d88d1;background-color:#1d88d1;color:#fff;font-weight:600}.wpdesk-metabox .button-primary:hover{background-color:#fff;color:#1d88d1;border:2px solid #1d88d1}.fs-info-wrapper{max-width:1005px;display:flex;justify-content:space-between;flex-wrap:wrap}.fs-info-wrapper .fs-info-metabox{position:relative;padding:16px;box-sizing:border-box;background:#fff;box-shadow:0 0 0 1px #dfdfdf,0 1px 2px #dfdfdf;flex:1 0 20%;margin:10px 5px 5px;display:flex;justify-content:space-between;flex-direction:column}.fs-info-wrapper .fs-info-metabox#fs-pro,.fs-info-wrapper .fs-info-metabox#fsie{background-color:#fff;color:#000;padding:20px;border:2px solid #1d88d1;border-radius:5px;box-shadow:1px 1px 10px #ccc;background-image:url(../images/onboarding/arrows-blue@2x.png);background-size:70%;background-position:100% 100%;background-repeat:no-repeat;transition:all .2s ease-in-out}.fs-info-wrapper .fs-info-metabox#fs-pro h3,.fs-info-wrapper .fs-info-metabox#fsie h3{color:#333;margin-top:10px;line-height:1.3}.fs-info-wrapper .fs-info-metabox#fs-pro .button-primary,.fs-info-wrapper .fs-info-metabox#fsie .button-primary{margin-top:10px;border:2px solid #1d88d1;background-color:#1d88d1;color:#fff;font-weight:600}.fs-info-wrapper .fs-info-metabox#fs-pro .button-primary:hover,.fs-info-wrapper .fs-info-metabox#fsie .button-primary:hover{background-color:#fff;color:#1d88d1;border:2px solid #1d88d1}.fs-info-wrapper .fs-info-metabox#fs-pro:hover,.fs-info-wrapper .fs-info-metabox#fsie:hover{box-shadow:1px 1px 10px #999}.fs-info-wrapper .fs-info-metabox .content li{margin-bottom:10px}.fs-info-wrapper .fs-info-metabox .link-arrow{color:#1d88d1}.fs-info-wrapper .fs-info-metabox .footer{margin-top:25px;text-align:right;font-size:16px}.fs-info-wrapper .fs-info-metabox .footer .read-more{font-size:14px}.notice.flexible-shipping-hint{background-image:url(../images/onboarding/arrows-blue@2x.png);background-repeat:no-repeat;background-position:100% 100%}.notice.flexible-shipping-hint h4{margin-top:0}table.flexible_shipping_methods td.select,table.flexible_shipping_methods th.select{text-align:center;width:40px;margin-top:-7px;margin-left:-6px;padding:2px}table.flexible_shipping_methods .checkbox-select-all{margin:0 12px 0 8px}table.flexible_shipping_methods td.integration,table.flexible_shipping_methods th.integration{text-align:center;width:130px}table.flexible_shipping_methods tr.highlight td{background-color:#e4f2fd}table.flexible_shipping_methods.wc_shipping th{font-weight:400;width:auto}table.flexible_shipping_methods td.ui-sortable-handle:before,table.flexible_shipping_services td.ui-sortable-handle:before{content:"\F333";font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%;line-height:24px}table.wc_input_table.flexible_shipping_rules.fs_new_interface td{padding:25px 5px;vertical-align:middle;border:none}table.wc_input_table.flexible_shipping_rules.fs_new_interface tr:nth-child(2n) td{background:#f9f9f9}table.wc_input_table.flexible_shipping_rules.fs_new_interface tr:nth-child(odd) td.sort{background:#fff}table.wc_input_table.flexible_shipping_rules.fs_new_interface td p.form-row{margin-top:0}table.wc_input_table.flexible_shipping_rules.fs_new_interface .description{padding-top:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface .form-row{padding-right:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface .single_rule_condition{vertical-align:middle;display:flex}table.wc_input_table.flexible_shipping_rules.fs_new_interface tbody .sort{padding-top:27px!important;padding-bottom:23px!important}.flexible_shipping_method_rules th{width:auto}.flexible_shipping_method_rules th.sort{width:10px}td.fs_cost{width:75px!important}div.rule_condition div{display:inline-block}div.rule_condition div.based_on,div.rule_condition div input{width:70px}table.flexible_shipping_method_rules th{padding:5px 10px 5px 0}table.flexible_shipping_method_rules td p,table.flexible_shipping_method_rules td p input,table.flexible_shipping_method_rules td p select{margin:0;width:100%;box-shadow:none;padding:0!important}table.flexible_shipping_method_rules td p input[type=text]{text-align:right;padding:0 5px!important;width:100%!important}table.flexible_shipping_method_rules td p select{margin:0;width:100%!important;box-shadow:none;line-height:28px;height:37px;vertical-align:middle}table.flexible_shipping_method_rules td p input[type=checkbox]{margin:0;width:auto}table.flexible_shipping_method_rules td,table.flexible_shipping_method_rules th{text-align:center}table.flexible_shipping_method_rules td.shipping_class,table.flexible_shipping_method_rules th.shipping_class{text-align:center;width:200px}table.flexible_shipping_method_rules td.shipping_class span{border:none}table.flexible_shipping_method_rules td.stop,table.flexible_shipping_method_rules th.stop{text-align:center;width:30px}table.flexible_shipping_method_rules td.cancel,table.flexible_shipping_method_rules th.cancel{text-align:center;width:60px}.woocommerce table.form-table .flexible_shipping_method_rules th span.woocommerce-help-tip{float:none;margin:0}.woocommerce table.form-table .flexible_shipping_method_rules .select2-container{margin:0}.woocommerce table.form-table .fs-locations-table .select2-container{max-width:none}.woocommerce table.form-table .fs-locations-table th .woocommerce-help-tip{float:none}div.flexilble_shipping_export_import{float:right}table.flexible_shipping_method_rules tfoot th{padding:10px}.woocommerce_page_wc-settings #mainform{position:relative}.column-flexible_shipping{width:130px}.column-flexible_shipping .shipping-status{float:left;margin-right:8px;margin-top:4px;text-align:left;width:18px}.column-flexible_shipping .shipping-status .created:after{color:#d0c21f!important}.column-flexible_shipping .shipping-actions a.button{float:left;margin:0 4px 2px 0;display:block;height:2em!important;padding:0!important;position:relative;text-indent:-9999px;width:2em}.column-flexible_shipping .shipping-actions a.button:after{font-family:WooCommerce;font-variant:normal;font-weight:400;height:100%;left:0;line-height:1.85;margin:0;position:absolute;text-align:center;text-indent:0;text-transform:none;top:0;width:100%}.column-flexible_shipping .shipping-actions a.button.get-label:after{content:"\E01E"}.column-flexible_shipping .shipping-actions a.button.track:after{content:"\E01B"}.column-flexible_shipping mark.failed:after{color:#a00!important}.column-flexible_shipping mark.manifest:after{color:#2ea2cc!important}.flexible_shipping_shipment_message{color:green}.flexible_shipping_shipment_message_error{color:#a00!important}.flexible_shipping_shipment_message_error span{color:#444;font-weight:700}.woocommerce .wp-admin select{height:100%}.button.flexible-printing-button-print{height:auto!important;white-space:normal!important;word-wrap:break-word!important}.inspire-settings{display:table;width:100%}.inspire-settings .inspire-main-content,.inspire-settings .inspire-sidebar{display:table-cell;height:500px;margin:0;padding:0;vertical-align:top}.inspire-settings .inspire-main-content{min-width:800px}.inspire-settings .inspire-sidebar{padding-left:30px;width:250px}.flexible-shipping-info ol{margin-top:0}#wpbody-content .flexible-shipping-info .metabox-holder{padding-top:0}#adminmenu #toplevel_page_flexible-shipping .menu-icon-generic div.wp-menu-image:before{font-family:WooCommerce!important;content:"\E01D"}.fs-new-service{color:#006799}.fs-order-item-fallback{margin-top:.5em;color:#888}.flexible_shipping_shipment_content p select{max-width:95%}.flexible_shipping_shipment_content span.description{display:block}.fs-saas-button-cancel-created{float:right;color:#a00;margin-top:5px}.fs-saas-button-cancel-created:hover{color:#a00;cursor:pointer}.flexible_shipping_shipment_content input[type=checkbox]{float:left;margin-right:5px;margin-top:2px!important;opacity:1;border-color:#888}.flexible_shipping_shipment_content input[type=checkbox]:disabled{opacity:.7;border-color:rgba(51,51,51,.5)}.flexible_shipping_shipment_content p.fs-saas-status span{font-weight:700;color:#444}.flexible_shipping_shipment_content p.fs-saas-status-fs-new{color:#ffba00}.flexible_shipping_shipment_content p.fs-saas-status-fs-created{color:#d0c21f}.flexible_shipping_shipment_content p.fs-saas-status-fs-confirmed{color:#444}.flexible_shipping_shipment_content p.fs-saas-status-fs-failed{color:#a00}.flexible_shipping_shipment_content p.fs-saas-status-fs-manifest{color:#2ea2cc}.flexible_shipping_shipment_content p.connection-error{font-weight:700;color:#a00}.fs-saas-labels-counts span,.fs-saas-shipment span{font-weight:700}.fs-saas-no-labels-left{color:#a00}div.flexible-shipping-shipment-attachments p{display:inline}.flexible_shipping_shipment_attachment_message{padding-top:10px;color:green}table.flexible_shipping_services{max-width:550px}table.flexible_shipping_services .sort{width:1%}table.flexible_shipping_services .service_code{width:30px}table.flexible_shipping_services .select{text-align:center;width:1%}table.flexible_shipping_services .select input{margin:0 8px}.woocommerce table.form-table table.flexible_shipping_services td.service_name input,input.woocommerce_flexible_shipping_service_name{width:100%}.updated .fs-banner__button-container{padding:.75rem 0 0}.notice-info.fs-connect__container{border-left:none;padding:0;box-shadow:0 0 0 1px #dfdfdf,0 1px 2px #dfdfdf}.fs-connect__container{display:block;position:relative;box-sizing:border-box}.fs-connect__inner-container>a:first-child{z-index:1}.fs-connect__inner-container{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:left}.fs-connect__content-container{width:1250px;position:relative;padding:2rem;z-index:0}.fs-connect__content-container p{color:#555;font-size:.875rem}.fs-connect__content-container h2{margin-top:0;color:#555;line-height:1.6}.fs-connect__content-icon{float:right;margin:0 1.5rem 0 2.25rem}.fs-connect__content-icon svg{fill:#0085ba;height:180px;width:auto}.fs-connect__slide{display:none}.fs-connect__slide.fs__slide-is-active{display:block}.fs-banner__button-container .button-primary{margin:0 .3125rem .3125rem 0}.fs-connect__vertical-nav{background-color:#f1f1f1}.fs-connect__vertical-nav-container{width:15rem}.vertical-menu__feature-item-label{display:none}.fs-couriers{margin-top:2.5em}.fs-courier{position:relative;margin-bottom:2.5em;text-align:center}.fs-courier img{height:50px;width:auto}.fs-courier-label{background-color:#333;border-radius:3px;color:#fff;padding:0 4px 1px;position:absolute;right:0;top:-10px}.admin_page_flexible_shipping_connect_register .notice.is-dismissible,.admin_page_flexible_shipping_connect_register .settings-error,.admin_page_flexible_shipping_connect_register .update-nag,.admin_page_flexible_shipping_connect_register .updated{display:none!important}.fs-page-wrap{margin:0 auto;max-width:45rem}.fs-page-wrap h1{font-weight:400;margin-bottom:.67em;text-align:center}.fs-box{display:block;position:relative;margin:0 auto 20px;padding:16px;box-sizing:border-box;background:#fff;box-shadow:0 0 0 1px #dfdfdf,0 1px 2px #dfdfdf}.fs-box:after{content:".";display:block;height:0;clear:both;visibility:hidden}.admin_page_flexible_shipping_connect_register .fs-box,.fs-box.text-center{text-align:center}.admin_page_flexible_shipping_connect_register .fs-box p{margin:1.5em 0}.fs-box input[type=email]{padding:8px 10px}.fs-actions{padding-left:40px}.fs-actions button:active{vertical-align:inherit!important}.fs-actions .spinner{float:none;margin-top:0}.fs-cols{display:flex;flex-wrap:wrap;justify-content:space-between}.fs-inner-box{box-sizing:border-box;margin-top:30px;padding:0 20px}.fs-inner-box h4{font-size:1.2em;margin-bottom:.37em}.fs-inner-box svg{fill:#0085ba;height:70px;width:auto}.fs-connect-box-header{margin-top:3em}.hide-fs-connect-integration-box{display:none}.fs-settings-div table.form-table{width:700px;float:left}.fs-flexible-shipping-sidebar{position:absolute;right:0;width:300px;margin-top:-100px;z-index:1000}.fs-flexible-shipping-sidebar.flexible_shipping{margin-top:-200px}table.wc_input_table.flexible_shipping_rules{width:auto;min-width:764px}table.wc_input_table.flexible_shipping_rules td{padding:3px 5px}table.wc_input_table.flexible_shipping_rules p span.woocommerce-input-wrapper select,table.wc_input_table.flexible_shipping_rules span.input-wrapper select{line-height:2em}table.wc_input_table.flexible_shipping_rules td label{padding-right:3px;padding-left:3px;padding-top:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface td label{padding-right:10px;padding-left:10px;padding-top:5px}table.wc_input_table.flexible_shipping_rules p.form-row span.description,table.wc_input_table.flexible_shipping_rules span.input-wrapper span.description{padding-right:3px;padding-left:3px;vertical-align:middle;font-style:normal;font-size:14px}table.wc_input_table.flexible_shipping_rules p.form-row span.description{padding-top:4px;position:absolute}table.wc_input_table.flexible_shipping_rules td.cb,table.wc_input_table.flexible_shipping_rules th.cb{padding:10px 5px;padding-right:5px!important;margin:0}table.wc_input_table.flexible_shipping_rules td.cb input,table.wc_input_table.flexible_shipping_rules th.cb input{margin:0}table.wc_input_table.flexible_shipping_rules th.rule_costs{width:220px}table.wc_input_table.flexible_shipping_rules input[type=text]{width:100px!important;height:2em!important}table.wc_input_table.flexible_shipping_rules select{width:120px!important;height:2em!important;border:1px solid;padding:0 5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface select{width:130px!important}table.wc_input_table.flexible_shipping_method_rules td p label span.optional{display:none}table.wc_input_table.flexible_shipping_rules td.rule_conditions{min-width:465px}table.wc_input_table.flexible_shipping_rules td.rule_conditions div.single_rule_condition p.form-row{display:inline-block}table.wc_input_table.flexible_shipping_rules td p label span.optional{display:none}table#fs_new_rules_table_banner.widefat thead td,table#fs_new_rules_table_banner_for_new_table.widefat thead td{padding:5px 20px 20px}table.wc_input_table.flexible_shipping_rules span.input-wrapper,table.wc_input_table.flexible_shipping_rules span.input-wrapper input,table.wc_input_table.flexible_shipping_rules span.input-wrapper select{line-height:2em}table.wc_input_table.flexible_shipping_rules span.input-wrapper label{padding-right:3px;padding-left:3px}table.wc_input_table.flexible_shipping_rules span.input-wrapper span.description{padding-right:3px;padding-left:3px;vertical-align:middle}table.wc_input_table.flexible_shipping_rules td{vertical-align:top;padding-top:2px;padding-bottom:2px}table.wc_input_table.flexible_shipping_rules td.cb,table.wc_input_table.flexible_shipping_rules th.cb,table.wc_input_table.flexible_shipping_rules th.sort{width:20px;text-align:center}table.wc_input_table.flexible_shipping_rules th.rule_costs{width:520px}table.wc_input_table.flexible_shipping_rules input[type=text]{width:auto!important;height:auto!important;border:1px solid}table.wc_input_table.flexible_shipping_rules input.cost_additional,table.wc_input_table.flexible_shipping_rules input.per_value{width:60px!important;min-width:60px}table.wc_input_table.flexible_shipping_rules td.rule_costs div.input-wrapper.cost_per_order{display:block}table.wc_input_table.flexible_shipping_rules td.rule_costs a.button.plus.insert{display:inline-block;float:right;clear:both}table.wc_input_table.flexible_shipping_rules td.rule_costs div.additional_cost_wrapper{border-top:1px solid #dfdfdf;margin-top:2px;padding-top:2px;display:block}table.wc_input_table.flexible_shipping_rules td.rule_costs a.button.minus{display:inline-block;float:right;clear:both}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2){border-top:1px solid #dfdfdf;padding-top:2px;margin-top:2px}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_field_wrapper,table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper input.parameter_max,table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper input.parameter_min{width:60px!important;min-width:60px}table.wc_input_table.flexible_shipping_rules div.single_rule_condition label.condition_field_label{width:55px;text-align:right}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child label.condition_field_label_where{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child label.condition_field_label_and,table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) label.condition_field_label_where{display:none}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) label.condition_field_label_and{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition a.minus,table.wc_input_table.flexible_shipping_rules div.single_rule_condition a.plus{float:right}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child a.minus,table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) a.plus{display:none}table.wc_input_table.flexible_shipping_rules input.select2-search__field{border:0}.fs-notice.is-limited-width{width:calc(100% - 350px)}@media (max-width:1200px){.fs-flexible-shipping-sidebar{display:none}}@media screen and (max-width:782px){.notice-info.fs-connect__container{padding:0!important}}@media (max-width:782px){.fs-connect__content-icon.fs-connect-illo{float:none;width:100%;text-align:center;margin:2.25rem 0 1.5rem}}@media (max-width:600px){.fs-connect__vertical-nav{display:none}}@media (min-width:600px){.fs-connect__vertical-nav{flex-direction:column;justify-content:flex-start}.vertical-menu__feature-item{display:flex;flex-direction:row;align-items:center;padding:.5rem;border:1px solid #dfdfdf;border-top:none;border-left:3px solid #f9f9f9;background-color:#f9f9f9;color:#555;cursor:pointer}.vertical-menu__feature-item:last-of-type{position:relative;top:1px}.vertical-menu__feature-item-is-selected{border-left:3px solid #0085ba;border-right:1px solid #fff;background-color:#fff;color:#2e4453}.vertical-menu__feature-item-is-selected.fs-feature-intro{border-left:3px solid #00be28}.vertical-menu__feature-item-icon{width:1.25rem;height:1.25rem;padding:.25rem;text-align:center}.vertical-menu__feature-item svg{fill:#555;vertical-align:middle}.vertical-menu__feature-item-is-selected svg{fill:#0085ba}.vertical-menu__feature-item-label{display:block;padding:.5rem}.fs-inner-box{width:33.33%}}@media (min-width:782px){.fs-connect__content-container{padding:2rem 2rem 4rem}.fs-connect__content-container .fs-banner__button-container{position:absolute;bottom:.5rem}}@media (min-width:1200px){.fs-couriers{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.fs-courier{width:20%}.description.limited-width{max-width:calc(100% - 300px);line-height:30px}}
1
+ .wpdesk-metabox{background-color:#fff;color:#000;padding:20px;border:2px solid #1d88d1;border-radius:5px;box-shadow:1px 1px 10px #ccc;background-image:url(../images/onboarding/arrows-blue@2x.png);background-size:70%;background-position:100% 100%;background-repeat:no-repeat;transition:all .2s ease-in-out}.wpdesk-metabox:hover{box-shadow:1px 1px 10px #999}.wpdesk-metabox .title{color:#333;margin-top:5px;line-height:1.3}.wpdesk-metabox .button-primary{border:2px solid #1d88d1;background-color:#1d88d1;color:#fff;font-weight:600}.wpdesk-metabox .button-primary:hover{background-color:#fff;color:#1d88d1;border:2px solid #1d88d1}.fs-info-wrapper{max-width:1005px;display:flex;justify-content:space-between;flex-wrap:wrap}.fs-info-wrapper .fs-info-metabox{position:relative;padding:16px;box-sizing:border-box;background:#fff;box-shadow:0 0 0 1px #dfdfdf,0 1px 2px #dfdfdf;flex:1 0 20%;margin:10px 5px 5px;display:flex;justify-content:space-between;flex-direction:column}.fs-info-wrapper .fs-info-metabox#fs-pro,.fs-info-wrapper .fs-info-metabox#fsie{background-color:#fff;color:#000;padding:20px;border:2px solid #1d88d1;border-radius:5px;box-shadow:1px 1px 10px #ccc;background-image:url(../images/onboarding/arrows-blue@2x.png);background-size:70%;background-position:100% 100%;background-repeat:no-repeat;transition:all .2s ease-in-out}.fs-info-wrapper .fs-info-metabox#fs-pro h3,.fs-info-wrapper .fs-info-metabox#fsie h3{color:#333;margin-top:10px;line-height:1.3}.fs-info-wrapper .fs-info-metabox#fs-pro .button-primary,.fs-info-wrapper .fs-info-metabox#fsie .button-primary{margin-top:10px;border:2px solid #1d88d1;background-color:#1d88d1;color:#fff;font-weight:600}.fs-info-wrapper .fs-info-metabox#fs-pro .button-primary:hover,.fs-info-wrapper .fs-info-metabox#fsie .button-primary:hover{background-color:#fff;color:#1d88d1;border:2px solid #1d88d1}.fs-info-wrapper .fs-info-metabox#fs-pro:hover,.fs-info-wrapper .fs-info-metabox#fsie:hover{box-shadow:1px 1px 10px #999}.fs-info-wrapper .fs-info-metabox .content li{margin-bottom:10px}.fs-info-wrapper .fs-info-metabox .link-arrow{color:#1d88d1}.fs-info-wrapper .fs-info-metabox .footer{margin-top:25px;text-align:right;font-size:16px}.fs-info-wrapper .fs-info-metabox .footer .read-more{font-size:14px}.notice.flexible-shipping-hint{background-image:url(../images/onboarding/arrows-blue@2x.png);background-repeat:no-repeat;background-position:100% 100%}.notice.flexible-shipping-hint h4{margin-top:0}table.flexible_shipping_methods td.select,table.flexible_shipping_methods th.select{text-align:center;width:40px;margin-top:-7px;margin-left:-6px;padding:2px}table.flexible_shipping_methods .checkbox-select-all{margin:0 12px 0 8px}table.flexible_shipping_methods td.integration,table.flexible_shipping_methods th.integration{text-align:center;width:130px}table.flexible_shipping_methods tr.highlight td{background-color:#e4f2fd}table.flexible_shipping_methods.wc_shipping th{font-weight:400;width:auto}table.flexible_shipping_methods td.ui-sortable-handle:before,table.flexible_shipping_services td.ui-sortable-handle:before{content:"\F333";font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%;line-height:24px}table.wc_input_table.flexible_shipping_rules.fs_new_interface td{padding:25px 5px;vertical-align:middle;border:none}table.wc_input_table.flexible_shipping_rules.fs_new_interface tr:nth-child(2n) td{background:#f9f9f9}table.wc_input_table.flexible_shipping_rules.fs_new_interface tr:nth-child(odd) td.sort{background:#fff}table.wc_input_table.flexible_shipping_rules.fs_new_interface td p.form-row{margin-top:0}table.wc_input_table.flexible_shipping_rules.fs_new_interface .description{padding-top:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface .form-row{padding-right:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface .single_rule_condition{vertical-align:middle;display:flex}table.wc_input_table.flexible_shipping_rules.fs_new_interface tbody .sort{padding-top:27px!important;padding-bottom:23px!important}.flexible_shipping_method_rules th{width:auto}.flexible_shipping_method_rules th.sort{width:10px}td.fs_cost{width:75px!important}div.rule_condition div{display:inline-block}div.rule_condition div.based_on,div.rule_condition div input{width:70px}table.flexible_shipping_method_rules th{padding:5px 10px 5px 0}table.flexible_shipping_method_rules td p,table.flexible_shipping_method_rules td p input,table.flexible_shipping_method_rules td p select{margin:0;width:100%;box-shadow:none;padding:0!important}table.flexible_shipping_method_rules td p input[type=text]{text-align:right;padding:0 5px!important;width:100%!important}table.flexible_shipping_method_rules td p select{margin:0;width:100%!important;box-shadow:none;line-height:28px;height:37px;vertical-align:middle}table.flexible_shipping_method_rules td p input[type=checkbox]{margin:0;width:auto}table.flexible_shipping_method_rules td,table.flexible_shipping_method_rules th{text-align:center}table.flexible_shipping_method_rules td.shipping_class,table.flexible_shipping_method_rules th.shipping_class{text-align:center;width:200px}table.flexible_shipping_method_rules td.shipping_class span{border:none}table.flexible_shipping_method_rules td.stop,table.flexible_shipping_method_rules th.stop{text-align:center;width:30px}table.flexible_shipping_method_rules td.cancel,table.flexible_shipping_method_rules th.cancel{text-align:center;width:60px}.woocommerce table.form-table .flexible_shipping_method_rules th span.woocommerce-help-tip{float:none;margin:0}.woocommerce table.form-table .flexible_shipping_method_rules .select2-container{margin:0}.woocommerce table.form-table .fs-locations-table .select2-container{max-width:none}.woocommerce table.form-table .fs-locations-table th .woocommerce-help-tip{float:none}div.flexilble_shipping_export_import{float:right}table.flexible_shipping_method_rules tfoot th{padding:10px}.woocommerce_page_wc-settings #mainform{position:relative}.column-flexible_shipping{width:130px}.column-flexible_shipping .shipping-status{float:left;margin-right:8px;margin-top:4px;text-align:left;width:18px}.column-flexible_shipping .shipping-status .created:after{color:#d0c21f!important}.column-flexible_shipping .shipping-actions a.button{float:left;margin:0 4px 2px 0;display:block;height:2em!important;padding:0!important;position:relative;text-indent:-9999px;width:2em}.column-flexible_shipping .shipping-actions a.button:after{font-family:WooCommerce;font-variant:normal;font-weight:400;height:100%;left:0;line-height:1.85;margin:0;position:absolute;text-align:center;text-indent:0;text-transform:none;top:0;width:100%}.column-flexible_shipping .shipping-actions a.button.get-label:after{content:"\E01E"}.column-flexible_shipping .shipping-actions a.button.track:after{content:"\E01B"}.column-flexible_shipping mark.failed:after{color:#a00!important}.column-flexible_shipping mark.manifest:after{color:#2ea2cc!important}.flexible_shipping_shipment_message{color:green}.flexible_shipping_shipment_message_error{color:#a00!important}.flexible_shipping_shipment_message_error span{color:#444;font-weight:700}.woocommerce .wp-admin select{height:100%}.button.flexible-printing-button-print{height:auto!important;white-space:normal!important;word-wrap:break-word!important}.inspire-settings{display:table;width:100%}.inspire-settings .inspire-main-content,.inspire-settings .inspire-sidebar{display:table-cell;height:500px;margin:0;padding:0;vertical-align:top}.inspire-settings .inspire-main-content{min-width:800px}.inspire-settings .inspire-sidebar{padding-left:30px;width:250px}.flexible-shipping-info ol{margin-top:0}#wpbody-content .flexible-shipping-info .metabox-holder{padding-top:0}#adminmenu #toplevel_page_flexible-shipping .menu-icon-generic div.wp-menu-image:before{font-family:WooCommerce!important;content:"\E01D"}.fs-new-service{color:#006799}.fs-order-item-fallback{margin-top:.5em;color:#888}.fs-saas-labels-counts span,.fs-saas-shipment span{font-weight:700}.fs-saas-no-labels-left{color:#a00}div.flexible-shipping-shipment-attachments p{display:inline}.flexible_shipping_shipment_attachment_message{padding-top:10px;color:green}table.flexible_shipping_services{max-width:550px}table.flexible_shipping_services .sort{width:1%}table.flexible_shipping_services .service_code{width:30px}table.flexible_shipping_services .select{text-align:center;width:1%}table.flexible_shipping_services .select input{margin:0 8px}.woocommerce table.form-table table.flexible_shipping_services td.service_name input,input.woocommerce_flexible_shipping_service_name{width:100%}.updated .fs-banner__button-container{padding:.75rem 0 0}.notice-info.fs-connect__container{border-left:none;padding:0;box-shadow:0 0 0 1px #dfdfdf,0 1px 2px #dfdfdf}.fs-connect__container{display:block;position:relative;box-sizing:border-box}.fs-connect__inner-container>a:first-child{z-index:1}.fs-connect__inner-container{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:left}.fs-connect__content-container{width:1250px;position:relative;padding:2rem;z-index:0}.fs-connect__content-container p{color:#555;font-size:.875rem}.fs-connect__content-container h2{margin-top:0;color:#555;line-height:1.6}.fs-connect__content-icon{float:right;margin:0 1.5rem 0 2.25rem}.fs-connect__content-icon svg{fill:#0085ba;height:180px;width:auto}.fs-connect__slide{display:none}.fs-connect__slide.fs__slide-is-active{display:block}.fs-banner__button-container .button-primary{margin:0 .3125rem .3125rem 0}.fs-connect__vertical-nav{background-color:#f1f1f1}.fs-connect__vertical-nav-container{width:15rem}.vertical-menu__feature-item-label{display:none}.fs-couriers{margin-top:2.5em}.fs-courier{position:relative;margin-bottom:2.5em;text-align:center}.fs-courier img{height:50px;width:auto}.fs-courier-label{background-color:#333;border-radius:3px;color:#fff;padding:0 4px 1px;position:absolute;right:0;top:-10px}.admin_page_flexible_shipping_connect_register .notice.is-dismissible,.admin_page_flexible_shipping_connect_register .settings-error,.admin_page_flexible_shipping_connect_register .update-nag,.admin_page_flexible_shipping_connect_register .updated{display:none!important}.fs-page-wrap{margin:0 auto;max-width:45rem}.fs-page-wrap h1{font-weight:400;margin-bottom:.67em;text-align:center}.fs-box{display:block;position:relative;margin:0 auto 20px;padding:16px;box-sizing:border-box;background:#fff;box-shadow:0 0 0 1px #dfdfdf,0 1px 2px #dfdfdf}.fs-box:after{content:".";display:block;height:0;clear:both;visibility:hidden}.admin_page_flexible_shipping_connect_register .fs-box,.fs-box.text-center{text-align:center}.admin_page_flexible_shipping_connect_register .fs-box p{margin:1.5em 0}.fs-box input[type=email]{padding:8px 10px}.fs-actions{padding-left:40px}.fs-actions button:active{vertical-align:inherit!important}.fs-actions .spinner{float:none;margin-top:0}.fs-cols{display:flex;flex-wrap:wrap;justify-content:space-between}.fs-inner-box{box-sizing:border-box;margin-top:30px;padding:0 20px}.fs-inner-box h4{font-size:1.2em;margin-bottom:.37em}.fs-inner-box svg{fill:#0085ba;height:70px;width:auto}.fs-connect-box-header{margin-top:3em}.hide-fs-connect-integration-box{display:none}.fs-settings-div table.form-table{width:700px;float:left}.fs-flexible-shipping-sidebar{position:absolute;right:0;width:300px;margin-top:-100px;z-index:1000}.fs-flexible-shipping-sidebar.flexible_shipping{margin-top:-200px}table.wc_input_table.flexible_shipping_rules{width:auto;min-width:764px}table.wc_input_table.flexible_shipping_rules td{padding:3px 5px}table.wc_input_table.flexible_shipping_rules p span.woocommerce-input-wrapper select,table.wc_input_table.flexible_shipping_rules span.input-wrapper select{line-height:2em}table.wc_input_table.flexible_shipping_rules td label{padding-right:3px;padding-left:3px;padding-top:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface td label{padding-right:10px;padding-left:10px;padding-top:5px}table.wc_input_table.flexible_shipping_rules p.form-row span.description,table.wc_input_table.flexible_shipping_rules span.input-wrapper span.description{padding-right:3px;padding-left:3px;vertical-align:middle;font-style:normal;font-size:14px}table.wc_input_table.flexible_shipping_rules p.form-row span.description{padding-top:4px;position:absolute}table.wc_input_table.flexible_shipping_rules td.cb,table.wc_input_table.flexible_shipping_rules th.cb{padding:10px 5px;padding-right:5px!important;margin:0}table.wc_input_table.flexible_shipping_rules td.cb input,table.wc_input_table.flexible_shipping_rules th.cb input{margin:0}table.wc_input_table.flexible_shipping_rules th.rule_costs{width:220px}table.wc_input_table.flexible_shipping_rules input[type=text]{width:100px!important;height:2em!important}table.wc_input_table.flexible_shipping_rules select{width:120px!important;height:2em!important;border:1px solid;padding:0 5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface select{width:130px!important}table.wc_input_table.flexible_shipping_method_rules td p label span.optional{display:none}table.wc_input_table.flexible_shipping_rules td.rule_conditions{min-width:465px}table.wc_input_table.flexible_shipping_rules td.rule_conditions div.single_rule_condition p.form-row{display:inline-block}table.wc_input_table.flexible_shipping_rules td p label span.optional{display:none}table#fs_new_rules_table_banner.widefat thead td,table#fs_new_rules_table_banner_for_new_table.widefat thead td{padding:5px 20px 20px}table.wc_input_table.flexible_shipping_rules span.input-wrapper,table.wc_input_table.flexible_shipping_rules span.input-wrapper input,table.wc_input_table.flexible_shipping_rules span.input-wrapper select{line-height:2em}table.wc_input_table.flexible_shipping_rules span.input-wrapper label{padding-right:3px;padding-left:3px}table.wc_input_table.flexible_shipping_rules span.input-wrapper span.description{padding-right:3px;padding-left:3px;vertical-align:middle}table.wc_input_table.flexible_shipping_rules td{vertical-align:top;padding-top:2px;padding-bottom:2px}table.wc_input_table.flexible_shipping_rules td.cb,table.wc_input_table.flexible_shipping_rules th.cb,table.wc_input_table.flexible_shipping_rules th.sort{width:20px;text-align:center}table.wc_input_table.flexible_shipping_rules th.rule_costs{width:520px}table.wc_input_table.flexible_shipping_rules input[type=text]{width:auto!important;height:auto!important;border:1px solid}table.wc_input_table.flexible_shipping_rules input.cost_additional,table.wc_input_table.flexible_shipping_rules input.per_value{width:60px!important;min-width:60px}table.wc_input_table.flexible_shipping_rules td.rule_costs div.input-wrapper.cost_per_order{display:block}table.wc_input_table.flexible_shipping_rules td.rule_costs a.button.plus.insert{display:inline-block;float:right;clear:both}table.wc_input_table.flexible_shipping_rules td.rule_costs div.additional_cost_wrapper{border-top:1px solid #dfdfdf;margin-top:2px;padding-top:2px;display:block}table.wc_input_table.flexible_shipping_rules td.rule_costs a.button.minus{display:inline-block;float:right;clear:both}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2){border-top:1px solid #dfdfdf;padding-top:2px;margin-top:2px}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_field_wrapper,table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper input.parameter_max,table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper input.parameter_min{width:60px!important;min-width:60px}table.wc_input_table.flexible_shipping_rules div.single_rule_condition label.condition_field_label{width:55px;text-align:right}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child label.condition_field_label_where{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child label.condition_field_label_and,table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) label.condition_field_label_where{display:none}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) label.condition_field_label_and{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition a.minus,table.wc_input_table.flexible_shipping_rules div.single_rule_condition a.plus{float:right}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child a.minus,table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) a.plus{display:none}table.wc_input_table.flexible_shipping_rules input.select2-search__field{border:0}.fs-notice.is-limited-width{width:calc(100% - 350px)}@media (max-width:1200px){.fs-flexible-shipping-sidebar{display:none}}@media screen and (max-width:782px){.notice-info.fs-connect__container{padding:0!important}}@media (max-width:782px){.fs-connect__content-icon.fs-connect-illo{float:none;width:100%;text-align:center;margin:2.25rem 0 1.5rem}}@media (max-width:600px){.fs-connect__vertical-nav{display:none}}@media (min-width:600px){.fs-connect__vertical-nav{flex-direction:column;justify-content:flex-start}.vertical-menu__feature-item{display:flex;flex-direction:row;align-items:center;padding:.5rem;border:1px solid #dfdfdf;border-top:none;border-left:3px solid #f9f9f9;background-color:#f9f9f9;color:#555;cursor:pointer}.vertical-menu__feature-item:last-of-type{position:relative;top:1px}.vertical-menu__feature-item-is-selected{border-left:3px solid #0085ba;border-right:1px solid #fff;background-color:#fff;color:#2e4453}.vertical-menu__feature-item-is-selected.fs-feature-intro{border-left:3px solid #00be28}.vertical-menu__feature-item-icon{width:1.25rem;height:1.25rem;padding:.25rem;text-align:center}.vertical-menu__feature-item svg{fill:#555;vertical-align:middle}.vertical-menu__feature-item-is-selected svg{fill:#0085ba}.vertical-menu__feature-item-label{display:block;padding:.5rem}.fs-inner-box{width:33.33%}}@media (min-width:782px){.fs-connect__content-container{padding:2rem 2rem 4rem}.fs-connect__content-container .fs-banner__button-container{position:absolute;bottom:.5rem}}@media (min-width:1200px){.fs-couriers{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.fs-courier{width:20%}.description.limited-width{max-width:calc(100% - 300px);line-height:30px}}
assets/js/admin.js CHANGED
@@ -1,78 +1,3 @@
1
- function fs_select2() {
2
- let elements = jQuery( '.fs_select2' );
3
- if ( elements.length ) {
4
- if (jQuery.fn.selectWoo) {
5
- elements.selectWoo();
6
- } else {
7
- elements.select2();
8
- }
9
- }
10
- }
11
-
12
- jQuery(document).ready(function(){
13
- if ( jQuery('#flexible_shipping_labels_url').length ) {
14
- window.location.href = jQuery('#flexible_shipping_labels_url').attr('href');
15
- }
16
-
17
- if ( jQuery('a.shipping_manifest_download').length == 1 ) {
18
- window.location.href = jQuery('a.shipping_manifest_download').attr('href');
19
- }
20
-
21
- if ( typeof window.history.pushState == 'function' ) {
22
- var url = document.location.href;
23
- var url2 = document.location.href;
24
- url = fs_removeParam('bulk_flexible_shipping_labels', url);
25
- url = fs_removeParam('bulk_flexible_shipping_send', url);
26
- url = fs_removeParam('bulk_flexible_shipping_manifests', url);
27
- url = fs_removeParam('bulk_flexible_shipping_no_labels_created', url);
28
- url = fs_trimChar(url,'?');
29
- if ( url != url2 ) {
30
- window.history.pushState({}, "", url);
31
- }
32
- }
33
-
34
- /* Connect Global Notice */
35
- var nav = jQuery( '.fs-connect__vertical-nav-container' ),
36
- contentContainer = jQuery( '.fs-connect__content-container' );
37
- nextFeatureButtons = jQuery( '.fs-banner__button-container .next-feature' ),
38
-
39
- nav.on( 'click', '.vertical-menu__feature-item:not( .vertical-menu__feature-item-is-selected )', function() {
40
- transitionSlideToIndex( jQuery( this ).index() );
41
- } );
42
-
43
- nextFeatureButtons.on( 'click', function( e ) {
44
- e.preventDefault();
45
-
46
- var slideIndex = jQuery( this )
47
- .closest( '.fs-connect__slide' )
48
- .index();
49
-
50
- transitionSlideToIndex( slideIndex + 1 );
51
- } );
52
-
53
- function transitionSlideToIndex( index ) {
54
- // Remove classes from previously selected menu item and content
55
- nav
56
- .find( '.vertical-menu__feature-item-is-selected' )
57
- .removeClass( 'vertical-menu__feature-item-is-selected' );
58
-
59
- contentContainer
60
- .find( '.fs__slide-is-active' )
61
- .removeClass( 'fs__slide-is-active' );
62
-
63
- // Add classes to selected menu item and content
64
- nav
65
- .children()
66
- .eq( index )
67
- .addClass( 'vertical-menu__feature-item-is-selected' );
68
-
69
- contentContainer
70
- .children()
71
- .eq( index )
72
- .addClass( 'fs__slide-is-active' );
73
- }
74
- });
75
-
76
  function fs_removeParam(key, sourceURL) {
77
  var rtn = sourceURL.split("?")[0],
78
  param,
@@ -103,116 +28,6 @@ function fs_trimChar(string, charToRemove) {
103
  return string;
104
  }
105
 
106
-
107
- // Order functions
108
-
109
- function fs_id( element ) {
110
- return jQuery(element).closest('.flexible_shipping_shipment').attr('data-id');
111
- }
112
-
113
- function fs_data_set_val( data, name, val ) {
114
- if ( typeof name == 'undefined' ) {
115
- return data;
116
- }
117
- if ( name.indexOf("[") == -1 ) {
118
- data[name] = val;
119
- }
120
- else {
121
- var names = name.split("[");
122
- var data2 = data;
123
- var data3 = data;
124
- var name2 = '';
125
- jQuery.each(names,function(index,name) {
126
- name2 = name.replace("]","");
127
- if ( typeof data2[name2] == 'undefined' ) {
128
- data2[name2] = {};
129
- }
130
- data3 = data2;
131
- data2 = data2[name2];
132
- });
133
- data3[name2] = val;
134
- }
135
- return data;
136
- }
137
-
138
- function fs_ajax(button, id, fs_action) {
139
- jQuery('.button-shipping').attr('disabled', true);
140
- jQuery(button).parent().find('.spinner').css({visibility: 'visible'});
141
- var data = {};
142
-
143
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_content input, #flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_content select, #flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_content textarea').each(function () {
144
- if (jQuery(this).attr('type') == 'radio') {
145
- data = fs_data_set_val( data, jQuery(this).attr('name'), jQuery('#flexible_shipping_shipment_' + id + ' input[name=' + jQuery(this).attr('name') + ']:checked').val() );
146
- }
147
- else if (jQuery(this).attr('type') == 'checkbox') {
148
- if (jQuery(this).is(':checked')) {
149
- data = fs_data_set_val( data, jQuery(this).attr('name'), jQuery(this).val() );
150
- }
151
- else {
152
- data = fs_data_set_val( data, jQuery(this).attr('name'), '' );
153
- }
154
- }
155
- else {
156
- data = fs_data_set_val( data, jQuery(this).attr('name'), jQuery(this).val() );
157
- }
158
- });
159
-
160
- var nonce = jQuery('#flexible_shipping_shipment_nonce_' + id).val();
161
-
162
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').hide();
163
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').removeClass("flexible_shipping_shipment_message_error");
164
-
165
- jQuery.ajax({
166
- url: fs_admin.ajax_url,
167
- type: 'POST',
168
- data: {
169
- fs_action: fs_action,
170
- action: 'flexible_shipping',
171
- nonce: nonce,
172
- shipment_id: id,
173
- data: data,
174
- },
175
- dataType: 'json',
176
- }).done(function (response) {
177
- if (response) {
178
- if (response == '0') {
179
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').show();
180
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').html("Invalid response: 0");
181
- }
182
- else if (response.status == 'success') {
183
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_content').html(response.content);
184
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').hide();
185
- if ( typeof response.message != 'undefined' ) {
186
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').show();
187
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').html(response.message);
188
- }
189
- }
190
- else {
191
- if ( typeof response.content !== 'undefined' ) {
192
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_content').html(response.content);
193
- }
194
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').addClass("flexible_shipping_shipment_message_error");
195
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').show();
196
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').html(response.message);
197
- }
198
- }
199
- else {
200
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').addClass("flexible_shipping_shipment_message_error");
201
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').show();
202
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').html("Request failed: invalid method?");
203
- }
204
- }).always(function () {
205
- jQuery('.button-shipping').attr('disabled', false);
206
- jQuery('.shipping-spinner').parent().find('.spinner').css({visibility: 'hidden'});
207
- fs_select2();
208
- jQuery('#flexible_shipping_shipment_' + id).trigger( "flexible_shipping_ajax_fs_action_after" );
209
- }).fail(function (jqXHR, textStatus) {
210
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').addClass("flexible_shipping_shipment_message_error");
211
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').show();
212
- jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').html("Request failed: " + textStatus + " " + jqXHR.status);
213
- })
214
- }
215
-
216
  /* Notice */
217
  jQuery(function($) {
218
  $( document ).on( 'click', '.flexible-shipping-taxes-notice .notice-dismiss', function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  function fs_removeParam(key, sourceURL) {
2
  var rtn = sourceURL.split("?")[0],
3
  param,
28
  return string;
29
  }
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  /* Notice */
32
  jQuery(function($) {
33
  $( document ).on( 'click', '.flexible-shipping-taxes-notice .notice-dismiss', function () {
assets/js/admin.min.js CHANGED
@@ -1,20 +1,9 @@
1
- function fs_select2(){let elements=jQuery('.fs_select2');if(elements.length){if(jQuery.fn.selectWoo){elements.selectWoo()}else{elements.select2()}}}
2
- jQuery(document).ready(function(){if(jQuery('#flexible_shipping_labels_url').length){window.location.href=jQuery('#flexible_shipping_labels_url').attr('href')}
3
- if(jQuery('a.shipping_manifest_download').length==1){window.location.href=jQuery('a.shipping_manifest_download').attr('href')}
4
- if(typeof window.history.pushState=='function'){var url=document.location.href;var url2=document.location.href;url=fs_removeParam('bulk_flexible_shipping_labels',url);url=fs_removeParam('bulk_flexible_shipping_send',url);url=fs_removeParam('bulk_flexible_shipping_manifests',url);url=fs_removeParam('bulk_flexible_shipping_no_labels_created',url);url=fs_trimChar(url,'?');if(url!=url2){window.history.pushState({},"",url)}}
5
- var nav=jQuery('.fs-connect__vertical-nav-container'),contentContainer=jQuery('.fs-connect__content-container');nextFeatureButtons=jQuery('.fs-banner__button-container .next-feature'),nav.on('click','.vertical-menu__feature-item:not( .vertical-menu__feature-item-is-selected )',function(){transitionSlideToIndex(jQuery(this).index())});nextFeatureButtons.on('click',function(e){e.preventDefault();var slideIndex=jQuery(this).closest('.fs-connect__slide').index();transitionSlideToIndex(slideIndex+1)});function transitionSlideToIndex(index){nav.find('.vertical-menu__feature-item-is-selected').removeClass('vertical-menu__feature-item-is-selected');contentContainer.find('.fs__slide-is-active').removeClass('fs__slide-is-active');nav.children().eq(index).addClass('vertical-menu__feature-item-is-selected');contentContainer.children().eq(index).addClass('fs__slide-is-active')}});function fs_removeParam(key,sourceURL){var rtn=sourceURL.split("?")[0],param,params_arr=[],queryString=(sourceURL.indexOf("?")!==-1)?sourceURL.split("?")[1]:"";if(queryString!==""){params_arr=queryString.split("&");for(var i=params_arr.length-1;i>=0;i-=1){param=params_arr[i].split("=")[0];if(param===key){params_arr.splice(i,1)}}
6
  rtn=rtn+"?"+params_arr.join("&")}
7
  return rtn}
8
  function fs_trimChar(string,charToRemove){while(string.charAt(0)==charToRemove){string=string.substring(1)}
9
  while(string.charAt(string.length-1)==charToRemove){string=string.substring(0,string.length-1)}
10
  return string}
11
- function fs_id(element){return jQuery(element).closest('.flexible_shipping_shipment').attr('data-id')}
12
- function fs_data_set_val(data,name,val){if(typeof name=='undefined'){return data}
13
- if(name.indexOf("[")==-1){data[name]=val}else{var names=name.split("[");var data2=data;var data3=data;var name2='';jQuery.each(names,function(index,name){name2=name.replace("]","");if(typeof data2[name2]=='undefined'){data2[name2]={}}
14
- data3=data2;data2=data2[name2]});data3[name2]=val}
15
- return data}
16
- function fs_ajax(button,id,fs_action){jQuery('.button-shipping').attr('disabled',!0);jQuery(button).parent().find('.spinner').css({visibility:'visible'});var data={};jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_content input, #flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_content select, #flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_content textarea').each(function(){if(jQuery(this).attr('type')=='radio'){data=fs_data_set_val(data,jQuery(this).attr('name'),jQuery('#flexible_shipping_shipment_'+id+' input[name='+jQuery(this).attr('name')+']:checked').val())}else if(jQuery(this).attr('type')=='checkbox'){if(jQuery(this).is(':checked')){data=fs_data_set_val(data,jQuery(this).attr('name'),jQuery(this).val())}else{data=fs_data_set_val(data,jQuery(this).attr('name'),'')}}else{data=fs_data_set_val(data,jQuery(this).attr('name'),jQuery(this).val())}});var nonce=jQuery('#flexible_shipping_shipment_nonce_'+id).val();jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').hide();jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').removeClass("flexible_shipping_shipment_message_error");jQuery.ajax({url:fs_admin.ajax_url,type:'POST',data:{fs_action:fs_action,action:'flexible_shipping',nonce:nonce,shipment_id:id,data:data,},dataType:'json',}).done(function(response){if(response){if(response=='0'){jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').show();jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').html("Invalid response: 0")}else if(response.status=='success'){jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_content').html(response.content);jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').hide();if(typeof response.message!='undefined'){jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').show();jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').html(response.message)}}else{if(typeof response.content!=='undefined'){jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_content').html(response.content)}
17
- jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').addClass("flexible_shipping_shipment_message_error");jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').show();jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').html(response.message)}}else{jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').addClass("flexible_shipping_shipment_message_error");jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').show();jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').html("Request failed: invalid method?")}}).always(function(){jQuery('.button-shipping').attr('disabled',!1);jQuery('.shipping-spinner').parent().find('.spinner').css({visibility:'hidden'});fs_select2();jQuery('#flexible_shipping_shipment_'+id).trigger("flexible_shipping_ajax_fs_action_after")}).fail(function(jqXHR,textStatus){jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').addClass("flexible_shipping_shipment_message_error");jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').show();jQuery('#flexible_shipping_shipment_'+id+' .flexible_shipping_shipment_message').html("Request failed: "+textStatus+" "+jqXHR.status)})}
18
  jQuery(function($){$(document).on('click','.flexible-shipping-taxes-notice .notice-dismiss',function(){$.ajax(ajaxurl,{type:'POST',data:{action:'flexible_shipping_taxes_notice',}})});$(document).on('click','#enable-fs-connect-box',function(){var fs_connect_checkbox=$('.enable-fs-connect-box');var fs_box_state;if(fs_connect_checkbox.prop('checked')){$('.fs-connect-integration-box').slideDown();fs_box_state=1}else{$('.fs-connect-integration-box').slideUp();fs_box_state=0}
19
  $.ajax(ajaxurl,{type:'POST',data:{action:'update_fs_connect_integration_setting',fs_box_state:fs_box_state}})});$(document).on('click','#flexible_shipping_rate_plugin .close-fs-rate-notice',function(){$('#flexible_shipping_rate_plugin .notice-dismiss').click()});$(document).on('click','#flexible_shipping_rate_plugin .fs-not-good',function(){$('#flexible_shipping_rate_plugin p').html(fs_admin.notice_not_good_enought)})});jQuery(function($){function fs_toggle_free_shipping_notice(){$('#woocommerce_flexible_shipping_method_free_shipping_cart_notice').closest('tr').toggle($('#woocommerce_flexible_shipping_method_free_shipping').val()!=='')}
20
  $('#woocommerce_flexible_shipping_method_free_shipping').on('change',function(){fs_toggle_free_shipping_notice()});fs_toggle_free_shipping_notice()})
1
+ function fs_removeParam(key,sourceURL){var rtn=sourceURL.split("?")[0],param,params_arr=[],queryString=(sourceURL.indexOf("?")!==-1)?sourceURL.split("?")[1]:"";if(queryString!==""){params_arr=queryString.split("&");for(var i=params_arr.length-1;i>=0;i-=1){param=params_arr[i].split("=")[0];if(param===key){params_arr.splice(i,1)}}
 
 
 
 
2
  rtn=rtn+"?"+params_arr.join("&")}
3
  return rtn}
4
  function fs_trimChar(string,charToRemove){while(string.charAt(0)==charToRemove){string=string.substring(1)}
5
  while(string.charAt(string.length-1)==charToRemove){string=string.substring(0,string.length-1)}
6
  return string}
 
 
 
 
 
 
 
7
  jQuery(function($){$(document).on('click','.flexible-shipping-taxes-notice .notice-dismiss',function(){$.ajax(ajaxurl,{type:'POST',data:{action:'flexible_shipping_taxes_notice',}})});$(document).on('click','#enable-fs-connect-box',function(){var fs_connect_checkbox=$('.enable-fs-connect-box');var fs_box_state;if(fs_connect_checkbox.prop('checked')){$('.fs-connect-integration-box').slideDown();fs_box_state=1}else{$('.fs-connect-integration-box').slideUp();fs_box_state=0}
8
  $.ajax(ajaxurl,{type:'POST',data:{action:'update_fs_connect_integration_setting',fs_box_state:fs_box_state}})});$(document).on('click','#flexible_shipping_rate_plugin .close-fs-rate-notice',function(){$('#flexible_shipping_rate_plugin .notice-dismiss').click()});$(document).on('click','#flexible_shipping_rate_plugin .fs-not-good',function(){$('#flexible_shipping_rate_plugin p').html(fs_admin.notice_not_good_enought)})});jQuery(function($){function fs_toggle_free_shipping_notice(){$('#woocommerce_flexible_shipping_method_free_shipping_cart_notice').closest('tr').toggle($('#woocommerce_flexible_shipping_method_free_shipping').val()!=='')}
9
  $('#woocommerce_flexible_shipping_method_free_shipping').on('change',function(){fs_toggle_free_shipping_notice()});fs_toggle_free_shipping_notice()})
classes/class-flexible-shipping-plugin.php CHANGED
@@ -88,7 +88,7 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
88
  *
89
  * @var string
90
  */
91
- private $scripts_version = '250';
92
 
93
  /**
94
  * Admin notices.
@@ -142,7 +142,7 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
142
  * Init logger on WPDesk_Flexible_Shipping_Shipment class.
143
  */
144
  private function init_logger_on_shipment() {
145
- WPDesk_Flexible_Shipping_Shipment::set_fs_logger( $this->logger );
146
  }
147
 
148
  /**
@@ -175,19 +175,10 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
175
  */
176
  private function load_dependencies() {
177
  require_once __DIR__ . '/../inc/functions.php';
178
- require_once __DIR__ . '/wp-wpdesk-fs-shipment/shipment/functions.php';
179
- require_once __DIR__ . '/manifest/functions.php';
180
 
181
  $session_factory = new SessionFactory();
182
 
183
- $shipment_cpt = new WPDesk_Flexible_Shipping_Shipment_CPT( $this );
184
- $this->add_hookable( $shipment_cpt );
185
-
186
- $this->add_hookable( new SubscriptionsIntegration( $shipment_cpt ) );
187
-
188
- new WPDesk_Flexible_Shipping_Shipping_Manifest_CPT( $this );
189
-
190
- new WPDesk_Flexible_Shipping_Shipment_Ajax( $this );
191
 
192
  $this->add_hookable( new WPDesk_Flexible_Shipping_Bulk_Actions( $session_factory ) );
193
 
@@ -195,16 +186,12 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
195
 
196
  $this->admin_notices = new WPDesk_Flexible_Shipping_Admin_Notices( $this );
197
 
198
- $this->add_hookable( new WPDesk_Flexible_Shipping_Single_Label_File_Dispatcher() );
199
-
200
  $this->add_hookable( new WPDesk_Flexible_Shipping_Tracker() );
201
 
202
  $this->add_hookable( new TrackerData() );
203
 
204
  $this->add_hookable( new WPDesk\FS\Rate\WPDesk_Flexible_Shipping_Rate_Notice() );
205
 
206
- $this->add_hookable( new WPDesk_Flexible_Shipping_Add_Shipping() );
207
-
208
  $this->add_hookable( new WPDesk_Flexible_Shipping_Shorcode_Unit_Weight() );
209
  $this->add_hookable( new WPDesk_Flexible_Shipping_Shorcode_Unit_Dimension() );
210
 
@@ -214,8 +201,6 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
214
 
215
  $this->add_hookable( new WPDesk_Flexible_Shipping_Logger_Downloader( new WPDeskLoggerFactory() ) );
216
 
217
- $this->add_hookable( new WPDesk_Flexible_Shipping_Rest_Api_Order_Response_Data_Appender() );
218
-
219
  $this->add_hookable( new ShippingIntegrations( 'flexible_shipping' ) );
220
 
221
  $this->add_hookable( new WPDesk_Flexible_Shipping_Order_Item_Meta() );
@@ -269,7 +254,7 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
269
 
270
  private function init_nps() {
271
  $user_meta_name = 'fs_nps';
272
- $nps = new Nps(
273
  'fs_nps',
274
  'vi75TA6E40L0BlKQ',
275
  '60b0d308a43c20215b585189',
@@ -280,7 +265,11 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
280
  new DisplayNpsLocationsAndUserDecisions(
281
  array(
282
  new ShippingMethodDisplayNpsDecision( 'flexible_shipping_single' ),
283
- new AdminPageDisplayNpsDecision( array( 'page' => 'wc-settings', 'tab' => 'shipping', 'section' => 'flexible_shipping_info' ) )
 
 
 
 
284
  ),
285
  array(
286
  new NpsDisplayDecision( new UserDisplayNpsDecision( $user_meta_name ) )
@@ -289,7 +278,9 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
289
  $user_meta_name,
290
  admin_url( 'admin-ajax.php' )
291
  );
292
- $nps->set_question( __( 'How likely are you to recommend our Flexible Shipping plugin to your friends?', 'flexible-shipping' ) );
 
 
293
  $nps->set_disclaimer(
294
  sprintf(
295
  __( 'By using the \'Send feedback\' button I hereby agree and consent to the terms of %1$sPrivacy Policy%2$s.', 'flexible-shipping' ),
@@ -395,7 +386,10 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
395
  public function hooks() {
396
  parent::hooks();
397
 
398
- add_filter( 'woocommerce_shipping_methods', array( $this, 'woocommerce_shipping_methods_filter' ), self::PRIORITY_AFTER_DEFAULT );
 
 
 
399
 
400
  add_action(
401
  'flexible_shipping_method_rate_id',
@@ -526,7 +520,7 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
526
  public function create_tracker() {
527
  $tracker_factory = new WPDesk_Tracker_Factory();
528
  $tracker_factory->create_tracker( basename( dirname( __FILE__ ) ) );
529
- (new \WPDesk\FS\Tracker\TrackerNotices())->hooks();
530
  }
531
 
532
  /**
@@ -786,7 +780,10 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
786
  private function should_enqueue_admin_scripts() {
787
  $current_screen = get_current_screen();
788
  $wc_screen_id = sanitize_title( __( 'WooCommerce', 'woocommerce' ) );
789
- if ( in_array( $current_screen->post_type, array( 'shop_order', 'shop_subscription' ), true ) || $wc_screen_id . '_page_wc-settings' === $current_screen->id ) {
 
 
 
790
  return true;
791
  }
792
 
88
  *
89
  * @var string
90
  */
91
+ private $scripts_version = '253';
92
 
93
  /**
94
  * Admin notices.
142
  * Init logger on WPDesk_Flexible_Shipping_Shipment class.
143
  */
144
  private function init_logger_on_shipment() {
145
+ // WPDesk_Flexible_Shipping_Shipment::set_fs_logger( $this->logger );
146
  }
147
 
148
  /**
175
  */
176
  private function load_dependencies() {
177
  require_once __DIR__ . '/../inc/functions.php';
 
 
178
 
179
  $session_factory = new SessionFactory();
180
 
181
+ $this->add_hookable( new \FSVendor\WPDesk\FS\Shipment\ShipmentFunctionality( $this->logger, trailingslashit( $this->get_plugin_assets_url() ) . '../vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/assets/', $this->scripts_version ) );
 
 
 
 
 
 
 
182
 
183
  $this->add_hookable( new WPDesk_Flexible_Shipping_Bulk_Actions( $session_factory ) );
184
 
186
 
187
  $this->admin_notices = new WPDesk_Flexible_Shipping_Admin_Notices( $this );
188
 
 
 
189
  $this->add_hookable( new WPDesk_Flexible_Shipping_Tracker() );
190
 
191
  $this->add_hookable( new TrackerData() );
192
 
193
  $this->add_hookable( new WPDesk\FS\Rate\WPDesk_Flexible_Shipping_Rate_Notice() );
194
 
 
 
195
  $this->add_hookable( new WPDesk_Flexible_Shipping_Shorcode_Unit_Weight() );
196
  $this->add_hookable( new WPDesk_Flexible_Shipping_Shorcode_Unit_Dimension() );
197
 
201
 
202
  $this->add_hookable( new WPDesk_Flexible_Shipping_Logger_Downloader( new WPDeskLoggerFactory() ) );
203
 
 
 
204
  $this->add_hookable( new ShippingIntegrations( 'flexible_shipping' ) );
205
 
206
  $this->add_hookable( new WPDesk_Flexible_Shipping_Order_Item_Meta() );
254
 
255
  private function init_nps() {
256
  $user_meta_name = 'fs_nps';
257
+ $nps = new Nps(
258
  'fs_nps',
259
  'vi75TA6E40L0BlKQ',
260
  '60b0d308a43c20215b585189',
265
  new DisplayNpsLocationsAndUserDecisions(
266
  array(
267
  new ShippingMethodDisplayNpsDecision( 'flexible_shipping_single' ),
268
+ new AdminPageDisplayNpsDecision( array(
269
+ 'page' => 'wc-settings',
270
+ 'tab' => 'shipping',
271
+ 'section' => 'flexible_shipping_info'
272
+ ) )
273
  ),
274
  array(
275
  new NpsDisplayDecision( new UserDisplayNpsDecision( $user_meta_name ) )
278
  $user_meta_name,
279
  admin_url( 'admin-ajax.php' )
280
  );
281
+ $nps->set_question( __( 'Hey, we are curious how would you grade your first impression on Flexible Shipping so far?', 'flexible-shipping' ) );
282
+ $nps->set_best_label( __( 'Wow, it\'s awesome!', 'flexible-shipping' ) );
283
+ $nps->set_worst_label( __( 'Really poor', 'flexible-shipping' ) );
284
  $nps->set_disclaimer(
285
  sprintf(
286
  __( 'By using the \'Send feedback\' button I hereby agree and consent to the terms of %1$sPrivacy Policy%2$s.', 'flexible-shipping' ),
386
  public function hooks() {
387
  parent::hooks();
388
 
389
+ add_filter( 'woocommerce_shipping_methods', array(
390
+ $this,
391
+ 'woocommerce_shipping_methods_filter'
392
+ ), self::PRIORITY_AFTER_DEFAULT );
393
 
394
  add_action(
395
  'flexible_shipping_method_rate_id',
520
  public function create_tracker() {
521
  $tracker_factory = new WPDesk_Tracker_Factory();
522
  $tracker_factory->create_tracker( basename( dirname( __FILE__ ) ) );
523
+ ( new \WPDesk\FS\Tracker\TrackerNotices() )->hooks();
524
  }
525
 
526
  /**
780
  private function should_enqueue_admin_scripts() {
781
  $current_screen = get_current_screen();
782
  $wc_screen_id = sanitize_title( __( 'WooCommerce', 'woocommerce' ) );
783
+ if ( in_array( $current_screen->post_type, array(
784
+ 'shop_order',
785
+ 'shop_subscription'
786
+ ), true ) || $wc_screen_id . '_page_wc-settings' === $current_screen->id ) {
787
  return true;
788
  }
789
 
classes/{wp-wpdesk-fs-shipment/rate-notices → notices}/abstract-rate.php RENAMED
File without changes
classes/{wp-wpdesk-fs-shipment → notices}/admin-notices.php RENAMED
File without changes
classes/{wp-wpdesk-fs-shipment/rate-notices → notices}/interface-rate.php RENAMED
File without changes
classes/{wp-wpdesk-fs-shipment/rate-notices → notices}/rate-notice-implementation.php RENAMED
File without changes
classes/{wp-wpdesk-fs-shipment → notices}/rate-notice.php RENAMED
File without changes
classes/table-rate/bulk-actions.php CHANGED
@@ -44,10 +44,16 @@ class WPDesk_Flexible_Shipping_Bulk_Actions implements Hookable {
44
  public function hooks() {
45
 
46
  add_filter( 'manage_edit-shop_order_columns', array( $this, 'manage_edit_shop_order_columns' ), 11 );
47
- add_action( 'manage_shop_order_posts_custom_column', array( $this, 'manage_shop_order_posts_custom_column' ), 11 );
 
 
 
48
 
49
  add_filter( 'bulk_actions-edit-shop_order', array( $this, 'bulk_actions_edit_shop_order' ) );
50
- add_filter( 'handle_bulk_actions-edit-shop_order', array( $this, 'handle_bulk_actions_edit_shop_order' ), 10, 3 );
 
 
 
51
 
52
  add_action( 'restrict_manage_posts', array( $this, 'restrict_manage_posts' ), 9999 );
53
 
@@ -89,8 +95,8 @@ class WPDesk_Flexible_Shipping_Bulk_Actions implements Hookable {
89
  global $wpdb;
90
  $query = $wp_query;
91
  if ( 'edit.php' === $pagenow && is_admin()
92
- && isset( $query->query_vars['post_type'] )
93
- && 'shop_order' === $query->query_vars['post_type']
94
  ) {
95
  $integration = '';
96
  if ( isset( $_GET['flexible_shipping_integration_filter'] ) ) {
@@ -277,8 +283,8 @@ class WPDesk_Flexible_Shipping_Bulk_Actions implements Hookable {
277
 
278
  /**
279
  * @param string $redirect_to .
280
- * @param string $do_action .
281
- * @param array $post_ids .
282
  *
283
  * @return bool|string
284
  */
@@ -322,19 +328,19 @@ class WPDesk_Flexible_Shipping_Bulk_Actions implements Hookable {
322
  return $redirect_to;
323
  }
324
  if ( 'flexible_shipping_labels' === $do_action ) {
325
- $labels_bulk_actions_handler = WPDesk_Flexible_Shipping_Labels_Bulk_Action_Handler::get_labels_bulk_actions_handler();
326
  $labels_bulk_actions_handler->bulk_process_orders( $post_ids );
327
 
328
- $labels = $labels_bulk_actions_handler->get_labels_for_shipments();
329
- if ( 0 === count( $labels ) ) {
330
- $redirect_to = add_query_arg( 'bulk_flexible_shipping_labels', count( $post_ids ), $redirect_to );
331
- $redirect_to = add_query_arg( 'bulk_flexible_shipping_no_labels_created', 1, $redirect_to );
 
332
 
333
- return $redirect_to;
334
- }
335
 
336
- try {
337
- $labels_file_creator = new WPDesk_Flexible_Shipping_Labels_File_Creator( $labels );
338
  $labels_file_creator->create_labels_file();
339
  $labels['tmp_file'] = $labels_file_creator->get_tmp_file_name();
340
  $labels['client_file'] = $labels_file_creator->get_file_name();
@@ -347,6 +353,8 @@ class WPDesk_Flexible_Shipping_Bulk_Actions implements Hookable {
347
  $labels['error'] = __( 'Unable to create temporary zip archive for labels. Check temporary folder configuration on server.', 'flexible-shipping' );
348
  } catch ( WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception $tmp_file_exception ) {
349
  $labels['error'] = __( 'Unable to create temporary file for labels. Check temporary folder configuration on server.', 'flexible-shipping' );
 
 
350
  }
351
 
352
  $this->get_session()->set( 'flexible_shipping_bulk_labels', $labels );
@@ -400,7 +408,7 @@ class WPDesk_Flexible_Shipping_Bulk_Actions implements Hookable {
400
  $messages[] = array(
401
  'type' => 'updated',
402
  'message' => sprintf(
403
- // Translators: manifests count and integration.
404
  __( 'Created manifest: %s (%s). If download not start automatically click %shere%s.', 'flexible-shipping' ), // phpcs:ignore
405
  $manifest->get_number(),
406
  $integrations[ $manifest->get_integration() ],
@@ -502,7 +510,7 @@ class WPDesk_Flexible_Shipping_Bulk_Actions implements Hookable {
502
  die( 'This file was already downloaded! Please retry bulk action!' );
503
  }
504
 
505
- $labels_file_dispatcher = new WPDesk_Flexible_Shipping_Labels_File_Dispatcher();
506
  $labels_file_dispatcher->dispatch_and_delete_labels_file( $file, $tmp_file );
507
  die();
508
  }
44
  public function hooks() {
45
 
46
  add_filter( 'manage_edit-shop_order_columns', array( $this, 'manage_edit_shop_order_columns' ), 11 );
47
+ add_action( 'manage_shop_order_posts_custom_column', array(
48
+ $this,
49
+ 'manage_shop_order_posts_custom_column'
50
+ ), 11 );
51
 
52
  add_filter( 'bulk_actions-edit-shop_order', array( $this, 'bulk_actions_edit_shop_order' ) );
53
+ add_filter( 'handle_bulk_actions-edit-shop_order', array(
54
+ $this,
55
+ 'handle_bulk_actions_edit_shop_order'
56
+ ), 10, 3 );
57
 
58
  add_action( 'restrict_manage_posts', array( $this, 'restrict_manage_posts' ), 9999 );
59
 
95
  global $wpdb;
96
  $query = $wp_query;
97
  if ( 'edit.php' === $pagenow && is_admin()
98
+ && isset( $query->query_vars['post_type'] )
99
+ && 'shop_order' === $query->query_vars['post_type']
100
  ) {
101
  $integration = '';
102
  if ( isset( $_GET['flexible_shipping_integration_filter'] ) ) {
283
 
284
  /**
285
  * @param string $redirect_to .
286
+ * @param string $do_action .
287
+ * @param array $post_ids .
288
  *
289
  * @return bool|string
290
  */
328
  return $redirect_to;
329
  }
330
  if ( 'flexible_shipping_labels' === $do_action ) {
331
+ $labels_bulk_actions_handler = \FSVendor\WPDesk\FS\Shipment\Label\LabelsBulkActionHandler::get_labels_bulk_actions_handler();
332
  $labels_bulk_actions_handler->bulk_process_orders( $post_ids );
333
 
334
+ try {
335
+ $labels = $labels_bulk_actions_handler->get_labels_for_shipments();
336
+ if ( 0 === count( $labels ) ) {
337
+ $redirect_to = add_query_arg( 'bulk_flexible_shipping_labels', count( $post_ids ), $redirect_to );
338
+ $redirect_to = add_query_arg( 'bulk_flexible_shipping_no_labels_created', 1, $redirect_to );
339
 
340
+ return $redirect_to;
341
+ }
342
 
343
+ $labels_file_creator = new \FSVendor\WPDesk\FS\Shipment\Label\LabelsFileCreator( $labels );
 
344
  $labels_file_creator->create_labels_file();
345
  $labels['tmp_file'] = $labels_file_creator->get_tmp_file_name();
346
  $labels['client_file'] = $labels_file_creator->get_file_name();
353
  $labels['error'] = __( 'Unable to create temporary zip archive for labels. Check temporary folder configuration on server.', 'flexible-shipping' );
354
  } catch ( WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception $tmp_file_exception ) {
355
  $labels['error'] = __( 'Unable to create temporary file for labels. Check temporary folder configuration on server.', 'flexible-shipping' );
356
+ } catch ( Exception $e ) {
357
+ $labels['error'] = $e->getMessage();
358
  }
359
 
360
  $this->get_session()->set( 'flexible_shipping_bulk_labels', $labels );
408
  $messages[] = array(
409
  'type' => 'updated',
410
  'message' => sprintf(
411
+ // Translators: manifests count and integration.
412
  __( 'Created manifest: %s (%s). If download not start automatically click %shere%s.', 'flexible-shipping' ), // phpcs:ignore
413
  $manifest->get_number(),
414
  $integrations[ $manifest->get_integration() ],
510
  die( 'This file was already downloaded! Please retry bulk action!' );
511
  }
512
 
513
+ $labels_file_dispatcher = new \FSVendor\WPDesk\FS\Shipment\Label\LabelsFileDispatcher();
514
  $labels_file_dispatcher->dispatch_and_delete_labels_file( $file, $tmp_file );
515
  die();
516
  }
classes/table-rate/shipping-method.php CHANGED
@@ -12,10 +12,8 @@ use WPDesk\FS\TableRate\ShippingMethod\CommonMethodSettings;
12
  use WPDesk\FS\TableRate\ShippingMethod\RateCalculatorFactory;
13
  use WPDesk\FS\TableRate\ShippingMethod\SettingsDisplayPreparer;
14
  use WPDesk\FS\TableRate\ShippingMethod\SettingsProcessor;
15
- use WPDesk\FS\TableRate\ShippingMethodTrait;
16
 
17
  class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
18
- use ShippingMethodTrait;
19
 
20
  const METHOD_ID = 'flexible_shipping';
21
 
@@ -560,7 +558,7 @@ class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
560
  $rate_calculator->set_logger( $logger );
561
  $calculated_rate = $rate_calculator->calculate_rate( $method_settings, $this->prepare_rate_id( $method_settings->get_raw_settings() ), is_user_logged_in() );
562
  if ( ! empty( $calculated_rate ) ) {
563
- $this->add_rate( $this->set_zero_cost_if_negative( $calculated_rate ) );
564
  $logger->debug( __( 'Shipping cost added.', 'flexible-shipping' ), $logger->get_results_context() );
565
  }
566
  $logger->show_notice_if_enabled();
12
  use WPDesk\FS\TableRate\ShippingMethod\RateCalculatorFactory;
13
  use WPDesk\FS\TableRate\ShippingMethod\SettingsDisplayPreparer;
14
  use WPDesk\FS\TableRate\ShippingMethod\SettingsProcessor;
 
15
 
16
  class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
 
17
 
18
  const METHOD_ID = 'flexible_shipping';
19
 
558
  $rate_calculator->set_logger( $logger );
559
  $calculated_rate = $rate_calculator->calculate_rate( $method_settings, $this->prepare_rate_id( $method_settings->get_raw_settings() ), is_user_logged_in() );
560
  if ( ! empty( $calculated_rate ) ) {
561
+ $this->add_rate( $calculated_rate );
562
  $logger->debug( __( 'Shipping cost added.', 'flexible-shipping' ), $logger->get_results_context() );
563
  }
564
  $logger->show_notice_if_enabled();
classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php DELETED
@@ -1,124 +0,0 @@
1
- <?php
2
- /**
3
- * Class WPDesk_Flexible_Shipping_Add_Shipping
4
- *
5
- * @package Flexible Shipping
6
- */
7
-
8
- /**
9
- * Can display maetabox and add new shipment.
10
- */
11
- class WPDesk_Flexible_Shipping_Add_Shipping implements \FSVendor\WPDesk\PluginBuilder\Plugin\HookablePluginDependant {
12
-
13
- use \FSVendor\WPDesk\PluginBuilder\Plugin\PluginAccess;
14
-
15
- /**
16
- * Shipping added?
17
- *
18
- * @var bool
19
- */
20
- private $shipping_added = false;
21
-
22
- /**
23
- * Hooks.
24
- */
25
- public function hooks() {
26
- add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ), 20, 2 );
27
- add_action( 'admin_init', array( $this, 'handle_add_shipping' ) );
28
- }
29
-
30
- /**
31
- * Add shipping.
32
- *
33
- * @param string $integration Integration.
34
- * @param array $get_data .
35
- */
36
- private function add_shipping( $integration, $get_data ) {
37
- $class_name = apply_filters( 'flexible_shipping_shipment_class', 'WPDesk_Flexible_Shipping_Shipment_' . $integration, $integration );
38
- if ( class_exists( $class_name ) ) {
39
- $order = wc_get_order( sanitize_key( $get_data['post'] ) );
40
- if ( $order ) {
41
- $order_id = $order->get_id();
42
- $integration = sanitize_key( $get_data['fs_add_shipping'] );
43
- // Translators: order id and integration.
44
- $post_title = sprintf( __( 'Shipment for order %1$s, %2$s', 'flexible-shipping' ), $order_id, $integration );
45
- $shipment_post = array(
46
- 'post_title' => $post_title,
47
- 'post_type' => 'shipment',
48
- 'post_status' => 'fs-new',
49
- 'post_parent' => $order_id,
50
- );
51
- $shipment_id = wp_insert_post( $shipment_post );
52
- update_post_meta( $shipment_id, '_integration', $integration );
53
- $shipment = fs_get_shipment( $shipment_id, $order );
54
- $shipment->set_created_via_add_shipment();
55
- if ( method_exists( $shipment, 'admin_add_shipment' ) ) {
56
- $shipment->admin_add_shipment();
57
- }
58
- $shipment->save();
59
- // Translators: shipment id.
60
- $order->add_order_note( sprintf( __( 'Added new shipment via metabox. Shipment ID: %1$s', 'flexible-shipping' ), $shipment->get_id() ) );
61
- $this->shipping_added = true;
62
- }
63
- }
64
- }
65
-
66
- /**
67
- * Handle add shipping.
68
- */
69
- public function handle_add_shipping() {
70
- if ( isset( $_GET['fs_add_shipping'] ) && isset( $_GET['post'] ) && isset( $_GET['_wpnonce'] ) ) {
71
- if ( wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'fs_add_shipping' ) ) {
72
- $integration = sanitize_key( $_GET['fs_add_shipping'] );
73
- $this->add_shipping( $integration, $_GET );
74
- }
75
- }
76
- }
77
-
78
- /**
79
- * Add metabox.
80
- *
81
- * @param string $post_type Post type.
82
- * @param WP_Post $post Post.
83
- */
84
- public function add_meta_box( $post_type, $post ) {
85
- if ( 'shop_order' === $post_type ) {
86
- $select_options = apply_filters( 'flexible_shipping_add_shipping_options', array() );
87
- if ( count( $select_options ) ) {
88
- $select_options = array_merge(
89
- array( '' => __( 'Select integration', 'flexible-shipping' ) ),
90
- $select_options
91
- );
92
- $args = array(
93
- 'select_options' => $select_options,
94
- 'order_id' => $post->ID,
95
- );
96
- add_meta_box(
97
- 'add_shipping_meta_box',
98
- __( 'Add shipping', 'flexible-shipping' ),
99
- array( $this, 'display_order_metabox' ),
100
- 'shop_order',
101
- 'side',
102
- 'default',
103
- $args
104
- );
105
- }
106
- }
107
- }
108
-
109
- /**
110
- * Display order metabox.
111
- *
112
- * @param WP_Post $post Post.
113
- * @param array $args Args.
114
- */
115
- public function display_order_metabox( $post, $args ) {
116
- $select_options = $args['args']['select_options'];
117
- $order_id = $args['args']['order_id'];
118
- $add_shipping_url = admin_url( 'post.php?post=' . $order_id . '&action=edit' );
119
- $add_shipping_url = wp_nonce_url( $add_shipping_url, 'fs_add_shipping' );
120
- $add_shipping_url = str_replace( '&amp;', '&', $add_shipping_url );
121
- include 'views/html-order-add_shipping-metabox.php';
122
- }
123
-
124
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/label/class-labels-bulk-action-handler.php DELETED
@@ -1,112 +0,0 @@
1
- <?php
2
- /**
3
- * Labels builders.
4
- *
5
- * @package Flexible Shipping
6
- */
7
-
8
- /**
9
- * Can create labels for shipments.
10
- */
11
- class WPDesk_Flexible_Shipping_Labels_Bulk_Action_Handler {
12
-
13
- /**
14
- * Builders.
15
- *
16
- * @var WPDesk_Flexible_Shipping_Labels_Bulk_Action_Handler
17
- */
18
- private static $labels_builder;
19
-
20
- /**
21
- * Labels builders collection.
22
- *
23
- * @var WPDesk_Flexible_Shipping_Labels_Builder[]
24
- */
25
- private $builders_collection = array();
26
-
27
- /**
28
- * Shipments.
29
- *
30
- * @var WPDesk_Flexible_Shipping_Shipment_Interface[]
31
- */
32
- private $shipments = array();
33
-
34
- /**
35
- * Add builder to builders collection.
36
- *
37
- * @param WPDesk_Flexible_Shipping_Labels_Builder $builder .
38
- */
39
- public function add_builder( WPDesk_Flexible_Shipping_Labels_Builder $builder ) {
40
- $this->builders_collection[ $builder->get_integration_id() ] = $builder;
41
- }
42
-
43
- /**
44
- * Bulk process orders.
45
- *
46
- * @param array $orders_ids .
47
- */
48
- public function bulk_process_orders( array $orders_ids ) {
49
- foreach ( $orders_ids as $order_id ) {
50
- $shipments = fs_get_order_shipments( $order_id );
51
- foreach ( $shipments as $shipment ) {
52
- $this->add_shipment( $shipment );
53
- }
54
- }
55
- }
56
-
57
- /**
58
- * Add shipment to labels builder.
59
- *
60
- * @param WPDesk_Flexible_Shipping_Shipment $shipment .
61
- */
62
- public function add_shipment( WPDesk_Flexible_Shipping_Shipment $shipment ) {
63
- if ( isset( $this->builders_collection[ $shipment->get_integration() ] ) ) {
64
- $this->builders_collection[ $shipment->get_integration() ]->add_shipment( $shipment );
65
- } else {
66
- $this->shipments[] = $shipment;
67
- }
68
- }
69
-
70
- /**
71
- * Get labels for shipments from builders.
72
- *
73
- * @return array
74
- */
75
- private function get_labels_for_shipments_from_builders() {
76
- $labels = array();
77
- foreach ( $this->builders_collection as $labels_builder ) {
78
- $labels += $labels_builder->get_labels_for_shipments();
79
- }
80
- return $labels;
81
- }
82
-
83
- /**
84
- * Get labels for shipments.
85
- *
86
- * @return array
87
- */
88
- public function get_labels_for_shipments() {
89
- $labels = $this->get_labels_for_shipments_from_builders();
90
- foreach ( $this->shipments as $shipment ) {
91
- try {
92
- $labels[] = $shipment->get_label();
93
- } catch ( Exception $e ) { // phpcs:ignore
94
- // do nothing.
95
- }
96
- }
97
- return $labels;
98
- }
99
-
100
- /**
101
- * Get builders.
102
- *
103
- * @return WPDesk_Flexible_Shipping_Labels_Bulk_Action_Handler
104
- */
105
- public static function get_labels_bulk_actions_handler() {
106
- if ( empty( static::$labels_builder ) ) {
107
- static::$labels_builder = new self();
108
- }
109
- return static::$labels_builder;
110
- }
111
-
112
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/label/class-labels-file-creator.php DELETED
@@ -1,104 +0,0 @@
1
- <?php
2
- /**
3
- * Labels file creator.
4
- *
5
- * @package Flexible Shipping
6
- */
7
-
8
- /**
9
- * Can create labels file.
10
- * When there is one label file it creates file from this label.
11
- * When there is more than one label file it creates zip file with all labels.
12
- */
13
- class WPDesk_Flexible_Shipping_Labels_File_Creator {
14
-
15
- /**
16
- * Labels.
17
- *
18
- * @var array
19
- */
20
- private $labels = array();
21
-
22
- /**
23
- * File name.
24
- *
25
- * @var string
26
- */
27
- private $file_name;
28
-
29
- /**
30
- * Tmp file name.
31
- *
32
- * @var string
33
- */
34
- private $tmp_file_name;
35
-
36
- /**
37
- * .
38
- *
39
- * @param array $labels .
40
- * @see WPDesk_Flexible_Shipping_Integration_Label_Builder::get_labels_for_shipments()
41
- */
42
- public function __construct( array $labels ) {
43
- $this->labels = $labels;
44
- $this->prepare_file_names();
45
- }
46
-
47
- /**
48
- * Create labels file.
49
- *
50
- * @throws WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception .
51
- */
52
- public function create_labels_file() {
53
- if ( 1 === count( $this->labels ) ) {
54
- file_put_contents( $this->tmp_file_name, $this->labels[0]['content'] ); // phpcs:ignore
55
- } else {
56
- $zip = new ZipArchive();
57
- if ( ! $zip->open( $this->tmp_file_name, ZipArchive::CREATE ) ) {
58
- throw new WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception();
59
- }
60
- foreach ( $this->labels as $label ) {
61
- if ( isset( $label['content'] ) ) {
62
- $zip->addFromString( $label['file_name'], $label['content'] );
63
- }
64
- }
65
- }
66
- }
67
-
68
- /**
69
- * Prepare file names.
70
- *
71
- * @throws WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception .
72
- */
73
- private function prepare_file_names() {
74
- if ( 1 === count( $this->labels ) ) {
75
- $this->file_name = $this->labels[0]['file_name'];
76
- } else {
77
- $this->file_name = 'labels.zip';
78
- }
79
- $this->tmp_file_name = @tempnam( 'tmp', 'labels_' ); // phpcs:ignore
80
- if ( ! $this->tmp_file_name ) {
81
- throw new WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception();
82
- }
83
- }
84
-
85
- /**
86
- * Get file name.
87
- *
88
- * @return string
89
- */
90
- public function get_file_name() {
91
- return $this->file_name;
92
- }
93
-
94
- /**
95
- * Get temporary file name.
96
- * In this file we save labels.
97
- *
98
- * @return string
99
- */
100
- public function get_tmp_file_name() {
101
- return $this->tmp_file_name;
102
- }
103
-
104
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/label/class-labels-file-dispatcher.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- /**
3
- * Labels file dispatcher.
4
- *
5
- * @package Flexible Shipping
6
- */
7
-
8
- /**
9
- * Can dispatch file to browser.
10
- */
11
- class WPDesk_Flexible_Shipping_Labels_File_Dispatcher {
12
-
13
- /**
14
- * Dispatches and delete temporary labels file.
15
- *
16
- * @param string $file_name Filename to send to browser.
17
- * @param string $tmp_file_path Temporary labels file name.
18
- */
19
- public function dispatch_and_delete_labels_file( $file_name, $tmp_file_path ) {
20
- header( 'Content-Description: File Transfer' );
21
- header( 'Content-Type: application/octet-stream' );
22
- header( 'Content-Disposition: attachment; filename="' . basename( $file_name ) . '"' );
23
- header( 'Expires: 0' );
24
- header( 'Cache-Control: must-revalidate' );
25
- header( 'Pragma: public' );
26
- header( 'Content-Length: ' . filesize( $tmp_file_path ) );
27
- readfile( $tmp_file_path ); // phpcs:ignore
28
- unlink( $tmp_file_path );
29
- }
30
-
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/label/class-single-label-file-dispatcher.php DELETED
@@ -1,104 +0,0 @@
1
- <?php
2
- /**
3
- * Single label file dispatcher.
4
- *
5
- * @package Flexible Shipping
6
- */
7
-
8
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
9
-
10
- /**
11
- * Can dispatch single label file.
12
- */
13
- class WPDesk_Flexible_Shipping_Single_Label_File_Dispatcher implements Hookable {
14
-
15
- const PRIORITY_VERY_LOW = 9999999;
16
-
17
- const DEFAULT_CONTENT_TYPE = 'application/octet-stream';
18
-
19
- const ACTION_DOWNLOAD = 'download';
20
- const ACTION_OPEN = 'open';
21
-
22
- /**
23
- * Hooks.
24
- */
25
- public function hooks() {
26
- add_action(
27
- 'admin_post_flexible_shipping_get_label',
28
- array(
29
- $this,
30
- 'dispatch_label_if_requested',
31
- ),
32
- self::PRIORITY_VERY_LOW
33
- );
34
- }
35
-
36
- /**
37
- * @param array $label_data .
38
- *
39
- * @return string
40
- */
41
- private function prepare_content_type_from_label_data( array $label_data ) {
42
- if ( 'html' === $label_data['label_format'] ) {
43
- return 'text/html';
44
- }
45
-
46
- return 'application/' . $label_data['label_format'];
47
- }
48
-
49
- /**
50
- * @return string
51
- */
52
- private function get_action_parameter() {
53
- return ! empty( $_GET['label_action'] ) ? sanitize_text_field( wp_unslash( $_GET['label_action'] ) ) : self::ACTION_DOWNLOAD; // phpcs:ignore
54
- }
55
-
56
- /**
57
- * @param array $label_data .
58
- *
59
- * @return string
60
- */
61
- private function prepare_content_type( array $label_data ) {
62
- if ( $this->get_action_parameter() === self::ACTION_OPEN ) {
63
- return $this->prepare_content_type_from_label_data( $label_data );
64
- } else {
65
- return self::DEFAULT_CONTENT_TYPE;
66
- }
67
- }
68
-
69
- /**
70
- * @param string $shipment_id .
71
- */
72
- private function dispatch_label_and_die( $shipment_id ) {
73
- $shipment = fs_get_shipment( $shipment_id );
74
- $label_data = $shipment->get_label();
75
- header( 'Content-type: ' . $this->prepare_content_type( $label_data ) );
76
- if ( $this->get_action_parameter() === self::ACTION_DOWNLOAD ) {
77
- header( 'Content-Disposition: attachment; filename=' . $label_data['file_name'] );
78
- }
79
- echo $label_data['content']; // phpcs:ignore
80
- die();
81
- }
82
-
83
- /**
84
- * Output shipping label.
85
- *
86
- * @internal
87
- */
88
- public function dispatch_label_if_requested() {
89
- check_admin_referer( 'flexible_shipping_get_label' );
90
-
91
- $shipment_id = filter_input( INPUT_GET, 'shipment_id', FILTER_VALIDATE_INT );
92
- $integration = get_post_meta( $shipment_id, '_integration', true );
93
-
94
- if ( ! $integration ) {
95
- wp_die( __( 'Integration doesn\'t exists.', 'flexible-shipping' ) ); // phpcs:ignore
96
- }
97
-
98
- try {
99
- $this->dispatch_label_and_die( $shipment_id );
100
- } catch ( Exception $e ) {
101
- wp_die( esc_html( $e->getMessage() ), esc_html( __( 'Label error', 'flexible-shipping' ) ) );
102
- }
103
- }
104
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/manifest/class-manifest.php DELETED
@@ -1,214 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
-
5
- if ( ! class_exists( 'WPDesk_Flexible_Shipping_Manifest' ) ) {
6
- /**
7
- * Class WPDesk_Flexible_Shipping_Shipment
8
- */
9
- abstract class WPDesk_Flexible_Shipping_Manifest {
10
-
11
- /**
12
- * @var int
13
- */
14
- private $id;
15
-
16
- /**
17
- * @var WP_Post
18
- * Post assigned to manifest
19
- */
20
- private $post;
21
-
22
- /**
23
- * @var bool
24
- * True if assigned post ich changed. Used when saving post
25
- */
26
- private $save_post = false;
27
-
28
- /**
29
- * @var null
30
- * Holds old status when manifest status is changed
31
- */
32
- private $old_status = null;
33
-
34
- /**
35
- * @var bool
36
- * True when status changing
37
- */
38
- private $status_changed = false;
39
-
40
- /**
41
- * @var array
42
- * Manifest metadata (from postmeta table)
43
- */
44
- private $meta_data = array();
45
-
46
- /**
47
- * @var bool
48
- * True when manifest metadata loaded
49
- */
50
- private $meta_data_loaded = false;
51
-
52
- /**
53
- * @var array
54
- * Holds changed metadata keys. Used when saving manifest
55
- */
56
- private $meta_data_save_keys = array();
57
-
58
- /**
59
- * WPDesk_Flexible_Shipping_Manifest constructor.
60
- *
61
- * @param int|WPDesk_Flexible_Shipping_Manifest|WP_Post $manifest Manifest.
62
- * @param WC_Order|null $order Order.
63
- */
64
- public function __construct( $manifest, $order = null ) {
65
- if ( is_numeric( $manifest ) ) {
66
- $this->id = absint( $manifest );
67
- $this->post = get_post( $this->id );
68
- } elseif ( $manifest instanceof WPDesk_Flexible_Shipping_Manifest ) {
69
- $this->id = absint( $manifest->get_id() );
70
- $this->post = $manifest->get_post();
71
- } elseif ( isset( $manifest->ID ) ) {
72
- $this->id = absint( $manifest->ID );
73
- $this->post = $manifest;
74
- }
75
- $this->order = $order;
76
- }
77
-
78
- /**
79
- * @return mixed
80
- */
81
- public function get_id() {
82
- return $this->id;
83
- }
84
-
85
- /**
86
- * @return mixed
87
- */
88
- public function get_post() {
89
- return $this->post;
90
- }
91
-
92
- /**
93
- * @param string $meta_key
94
- * @param null|string $default
95
- * @return array|string|null
96
- */
97
- public function get_meta( $meta_key = '', $default = null ) {
98
- $this->load_meta_data();
99
- if ( $meta_key == '' ) {
100
- return $this->meta_data;
101
- }
102
- if ( isset( $this->meta_data[$meta_key] ) ) {
103
- return maybe_unserialize( $this->meta_data[$meta_key][0] );
104
- }
105
- else {
106
- return $default;
107
- }
108
- }
109
-
110
- /**
111
- * @param string $meta_key
112
- * @param int|string|array|object|null $value
113
- */
114
- public function set_meta( $meta_key, $value ) {
115
- $this->load_meta_data();
116
- if ( !isset( $this->meta_data[$meta_key] ) ) {
117
- $this->meta_data[$meta_key] = array();
118
- }
119
- $this->meta_data[$meta_key][0] = $value;
120
- $this->meta_data_save_keys[$meta_key] = $meta_key;
121
- }
122
-
123
- /**
124
- * @param string $meta_key
125
- */
126
- public function delete_meta( $meta_key ) {
127
- unset( $this->meta_data[$meta_key] );
128
- $this->meta_data_save_keys[$meta_key] = $meta_key;
129
- }
130
-
131
- /**
132
- * Saves manifest data to database.
133
- */
134
- public function save() {
135
- if ( $this->save_post ) {
136
- wp_update_post($this->post);
137
- $this->save_post = false;
138
- }
139
- foreach ( $this->meta_data_save_keys as $key ) {
140
- if ( isset( $this->meta_data[$key] ) ) {
141
- update_post_meta( $this->id, $key, $this->meta_data[$key][0] );
142
- }
143
- else {
144
- delete_post_meta( $this->id, $key );
145
- }
146
- unset( $this->meta_data_save_keys[$key] );
147
- }
148
- if ( $this->status_changed ) {
149
- do_action( 'flexible_shipping_manifest_status_updated', $this->old_status, $this->post->post_status, $this );
150
- $this->status_changed = false;
151
- $this->old_status = null;
152
- }
153
- }
154
-
155
- /**
156
- * Loads all meta data from postmeta
157
- */
158
- public function load_meta_data() {
159
- if ( !$this->meta_data_loaded ) {
160
- $this->meta_data = get_post_meta( $this->id );
161
- $this->meta_data_loaded = true;
162
- }
163
- }
164
-
165
- /**
166
- * @return array|null
167
- * Returns integration assigned to manifest
168
- */
169
- public function get_integration() {
170
- return $this->get_meta( '_integration' );
171
- }
172
-
173
- /**
174
- * @return string
175
- */
176
- public function get_status() {
177
- return $this->post->post_status;
178
- }
179
-
180
- public function get_date() {
181
- return $this->post->post_date;
182
- }
183
-
184
- /**
185
- * @param string $new_status
186
- */
187
- public function update_status( $new_status ) {
188
- $this->old_status = $this->post->post_status;
189
- $this->post->post_status = $new_status;
190
- $this->save_post = true;
191
- $this->status_changed = true;
192
- }
193
-
194
-
195
- /**
196
- * @param mixed $shipments
197
- */
198
- public function add_shipments( $shipments ) {
199
- if ( !is_array( $shipments ) ) {
200
- $shipments = array( $shipments );
201
- }
202
- $shipments_ids = $this->get_meta( '_shipments', array() );
203
- foreach ( $shipments as $shipment ) {
204
- /* @var WPDesk_Flexible_Shipping_Shipment $shipment */
205
- $shipment->add_to_manifest( $this );
206
- $shipment->save();
207
- $shipments_ids[] = $shipment->get_id();
208
- }
209
- $this->set_meta( '_shipments', $shipments_ids );
210
- $this->save();
211
- }
212
-
213
- }
214
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php DELETED
@@ -1,327 +0,0 @@
1
- <?php
2
-
3
- if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
-
5
- class WPDesk_Flexible_Shipping_Shipping_Manifest_CPT {
6
-
7
- private $plugin = null;
8
-
9
- public function __construct( Flexible_Shipping_Plugin $plugin ) {
10
- $this->plugin = $plugin;
11
- $this->hooks();
12
- }
13
-
14
- public function hooks() {
15
-
16
- add_action( 'init', array( $this, 'register_post_types' ), 20 );
17
-
18
- add_action( 'admin_init', array( $this, 'cancel_manifest' ), 20 );
19
-
20
- add_action( 'admin_init', array( $this, 'download_manifest' ), 20 );
21
-
22
- add_action( 'admin_menu', array( $this, 'admin_menu' ), 199 );
23
-
24
- add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 20, 2 );
25
-
26
- add_action( 'trash_shipping_manifest', array( $this, 'trash_shipping_manifest' ) );
27
-
28
- add_filter( 'manage_edit-shipping_manifest_columns', array( $this, 'manage_edit_shipping_manifest_columns' ), 11 );
29
-
30
- add_action( 'manage_shipping_manifest_posts_custom_column', array(
31
- $this,
32
- 'manage_shipping_manifest_posts_custom_column'
33
- ), 11 );
34
-
35
- add_filter( 'post_row_actions', array( $this, 'shipping_manifest_row_actions' ), 10, 2 ) ;
36
-
37
- add_action( 'do_meta_boxes', array( $this, 'hide_publish_metabox' ) );
38
-
39
- add_filter( 'woocommerce_screen_ids', array( $this, 'woocommerce_screen_ids' ) );
40
-
41
- add_filter( 'bulk_actions-edit-shipping_manifest', array( $this, 'bulk_actions_edit_shipping_manifest' ) );
42
-
43
- add_action( 'restrict_manage_posts', array( $this, 'restrict_manage_posts' ), 9999 );
44
- add_filter( 'parse_query', array( $this, 'parse_query' ), 999 );
45
-
46
- }
47
-
48
- /**
49
- * Register post types.
50
- */
51
- public function register_post_types() {
52
-
53
- if ( post_type_exists( 'shipping_manifest' ) ) {
54
- return;
55
- }
56
-
57
- register_post_type( 'shipping_manifest',
58
- array(
59
- 'labels' => array(
60
- 'name' => __( 'Shipping Manifests', 'flexible-shipping' ),
61
- 'singular_name' => __( 'Shipping Manifest', 'flexible-shipping' ),
62
- 'menu_name' => __( 'Shipping Manifests', 'flexible-shipping' ),
63
- 'parent_item_colon' => '',
64
- 'all_items' => __( 'Shipping Manifests', 'flexible-shipping' ),
65
- 'view_item' => __( 'View Shipping Manifests', 'flexible-shipping' ),
66
- 'add_new_item' => __( 'Add new Shipping Manifest', 'flexible-shipping' ),
67
- 'add_new' => __( 'Add new Shipping Manifests', 'flexible-shipping' ),
68
- 'edit_item' => __( 'Edit Shipping Manifest', 'flexible-shipping' ),
69
- 'update_item' => __( 'Save Shipping Manifest', 'flexible-shipping' ),
70
- 'search_items' => __( 'Search Shipping Manifests', 'flexible-shipping' ),
71
- 'not_found' => __( 'Shipping Manifests not found', 'flexible-shipping' ),
72
- 'not_found_in_trash' => __( 'Shipping Manifests not found in trash', 'flexible-shipping' )
73
- ),
74
- 'description' => __( 'Shipping Manifests.', 'flexible-shipping' ),
75
- 'public' => false,
76
- 'show_ui' => true,
77
- 'capability_type' => 'post',
78
- 'capabilities' => array( 'create_posts' => false ),
79
- 'map_meta_cap' => true,
80
- 'publicly_queryable' => false,
81
- 'exclude_from_search' => true,
82
- 'hierarchical' => false,
83
- 'query_var' => true,
84
- 'supports' => array( 'title' ),
85
- 'has_archive' => false,
86
- 'show_in_nav_menus' => false,
87
- 'show_in_menu' => 'edit.php?post_type=shop_order',
88
- 'menu_icon' => 'dashicons-upload',
89
- )
90
- );
91
-
92
- }
93
-
94
- public function admin_menu() {
95
- $show_in_menu = current_user_can( 'manage_woocommerce' ) ? 'woocommerce' : false;
96
- if ( apply_filters( 'flexible_shipping_has_manifests', false ) ) {
97
- $slug = add_submenu_page( $show_in_menu, __( 'Shipping Manifests', 'flexible-shipping' ), __( 'Shipping Manifests', 'flexible-shipping' ), 'manage_woocommerce', 'edit.php?post_type=shipping_manifest' );
98
- }
99
- }
100
-
101
-
102
- public function add_meta_boxes( $post_type, $post ) {
103
- if ( $post_type == 'shipping_manifest' ) {
104
- /*
105
- add_meta_box(
106
- 'shipping_manifest_meta_box',
107
- __('Shipping manifest data', 'flexible-shipping'),
108
- array( $this, 'metabox' ),
109
- 'shipping_manifest',
110
- 'normal',
111
- 'high'
112
- );
113
- */
114
- add_meta_box(
115
- 'shipping_manifest_shipments',
116
- __('Shipments', 'flexible-shipping'),
117
- array( $this, 'shipments_metabox' ),
118
- 'shipping_manifest',
119
- 'normal',
120
- 'high'
121
- );
122
- }
123
- }
124
-
125
- public function metabox() {
126
- global $post;
127
- echo '<pre>';
128
- print_r( $post );
129
- echo '</pre>';
130
- $meta_data = get_post_meta( $post->ID );
131
- foreach ( $meta_data as $key => $val ) {
132
- echo '<pre>';
133
- echo $key;
134
- echo ' = ';
135
- print_r( maybe_unserialize( $val[0] ) );
136
- echo '</pre>';
137
- }
138
- }
139
-
140
- public function shipments_metabox() {
141
- global $post;
142
- $manifest = fs_get_manifest( $post->ID );
143
- $shipments_array = $manifest->get_meta( '_shipments', array() );
144
- $shipments = array();
145
- foreach ( $shipments_array as $shipment_id ) {
146
- $shipments[] = fs_get_shipment( $shipment_id );
147
- }
148
- include( 'views/manifest-metabox.php' );
149
- /*
150
- echo "<pre>";
151
- print_r($shipments);
152
- echo "</pre>";
153
- */
154
- }
155
-
156
- public function manage_edit_shipping_manifest_columns( $columns ) {
157
- unset( $columns['title'] );
158
- unset( $columns['date'] );
159
- unset( $columns['cb'] );
160
- $columns['manifest_date'] = __( 'Date', 'flexible-shipping' );
161
- $columns['integration'] = __( 'Integration', 'flexible-shipping' );
162
- $columns['external_number'] = __( 'Number', 'flexible-shipping' );
163
- $columns['shipment_count'] = __( 'Shipments count', 'flexible-shipping' );
164
- $columns['actions'] = __( 'Actions', 'flexible-shipping' );
165
- return $columns;
166
- }
167
-
168
- public function shipping_manifest_row_actions( $actions, $post ) {
169
- if ( $post->post_type == 'shipping_manifest' ) {
170
- $actions = array();
171
- }
172
- return $actions;
173
- }
174
-
175
- public function manage_shipping_manifest_posts_custom_column( $column ) {
176
- global $post;
177
- global $manifest;
178
- $integrations = apply_filters( 'flexible_shipping_integration_options', array() );
179
- if ( empty( $manifest ) || $manifest->get_id() != $post->ID ) {
180
- $manifest = fs_get_manifest( $post->ID );
181
- }
182
- if ( $column == 'manifest_date' ) {
183
- echo $manifest->get_date();
184
- }
185
- if ( $column == 'integration' ) {
186
- echo $integrations[$manifest->get_integration()];
187
- }
188
- if ( $column == 'external_number' ) {
189
- $download_manifest_url = admin_url('edit.php?post_type=shipping_manifest&flexible_shipping_download_manifest=' . $manifest->get_id() . '&nonce=' . wp_create_nonce('flexible_shipping_download_manifest'));
190
- include( 'views/column-number.php' );
191
- }
192
- if ( $column == 'shipment_count' ) {
193
- echo count( $manifest->get_meta( '_shipments', array() ) );
194
- }
195
- if ( $column == 'actions' ) {
196
- if ( $manifest->get_status() != 'trash' ) {
197
- $download_manifest_url = admin_url('edit.php?post_type=shipping_manifest&flexible_shipping_download_manifest=' . $manifest->get_id() . '&nonce=' . wp_create_nonce('flexible_shipping_download_manifest'));
198
- $cancel_url = admin_url('edit.php?post_type=shipping_manifest&flexible_shipping_cancel_manifest=' . $manifest->get_id() . '&nonce=' . wp_create_nonce('flexible_shipping_cancel_manifest'));
199
- include( 'views/column-actions.php' );
200
- }
201
- }
202
- }
203
-
204
- public function woocommerce_screen_ids( $screen_ids ) {
205
- $screen_ids[] = 'edit-shipping_manifest';
206
- $screen_ids[] = 'shipping_manifest';
207
- return $screen_ids;
208
- }
209
-
210
- public function bulk_actions_edit_shipping_manifest( $bulk_actions ) {
211
- $bulk_actions = array();
212
- return $bulk_actions;
213
- }
214
-
215
- public function cancel_manifest() {
216
- if ( !empty( $_GET['flexible_shipping_cancel_manifest'] ) && !empty( $_GET['nonce'] ) ) {
217
- $nonce = sanitize_text_field( $_GET['nonce'] );
218
- if ( !wp_verify_nonce( $nonce, 'flexible_shipping_cancel_manifest' ) ) {
219
- echo __( 'Invalid nonce!', 'flexible-shipping' );
220
- exit;
221
- }
222
- $sendback = admin_url( 'edit.php?post_type=shipping_manifest' );
223
- try {
224
- $shipping_manifest_id = sanitize_key( $_GET['flexible_shipping_cancel_manifest'] );
225
- $shipping_manifest = fs_get_manifest( $shipping_manifest_id );
226
- $shipping_manifest->cancel();
227
- fs_delete_manifest( $shipping_manifest );
228
- wp_redirect( $sendback );
229
- exit();
230
- }
231
- catch ( Exception $e ) {
232
- wp_redirect( $sendback );
233
- exit();
234
- }
235
-
236
- }
237
- }
238
-
239
- public function download_manifest() {
240
- if ( !empty( $_GET['flexible_shipping_download_manifest'] ) && !empty( $_GET['nonce'] ) ) {
241
- $nonce = sanitize_text_field( $_GET['nonce'] );
242
- if ( !wp_verify_nonce( $nonce, 'flexible_shipping_download_manifest' ) ) {
243
- echo __( 'Invalid nonce!', 'flexible-shipping' );
244
- }
245
- try {
246
- $shipping_manifest_id = sanitize_key( $_GET['flexible_shipping_download_manifest'] );
247
- $shipping_manifest = fs_get_manifest( $shipping_manifest_id );
248
- $manifest = $shipping_manifest->get_manifest();
249
- header( "Content-type: application/octet-stream" );
250
- header( "Content-Disposition: attachment; filename=" . $manifest['file_name'] );
251
- echo $manifest['content'];
252
- }
253
- catch ( Exception $e ) {
254
- echo $e->getMessage();
255
- }
256
- exit();
257
- }
258
- }
259
-
260
- public function hide_publish_metabox() {
261
- remove_meta_box( 'submitdiv', 'shipping_manifest', 'side' );
262
- }
263
-
264
- public function trash_shipping_manifest( $post_id ) {
265
- $manifest = fs_get_manifest( $post_id );
266
- $shipments_posts = get_posts( array(
267
- 'posts_per_page' => -1,
268
- 'post_type' => 'shipment',
269
- 'post_status' => 'any',
270
- 'meta_key' => '_manifest',
271
- 'meta_value' => $post_id
272
- ));
273
- foreach ( $shipments_posts as $shipment_post ) {
274
- $shipment = fs_get_shipment( $shipment_post->ID );
275
- $shipment->delete_meta( '_manifest' );
276
- $shipment->update_status('fs-confirmed' );
277
- $shipment->save();
278
- }
279
- $manifest->delete_meta( '_shipments' );
280
- $manifest->save();
281
- }
282
-
283
- public function restrict_manage_posts() {
284
- global $typenow;
285
- if ( 'shipping_manifest' == $typenow ){
286
- $integrations = apply_filters( 'flexible_shipping_integration_options', array() );
287
- foreach ( $integrations as $key => $integration ) {
288
- if ( !class_exists( 'WPDesk_Flexible_Shipping_Manifest_' . $key ) ) {
289
- unset( $integrations[$key] );
290
- }
291
- }
292
- $integration = '';
293
- if ( isset( $_GET['flexible_shipping_integration_filter'] ) ) {
294
- $integration = sanitize_key( $_GET['flexible_shipping_integration_filter'] );
295
- }
296
- include( 'views/filter-form.php' );
297
- }
298
- }
299
-
300
- /**
301
- * @param WP_Query $query .
302
- */
303
- public function parse_query( $query ) {
304
- global $pagenow;
305
- if ( 'edit.php' == $pagenow && is_admin()
306
- && isset( $query->query_vars['post_type'] ) && $query->query_vars['post_type'] == 'shipping_manifest'
307
- ) {
308
- $integration = '';
309
- if ( isset( $_GET['flexible_shipping_integration_filter'] ) ) {
310
- $integration = sanitize_key( $_GET['flexible_shipping_integration_filter'] );
311
- }
312
- if ( $integration != '' ) {
313
- if ($integration != '') {
314
- if (!isset($query->query_vars['meta_query'])) {
315
- $query->query_vars['meta_query'] = array();
316
- }
317
- $meta_query = array();
318
- $meta_query['key'] = '_integration';
319
- $meta_query['value'] = $integration;
320
- $query->query_vars['meta_query'][] = $meta_query;
321
- }
322
- }
323
- }
324
- }
325
-
326
-
327
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/manifest/functions.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
-
5
-
6
- function fs_manifest_integration_exists( $integration ) {
7
- $class_name = 'WPDesk_Flexible_Shipping_Manifest' . '_' . $integration ;
8
- if ( class_exists( $class_name ) ) {
9
- return true;
10
- }
11
- return false;
12
- }
13
-
14
-
15
- function fs_create_manifest( $integration ) {
16
- $post_title = sprintf( __( 'Shipping manifest %s, %s', 'flexible-shipping' ), $integration, date_i18n( get_option( 'date_format' ) ) );
17
- $post_title = apply_filters( 'flexible_shipping_manifest_post_title_'. $integration, $post_title );
18
- $manifest_post = array(
19
- 'post_title' => $post_title,
20
- 'post_type' => 'shipping_manifest',
21
- 'post_status' => 'publish',
22
- );
23
- $manifest_id = wp_insert_post( $manifest_post );
24
- update_post_meta( $manifest_id, '_integration', $integration );
25
- return fs_get_manifest( $manifest_id );
26
- }
27
-
28
- /**
29
- * @param $manifest_id
30
- * @return WPDesk_Flexible_Shipping_Manifest
31
- */
32
- function fs_get_manifest( $manifest_id ) {
33
- $integration = get_post_meta( $manifest_id, '_integration', true );
34
- $class_name = 'WPDesk_Flexible_Shipping_Manifest';
35
- if ( class_exists( $class_name . '_' . $integration ) ) {
36
- $class_name = $class_name . '_' . $integration;
37
- }
38
- else {
39
- $class_name = 'WPDesk_Flexible_Shipping_Manifest_FS';
40
- }
41
- return new $class_name( $manifest_id );
42
- }
43
-
44
- function fs_delete_manifest( $manifest ) {
45
- $shipments_posts = get_posts( array(
46
- 'posts_per_page' => -1,
47
- 'post_type' => 'shipment',
48
- 'post_status' => 'any',
49
- 'meta_key' => '_manifest',
50
- 'meta_value' => $manifest->get_id()
51
- ) );
52
- foreach ( $shipments_posts as $shipment_post ) {
53
- $shipment = fs_get_shipment( $shipment_post->ID );
54
- $shipment->delete_meta( '_manifest' );
55
- $shipment->update_status('fs-confirmed' );
56
- $shipment->save();
57
- }
58
- $manifest->set_meta( '_shipments', array() );
59
- $manifest->update_status( 'trash' );
60
- $manifest->save();
61
- }
62
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/manifest/interface-manifest.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
-
5
- if ( ! interface_exists( 'WPDesk_Flexible_Shipping_Manifest_Interface' ) ) {
6
-
7
- interface WPDesk_Flexible_Shipping_Manifest_Interface {
8
-
9
- /**
10
- * @return array
11
- * Returns manifest data in array
12
- * file_name => file name for manifest
13
- * content => pdf content
14
- */
15
- public function get_manifest();
16
-
17
- /**
18
- * @return string
19
- * Returns manifest number
20
- */
21
- public function get_number();
22
-
23
- /**
24
- * @return null
25
- * Generates manifest (ie. in API)
26
- */
27
- public function generate();
28
-
29
- /**
30
- * @return null
31
- * Cancels manifest (ie. in API)
32
- */
33
- public function cancel();
34
-
35
- }
36
-
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/manifest/views/column-actions.php DELETED
@@ -1,2 +0,0 @@
1
- <a class="button button-primary" target="_blank" href="<?php echo $download_manifest_url; ?>"><?php _e( 'Download', 'flexible-shipping' ); ?></a>
2
- <a class="button" href="<?php echo $cancel_url; ?>"><?php _e( 'Cancel', 'flexible-shipping' ); ?></a>
 
 
classes/wp-wpdesk-fs-shipment/manifest/views/column-number.php DELETED
@@ -1 +0,0 @@
1
- <a target="_blank" href="<?php echo $download_manifest_url; ?>"><?php echo $manifest->get_number(); ?></a>
 
classes/wp-wpdesk-fs-shipment/manifest/views/filter-form.php DELETED
@@ -1,11 +0,0 @@
1
- <?php ?>
2
- <div class="alignleft actions">
3
- <select name="flexible_shipping_integration_filter">
4
- <option value=""><?php _e( 'All manifests', 'flexible-shipping' ); ?></option>
5
- <optgroup label="<?php _e( 'Integration', 'flexible-shipping' ); ?>">
6
- <?php foreach ( $integrations as $key => $val ) : ?>
7
- <option value="<?php echo $key; ?>" <?php echo ($key == $integration ? 'selected' : '' ); ?>><?php echo $val; ?></option>
8
- <?php endforeach; ?>
9
- </optgroup>
10
- </select>
11
- </div>
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/manifest/views/manifest-metabox.php DELETED
@@ -1,55 +0,0 @@
1
- <table class="wp-list-table widefat fixed striped">
2
- <thead>
3
- <tr>
4
- <th>
5
- </th>
6
- <th>
7
- <?php _e( 'Shipment', 'flexible-shipping' ); ?>
8
- </th>
9
- <th>
10
- <?php _e( 'Order', 'flexible-shipping' ); ?>
11
- </th>
12
- </tr>
13
- </thead>
14
-
15
- <tbody id="the-list">
16
- <?php $count = 0; ?>
17
- <?php foreach ( $shipments as $shipment ) : ?>
18
- <?php
19
- $count++;
20
- $order = $shipment->get_order();
21
- if ( version_compare( WC_VERSION, '2.7', '<' ) ) {
22
- $order_id = $order->id;
23
- }
24
- else {
25
- $order_id = $order->get_id();
26
- }
27
- ?>
28
- <tr>
29
- <td>
30
- <?php echo $count; ?>
31
- </td>
32
- <td>
33
- <a href="<?php echo $shipment->get_order_metabox_url(); ?>"><?php echo $shipment->get_tracking_number(); ?></a>
34
- </td>
35
- <td>
36
- <a href="<?php echo admin_url( 'post.php?action=edit&post=' . $order_id ); ?>"><?php echo $order->get_order_number(); ?></a>
37
- </td>
38
- </tr>
39
- <?php endforeach; ?>
40
- </tbody>
41
-
42
- <tfoot>
43
- <tr>
44
- <th>
45
- </th>
46
- <th>
47
- <?php _e( 'Shipment', 'flexible-shipping' ); ?>
48
- </th>
49
- <th>
50
- <?php _e( 'Order', 'flexible-shipping' ); ?>
51
- </th>
52
- </tr>
53
- </tfoot>
54
-
55
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-provider-default.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
- /**
3
- * Class WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider_Default
4
- *
5
- * @package Flexible Shipping
6
- */
7
-
8
- use WPDesk\FS\TableRate\ShippingMethod\RateCalculator;
9
-
10
- /**
11
- * Default data provider. Can get data from shipment.
12
- */
13
- class WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider_Default implements WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider {
14
-
15
- const COMMON_KEYS_TO_REMOVE = array(
16
- RateCalculator::FS_METHOD,
17
- RateCalculator::FS_INTEGRATION,
18
- '_shipping_method',
19
- '_package',
20
- '_packages',
21
- );
22
-
23
- /**
24
- * Keys to remove.
25
- *
26
- * @var array
27
- */
28
- protected $keys_to_remove = array();
29
-
30
- /**
31
- * Get data from shipment.
32
- *
33
- * @param WPDesk_Flexible_Shipping_Shipment $shipment .
34
- *
35
- * @return array
36
- */
37
- public function get_data_from_shipment( WPDesk_Flexible_Shipping_Shipment $shipment ) {
38
- return $this->remove_internal_data_from_shipment_data( get_post_meta( $shipment->get_id() ) );
39
- }
40
-
41
- /**
42
- * Filter data.
43
- *
44
- * @param array $data .
45
- *
46
- * @return array
47
- */
48
- protected function remove_internal_data_from_shipment_data( array $data ) {
49
-
50
- $keys_to_remove = array_merge( self::COMMON_KEYS_TO_REMOVE, $this->keys_to_remove );
51
-
52
- foreach ( $keys_to_remove as $key ) {
53
- if ( isset( $data[ $key ] ) ) {
54
- unset( $data[ $key ] );
55
- }
56
- }
57
-
58
- return $this->format_data( $data );
59
- }
60
-
61
- /**
62
- * Format data.
63
- *
64
- * @param array $data .
65
- *
66
- * @return array
67
- */
68
- private function format_data( array $data ) {
69
- $formatted_data = array();
70
- foreach ( $data as $key => $value ) {
71
- if ( is_array( $value ) && isset( $value[0] ) ) {
72
- $formatted_data[ $key ] = $value[0];
73
- } else {
74
- $formatted_data[ $key ] = $value;
75
- }
76
- }
77
- return $formatted_data;
78
- }
79
-
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-providers-collection.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Data providers.
5
- * Collects data providers and can return provider per integration or default provider.
6
- */
7
- class WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Providers_Collection {
8
-
9
- /**
10
- * Providers.
11
- *
12
- * @var WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider[]
13
- */
14
- private $providers = array();
15
-
16
- /**
17
- * Add provider.
18
- *
19
- * @param string $integration .
20
- * @param WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider $provider .
21
- */
22
- public function set_provider( $integration, WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider $provider ) {
23
- $this->providers[ $integration ] = $provider;
24
- }
25
-
26
- /**
27
- * Get provider for integration.
28
- *
29
- * @param string $integration .
30
- *
31
- * @return WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider
32
- */
33
- public function get_provider_for_integration( $integration ) {
34
- if ( isset( $this->providers[ $integration ] ) ) {
35
- return $this->providers[ $integration ];
36
- }
37
- return new WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider_Default();
38
- }
39
-
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-providers-factory.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Data providers factory.
5
- */
6
- class WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Providers_Factory {
7
-
8
- /**
9
- * Providers.
10
- *
11
- * @var WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Providers_Collection
12
- */
13
- private static $data_providers = null;
14
-
15
- /**
16
- * Get data providers.
17
- *
18
- * @return WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Providers_Collection
19
- */
20
- public static function get_providers() {
21
- if ( empty( self::$data_providers ) ) {
22
- self::$data_providers = new WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Providers_Collection();
23
- }
24
- return self::$data_providers;
25
- }
26
-
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-response-data-appender.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
-
3
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
4
-
5
- /**
6
- * Can append shipments data to WooCommerce REST API Order response.
7
- */
8
- class WPDesk_Flexible_Shipping_Rest_Api_Order_Response_Data_Appender implements Hookable {
9
-
10
- const REST_API_DATA_KEY = 'fs_shipping_lines';
11
-
12
- /**
13
- * Hooks.
14
- */
15
- public function hooks() {
16
- add_filter( 'woocommerce_rest_prepare_shop_order_object', array( $this, 'maybe_append_shipment_to_order_data' ), 10, 3 );
17
- }
18
-
19
- /**
20
- * Appends shipment data if exists to order in REST API response.
21
- *
22
- * @param WP_REST_Response $response .
23
- * @param WC_Order $order .
24
- * @param WP_REST_Request $request .
25
- *
26
- * @return WP_REST_Response
27
- */
28
- public function maybe_append_shipment_to_order_data( $response, $order, $request ) {
29
- $shipments = fs_get_order_shipments( $order->get_id() );
30
-
31
- if ( ! empty( $shipments ) ) {
32
- return $this->append_shipment_to_order_data( $response, $order, $request, $shipments );
33
- }
34
-
35
- return $response;
36
- }
37
-
38
- /**
39
- * Appends shipment data to order in REST API response.
40
- *
41
- * @param WP_REST_Response $response .
42
- * @param WC_Order $order .
43
- * @param WP_REST_Request $request .
44
- * @param WPDesk_Flexible_Shipping_Shipment[] $shipments .
45
- *
46
- * @return WP_REST_Response
47
- */
48
- private function append_shipment_to_order_data( $response, $order, $request, $shipments ) {
49
-
50
- $response_data = $response->get_data();
51
-
52
- if ( empty( $response_data[ self::REST_API_DATA_KEY ] ) ) {
53
- $response_data[ self::REST_API_DATA_KEY ] = array();
54
- }
55
-
56
- $providers = WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Providers_Factory::get_providers();
57
- foreach ( $shipments as $shipment ) {
58
- $integration = $shipment->get_integration();
59
- $data_provider = $providers->get_provider_for_integration( $integration );
60
-
61
- $response_data[ self::REST_API_DATA_KEY ][] = $data_provider->get_data_from_shipment( $shipment );
62
- }
63
-
64
- $response->set_data( $response_data );
65
-
66
- return $response;
67
- }
68
-
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/rest-api/interface-rest-api-order-data-provider.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Defines interface that REST API Order Data Provider should implement.
5
- */
6
- interface WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider {
7
-
8
- /**
9
- * Get data from shipment.
10
- *
11
- * @param WPDesk_Flexible_Shipping_Shipment $shipment .
12
- *
13
- * @return array
14
- */
15
- public function get_data_from_shipment( WPDesk_Flexible_Shipping_Shipment $shipment );
16
-
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php DELETED
@@ -1,344 +0,0 @@
1
- <?php
2
- /**
3
- * Class WPDesk_Flexible_Shipping_Shipment_CPT
4
- *
5
- * @package Flexible Shipping
6
- */
7
-
8
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
9
-
10
- /**
11
- * Shipment Custom Post Type.
12
- */
13
- class WPDesk_Flexible_Shipping_Shipment_CPT implements Hookable {
14
-
15
- const POST_TYPE_SHIPMENT = 'shipment';
16
-
17
- /**
18
- * Is order processed on checkout?
19
- *
20
- * @var bool
21
- */
22
- private $is_order_processed_on_checkout = false;
23
-
24
- /**
25
- * Hooks.
26
- */
27
- public function hooks() {
28
- $last_priority = PHP_INT_MAX;
29
-
30
- add_action( 'init', array( $this, 'register_post_types' ), 20 );
31
- add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 20, 2 );
32
- add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'create_shipping_for_order' ), $last_priority );
33
- add_action( 'woocommerce_order_details_after_order_table', array( $this, 'woocommerce_order_details_after_order_table' ) );
34
- add_action( 'woocommerce_email_after_order_table', array( $this, 'woocommerce_email_after_order_table' ), 10, 2 );
35
- }
36
-
37
- /**
38
- * Register post types.
39
- */
40
- public function register_post_types() {
41
-
42
- if ( post_type_exists( self::POST_TYPE_SHIPMENT ) ) {
43
- return;
44
- }
45
-
46
- register_post_type(
47
- self::POST_TYPE_SHIPMENT,
48
- array(
49
- 'labels' => array(
50
- 'name' => __( 'Shipments', 'flexible-shipping' ),
51
- 'singular_name' => __( 'Shipment', 'flexible-shipping' ),
52
- 'menu_name' => __( 'Shipments', 'flexible-shipping' ),
53
- 'parent_item_colon' => '',
54
- 'all_items' => __( 'Shipments', 'flexible-shipping' ),
55
- 'view_item' => __( 'View Shipments', 'flexible-shipping' ),
56
- 'add_new_item' => __( 'Add new Shipment', 'flexible-shipping' ),
57
- 'add_new' => __( 'Add new Shipment', 'flexible-shipping' ),
58
- 'edit_item' => __( 'Edit Shipment', 'flexible-shipping' ),
59
- 'update_item' => __( 'Save Shipment', 'flexible-shipping' ),
60
- 'search_items' => __( 'Search Shipments', 'flexible-shipping' ),
61
- 'not_found' => __( 'Shipment not found', 'flexible-shipping' ),
62
- 'not_found_in_trash' => __( 'Shipment not found in trash', 'flexible-shipping' ),
63
- ),
64
- 'description' => __( 'Shipments.', 'flexible-shipping' ),
65
- 'public' => false,
66
- 'show_ui' => false,
67
- 'capability_type' => 'post',
68
- 'capabilities' => array(),
69
- 'map_meta_cap' => true,
70
- 'publicly_queryable' => false,
71
- 'exclude_from_search' => true,
72
- 'hierarchical' => false,
73
- 'query_var' => true,
74
- 'supports' => array( 'title' ),
75
- 'has_archive' => false,
76
- 'show_in_nav_menus' => true,
77
- 'menu_icon' => 'dashicons-upload',
78
- )
79
- );
80
-
81
- $shipment_statuses = apply_filters(
82
- 'flexible_shipping_register_shipment_statuses',
83
- array(
84
- 'fs-new' => array(
85
- 'label' => _x( 'New', 'Shipment status', 'flexible-shipping' ),
86
- 'public' => false,
87
- 'exclude_from_search' => false,
88
- 'show_in_admin_all_list' => true,
89
- 'show_in_admin_status_list' => true,
90
- 'label_count' => _n_noop( 'New <span class="count">(%s)</span>', 'New <span class="count">(%s)</span>', 'flexible-shipping' ), // phpcs:ignore.
91
- ),
92
- 'fs-created' => array(
93
- 'label' => _x( 'Created', 'Shipment status', 'flexible-shipping' ),
94
- 'public' => false,
95
- 'exclude_from_search' => false,
96
- 'show_in_admin_all_list' => true,
97
- 'show_in_admin_status_list' => true,
98
- 'label_count' => _n_noop( 'Created <span class="count">(%s)</span>', 'Created <span class="count">(%s)</span>', 'flexible-shipping' ), // phpcs:ignore.
99
- ),
100
- 'fs-confirmed' => array(
101
- 'label' => _x( 'Confirmed', 'Shipment status', 'flexible-shipping' ),
102
- 'public' => false,
103
- 'exclude_from_search' => false,
104
- 'show_in_admin_all_list' => true,
105
- 'show_in_admin_status_list' => true,
106
- 'label_count' => _n_noop( 'Confirmed <span class="count">(%s)</span>', 'Confirmed <span class="count">(%s)</span>', 'flexible-shipping' ), // phpcs:ignore.
107
- ),
108
- 'fs-manifest' => array(
109
- 'label' => _x( 'Manifest created', 'Shipment status', 'flexible-shipping' ),
110
- 'public' => false,
111
- 'exclude_from_search' => false,
112
- 'show_in_admin_all_list' => true,
113
- 'show_in_admin_status_list' => true,
114
- 'label_count' => _n_noop( 'Confirmed <span class="count">(%s)</span>', 'Confirmed <span class="count">(%s)</span>', 'flexible-shipping' ), // phpcs:ignore.
115
- ),
116
- 'fs-failed' => array(
117
- 'label' => _x( 'Failed', 'Shipment status', 'flexible-shipping' ),
118
- 'public' => false,
119
- 'exclude_from_search' => false,
120
- 'show_in_admin_all_list' => true,
121
- 'show_in_admin_status_list' => true,
122
- 'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'flexible-shipping' ), // phpcs:ignore.
123
- ),
124
- )
125
- );
126
-
127
- foreach ( $shipment_statuses as $shipment_status => $values ) {
128
- register_post_status( $shipment_status, $values );
129
- }
130
-
131
- }
132
-
133
- /**
134
- * Prepares class name for integration.
135
- *
136
- * @param string $integration .
137
- *
138
- * @return string
139
- */
140
- public function prepare_integration_class_name( $integration ) {
141
- return apply_filters( 'flexible_shipping_shipment_class', 'WPDesk_Flexible_Shipping_Shipment_' . $integration, $integration );
142
- }
143
-
144
- /**
145
- * @param string $post_type .
146
- * @param WP_Post $post .
147
- */
148
- public function add_meta_boxes( $post_type, $post ) {
149
- if ( self::POST_TYPE_SHIPMENT === $post_type ) {
150
- add_meta_box(
151
- 'shipment_meta_box',
152
- __( 'Shipment data', 'flexible-shipping' ),
153
- array( $this, 'metabox' ),
154
- 'shipment',
155
- 'normal',
156
- 'high'
157
- );
158
- }
159
- if ( in_array( $post_type, array( 'shop_order', 'shop_subscription' ), true ) ) {
160
- $shipments = fs_get_order_shipments( $post->ID );
161
- foreach ( $shipments as $shipment ) {
162
- $args = array( 'shipment' => $shipment );
163
- add_meta_box(
164
- 'shipment_meta_box_' . $shipment->get_id(),
165
- $shipment->get_order_metabox_title(),
166
- array( $this, 'order_metabox' ),
167
- null,
168
- $shipment->get_order_metabox_context(),
169
- 'default',
170
- $args
171
- );
172
-
173
- }
174
- }
175
- }
176
-
177
- /**
178
- * @param WP_Post $post .
179
- * @param array $args .
180
- */
181
- public function order_metabox( $post, $args ) {
182
- /** @var WPDesk_Flexible_Shipping_Shipment $shipment */
183
- $shipment = $args['args']['shipment'];
184
- $shipment_id = $shipment->get_id();
185
- $message = $shipment->get_error_message();
186
- $message_heading = $shipment->get_order_metabox_title();
187
- $message_css_style = '';
188
- include( 'views/order-metabox.php' );
189
- }
190
-
191
- /**
192
- * .
193
- */
194
- public function metabox() {
195
- global $post;
196
- echo '<pre>';
197
- print_r( $post );
198
- echo '</pre>';
199
- $meta_data = get_post_meta( $post->ID );
200
- foreach ( $meta_data as $key => $val ) {
201
- echo '<pre>';
202
- echo esc_html( $key );
203
- echo ' = ';
204
- print_r( maybe_unserialize( $val[0] ) );
205
- echo '</pre>';
206
- }
207
- }
208
-
209
- /**
210
- * Get Flexible Shipping method from order shipping method meta data.
211
- *
212
- * @param WC_Order_Item_Shipping $shipping_method .
213
- *
214
- * @return array
215
- */
216
- private function get_fs_method_from_order_shipping_method( $shipping_method ) {
217
- $fs_method = array();
218
- if ( isset( $shipping_method['item_meta'] )
219
- && isset( $shipping_method['item_meta']['_fs_method'] )
220
- ) {
221
- $fs_method = $shipping_method['item_meta']['_fs_method'];
222
- }
223
-
224
- return $fs_method;
225
- }
226
-
227
- /**
228
- * Create shipment for order and shipping method.
229
- *
230
- * @param WC_Order $order Order.
231
- * @param array $fs_method Flexible Shipping shipping method.
232
- * @param string $shipping_id Shipping Id.
233
- * @param WC_Order_Item_Shipping $shipping_method Shipping method.
234
- * @param array $packages Packages.
235
- * @param int $package_id Package Id.
236
- *
237
- * @return WPDesk_Flexible_Shipping_Shipment
238
- */
239
- private function create_shipment_for_order_and_fs_shipping_method(
240
- WC_Order $order,
241
- array $fs_method,
242
- $shipping_id,
243
- WC_Order_Item_Shipping $shipping_method,
244
- array $packages,
245
- $package_id
246
- ) {
247
- $shipment = fs_create_shipment( $order, $fs_method );
248
- $shipment->set_meta( '_fs_method', $fs_method );
249
- $shipment->set_meta( '_shipping_id', $shipping_id );
250
- $shipment->set_meta( '_shipping_method', $shipping_method );
251
- $shipment->set_created_via_checkout();
252
- $shipment->checkout( $fs_method, $packages[ $package_id ] );
253
- $shipment->save();
254
-
255
- return $shipment;
256
- }
257
-
258
- /**
259
- * Create shipping for order.
260
- *
261
- * @param int $order_id .
262
- */
263
- public function create_shipping_for_order( $order_id ) {
264
- $order = wc_get_order( $order_id );
265
- if ( $order && ! $this->is_order_processed_on_checkout ) {
266
- $mutex = \FSVendor\WPDesk\Mutex\WordpressPostMutex::fromOrder( $order );
267
- $mutex->acquireLock();
268
- $shipments = fs_get_order_shipments( $order_id );
269
- if ( 0 === count( $shipments ) ) {
270
- $this->is_order_processed_on_checkout = true;
271
- $this->create_shipping_for_order_and_cart( $order, WC()->cart );
272
- }
273
- $mutex->releaseLock();
274
- }
275
- }
276
-
277
- /**
278
- * @param WC_Order $order .
279
- * @param WC_Cart $cart .
280
- */
281
- public function create_shipping_for_order_and_cart( $order, $cart ) {
282
- global $fs_package_id;
283
- $order_shipping_methods = $order->get_shipping_methods();
284
- $packages = $cart->get_shipping_packages();
285
- $package_id = - 1;
286
- foreach ( $order_shipping_methods as $shipping_id => $shipping_method ) {
287
- $package_id ++;
288
- $fs_package_id = $package_id;
289
- $fs_method = $this->get_fs_method_from_order_shipping_method( $shipping_method );
290
- if ( ! empty( $fs_method['method_integration'] ) ) {
291
- $integration = $fs_method['method_integration'];
292
- if ( fs_shipment_integration_exists( $integration ) && $this->is_order_type_supported_by_integration( $order->get_type(), $integration ) ) {
293
- $shipment = $this->create_shipment_for_order_and_fs_shipping_method( $order, $fs_method, $shipping_id, $shipping_method, $packages, $package_id );
294
-
295
- /**
296
- * Do actions when shipment is created via checkout.
297
- *
298
- * @param WPDesk_Flexible_Shipping_Shipment $shipment Created shipment.
299
- */
300
- do_action( 'flexible_shipping_checkout_shipment_created', $shipment );
301
- }
302
- }
303
- }
304
- }
305
-
306
- /**
307
- * @param string $order_type .
308
- * @param string $integration .
309
- *
310
- * @return bool
311
- */
312
- private function is_order_type_supported_by_integration( $order_type, $integration ) {
313
- $supported = 'shop_order' === $order_type;
314
- $supported = apply_filters( 'flexible-shipping/shipment/supported-order-type/' . $integration, $supported, $order_type );
315
-
316
- return is_bool( $supported ) ? $supported : false;
317
- }
318
-
319
- /**
320
- * Hook woocommerce_order_details_after_order_table.
321
- *
322
- * @param WC_Abstract_Order $order Order.
323
- */
324
- public function woocommerce_order_details_after_order_table( $order ) {
325
- $order_id = $order->get_id();
326
- $shipments = fs_get_order_shipments( $order_id );
327
- foreach ( $shipments as $shipment ) {
328
- echo wp_kses_post( $shipment->get_after_order_table() );
329
- }
330
- }
331
-
332
- /**
333
- * @param WC_Order $order .
334
- * @param bool $sent_to_admin .
335
- */
336
- public function woocommerce_email_after_order_table( $order, $sent_to_admin ) {
337
- $order_id = $order->get_id();
338
- $shipments = fs_get_order_shipments( $order_id );
339
- foreach ( $shipments as $shipment ) {
340
- echo wp_kses_post( $shipment->get_email_after_order_table() );
341
- }
342
- }
343
-
344
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/wp-wpdesk-fs-shipment/shipment/views/order-metabox.php DELETED
@@ -1,9 +0,0 @@
1
- <div class="flexible_shipping_shipment" id="flexible_shipping_shipment_<?php echo $shipment->get_id(); ?>" data-id="<?php echo $shipment_id; ?>">
2
- <?php wp_nonce_field( 'flexible_shipping_shipment_nonce', 'flexible_shipping_shipment_nonce_' . $shipment_id, false ); ?>
3
- <div class="flexible_shipping_shipment_content">
4
- <?php $shipment->order_metabox(); ?>
5
- </div>
6
- <div class="flexible_shipping_shipment_message flexible_shipping_shipment_message_error" style="<?php echo $message_css_style; ?>">
7
- <?php echo $message; ?>
8
- </div>
9
- </div>
 
 
 
 
 
 
 
 
 
flexible-shipping.php CHANGED
@@ -3,15 +3,15 @@
3
  * Plugin Name: Flexible Shipping
4
  * Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  * Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
6
- * Version: 4.6.1
7
  * Author: WP Desk
8
  * Author URI: https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author
9
  * Text Domain: flexible-shipping
10
  * Domain Path: /lang/
11
  * Requires at least: 5.2
12
- * Tested up to: 5.7
13
- * WC requires at least: 4.8
14
- * WC tested up to: 5.4
15
  * Requires PHP: 7.0
16
  *
17
  * Copyright 2017 WP Desk Ltd.
@@ -38,7 +38,7 @@ if ( ! defined( 'ABSPATH' ) ) {
38
  } // Exit if accessed directly
39
 
40
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
41
- $plugin_version = '4.6.1';
42
 
43
  $plugin_name = 'Flexible Shipping';
44
  $product_id = 'Flexible Shipping';
3
  * Plugin Name: Flexible Shipping
4
  * Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  * Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
6
+ * Version: 4.7.0
7
  * Author: WP Desk
8
  * Author URI: https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author
9
  * Text Domain: flexible-shipping
10
  * Domain Path: /lang/
11
  * Requires at least: 5.2
12
+ * Tested up to: 5.8
13
+ * WC requires at least: 5.2
14
+ * WC tested up to: 5.5
15
  * Requires PHP: 7.0
16
  *
17
  * Copyright 2017 WP Desk Ltd.
38
  } // Exit if accessed directly
39
 
40
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
41
+ $plugin_version = '4.7.0';
42
 
43
  $plugin_name = 'Flexible Shipping';
44
  $product_id = 'Flexible Shipping';
lang/flexible-shipping.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Flexible Shipping plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Flexible Shipping 4.6.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-shipping\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2021-06-21T17:30:43+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: flexible-shipping\n"
@@ -20,9 +20,9 @@ msgstr ""
20
  #: classes/table-rate/multilingual.php:52
21
  #: classes/table-rate/settings/flexible-shipping.php:18
22
  #: classes/table-rate/settings/flexible-shipping.php:33
23
- #: classes/table-rate/shipping-method.php:97
24
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:151
25
- #: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:62
26
  msgid "Flexible Shipping"
27
  msgstr ""
28
 
@@ -42,135 +42,169 @@ msgstr ""
42
  msgid "https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author"
43
  msgstr ""
44
 
45
- #: classes/class-flexible-shipping-plugin.php:292
46
- msgid "How likely are you to recommend our Flexible Shipping plugin to your friends?"
 
 
 
 
 
 
 
 
47
  msgstr ""
48
 
49
- #: classes/class-flexible-shipping-plugin.php:295
50
  msgid "By using the 'Send feedback' button I hereby agree and consent to the terms of %1$sPrivacy Policy%2$s."
51
  msgstr ""
52
 
53
  #. Translators: link.
54
- #: classes/class-flexible-shipping-plugin.php:741
55
  msgid "How can We make Flexible Shipping better for you? %1$sJust write to us.%2$s"
56
  msgstr ""
57
 
58
- #: classes/class-flexible-shipping-plugin.php:819
59
  msgid "Settings"
60
  msgstr ""
61
 
62
- #: classes/class-flexible-shipping-plugin.php:823
63
  msgid "Docs"
64
  msgstr ""
65
 
66
- #: classes/class-flexible-shipping-plugin.php:824
67
  msgid "Support"
68
  msgstr ""
69
 
70
- #: classes/class-flexible-shipping-plugin.php:830
71
  msgid "Upgrade"
72
  msgstr ""
73
 
74
- #: classes/manifest/functions.php:16
75
- #: classes/wp-wpdesk-fs-shipment/manifest/functions.php:16
76
- msgid "Shipping manifest %s, %s"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  msgstr ""
78
 
79
- #: classes/table-rate/bulk-actions.php:72
 
 
 
 
 
 
 
 
80
  msgid "New"
81
  msgstr ""
82
 
83
- #: classes/table-rate/bulk-actions.php:73
84
- #: classes/table-rate/bulk-actions.php:192
85
  #: classes/wp-wpdesk-fs-shipment/metabox/ajax.php:55
86
  msgid "Created"
87
  msgstr ""
88
 
89
- #: classes/table-rate/bulk-actions.php:74
90
- #: classes/table-rate/bulk-actions.php:193
91
  msgid "Confirmed"
92
  msgstr ""
93
 
94
- #: classes/table-rate/bulk-actions.php:75
95
  msgid "Manifest"
96
  msgstr ""
97
 
98
- #: classes/table-rate/bulk-actions.php:76
99
  msgid "Failed"
100
  msgstr ""
101
 
102
- #: classes/table-rate/bulk-actions.php:190
103
- #: classes/table-rate/bulk-actions.php:217
104
  msgid "Error"
105
  msgstr ""
106
 
107
- #: classes/table-rate/bulk-actions.php:191
108
  msgid "New shipment"
109
  msgstr ""
110
 
111
- #: classes/table-rate/bulk-actions.php:194
112
  msgid "Manifest created"
113
  msgstr ""
114
 
115
- #: classes/table-rate/bulk-actions.php:248
116
  #: classes/table-rate/bulk-actions.php:254
 
117
  msgid "Shipping"
118
  msgstr ""
119
 
120
- #: classes/table-rate/bulk-actions.php:268
121
  msgid "Send shipment"
122
  msgstr ""
123
 
124
- #: classes/table-rate/bulk-actions.php:269
125
  msgid "Get labels"
126
  msgstr ""
127
 
128
- #: classes/table-rate/bulk-actions.php:271
129
  msgid "Create shipping manifest"
130
  msgstr ""
131
 
132
- #: classes/table-rate/bulk-actions.php:301
133
  msgid "Shipment created."
134
  msgstr ""
135
 
136
- #: classes/table-rate/bulk-actions.php:314
137
  msgid "No action performed."
138
  msgstr ""
139
 
140
- #: classes/table-rate/bulk-actions.php:347
141
  msgid "Unable to create temporary zip archive for labels. Check temporary folder configuration on server."
142
  msgstr ""
143
 
144
- #: classes/table-rate/bulk-actions.php:349
145
  msgid "Unable to create temporary file for labels. Check temporary folder configuration on server."
146
  msgstr ""
147
 
148
  #. Translators: manifests count and integration.
149
- #: classes/table-rate/bulk-actions.php:404
150
  msgid "Created manifest: %s (%s). If download not start automatically click %shere%s."
151
  msgstr ""
152
 
153
- #: classes/table-rate/bulk-actions.php:415
154
  msgid "Manifest creation error: %s (%s)."
155
  msgstr ""
156
 
157
- #: classes/table-rate/bulk-actions.php:426
158
  msgid "No manifests created."
159
  msgstr ""
160
 
161
- #: classes/table-rate/bulk-actions.php:446
162
  msgid "Bulk send shipment - processed orders: %d"
163
  msgstr ""
164
 
165
- #: classes/table-rate/bulk-actions.php:453
166
  msgid "Bulk labels - processed orders: %d. No labels for processed orders."
167
  msgstr ""
168
 
169
- #: classes/table-rate/bulk-actions.php:464
170
  msgid "Bulk labels - processed orders: %d. If download not start automatically click %shere%s."
171
  msgstr ""
172
 
173
- #: classes/table-rate/bulk-actions.php:477
174
  msgid "Bulk shipping manifest - processed orders: %d"
175
  msgstr ""
176
 
@@ -209,7 +243,7 @@ msgid "See how to %1$sconfigure Flexible Shipping%2$s."
209
  msgstr ""
210
 
211
  #: classes/table-rate/settings/flexible-shipping.php:24
212
- #: classes/table-rate/shipping-method.php:88
213
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:50
214
  msgid "Enable/Disable"
215
  msgstr ""
@@ -253,63 +287,63 @@ msgstr ""
253
  msgid "Shipping Methods"
254
  msgstr ""
255
 
256
- #: classes/table-rate/shipping-method.php:75
257
  msgid "Flexible Shipping Group"
258
  msgstr ""
259
 
260
- #: classes/table-rate/shipping-method.php:76
261
  msgid "A group of Flexible Shipping methods - useful to organize numerous shipping methods."
262
  msgstr ""
263
 
264
- #: classes/table-rate/shipping-method.php:90
265
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:53
266
  msgid "Enable this shipment method"
267
  msgstr ""
268
 
269
- #: classes/table-rate/shipping-method.php:94
270
  msgid "Shipping Title"
271
  msgstr ""
272
 
273
- #: classes/table-rate/shipping-method.php:96
274
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:58
275
  msgid "This controls the title which the user sees during checkout."
276
  msgstr ""
277
 
278
- #: classes/table-rate/shipping-method.php:198
279
  msgid "Add New"
280
  msgstr ""
281
 
282
- #: classes/table-rate/shipping-method.php:358
283
  msgid "Flexible Shipping: security check error. Shipping method order not saved!"
284
  msgstr ""
285
 
286
- #: classes/table-rate/shipping-method.php:426
287
  msgid "New Shipping Method"
288
  msgstr ""
289
 
290
- #: classes/table-rate/shipping-method.php:429
291
  msgid "Edit Shipping Method"
292
  msgstr ""
293
 
294
- #: classes/table-rate/shipping-method.php:439
295
- #: classes/table-rate/shipping-method.php:482
296
  msgid "Shipping method %s added."
297
  msgstr ""
298
 
299
- #: classes/table-rate/shipping-method.php:465
300
  msgid "Shipping method %s deleted."
301
  msgstr ""
302
 
303
- #: classes/table-rate/shipping-method.php:468
304
  msgid "Shipping method not found."
305
  msgstr ""
306
 
307
- #: classes/table-rate/shipping-method.php:494
308
  msgid "Shipping method %s updated."
309
  msgstr ""
310
 
311
- #: classes/table-rate/shipping-method.php:564
312
- #: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:271
313
  msgid "Shipping cost added."
314
  msgstr ""
315
 
@@ -400,8 +434,6 @@ msgstr ""
400
 
401
  #: classes/table-rate/views/html-orders-filter-form.php:5
402
  #: classes/table-rate/views/html-shipping-method-settings.php:15
403
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:161
404
- #: classes/wp-wpdesk-fs-shipment/manifest/views/filter-form.php:5
405
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:172
406
  msgid "Integration"
407
  msgstr ""
@@ -444,7 +476,7 @@ msgstr ""
444
  #: src/WPDesk/FS/TableRate/Rule/Condition/None.php:62
445
  #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:252
446
  #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:258
447
- #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:268
448
  msgid "yes"
449
  msgstr ""
450
 
@@ -602,7 +634,6 @@ msgid "Please let us know how we can improve our plugin"
602
  msgstr ""
603
 
604
  #: classes/views/deactivation_thickbox.php:116
605
- #: classes/wp-wpdesk-fs-shipment/manifest/views/column-actions.php:2
606
  msgid "Cancel"
607
  msgstr ""
608
 
@@ -610,140 +641,6 @@ msgstr ""
610
  msgid "Skip &amp; Deactivate"
611
  msgstr ""
612
 
613
- #: classes/wp-wpdesk-fs-shipment/admin-notices.php:89
614
- msgid "Flexible Shipping requires at least version 2.7 of Active Payments plugin."
615
- msgstr ""
616
-
617
- #: classes/wp-wpdesk-fs-shipment/admin-notices.php:104
618
- msgid "Flexible Shipping requires at least version 1.2 of eNadawca plugin."
619
- msgstr ""
620
-
621
- #: classes/wp-wpdesk-fs-shipment/admin-notices.php:119
622
- msgid "Flexible Shipping requires at least version 1.1 of Paczka w Ruchu plugin."
623
- msgstr ""
624
-
625
- #. Translators: order id and integration.
626
- #: classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php:44
627
- msgid "Shipment for order %1$s, %2$s"
628
- msgstr ""
629
-
630
- #. Translators: shipment id.
631
- #: classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php:60
632
- msgid "Added new shipment via metabox. Shipment ID: %1$s"
633
- msgstr ""
634
-
635
- #: classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php:89
636
- msgid "Select integration"
637
- msgstr ""
638
-
639
- #: classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php:98
640
- msgid "Add shipping"
641
- msgstr ""
642
-
643
- #: classes/wp-wpdesk-fs-shipment/label/class-single-label-file-dispatcher.php:95
644
- msgid "Integration doesn't exists."
645
- msgstr ""
646
-
647
- #: classes/wp-wpdesk-fs-shipment/label/class-single-label-file-dispatcher.php:101
648
- msgid "Label error"
649
- msgstr ""
650
-
651
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:60
652
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:62
653
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:64
654
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:97
655
- msgid "Shipping Manifests"
656
- msgstr ""
657
-
658
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:61
659
- msgid "Shipping Manifest"
660
- msgstr ""
661
-
662
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:65
663
- msgid "View Shipping Manifests"
664
- msgstr ""
665
-
666
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:66
667
- msgid "Add new Shipping Manifest"
668
- msgstr ""
669
-
670
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:67
671
- msgid "Add new Shipping Manifests"
672
- msgstr ""
673
-
674
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:68
675
- msgid "Edit Shipping Manifest"
676
- msgstr ""
677
-
678
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:69
679
- msgid "Save Shipping Manifest"
680
- msgstr ""
681
-
682
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:70
683
- msgid "Search Shipping Manifests"
684
- msgstr ""
685
-
686
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:71
687
- msgid "Shipping Manifests not found"
688
- msgstr ""
689
-
690
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:72
691
- msgid "Shipping Manifests not found in trash"
692
- msgstr ""
693
-
694
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:74
695
- msgid "Shipping Manifests."
696
- msgstr ""
697
-
698
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:116
699
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:50
700
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:52
701
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:54
702
- msgid "Shipments"
703
- msgstr ""
704
-
705
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:160
706
- msgid "Date"
707
- msgstr ""
708
-
709
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:162
710
- msgid "Number"
711
- msgstr ""
712
-
713
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:163
714
- msgid "Shipments count"
715
- msgstr ""
716
-
717
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:164
718
- msgid "Actions"
719
- msgstr ""
720
-
721
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:219
722
- #: classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php:243
723
- msgid "Invalid nonce!"
724
- msgstr ""
725
-
726
- #: classes/wp-wpdesk-fs-shipment/manifest/views/column-actions.php:1
727
- msgid "Download"
728
- msgstr ""
729
-
730
- #: classes/wp-wpdesk-fs-shipment/manifest/views/filter-form.php:4
731
- msgid "All manifests"
732
- msgstr ""
733
-
734
- #: classes/wp-wpdesk-fs-shipment/manifest/views/manifest-metabox.php:7
735
- #: classes/wp-wpdesk-fs-shipment/manifest/views/manifest-metabox.php:47
736
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:51
737
- #: templates/email/after_order_table.php:12
738
- #: templates/myaccount/after_order_table.php:15
739
- msgid "Shipment"
740
- msgstr ""
741
-
742
- #: classes/wp-wpdesk-fs-shipment/manifest/views/manifest-metabox.php:10
743
- #: classes/wp-wpdesk-fs-shipment/manifest/views/manifest-metabox.php:50
744
- msgid "Order"
745
- msgstr ""
746
-
747
  #: classes/wp-wpdesk-fs-shipment/metabox/ajax.php:22
748
  msgid "Unknown error!"
749
  msgstr ""
@@ -764,125 +661,6 @@ msgstr ""
764
  msgid "Saved"
765
  msgstr ""
766
 
767
- #: classes/wp-wpdesk-fs-shipment/rate-notices/abstract-rate.php:25
768
- #: classes/wp-wpdesk-fs-shipment/rate-notices/rate-notice-implementation.php:15
769
- msgid "%1$sOk, you deserved it%2$s"
770
- msgstr ""
771
-
772
- #: classes/wp-wpdesk-fs-shipment/rate-notices/abstract-rate.php:30
773
- #: classes/wp-wpdesk-fs-shipment/rate-notices/rate-notice-implementation.php:20
774
- msgid "%1$sNope, maybe later%2$s"
775
- msgstr ""
776
-
777
- #: classes/wp-wpdesk-fs-shipment/rate-notices/abstract-rate.php:35
778
- #: classes/wp-wpdesk-fs-shipment/rate-notices/rate-notice-implementation.php:25
779
- msgid "%1$sI already did%2$s"
780
- msgstr ""
781
-
782
- #: classes/wp-wpdesk-fs-shipment/rate-notices/rate-notice-implementation.php:57
783
- msgid "Awesome, you've been using Flexible Shipping for more than 2 weeks. Could you please do me a BIG favor and give it a 5-star rating on WordPress? ~FS Team"
784
- msgstr ""
785
-
786
- #: classes/wp-wpdesk-fs-shipment/shipment/class-shipment.php:387
787
- msgid "Please override shipping_column method!"
788
- msgstr ""
789
-
790
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:55
791
- msgid "View Shipments"
792
- msgstr ""
793
-
794
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:56
795
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:57
796
- msgid "Add new Shipment"
797
- msgstr ""
798
-
799
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:58
800
- msgid "Edit Shipment"
801
- msgstr ""
802
-
803
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:59
804
- msgid "Save Shipment"
805
- msgstr ""
806
-
807
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:60
808
- msgid "Search Shipments"
809
- msgstr ""
810
-
811
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:61
812
- msgid "Shipment not found"
813
- msgstr ""
814
-
815
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:62
816
- msgid "Shipment not found in trash"
817
- msgstr ""
818
-
819
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:64
820
- msgid "Shipments."
821
- msgstr ""
822
-
823
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:85
824
- msgctxt "Shipment status"
825
- msgid "New"
826
- msgstr ""
827
-
828
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:90
829
- msgid "New <span class=\"count\">(%s)</span>"
830
- msgid_plural "New <span class=\"count\">(%s)</span>"
831
- msgstr[0] ""
832
- msgstr[1] ""
833
-
834
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:93
835
- msgctxt "Shipment status"
836
- msgid "Created"
837
- msgstr ""
838
-
839
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:98
840
- msgid "Created <span class=\"count\">(%s)</span>"
841
- msgid_plural "Created <span class=\"count\">(%s)</span>"
842
- msgstr[0] ""
843
- msgstr[1] ""
844
-
845
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:101
846
- msgctxt "Shipment status"
847
- msgid "Confirmed"
848
- msgstr ""
849
-
850
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:106
851
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:114
852
- msgid "Confirmed <span class=\"count\">(%s)</span>"
853
- msgid_plural "Confirmed <span class=\"count\">(%s)</span>"
854
- msgstr[0] ""
855
- msgstr[1] ""
856
-
857
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:109
858
- msgctxt "Shipment status"
859
- msgid "Manifest created"
860
- msgstr ""
861
-
862
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:117
863
- msgctxt "Shipment status"
864
- msgid "Failed"
865
- msgstr ""
866
-
867
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:122
868
- msgid "Failed <span class=\"count\">(%s)</span>"
869
- msgid_plural "Failed <span class=\"count\">(%s)</span>"
870
- msgstr[0] ""
871
- msgstr[1] ""
872
-
873
- #: classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php:152
874
- msgid "Shipment data"
875
- msgstr ""
876
-
877
- #. Translators: order id and integration.
878
- #: classes/wp-wpdesk-fs-shipment/shipment/functions.php:59
879
- msgid "Shipment for order %s, %s"
880
- msgstr ""
881
-
882
- #: classes/wp-wpdesk-fs-shipment/views/html-order-add_shipping-metabox.php:15
883
- msgid "Add"
884
- msgstr ""
885
-
886
  #: inc/functions.php:68
887
  msgid "Redirecting. If page not redirects click %s here %s."
888
  msgstr ""
@@ -1330,7 +1108,7 @@ msgstr ""
1330
  #: src/WPDesk/FS/TableRate/Rule/Condition/None.php:62
1331
  #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:252
1332
  #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:258
1333
- #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:268
1334
  msgid "no"
1335
  msgstr ""
1336
 
@@ -1499,7 +1277,7 @@ msgid "special action"
1499
  msgstr ""
1500
 
1501
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:34
1502
- #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:338
1503
  msgid "Free"
1504
  msgstr ""
1505
 
@@ -1524,7 +1302,7 @@ msgid "Free Shipping Label"
1524
  msgstr ""
1525
 
1526
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:81
1527
- msgid "Enter additional label for shipment when free shipment available."
1528
  msgstr ""
1529
 
1530
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:85
@@ -1651,36 +1429,36 @@ msgid "Used and displayed in the cart/checkout after filters: %1$s"
1651
  msgstr ""
1652
 
1653
  #. Translators: cost, currency.
1654
- #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:264
1655
  msgid "Calculated shipping cost: %1$s %2$s"
1656
  msgstr ""
1657
 
1658
  #. Translators: free shipping.
1659
- #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:268
1660
  msgid "Free shipping: %1$s"
1661
  msgstr ""
1662
 
1663
  #. Translators: shipping cost after free shipping.
1664
- #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:273
1665
  msgid "Shipping cost after free shipping applied: %1$s"
1666
  msgstr ""
1667
 
1668
  #. Translators: method id.
1669
- #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:277
1670
  msgid "Shipping method ID: %1$s"
1671
  msgstr ""
1672
 
1673
  #. Translators: method title.
1674
- #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:281
1675
  msgid "Shipping method title: %1$s"
1676
  msgstr ""
1677
 
1678
- #: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:63
1679
  msgid "A single Flexible Shipping method."
1680
  msgstr ""
1681
 
1682
  #. Translators: docs link.
1683
- #: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:68
1684
  msgid "A single Flexible Shipping method. Learn %1$show to configure FS shipping method &rarr;%2$s"
1685
  msgstr ""
1686
 
@@ -1722,6 +1500,11 @@ msgstr ""
1722
  msgid "Thank you in advance!%1$s~ Flexible Shipping Team"
1723
  msgstr ""
1724
 
 
 
 
 
 
1725
  #: templates/email/after_order_table.php:15
1726
  #: templates/myaccount/after_order_table.php:18
1727
  msgid "Track shipment: "
2
  # This file is distributed under the same license as the Flexible Shipping plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Flexible Shipping 4.7.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-shipping\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-07-20T07:59:43+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: flexible-shipping\n"
20
  #: classes/table-rate/multilingual.php:52
21
  #: classes/table-rate/settings/flexible-shipping.php:18
22
  #: classes/table-rate/settings/flexible-shipping.php:33
23
+ #: classes/table-rate/shipping-method.php:95
24
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:151
25
+ #: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:61
26
  msgid "Flexible Shipping"
27
  msgstr ""
28
 
42
  msgid "https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author"
43
  msgstr ""
44
 
45
+ #: classes/class-flexible-shipping-plugin.php:281
46
+ msgid "Hey, we are curious how would you grade your first impression on Flexible Shipping so far?"
47
+ msgstr ""
48
+
49
+ #: classes/class-flexible-shipping-plugin.php:282
50
+ msgid "Wow, it's awesome!"
51
+ msgstr ""
52
+
53
+ #: classes/class-flexible-shipping-plugin.php:283
54
+ msgid "Really poor"
55
  msgstr ""
56
 
57
+ #: classes/class-flexible-shipping-plugin.php:286
58
  msgid "By using the 'Send feedback' button I hereby agree and consent to the terms of %1$sPrivacy Policy%2$s."
59
  msgstr ""
60
 
61
  #. Translators: link.
62
+ #: classes/class-flexible-shipping-plugin.php:735
63
  msgid "How can We make Flexible Shipping better for you? %1$sJust write to us.%2$s"
64
  msgstr ""
65
 
66
+ #: classes/class-flexible-shipping-plugin.php:816
67
  msgid "Settings"
68
  msgstr ""
69
 
70
+ #: classes/class-flexible-shipping-plugin.php:820
71
  msgid "Docs"
72
  msgstr ""
73
 
74
+ #: classes/class-flexible-shipping-plugin.php:821
75
  msgid "Support"
76
  msgstr ""
77
 
78
+ #: classes/class-flexible-shipping-plugin.php:827
79
  msgid "Upgrade"
80
  msgstr ""
81
 
82
+ #: classes/notices/abstract-rate.php:25
83
+ #: classes/notices/rate-notice-implementation.php:15
84
+ msgid "%1$sOk, you deserved it%2$s"
85
+ msgstr ""
86
+
87
+ #: classes/notices/abstract-rate.php:30
88
+ #: classes/notices/rate-notice-implementation.php:20
89
+ msgid "%1$sNope, maybe later%2$s"
90
+ msgstr ""
91
+
92
+ #: classes/notices/abstract-rate.php:35
93
+ #: classes/notices/rate-notice-implementation.php:25
94
+ msgid "%1$sI already did%2$s"
95
+ msgstr ""
96
+
97
+ #: classes/notices/admin-notices.php:89
98
+ msgid "Flexible Shipping requires at least version 2.7 of Active Payments plugin."
99
+ msgstr ""
100
+
101
+ #: classes/notices/admin-notices.php:104
102
+ msgid "Flexible Shipping requires at least version 1.2 of eNadawca plugin."
103
  msgstr ""
104
 
105
+ #: classes/notices/admin-notices.php:119
106
+ msgid "Flexible Shipping requires at least version 1.1 of Paczka w Ruchu plugin."
107
+ msgstr ""
108
+
109
+ #: classes/notices/rate-notice-implementation.php:57
110
+ msgid "Awesome, you've been using Flexible Shipping for more than 2 weeks. Could you please do me a BIG favor and give it a 5-star rating on WordPress? ~FS Team"
111
+ msgstr ""
112
+
113
+ #: classes/table-rate/bulk-actions.php:78
114
  msgid "New"
115
  msgstr ""
116
 
117
+ #: classes/table-rate/bulk-actions.php:79
118
+ #: classes/table-rate/bulk-actions.php:198
119
  #: classes/wp-wpdesk-fs-shipment/metabox/ajax.php:55
120
  msgid "Created"
121
  msgstr ""
122
 
123
+ #: classes/table-rate/bulk-actions.php:80
124
+ #: classes/table-rate/bulk-actions.php:199
125
  msgid "Confirmed"
126
  msgstr ""
127
 
128
+ #: classes/table-rate/bulk-actions.php:81
129
  msgid "Manifest"
130
  msgstr ""
131
 
132
+ #: classes/table-rate/bulk-actions.php:82
133
  msgid "Failed"
134
  msgstr ""
135
 
136
+ #: classes/table-rate/bulk-actions.php:196
137
+ #: classes/table-rate/bulk-actions.php:223
138
  msgid "Error"
139
  msgstr ""
140
 
141
+ #: classes/table-rate/bulk-actions.php:197
142
  msgid "New shipment"
143
  msgstr ""
144
 
145
+ #: classes/table-rate/bulk-actions.php:200
146
  msgid "Manifest created"
147
  msgstr ""
148
 
 
149
  #: classes/table-rate/bulk-actions.php:254
150
+ #: classes/table-rate/bulk-actions.php:260
151
  msgid "Shipping"
152
  msgstr ""
153
 
154
+ #: classes/table-rate/bulk-actions.php:274
155
  msgid "Send shipment"
156
  msgstr ""
157
 
158
+ #: classes/table-rate/bulk-actions.php:275
159
  msgid "Get labels"
160
  msgstr ""
161
 
162
+ #: classes/table-rate/bulk-actions.php:277
163
  msgid "Create shipping manifest"
164
  msgstr ""
165
 
166
+ #: classes/table-rate/bulk-actions.php:307
167
  msgid "Shipment created."
168
  msgstr ""
169
 
170
+ #: classes/table-rate/bulk-actions.php:320
171
  msgid "No action performed."
172
  msgstr ""
173
 
174
+ #: classes/table-rate/bulk-actions.php:353
175
  msgid "Unable to create temporary zip archive for labels. Check temporary folder configuration on server."
176
  msgstr ""
177
 
178
+ #: classes/table-rate/bulk-actions.php:355
179
  msgid "Unable to create temporary file for labels. Check temporary folder configuration on server."
180
  msgstr ""
181
 
182
  #. Translators: manifests count and integration.
183
+ #: classes/table-rate/bulk-actions.php:412
184
  msgid "Created manifest: %s (%s). If download not start automatically click %shere%s."
185
  msgstr ""
186
 
187
+ #: classes/table-rate/bulk-actions.php:423
188
  msgid "Manifest creation error: %s (%s)."
189
  msgstr ""
190
 
191
+ #: classes/table-rate/bulk-actions.php:434
192
  msgid "No manifests created."
193
  msgstr ""
194
 
195
+ #: classes/table-rate/bulk-actions.php:454
196
  msgid "Bulk send shipment - processed orders: %d"
197
  msgstr ""
198
 
199
+ #: classes/table-rate/bulk-actions.php:461
200
  msgid "Bulk labels - processed orders: %d. No labels for processed orders."
201
  msgstr ""
202
 
203
+ #: classes/table-rate/bulk-actions.php:472
204
  msgid "Bulk labels - processed orders: %d. If download not start automatically click %shere%s."
205
  msgstr ""
206
 
207
+ #: classes/table-rate/bulk-actions.php:485
208
  msgid "Bulk shipping manifest - processed orders: %d"
209
  msgstr ""
210
 
243
  msgstr ""
244
 
245
  #: classes/table-rate/settings/flexible-shipping.php:24
246
+ #: classes/table-rate/shipping-method.php:86
247
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:50
248
  msgid "Enable/Disable"
249
  msgstr ""
287
  msgid "Shipping Methods"
288
  msgstr ""
289
 
290
+ #: classes/table-rate/shipping-method.php:73
291
  msgid "Flexible Shipping Group"
292
  msgstr ""
293
 
294
+ #: classes/table-rate/shipping-method.php:74
295
  msgid "A group of Flexible Shipping methods - useful to organize numerous shipping methods."
296
  msgstr ""
297
 
298
+ #: classes/table-rate/shipping-method.php:88
299
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:53
300
  msgid "Enable this shipment method"
301
  msgstr ""
302
 
303
+ #: classes/table-rate/shipping-method.php:92
304
  msgid "Shipping Title"
305
  msgstr ""
306
 
307
+ #: classes/table-rate/shipping-method.php:94
308
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:58
309
  msgid "This controls the title which the user sees during checkout."
310
  msgstr ""
311
 
312
+ #: classes/table-rate/shipping-method.php:196
313
  msgid "Add New"
314
  msgstr ""
315
 
316
+ #: classes/table-rate/shipping-method.php:356
317
  msgid "Flexible Shipping: security check error. Shipping method order not saved!"
318
  msgstr ""
319
 
320
+ #: classes/table-rate/shipping-method.php:424
321
  msgid "New Shipping Method"
322
  msgstr ""
323
 
324
+ #: classes/table-rate/shipping-method.php:427
325
  msgid "Edit Shipping Method"
326
  msgstr ""
327
 
328
+ #: classes/table-rate/shipping-method.php:437
329
+ #: classes/table-rate/shipping-method.php:480
330
  msgid "Shipping method %s added."
331
  msgstr ""
332
 
333
+ #: classes/table-rate/shipping-method.php:463
334
  msgid "Shipping method %s deleted."
335
  msgstr ""
336
 
337
+ #: classes/table-rate/shipping-method.php:466
338
  msgid "Shipping method not found."
339
  msgstr ""
340
 
341
+ #: classes/table-rate/shipping-method.php:492
342
  msgid "Shipping method %s updated."
343
  msgstr ""
344
 
345
+ #: classes/table-rate/shipping-method.php:562
346
+ #: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:274
347
  msgid "Shipping cost added."
348
  msgstr ""
349
 
434
 
435
  #: classes/table-rate/views/html-orders-filter-form.php:5
436
  #: classes/table-rate/views/html-shipping-method-settings.php:15
 
 
437
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:172
438
  msgid "Integration"
439
  msgstr ""
476
  #: src/WPDesk/FS/TableRate/Rule/Condition/None.php:62
477
  #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:252
478
  #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:258
479
+ #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:269
480
  msgid "yes"
481
  msgstr ""
482
 
634
  msgstr ""
635
 
636
  #: classes/views/deactivation_thickbox.php:116
 
637
  msgid "Cancel"
638
  msgstr ""
639
 
641
  msgid "Skip &amp; Deactivate"
642
  msgstr ""
643
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
  #: classes/wp-wpdesk-fs-shipment/metabox/ajax.php:22
645
  msgid "Unknown error!"
646
  msgstr ""
661
  msgid "Saved"
662
  msgstr ""
663
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
  #: inc/functions.php:68
665
  msgid "Redirecting. If page not redirects click %s here %s."
666
  msgstr ""
1108
  #: src/WPDesk/FS/TableRate/Rule/Condition/None.php:62
1109
  #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:252
1110
  #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:258
1111
+ #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:269
1112
  msgid "no"
1113
  msgstr ""
1114
 
1277
  msgstr ""
1278
 
1279
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:34
1280
+ #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:354
1281
  msgid "Free"
1282
  msgstr ""
1283
 
1302
  msgstr ""
1303
 
1304
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:81
1305
+ msgid "Enter the text for the additional shipping method's label which will be displayed once the free shipping is triggered or calculated."
1306
  msgstr ""
1307
 
1308
  #: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:85
1429
  msgstr ""
1430
 
1431
  #. Translators: cost, currency.
1432
+ #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:265
1433
  msgid "Calculated shipping cost: %1$s %2$s"
1434
  msgstr ""
1435
 
1436
  #. Translators: free shipping.
1437
+ #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:269
1438
  msgid "Free shipping: %1$s"
1439
  msgstr ""
1440
 
1441
  #. Translators: shipping cost after free shipping.
1442
+ #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:274
1443
  msgid "Shipping cost after free shipping applied: %1$s"
1444
  msgstr ""
1445
 
1446
  #. Translators: method id.
1447
+ #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:278
1448
  msgid "Shipping method ID: %1$s"
1449
  msgstr ""
1450
 
1451
  #. Translators: method title.
1452
+ #: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:282
1453
  msgid "Shipping method title: %1$s"
1454
  msgstr ""
1455
 
1456
+ #: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:62
1457
  msgid "A single Flexible Shipping method."
1458
  msgstr ""
1459
 
1460
  #. Translators: docs link.
1461
+ #: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:67
1462
  msgid "A single Flexible Shipping method. Learn %1$show to configure FS shipping method &rarr;%2$s"
1463
  msgstr ""
1464
 
1500
  msgid "Thank you in advance!%1$s~ Flexible Shipping Team"
1501
  msgstr ""
1502
 
1503
+ #: templates/email/after_order_table.php:12
1504
+ #: templates/myaccount/after_order_table.php:15
1505
+ msgid "Shipment"
1506
+ msgstr ""
1507
+
1508
  #: templates/email/after_order_table.php:15
1509
  #: templates/myaccount/after_order_table.php:18
1510
  msgid "Track shipment: "
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wpdesk,dyszczo,grola,piotrpo,marcinkolanko,mateuszgbiorczyk,sebast
3
  Donate link: https://flexibleshipping.com/products/flexible-shipping-pro-woocommerce/?utm_source=wordpress&utm_medium=link&utm_campaign=wordpress
4
  Tags: table rate, table rate shipping, conditional shipping, shipping method, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes, shipping, free shipping, advanced shipping
5
  Requires at least: 4.5
6
- Tested up to: 5.7
7
- Stable tag: 4.6.1
8
  Requires PHP: 7.0
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -199,6 +199,10 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
199
 
200
  == Changelog ==
201
 
 
 
 
 
202
  = 4.6.1 - 2021-06-21 =
203
  * Changed notice type for Left Free Shipping message
204
  * Fixed fatal error with CoCart plugin: added parameters types verification in Free Shipping Notice
3
  Donate link: https://flexibleshipping.com/products/flexible-shipping-pro-woocommerce/?utm_source=wordpress&utm_medium=link&utm_campaign=wordpress
4
  Tags: table rate, table rate shipping, conditional shipping, shipping method, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes, shipping, free shipping, advanced shipping
5
  Requires at least: 4.5
6
+ Tested up to: 5.8
7
+ Stable tag: 4.7.0
8
  Requires PHP: 7.0
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
199
 
200
  == Changelog ==
201
 
202
+ = 4.7.0 - 2021-07-20 =
203
+ * Changed functionality for shipping integrations: DPD UK, InPost and others
204
+ * Fixed free shipping label when negative cost calculated and set as 0 (zero)
205
+
206
  = 4.6.1 - 2021-06-21 =
207
  * Changed notice type for Left Free Shipping message
208
  * Fixed fatal error with CoCart plugin: added parameters types verification in Free Shipping Notice
src/WPDesk/FS/Shipment/SubscriptionsIntegration.php CHANGED
@@ -7,6 +7,7 @@
7
 
8
  namespace WPDesk\FS\Shipment;
9
 
 
10
  use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
 
12
  /**
@@ -15,16 +16,16 @@ use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
15
  class SubscriptionsIntegration implements Hookable {
16
 
17
  /**
18
- * @var \WPDesk_Flexible_Shipping_Shipment_CPT
19
  */
20
  private $shipment_cpt;
21
 
22
  /**
23
  * SubscriptionsIntegration constructor.
24
  *
25
- * @param \WPDesk_Flexible_Shipping_Shipment_CPT $shipment_cpt .
26
  */
27
- public function __construct( \WPDesk_Flexible_Shipping_Shipment_CPT $shipment_cpt ) {
28
  $this->shipment_cpt = $shipment_cpt;
29
  }
30
 
@@ -33,8 +34,8 @@ class SubscriptionsIntegration implements Hookable {
33
  */
34
  public function hooks() {
35
  $last_priority = PHP_INT_MAX;
36
- add_action( 'woocommerce_checkout_subscription_created', array( $this, 'create_shipping_for_subscription' ), $last_priority, 3 );
37
- add_filter( 'wcs_renewal_order_created', array( $this, 'create_shipping_for_order_from_subscription' ), 10, 2 );
38
  }
39
 
40
  /**
@@ -65,7 +66,7 @@ class SubscriptionsIntegration implements Hookable {
65
  */
66
  private function create_single_shipment( \WPDesk_Flexible_Shipping_Shipment $shipment, \WC_Order $order ) {
67
  $meta_data = $shipment->get_meta_data();
68
- $fs_method = $shipment->get_meta( '_fs_method', array( 'method_integration' => $shipment->get_integration() ) );
69
  $order_shipment = fs_create_shipment( $order, $fs_method );
70
  $integration = $order_shipment->get_integration();
71
  $this->setup_shipment_meta_data( $meta_data, $integration, $shipment, $order_shipment );
@@ -74,7 +75,7 @@ class SubscriptionsIntegration implements Hookable {
74
  /**
75
  * New shipment created from subscription.
76
  *
77
- * @param WPDesk_Flexible_Shipping_Shipment $order_shipment Created shipment.
78
  */
79
  do_action( 'flexible-shipping/shipment-from-subscription/created/' . $integration, $order_shipment );
80
  }
7
 
8
  namespace WPDesk\FS\Shipment;
9
 
10
+ use FSVendor\WPDesk\FS\Shipment\CustomPostType;
11
  use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
12
 
13
  /**
16
  class SubscriptionsIntegration implements Hookable {
17
 
18
  /**
19
+ * @var CustomPostType
20
  */
21
  private $shipment_cpt;
22
 
23
  /**
24
  * SubscriptionsIntegration constructor.
25
  *
26
+ * @param CustomPostType $shipment_cpt .
27
  */
28
+ public function __construct( CustomPostType $shipment_cpt ) {
29
  $this->shipment_cpt = $shipment_cpt;
30
  }
31
 
34
  */
35
  public function hooks() {
36
  $last_priority = PHP_INT_MAX;
37
+ add_action( 'woocommerce_checkout_subscription_created', [ $this, 'create_shipping_for_subscription' ], $last_priority, 3 );
38
+ add_filter( 'wcs_renewal_order_created', [ $this, 'create_shipping_for_order_from_subscription' ], 10, 2 );
39
  }
40
 
41
  /**
66
  */
67
  private function create_single_shipment( \WPDesk_Flexible_Shipping_Shipment $shipment, \WC_Order $order ) {
68
  $meta_data = $shipment->get_meta_data();
69
+ $fs_method = $shipment->get_meta( '_fs_method', [ 'method_integration' => $shipment->get_integration() ] );
70
  $order_shipment = fs_create_shipment( $order, $fs_method );
71
  $integration = $order_shipment->get_integration();
72
  $this->setup_shipment_meta_data( $meta_data, $integration, $shipment, $order_shipment );
75
  /**
76
  * New shipment created from subscription.
77
  *
78
+ * @param \WPDesk_Flexible_Shipping_Shipment $order_shipment Created shipment.
79
  */
80
  do_action( 'flexible-shipping/shipment-from-subscription/created/' . $integration, $order_shipment );
81
  }
src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php CHANGED
@@ -45,43 +45,43 @@ class CommonMethodSettings implements MethodSettings {
45
  $method_free_shipping = floatval( $method_settings['method_free_shipping'] );
46
  }
47
 
48
- $settings = array(
49
- 'method_enabled' => array(
50
  'title' => __( 'Enable/Disable', 'flexible-shipping' ),
51
  'type' => 'checkbox',
52
  'default' => $this->get_value_from_settings( $method_settings, 'method_enabled', 'yes' ),
53
  'label' => __( 'Enable this shipment method', 'flexible-shipping' ),
54
- ),
55
- self::METHOD_TITLE => array(
56
  'title' => __( 'Method Title', 'flexible-shipping' ),
57
  'type' => 'text',
58
  'description' => __( 'This controls the title which the user sees during checkout.', 'flexible-shipping' ),
59
  'desc_tip' => true,
60
  'default' => $this->get_value_from_settings( $method_settings, self::METHOD_TITLE, 'Flexible Shipping' ),
61
- 'custom_attributes' => array( 'required' => true ),
62
- ),
63
- self::METHOD_DESCRIPTION => array(
64
  'title' => __( 'Method Description', 'flexible-shipping' ),
65
  'type' => 'text',
66
  'description' => __( 'This controls method description which the user sees during checkout.', 'flexible-shipping' ),
67
  'desc_tip' => true,
68
  'default' => $this->get_value_from_settings( $method_settings, self::METHOD_DESCRIPTION, '' ),
69
- ),
70
- 'method_free_shipping' => array(
71
  'title' => __( 'Free Shipping', 'flexible-shipping' ),
72
  'type' => 'price',
73
  'default' => $method_free_shipping,
74
  'description' => __( 'Enter a minimum order amount for free shipment. This will override the costs configured below.', 'flexible-shipping' ),
75
  'desc_tip' => true,
76
- ),
77
- 'method_free_shipping_label' => array(
78
  'title' => __( 'Free Shipping Label', 'flexible-shipping' ),
79
  'type' => 'text',
80
  'default' => $this->get_value_from_settings( $method_settings, 'method_free_shipping_label', '' ),
81
- 'description' => __( 'Enter additional label for shipment when free shipment available.', 'flexible-shipping' ),
82
  'desc_tip' => true,
83
- ),
84
- WPDesk_Flexible_Shipping::SETTING_METHOD_FREE_SHIPPING_NOTICE => array(
85
  'title' => __( '\'Left to free shipping\' notice', 'flexible-shipping' ),
86
  'type' => 'checkbox',
87
  'default' => $this->get_value_from_settings( $method_settings, WPDesk_Flexible_Shipping::SETTING_METHOD_FREE_SHIPPING_NOTICE, 'no' ),
@@ -93,36 +93,36 @@ class CommonMethodSettings implements MethodSettings {
93
  sprintf( '<a href="%s" target="_blank">', esc_url( get_locale() === 'pl_PL' ? 'https://wpde.sk/fs-fsn-pl' : 'https://wpde.sk/fs-fsn' ) ),
94
  '</a>'
95
  ) . '<br /><br />' . __( 'Please mind that if you use any additional plugins to split the shipment into packages, the \'Left to free shipping notice\' will not be displayed.', 'flexible-shipping' ),
96
- ),
97
- 'method_calculation_method' => array(
98
  'title' => __( 'Rules Calculation', 'flexible-shipping' ),
99
  'type' => 'select',
100
  'description' => __( 'Select how rules will be calculated. If you choose "sum" the rules order is important.', 'flexible-shipping' ),
101
  'default' => $this->get_value_from_settings( $method_settings, 'method_calculation_method', '' ),
102
  'desc_tip' => true,
103
  'options' => ( new CalculationMethodOptions() )->get_options(),
104
- ),
105
- self::CART_CALCULATION => array(
106
  'title' => __( 'Cart Calculation', 'flexible-shipping' ),
107
  'type' => 'select',
108
  'default' => $this->get_value_from_settings( $method_settings, self::CART_CALCULATION, isset( $method_settings[ self::METHOD_DESCRIPTION ] ) ? CartCalculationOptions::CART : CartCalculationOptions::PACKAGE ),
109
  'options' => ( new CartCalculationOptions() )->get_options(),
110
  'description' => __( 'Choose Package value to exclude virtual products from rules calculation.', 'flexible-shipping' ),
111
  'desc_tip' => true,
112
- ),
113
- 'method_visibility' => array(
114
  'title' => __( 'Visibility', 'flexible-shipping' ),
115
  'type' => 'checkbox',
116
  'default' => $this->get_value_from_settings( $method_settings, 'method_visibility', 'no' ),
117
  'label' => __( 'Show only for logged in users', 'flexible-shipping' ),
118
- ),
119
- 'method_default' => array(
120
  'title' => __( 'Default', 'flexible-shipping' ),
121
  'type' => 'checkbox',
122
  'default' => $this->get_value_from_settings( $method_settings, 'method_default', 'no' ),
123
  'label' => __( 'Check the box to set this option as the default selected choice on the cart page.', 'flexible-shipping' ),
124
- ),
125
- 'method_debug_mode' => array(
126
  'title' => __( 'FS Debug Mode', 'flexible-shipping' ),
127
  'type' => 'checkbox',
128
  'default' => $this->get_value_from_settings( $method_settings, 'method_debug_mode', 'no' ),
@@ -133,8 +133,8 @@ class CommonMethodSettings implements MethodSettings {
133
  '<a href="' . ( 'pl_PL' !== get_locale() ? 'https://docs.flexibleshipping.com/article/421-fs-table-rate-debug-mode?utm_source=flexible-shipping-method&utm_medium=link&utm_campaign=flexible-shipping-debug-mode' : 'https://www.wpdesk.pl/docs/tryb-debugowania-flexible-shipping/?utm_source=flexible-shipping-method&utm_medium=link&utm_campaign=flexible-shipping-debug-mode' ) . '" target="_blank">',
134
  '</a>'
135
  ),
136
- ),
137
- );
138
 
139
  if ( $with_integration_settings ) {
140
  $settings = $this->append_integration_settings_if_present( $settings, $method_settings );
@@ -144,12 +144,12 @@ class CommonMethodSettings implements MethodSettings {
144
  $this->settings['method_max_cost'] = $settings['method_max_cost']['default'];
145
  }
146
 
147
- $settings[ self::METHOD_RULES ] = array(
148
  'title' => __( 'Shipping Cost Calculation Rules', 'flexible-shipping' ),
149
  'type' => RulesSettingsField::FIELD_TYPE,
150
  'default' => $this->get_value_from_settings( $method_settings, self::METHOD_RULES, ( new DefaultRulesSettings() )->get_normalized_settings() ),
151
  self::METHOD_TITLE => $this->get_value_from_settings( $method_settings, self::METHOD_TITLE, __( 'Flexible Shipping', 'flexible-shipping' ) ),
152
- );
153
 
154
  return $settings;
155
  }
@@ -161,53 +161,53 @@ class CommonMethodSettings implements MethodSettings {
161
  * @return array
162
  */
163
  private function append_integration_settings_if_present( array $settings, $method_settings ) {
164
- $integrations_options = apply_filters( 'flexible_shipping_integration_options', array( '' => __( 'None', 'flexible-shipping' ) ) );
165
 
166
  if ( 1 < count( $integrations_options ) ) {
167
- $settings['title_shipping_integration'] = array(
168
  'title' => __( 'Shipping Integration', 'flexible-shipping' ),
169
  'type' => 'title',
170
- );
171
- $settings['method_integration'] = array(
172
  'title' => __( 'Integration', 'flexible-shipping' ),
173
  'type' => 'select',
174
  'desc_tip' => false,
175
  'options' => $integrations_options,
176
  'default' => $this->get_value_from_settings( $method_settings, 'method_integration' ),
177
- );
178
  }
179
 
180
  $filtered_settings = apply_filters( 'flexible_shipping_method_settings', $settings, $method_settings );
181
 
182
- $settings = array();
183
 
184
  foreach ( $filtered_settings as $settings_key => $settings_value ) {
185
  if ( 'method_enabled' === $settings_key ) {
186
- $settings['title_general_settings'] = array(
187
  'title' => __( 'General Settings', 'flexible-shipping' ),
188
  'type' => 'title',
189
- );
190
  }
191
 
192
  if ( 'method_free_shipping_requires' === $settings_key || ( 'method_free_shipping' === $settings_key && ! isset( $settings['method_free_shipping_requires'] ) ) ) {
193
- $settings['title_free_shipping'] = array(
194
  'title' => __( 'Free Shipping', 'flexible-shipping' ),
195
  'type' => 'title',
196
- );
197
  }
198
 
199
  if ( 'method_max_cost' === $settings_key || ( 'method_calculation_method' === $settings_key && ! isset( $settings['method_max_cost'] ) ) ) {
200
- $settings['title_cost_calculation'] = array(
201
  'title' => __( 'Cost Calculation', 'flexible-shipping' ),
202
  'type' => 'title',
203
- );
204
  }
205
 
206
  if ( 'method_visibility' === $settings_key ) {
207
- $settings['title_advanced_options'] = array(
208
  'title' => __( 'Advanced Options', 'flexible-shipping' ),
209
  'type' => 'title',
210
- );
211
  }
212
 
213
  $settings[ $settings_key ] = $settings_value;
45
  $method_free_shipping = floatval( $method_settings['method_free_shipping'] );
46
  }
47
 
48
+ $settings = [
49
+ 'method_enabled' => [
50
  'title' => __( 'Enable/Disable', 'flexible-shipping' ),
51
  'type' => 'checkbox',
52
  'default' => $this->get_value_from_settings( $method_settings, 'method_enabled', 'yes' ),
53
  'label' => __( 'Enable this shipment method', 'flexible-shipping' ),
54
+ ],
55
+ self::METHOD_TITLE => [
56
  'title' => __( 'Method Title', 'flexible-shipping' ),
57
  'type' => 'text',
58
  'description' => __( 'This controls the title which the user sees during checkout.', 'flexible-shipping' ),
59
  'desc_tip' => true,
60
  'default' => $this->get_value_from_settings( $method_settings, self::METHOD_TITLE, 'Flexible Shipping' ),
61
+ 'custom_attributes' => [ 'required' => true ],
62
+ ],
63
+ self::METHOD_DESCRIPTION => [
64
  'title' => __( 'Method Description', 'flexible-shipping' ),
65
  'type' => 'text',
66
  'description' => __( 'This controls method description which the user sees during checkout.', 'flexible-shipping' ),
67
  'desc_tip' => true,
68
  'default' => $this->get_value_from_settings( $method_settings, self::METHOD_DESCRIPTION, '' ),
69
+ ],
70
+ 'method_free_shipping' => [
71
  'title' => __( 'Free Shipping', 'flexible-shipping' ),
72
  'type' => 'price',
73
  'default' => $method_free_shipping,
74
  'description' => __( 'Enter a minimum order amount for free shipment. This will override the costs configured below.', 'flexible-shipping' ),
75
  'desc_tip' => true,
76
+ ],
77
+ 'method_free_shipping_label' => [
78
  'title' => __( 'Free Shipping Label', 'flexible-shipping' ),
79
  'type' => 'text',
80
  'default' => $this->get_value_from_settings( $method_settings, 'method_free_shipping_label', '' ),
81
+ 'description' => __( 'Enter the text for the additional shipping method\'s label which will be displayed once the free shipping is triggered or calculated.', 'flexible-shipping' ),
82
  'desc_tip' => true,
83
+ ],
84
+ WPDesk_Flexible_Shipping::SETTING_METHOD_FREE_SHIPPING_NOTICE => [
85
  'title' => __( '\'Left to free shipping\' notice', 'flexible-shipping' ),
86
  'type' => 'checkbox',
87
  'default' => $this->get_value_from_settings( $method_settings, WPDesk_Flexible_Shipping::SETTING_METHOD_FREE_SHIPPING_NOTICE, 'no' ),
93
  sprintf( '<a href="%s" target="_blank">', esc_url( get_locale() === 'pl_PL' ? 'https://wpde.sk/fs-fsn-pl' : 'https://wpde.sk/fs-fsn' ) ),
94
  '</a>'
95
  ) . '<br /><br />' . __( 'Please mind that if you use any additional plugins to split the shipment into packages, the \'Left to free shipping notice\' will not be displayed.', 'flexible-shipping' ),
96
+ ],
97
+ 'method_calculation_method' => [
98
  'title' => __( 'Rules Calculation', 'flexible-shipping' ),
99
  'type' => 'select',
100
  'description' => __( 'Select how rules will be calculated. If you choose "sum" the rules order is important.', 'flexible-shipping' ),
101
  'default' => $this->get_value_from_settings( $method_settings, 'method_calculation_method', '' ),
102
  'desc_tip' => true,
103
  'options' => ( new CalculationMethodOptions() )->get_options(),
104
+ ],
105
+ self::CART_CALCULATION => [
106
  'title' => __( 'Cart Calculation', 'flexible-shipping' ),
107
  'type' => 'select',
108
  'default' => $this->get_value_from_settings( $method_settings, self::CART_CALCULATION, isset( $method_settings[ self::METHOD_DESCRIPTION ] ) ? CartCalculationOptions::CART : CartCalculationOptions::PACKAGE ),
109
  'options' => ( new CartCalculationOptions() )->get_options(),
110
  'description' => __( 'Choose Package value to exclude virtual products from rules calculation.', 'flexible-shipping' ),
111
  'desc_tip' => true,
112
+ ],
113
+ 'method_visibility' => [
114
  'title' => __( 'Visibility', 'flexible-shipping' ),
115
  'type' => 'checkbox',
116
  'default' => $this->get_value_from_settings( $method_settings, 'method_visibility', 'no' ),
117
  'label' => __( 'Show only for logged in users', 'flexible-shipping' ),
118
+ ],
119
+ 'method_default' => [
120
  'title' => __( 'Default', 'flexible-shipping' ),
121
  'type' => 'checkbox',
122
  'default' => $this->get_value_from_settings( $method_settings, 'method_default', 'no' ),
123
  'label' => __( 'Check the box to set this option as the default selected choice on the cart page.', 'flexible-shipping' ),
124
+ ],
125
+ 'method_debug_mode' => [
126
  'title' => __( 'FS Debug Mode', 'flexible-shipping' ),
127
  'type' => 'checkbox',
128
  'default' => $this->get_value_from_settings( $method_settings, 'method_debug_mode', 'no' ),
133
  '<a href="' . ( 'pl_PL' !== get_locale() ? 'https://docs.flexibleshipping.com/article/421-fs-table-rate-debug-mode?utm_source=flexible-shipping-method&utm_medium=link&utm_campaign=flexible-shipping-debug-mode' : 'https://www.wpdesk.pl/docs/tryb-debugowania-flexible-shipping/?utm_source=flexible-shipping-method&utm_medium=link&utm_campaign=flexible-shipping-debug-mode' ) . '" target="_blank">',
134
  '</a>'
135
  ),
136
+ ],
137
+ ];
138
 
139
  if ( $with_integration_settings ) {
140
  $settings = $this->append_integration_settings_if_present( $settings, $method_settings );
144
  $this->settings['method_max_cost'] = $settings['method_max_cost']['default'];
145
  }
146
 
147
+ $settings[ self::METHOD_RULES ] = [
148
  'title' => __( 'Shipping Cost Calculation Rules', 'flexible-shipping' ),
149
  'type' => RulesSettingsField::FIELD_TYPE,
150
  'default' => $this->get_value_from_settings( $method_settings, self::METHOD_RULES, ( new DefaultRulesSettings() )->get_normalized_settings() ),
151
  self::METHOD_TITLE => $this->get_value_from_settings( $method_settings, self::METHOD_TITLE, __( 'Flexible Shipping', 'flexible-shipping' ) ),
152
+ ];
153
 
154
  return $settings;
155
  }
161
  * @return array
162
  */
163
  private function append_integration_settings_if_present( array $settings, $method_settings ) {
164
+ $integrations_options = apply_filters( 'flexible_shipping_integration_options', [ '' => __( 'None', 'flexible-shipping' ) ] );
165
 
166
  if ( 1 < count( $integrations_options ) ) {
167
+ $settings['title_shipping_integration'] = [
168
  'title' => __( 'Shipping Integration', 'flexible-shipping' ),
169
  'type' => 'title',
170
+ ];
171
+ $settings['method_integration'] = [
172
  'title' => __( 'Integration', 'flexible-shipping' ),
173
  'type' => 'select',
174
  'desc_tip' => false,
175
  'options' => $integrations_options,
176
  'default' => $this->get_value_from_settings( $method_settings, 'method_integration' ),
177
+ ];
178
  }
179
 
180
  $filtered_settings = apply_filters( 'flexible_shipping_method_settings', $settings, $method_settings );
181
 
182
+ $settings = [];
183
 
184
  foreach ( $filtered_settings as $settings_key => $settings_value ) {
185
  if ( 'method_enabled' === $settings_key ) {
186
+ $settings['title_general_settings'] = [
187
  'title' => __( 'General Settings', 'flexible-shipping' ),
188
  'type' => 'title',
189
+ ];
190
  }
191
 
192
  if ( 'method_free_shipping_requires' === $settings_key || ( 'method_free_shipping' === $settings_key && ! isset( $settings['method_free_shipping_requires'] ) ) ) {
193
+ $settings['title_free_shipping'] = [
194
  'title' => __( 'Free Shipping', 'flexible-shipping' ),
195
  'type' => 'title',
196
+ ];
197
  }
198
 
199
  if ( 'method_max_cost' === $settings_key || ( 'method_calculation_method' === $settings_key && ! isset( $settings['method_max_cost'] ) ) ) {
200
+ $settings['title_cost_calculation'] = [
201
  'title' => __( 'Cost Calculation', 'flexible-shipping' ),
202
  'type' => 'title',
203
+ ];
204
  }
205
 
206
  if ( 'method_visibility' === $settings_key ) {
207
+ $settings['title_advanced_options'] = [
208
  'title' => __( 'Advanced Options', 'flexible-shipping' ),
209
  'type' => 'title',
210
+ ];
211
  }
212
 
213
  $settings[ $settings_key ] = $settings_value;
src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php CHANGED
@@ -218,7 +218,7 @@ class RateCalculator {
218
 
219
  $rate = $this->calculate_rate_for_rates( $method_settings, $shipping_contents, $rate_id, $logger );
220
  } else {
221
- $rate = array();
222
  }
223
 
224
  return $rate;
@@ -259,7 +259,8 @@ class RateCalculator {
259
  }
260
 
261
  if ( $add_method ) {
262
- $cost = $cost_calculator->get_calculated_cost();
 
263
  // Translators: cost, currency.
264
  $logger->debug( sprintf( __( 'Calculated shipping cost: %1$s %2$s', 'flexible-shipping' ), $cost, $this->shop_currency ), $logger->get_results_context() );
265
 
@@ -280,20 +281,35 @@ class RateCalculator {
280
  // Translators: method title.
281
  $logger->debug( sprintf( __( 'Shipping method title: %1$s', 'flexible-shipping' ), $method_title ), $logger->get_results_context() );
282
 
283
- $rate = array(
284
  'id' => $rate_id,
285
  'label' => $method_title,
286
  'cost' => $cost,
287
  'package' => $this->package,
288
  'meta_data' => $this->prepare_meta_data( $method_settings ),
289
- );
290
  } else {
291
- $rate = array();
292
  }
293
 
294
  return $rate;
295
  }
296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  /**
298
  * @param MethodSettingsImplementation $method_settings .
299
  *
@@ -302,12 +318,12 @@ class RateCalculator {
302
  private function prepare_meta_data( MethodSettingsImplementation $method_settings ) {
303
  $description = wpdesk__( $method_settings->get_description(), 'flexible-shipping' );
304
 
305
- $meta_data = array(
306
  WPDesk_Flexible_Shipping::META_DEFAULT => $method_settings->get_default(),
307
  self::FS_METHOD => $method_settings->get_raw_settings(),
308
  self::FS_INTEGRATION => $method_settings->get_integration(),
309
  self::DESCRIPTION => $description,
310
- );
311
 
312
  if ( esc_html( $description ) !== $description ) {
313
  $meta_data[ self::DESCRIPTION_BASE64ENCODED ] = base64_encode( $description );
@@ -333,7 +349,7 @@ class RateCalculator {
333
  private function get_single_method_title( $shipping_method, $cost ) {
334
  $method_title = wpdesk__( $shipping_method['method_title'], 'flexible-shipping' );
335
 
336
- if ( 0.0 === (float) $cost ) {
337
  if ( ! isset( $shipping_method['method_free_shipping_label'] ) ) {
338
  $shipping_method['method_free_shipping_label'] = __( 'Free', 'flexible-shipping' );
339
  }
218
 
219
  $rate = $this->calculate_rate_for_rates( $method_settings, $shipping_contents, $rate_id, $logger );
220
  } else {
221
+ $rate = [];
222
  }
223
 
224
  return $rate;
259
  }
260
 
261
  if ( $add_method ) {
262
+ $cost = $this->set_zero_cost_if_negative( $cost_calculator->get_calculated_cost() );
263
+
264
  // Translators: cost, currency.
265
  $logger->debug( sprintf( __( 'Calculated shipping cost: %1$s %2$s', 'flexible-shipping' ), $cost, $this->shop_currency ), $logger->get_results_context() );
266
 
281
  // Translators: method title.
282
  $logger->debug( sprintf( __( 'Shipping method title: %1$s', 'flexible-shipping' ), $method_title ), $logger->get_results_context() );
283
 
284
+ $rate = [
285
  'id' => $rate_id,
286
  'label' => $method_title,
287
  'cost' => $cost,
288
  'package' => $this->package,
289
  'meta_data' => $this->prepare_meta_data( $method_settings ),
290
+ ];
291
  } else {
292
+ $rate = [];
293
  }
294
 
295
  return $rate;
296
  }
297
 
298
+ /**
299
+ * @param float $cost .
300
+ *
301
+ * @return float
302
+ */
303
+ private function set_zero_cost_if_negative( $cost ) {
304
+ $allow_negative_costs = (bool) apply_filters( 'flexible-shipping/shipping-method/allow-negative-costs', false );
305
+
306
+ if ( ! $allow_negative_costs && 0.0 > (float) $cost ) {
307
+ $cost = 0.0;
308
+ }
309
+
310
+ return (float) $cost;
311
+ }
312
+
313
  /**
314
  * @param MethodSettingsImplementation $method_settings .
315
  *
318
  private function prepare_meta_data( MethodSettingsImplementation $method_settings ) {
319
  $description = wpdesk__( $method_settings->get_description(), 'flexible-shipping' );
320
 
321
+ $meta_data = [
322
  WPDesk_Flexible_Shipping::META_DEFAULT => $method_settings->get_default(),
323
  self::FS_METHOD => $method_settings->get_raw_settings(),
324
  self::FS_INTEGRATION => $method_settings->get_integration(),
325
  self::DESCRIPTION => $description,
326
+ ];
327
 
328
  if ( esc_html( $description ) !== $description ) {
329
  $meta_data[ self::DESCRIPTION_BASE64ENCODED ] = base64_encode( $description );
349
  private function get_single_method_title( $shipping_method, $cost ) {
350
  $method_title = wpdesk__( $shipping_method['method_title'], 'flexible-shipping' );
351
 
352
+ if ( 0.0 >= (float) $cost ) {
353
  if ( ! isset( $shipping_method['method_free_shipping_label'] ) ) {
354
  $shipping_method['method_free_shipping_label'] = __( 'Free', 'flexible-shipping' );
355
  }
src/WPDesk/FS/TableRate/ShippingMethodSingle.php CHANGED
@@ -23,7 +23,6 @@ use WPDesk_Flexible_Shipping;
23
  * Shipping method flexible_shipping_single
24
  */
25
  class ShippingMethodSingle extends WC_Shipping_Method {
26
- use ShippingMethodTrait;
27
 
28
  const SHIPPING_METHOD_ID = 'flexible_shipping_single';
29
 
@@ -54,10 +53,10 @@ class ShippingMethodSingle extends WC_Shipping_Method {
54
  * Init.
55
  */
56
  private function init() {
57
- $this->supports = array(
58
  'shipping-zones',
59
  'instance-settings',
60
- );
61
  $this->init_instance_form_fields( false );
62
  $this->method_title = __( 'Flexible Shipping', 'flexible-shipping' );
63
  $this->method_description = __( 'A single Flexible Shipping method.', 'flexible-shipping' );
@@ -69,7 +68,6 @@ class ShippingMethodSingle extends WC_Shipping_Method {
69
  }
70
  $this->title = $this->get_instance_option( 'method_title', $this->method_title );
71
  $this->tax_status = $this->get_instance_option( 'tax_status' );
72
-
73
  }
74
 
75
  /**
@@ -85,7 +83,7 @@ class ShippingMethodSingle extends WC_Shipping_Method {
85
  *
86
  * @return string
87
  */
88
- public function generate_settings_html( $form_fields = array(), $echo = true ) {
89
  $this->init_instance_form_fields( true );
90
  $form_fields = $this->get_instance_form_fields();
91
  if ( $echo ) {
@@ -107,13 +105,24 @@ class ShippingMethodSingle extends WC_Shipping_Method {
107
  */
108
  public function generate_title_html( $key, $data ) {
109
  $field_key = $this->get_field_key( $key );
110
- $defaults = array(
111
  'title' => '',
112
  'class' => '',
113
- );
114
 
115
  $data = wp_parse_args( $data, $defaults );
116
 
 
 
 
 
 
 
 
 
 
 
 
117
  ob_start();
118
  ?>
119
  </table>
@@ -123,13 +132,7 @@ class ShippingMethodSingle extends WC_Shipping_Method {
123
  <p><?php echo wp_kses_post( $data['description'] ); ?></p>
124
  <?php endif; ?>
125
 
126
- <?php
127
- if ( ! $this->is_html_ads_loaded ) {
128
- $shipping_method_id = self::SHIPPING_METHOD_ID;
129
- include __DIR__ . '/../../../../classes/table-rate/views/html-ads.php';
130
- $this->is_html_ads_loaded = true;
131
- }
132
- ?>
133
 
134
  <table class="form-table">
135
  <?php
@@ -155,7 +158,7 @@ class ShippingMethodSingle extends WC_Shipping_Method {
155
  public function process_admin_options() {
156
  $this->init_instance_form_fields( true );
157
  $filter_name = 'woocommerce_shipping_' . $this->id . '_instance_settings_values';
158
- $filter_callback = array( $this, 'process_integrations_settings' );
159
  add_filter( $filter_name, $filter_callback );
160
  $processed = parent::process_admin_options();
161
  remove_filter( $filter_name, $filter_callback );
@@ -206,7 +209,7 @@ class ShippingMethodSingle extends WC_Shipping_Method {
206
  */
207
  public function validate_shipping_rules_field( $key, $value ) {
208
  $rules_settings_processor = new Rule\Settings\SettingsProcessor(
209
- ( null === $value || ! is_array( $value ) ) ? array() : $value,
210
  ( new ConditionsFactory() )->get_conditions(),
211
  ( new RuleCostFieldsFactory() )->get_fields(),
212
  ( new Rule\Cost\RuleAdditionalCostFieldsFactory( ( new RuleAdditionalCostFactory() )->get_additional_costs() ) )->get_fields(),
@@ -234,7 +237,7 @@ class ShippingMethodSingle extends WC_Shipping_Method {
234
  * @return array
235
  */
236
  public function get_method_rules() {
237
- return $this->get_instance_option( 'method_rules', array() );
238
  }
239
 
240
  /**
@@ -256,7 +259,7 @@ class ShippingMethodSingle extends WC_Shipping_Method {
256
  /**
257
  * @param array $package .
258
  */
259
- public function calculate_shipping( $package = array() ) {
260
  $rate_calculator = RateCalculatorFactory::create_for_shipping_method( $this, $package );
261
 
262
  $method_settings = MethodSettingsFactory::create_from_array( $this->instance_settings );
@@ -267,7 +270,7 @@ class ShippingMethodSingle extends WC_Shipping_Method {
267
  $calculated_rate = $rate_calculator->calculate_rate( $method_settings, $this->get_rate_id(), is_user_logged_in() );
268
 
269
  if ( ! empty( $calculated_rate ) && $this->should_add_rate( $calculated_rate ) ) {
270
- $this->add_rate( $this->set_zero_cost_if_negative( $calculated_rate ) );
271
  $logger->debug( __( 'Shipping cost added.', 'flexible-shipping' ), $logger->get_results_context() );
272
  }
273
 
23
  * Shipping method flexible_shipping_single
24
  */
25
  class ShippingMethodSingle extends WC_Shipping_Method {
 
26
 
27
  const SHIPPING_METHOD_ID = 'flexible_shipping_single';
28
 
53
  * Init.
54
  */
55
  private function init() {
56
+ $this->supports = [
57
  'shipping-zones',
58
  'instance-settings',
59
+ ];
60
  $this->init_instance_form_fields( false );
61
  $this->method_title = __( 'Flexible Shipping', 'flexible-shipping' );
62
  $this->method_description = __( 'A single Flexible Shipping method.', 'flexible-shipping' );
68
  }
69
  $this->title = $this->get_instance_option( 'method_title', $this->method_title );
70
  $this->tax_status = $this->get_instance_option( 'tax_status' );
 
71
  }
72
 
73
  /**
83
  *
84
  * @return string
85
  */
86
+ public function generate_settings_html( $form_fields = [], $echo = true ) {
87
  $this->init_instance_form_fields( true );
88
  $form_fields = $this->get_instance_form_fields();
89
  if ( $echo ) {
105
  */
106
  public function generate_title_html( $key, $data ) {
107
  $field_key = $this->get_field_key( $key );
108
+ $defaults = [
109
  'title' => '',
110
  'class' => '',
111
+ ];
112
 
113
  $data = wp_parse_args( $data, $defaults );
114
 
115
+ $ads = '';
116
+
117
+ if ( ! $this->is_html_ads_loaded ) {
118
+ ob_start();
119
+ $shipping_method_id = self::SHIPPING_METHOD_ID;
120
+ include __DIR__ . '/../../../../classes/table-rate/views/html-ads.php';
121
+ $ads = ob_get_clean();
122
+ $ads = apply_filters( 'flexible-shipping/sell-box', is_string( $ads ) ? $ads : '' );
123
+ $this->is_html_ads_loaded = true;
124
+ }
125
+
126
  ob_start();
127
  ?>
128
  </table>
132
  <p><?php echo wp_kses_post( $data['description'] ); ?></p>
133
  <?php endif; ?>
134
 
135
+ <?php echo wp_kses_post( $ads ); ?>
 
 
 
 
 
 
136
 
137
  <table class="form-table">
138
  <?php
158
  public function process_admin_options() {
159
  $this->init_instance_form_fields( true );
160
  $filter_name = 'woocommerce_shipping_' . $this->id . '_instance_settings_values';
161
+ $filter_callback = [ $this, 'process_integrations_settings' ];
162
  add_filter( $filter_name, $filter_callback );
163
  $processed = parent::process_admin_options();
164
  remove_filter( $filter_name, $filter_callback );
209
  */
210
  public function validate_shipping_rules_field( $key, $value ) {
211
  $rules_settings_processor = new Rule\Settings\SettingsProcessor(
212
+ ( null === $value || ! is_array( $value ) ) ? [] : $value,
213
  ( new ConditionsFactory() )->get_conditions(),
214
  ( new RuleCostFieldsFactory() )->get_fields(),
215
  ( new Rule\Cost\RuleAdditionalCostFieldsFactory( ( new RuleAdditionalCostFactory() )->get_additional_costs() ) )->get_fields(),
237
  * @return array
238
  */
239
  public function get_method_rules() {
240
+ return $this->get_instance_option( 'method_rules', [] );
241
  }
242
 
243
  /**
259
  /**
260
  * @param array $package .
261
  */
262
+ public function calculate_shipping( $package = [] ) {
263
  $rate_calculator = RateCalculatorFactory::create_for_shipping_method( $this, $package );
264
 
265
  $method_settings = MethodSettingsFactory::create_from_array( $this->instance_settings );
270
  $calculated_rate = $rate_calculator->calculate_rate( $method_settings, $this->get_rate_id(), is_user_logged_in() );
271
 
272
  if ( ! empty( $calculated_rate ) && $this->should_add_rate( $calculated_rate ) ) {
273
+ $this->add_rate( $calculated_rate );
274
  $logger->debug( __( 'Shipping cost added.', 'flexible-shipping' ), $logger->get_results_context() );
275
  }
276
 
src/WPDesk/FS/TableRate/ShippingMethodTrait.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- /**
3
- * Trait ShippingMethodTrait
4
- *
5
- * @package WPDesk\FS\TableRate
6
- */
7
-
8
- namespace WPDesk\FS\TableRate;
9
-
10
- /**
11
- * Common methods for shipping methods.
12
- */
13
- trait ShippingMethodTrait {
14
- /**
15
- * @param array $args .
16
- *
17
- * @return array
18
- */
19
- private function set_zero_cost_if_negative( $args = array() ) {
20
- $allow_negative_costs = (bool) apply_filters( 'flexible-shipping/shipping-method/allow-negative-costs', false );
21
-
22
- if ( ! $allow_negative_costs && isset( $args['cost'] ) && 0.0 > (float) $args['cost'] ) {
23
- $args['cost'] = 0.0;
24
- }
25
-
26
- return $args;
27
- }
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit5e2bb2f7f43fe6060cc64f56ec4704ce::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInite6a0a8b5b22ff56576b816fc78d3ff4e::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -123,6 +123,7 @@ return array(
123
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\LocalCodeceptionTrait' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/LocalCodeceptionTrait.php',
124
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareCodeceptionDb' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareCodeceptionDb.php',
125
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareLocalCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTests.php',
 
126
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareWordpressForCodeception' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareWordpressForCodeception.php',
127
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
128
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunLocalCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunLocalCodeceptionTests.php',
@@ -134,6 +135,22 @@ return array(
134
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginCompatibility' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginCompatibility.php',
135
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginCompatibilityChecker' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginCompatibilityChecker.php',
136
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginDetails' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginDetails.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  'FSVendor\\WPDesk\\FS\\TableRate\\AbstractOptions' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/AbstractOptions.php',
138
  'FSVendor\\WPDesk\\FS\\TableRate\\BasedOnOptions' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/BasedOnOptions.php',
139
  'FSVendor\\WPDesk\\FS\\TableRate\\CalculationMethodOptions' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/CalculationMethodOptions.php',
@@ -365,6 +382,20 @@ return array(
365
  'FSVendor\\WPDesk_Basic_Requirement_Checker_Factory' => $baseDir . '/vendor_prefixed/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker_Factory.php',
366
  'FSVendor\\WPDesk_Basic_Requirement_Checker_With_Update_Disable' => $baseDir . '/vendor_prefixed/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker_With_Update_Disable.php',
367
  'FSVendor\\WPDesk_Buildable' => $baseDir . '/vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
368
  'FSVendor\\WPDesk_Has_Plugin_Info' => $baseDir . '/vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php',
369
  'FSVendor\\WPDesk_Helper_List_Table' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/Page/License/views/class-wpdesk-helper-list-table.php',
370
  'FSVendor\\WPDesk_Logger' => $baseDir . '/vendor_prefixed/wpdesk/wp-logs/src/deprecated/wpdesk-logger.php',
@@ -442,10 +473,10 @@ return array(
442
  'WPDesk\\FS\\Onboarding\\TableRate\\PopupData' => $baseDir . '/src/WPDesk/FS/Onboarding/TableRate/PopupData.php',
443
  'WPDesk\\FS\\Onboarding\\TableRate\\Tracker' => $baseDir . '/src/WPDesk/FS/Onboarding/TableRate/Tracker.php',
444
  'WPDesk\\FS\\Plugin\\PluginActivation' => $baseDir . '/src/WPDesk/FS/Plugin/PluginActivation.php',
445
- 'WPDesk\\FS\\Rate\\RateNotice' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/abstract-rate.php',
446
- 'WPDesk\\FS\\Rate\\RateNoticeImplementation' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/rate-notice-implementation.php',
447
- 'WPDesk\\FS\\Rate\\RateNoticeInterface' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/interface-rate.php',
448
- 'WPDesk\\FS\\Rate\\WPDesk_Flexible_Shipping_Rate_Notice' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notice.php',
449
  'WPDesk\\FS\\Shipment\\SubscriptionsIntegration' => $baseDir . '/src/WPDesk/FS/Shipment/SubscriptionsIntegration.php',
450
  'WPDesk\\FS\\TableRate\\Beacon' => $baseDir . '/src/WPDesk/FS/TableRate/Beacon.php',
451
  'WPDesk\\FS\\TableRate\\Beacon\\Beacon' => $baseDir . '/src/WPDesk/FS/TableRate/Beacon/Beacon.php',
@@ -527,7 +558,6 @@ return array(
527
  'WPDesk\\FS\\TableRate\\RulesSettingsField' => $baseDir . '/src/WPDesk/FS/TableRate/RulesSettingsField.php',
528
  'WPDesk\\FS\\TableRate\\RulesTableSettings' => $baseDir . '/src/WPDesk/FS/TableRate/RulesTableSettings.php',
529
  'WPDesk\\FS\\TableRate\\ShippingMethodSingle' => $baseDir . '/src/WPDesk/FS/TableRate/ShippingMethodSingle.php',
530
- 'WPDesk\\FS\\TableRate\\ShippingMethodTrait' => $baseDir . '/src/WPDesk/FS/TableRate/ShippingMethodTrait.php',
531
  'WPDesk\\FS\\TableRate\\ShippingMethod\\BlockEditing\\BlockEditing' => $baseDir . '/src/WPDesk/FS/TableRate/ShippingMethod/BlockEditing/BlockEditing.php',
532
  'WPDesk\\FS\\TableRate\\ShippingMethod\\CommonMethodSettings' => $baseDir . '/src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php',
533
  'WPDesk\\FS\\TableRate\\ShippingMethod\\Convert\\ConvertAction' => $baseDir . '/src/WPDesk/FS/TableRate/ShippingMethod/Convert/ConvertAction.php',
@@ -575,46 +605,20 @@ return array(
575
  'WPDesk\\PluginBuilder\\Storage\\WordpressFilterStorage' => $vendorDir . '/wpdesk/wp-builder/src/Storage/WordpressFilterStorage.php',
576
  'WPDesk_Buildable' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php',
577
  'WPDesk_Flexible_Shipping' => $baseDir . '/classes/table-rate/shipping-method.php',
578
- 'WPDesk_Flexible_Shipping_Add_Shipping' => $baseDir . '/classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php',
579
- 'WPDesk_Flexible_Shipping_Admin_Notices' => $baseDir . '/classes/wp-wpdesk-fs-shipment/admin-notices.php',
580
  'WPDesk_Flexible_Shipping_Bulk_Actions' => $baseDir . '/classes/table-rate/bulk-actions.php',
581
- 'WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-cancel-shipment-exception.php',
582
- 'WPDesk_Flexible_Shipping_Get_Label_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-get-label-exception.php',
583
- 'WPDesk_Flexible_Shipping_Integration_Label_Builder' => $baseDir . '/classes/wp-wpdesk-fs-shipment/label/class-integration-label-builder.php',
584
- 'WPDesk_Flexible_Shipping_Label_Not_Available_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-label-not-available-exception.php',
585
- 'WPDesk_Flexible_Shipping_Labels_Builder' => $baseDir . '/classes/wp-wpdesk-fs-shipment/label/interface-labels-builder.php',
586
- 'WPDesk_Flexible_Shipping_Labels_Bulk_Action_Handler' => $baseDir . '/classes/wp-wpdesk-fs-shipment/label/class-labels-bulk-action-handler.php',
587
- 'WPDesk_Flexible_Shipping_Labels_File_Creator' => $baseDir . '/classes/wp-wpdesk-fs-shipment/label/class-labels-file-creator.php',
588
- 'WPDesk_Flexible_Shipping_Labels_File_Dispatcher' => $baseDir . '/classes/wp-wpdesk-fs-shipment/label/class-labels-file-dispatcher.php',
589
  'WPDesk_Flexible_Shipping_Logger_Downloader' => $baseDir . '/classes/table-rate/logger/class-logger-downloader.php',
590
  'WPDesk_Flexible_Shipping_Logger_Factory' => $baseDir . '/classes/table-rate/logger/class-logger-factory.php',
591
  'WPDesk_Flexible_Shipping_Logger_Settings' => $baseDir . '/classes/table-rate/logger/class-logger-settings.php',
592
- 'WPDesk_Flexible_Shipping_Manifest' => $baseDir . '/classes/wp-wpdesk-fs-shipment/manifest/class-manifest.php',
593
- 'WPDesk_Flexible_Shipping_Manifest_FS' => $baseDir . '/classes/wp-wpdesk-fs-shipment/manifest/class-manifest-fs.php',
594
- 'WPDesk_Flexible_Shipping_Manifest_Interface' => $baseDir . '/classes/wp-wpdesk-fs-shipment/manifest/interface-manifest.php',
595
  'WPDesk_Flexible_Shipping_Method_Created_Tracker_Deactivation_Data' => $baseDir . '/classes/tracker/class-method-created-tracker-deactivation-data.php',
596
  'WPDesk_Flexible_Shipping_Multicurrency' => $baseDir . '/classes/table-rate/multicurrency.php',
597
  'WPDesk_Flexible_Shipping_Multilingual' => $baseDir . '/classes/table-rate/multilingual.php',
598
  'WPDesk_Flexible_Shipping_Order_Item_Meta' => $baseDir . '/classes/table-rate/order-item-meta.php',
599
- 'WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rest-api/interface-rest-api-order-data-provider.php',
600
- 'WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider_Default' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-provider-default.php',
601
- 'WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Providers_Collection' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-providers-collection.php',
602
- 'WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Providers_Factory' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-providers-factory.php',
603
- 'WPDesk_Flexible_Shipping_Rest_Api_Order_Response_Data_Appender' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-response-data-appender.php',
604
- 'WPDesk_Flexible_Shipping_Send_Shipment_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-send-shipment-exception.php',
605
  'WPDesk_Flexible_Shipping_Settings' => $baseDir . '/classes/table-rate/flexible-shipping-settings.php',
606
- 'WPDesk_Flexible_Shipping_Shipment' => $baseDir . '/classes/wp-wpdesk-fs-shipment/shipment/class-shipment.php',
607
  'WPDesk_Flexible_Shipping_Shipment_Ajax' => $baseDir . '/classes/wp-wpdesk-fs-shipment/metabox/ajax.php',
608
- 'WPDesk_Flexible_Shipping_Shipment_CPT' => $baseDir . '/classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php',
609
- 'WPDesk_Flexible_Shipping_Shipment_Interface' => $baseDir . '/classes/wp-wpdesk-fs-shipment/shipment/interface-shipment.php',
610
- 'WPDesk_Flexible_Shipping_Shipment_Plan_Exceeded_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-plan-exceeded-exception.php',
611
- 'WPDesk_Flexible_Shipping_Shipping_Manifest_CPT' => $baseDir . '/classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php',
612
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Dimension' => $baseDir . '/classes/table-rate/class-shortcode-unit-dimension.php',
613
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Weight' => $baseDir . '/classes/table-rate/class-shortcode-unit-weight.php',
614
- 'WPDesk_Flexible_Shipping_Single_Label_File_Dispatcher' => $baseDir . '/classes/wp-wpdesk-fs-shipment/label/class-single-label-file-dispatcher.php',
615
  'WPDesk_Flexible_Shipping_Tracker' => $baseDir . '/classes/tracker/tracker.php',
616
- 'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-file-exception.php',
617
- 'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php',
618
  'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => $baseDir . '/classes/table-rate/logger/class-woocommerce-context-logger.php',
619
  'WPDesk_Has_Plugin_Info' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php',
620
  'WPDesk_Plugin_Info' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Plugin_Info.php',
123
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\LocalCodeceptionTrait' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/LocalCodeceptionTrait.php',
124
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareCodeceptionDb' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareCodeceptionDb.php',
125
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareLocalCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTests.php',
126
+ 'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareParallelCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareParallelCodeceptionTests.php',
127
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareWordpressForCodeception' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareWordpressForCodeception.php',
128
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
129
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunLocalCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunLocalCodeceptionTests.php',
135
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginCompatibility' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginCompatibility.php',
136
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginCompatibilityChecker' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginCompatibilityChecker.php',
137
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginDetails' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginDetails.php',
138
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Assets' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Assets.php',
139
+ 'FSVendor\\WPDesk\\FS\\Shipment\\CustomPostType' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/CustomPostType.php',
140
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Label\\LabelsBulkActionHandler' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsBulkActionHandler.php',
141
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Label\\LabelsFileCreator' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsFileCreator.php',
142
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Label\\LabelsFileDispatcher' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsFileDispatcher.php',
143
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Label\\SingleLabelFileDispatcher' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/SingleLabelFileDispatcher.php',
144
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Manifest\\ManifestCustomPostType' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/CustomPostType.php',
145
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Metabox\\Ajax' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Metabox/Ajax.php',
146
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Order\\AddShippingMetabox' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Order/AddShippingMetabox.php',
147
+ 'FSVendor\\WPDesk\\FS\\Shipment\\RestApi\\OrderDataProvider' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvider.php',
148
+ 'FSVendor\\WPDesk\\FS\\Shipment\\RestApi\\OrderDataProviderDefault' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProviderDefault.php',
149
+ 'FSVendor\\WPDesk\\FS\\Shipment\\RestApi\\OrderDataProvidersCollection' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvidersCollection.php',
150
+ 'FSVendor\\WPDesk\\FS\\Shipment\\RestApi\\OrderDataProvidersFactory' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvidersFactory.php',
151
+ 'FSVendor\\WPDesk\\FS\\Shipment\\RestApi\\OrderResponseDataAppender' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderResponseDataAppender.php',
152
+ 'FSVendor\\WPDesk\\FS\\Shipment\\ShipmentFunctionality' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/ShipmentFunctionality.php',
153
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Subscriptions\\SubscriptionsIntegration' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Subscriptions/SubscriptionsIntegration.php',
154
  'FSVendor\\WPDesk\\FS\\TableRate\\AbstractOptions' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/AbstractOptions.php',
155
  'FSVendor\\WPDesk\\FS\\TableRate\\BasedOnOptions' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/BasedOnOptions.php',
156
  'FSVendor\\WPDesk\\FS\\TableRate\\CalculationMethodOptions' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/CalculationMethodOptions.php',
382
  'FSVendor\\WPDesk_Basic_Requirement_Checker_Factory' => $baseDir . '/vendor_prefixed/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker_Factory.php',
383
  'FSVendor\\WPDesk_Basic_Requirement_Checker_With_Update_Disable' => $baseDir . '/vendor_prefixed/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker_With_Update_Disable.php',
384
  'FSVendor\\WPDesk_Buildable' => $baseDir . '/vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php',
385
+ 'FSVendor\\WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-cancel-shipment-exception.php',
386
+ 'FSVendor\\WPDesk_Flexible_Shipping_Get_Label_Exception' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-get-label-exception.php',
387
+ 'FSVendor\\WPDesk_Flexible_Shipping_Integration_Label_Builder' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/label/class-integration-label-builder.php',
388
+ 'FSVendor\\WPDesk_Flexible_Shipping_Label_Not_Available_Exception' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-label-not-available-exception.php',
389
+ 'FSVendor\\WPDesk_Flexible_Shipping_Labels_Builder' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/label/interface-labels-builder.php',
390
+ 'FSVendor\\WPDesk_Flexible_Shipping_Manifest' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/class-manifest.php',
391
+ 'FSVendor\\WPDesk_Flexible_Shipping_Manifest_FS' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/class-manifest-fs.php',
392
+ 'FSVendor\\WPDesk_Flexible_Shipping_Manifest_Interface' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/interface-manifest.php',
393
+ 'FSVendor\\WPDesk_Flexible_Shipping_Send_Shipment_Exception' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-send-shipment-exception.php',
394
+ 'FSVendor\\WPDesk_Flexible_Shipping_Shipment' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/shipment/class-shipment.php',
395
+ 'FSVendor\\WPDesk_Flexible_Shipping_Shipment_Interface' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/shipment/interface-shipment.php',
396
+ 'FSVendor\\WPDesk_Flexible_Shipping_Shipment_Plan_Exceeded_Exception' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-plan-exceeded-exception.php',
397
+ 'FSVendor\\WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-unable-to-create-tmp-file-exception.php',
398
+ 'FSVendor\\WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php',
399
  'FSVendor\\WPDesk_Has_Plugin_Info' => $baseDir . '/vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php',
400
  'FSVendor\\WPDesk_Helper_List_Table' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/Page/License/views/class-wpdesk-helper-list-table.php',
401
  'FSVendor\\WPDesk_Logger' => $baseDir . '/vendor_prefixed/wpdesk/wp-logs/src/deprecated/wpdesk-logger.php',
473
  'WPDesk\\FS\\Onboarding\\TableRate\\PopupData' => $baseDir . '/src/WPDesk/FS/Onboarding/TableRate/PopupData.php',
474
  'WPDesk\\FS\\Onboarding\\TableRate\\Tracker' => $baseDir . '/src/WPDesk/FS/Onboarding/TableRate/Tracker.php',
475
  'WPDesk\\FS\\Plugin\\PluginActivation' => $baseDir . '/src/WPDesk/FS/Plugin/PluginActivation.php',
476
+ 'WPDesk\\FS\\Rate\\RateNotice' => $baseDir . '/classes/notices/abstract-rate.php',
477
+ 'WPDesk\\FS\\Rate\\RateNoticeImplementation' => $baseDir . '/classes/notices/rate-notice-implementation.php',
478
+ 'WPDesk\\FS\\Rate\\RateNoticeInterface' => $baseDir . '/classes/notices/interface-rate.php',
479
+ 'WPDesk\\FS\\Rate\\WPDesk_Flexible_Shipping_Rate_Notice' => $baseDir . '/classes/notices/rate-notice.php',
480
  'WPDesk\\FS\\Shipment\\SubscriptionsIntegration' => $baseDir . '/src/WPDesk/FS/Shipment/SubscriptionsIntegration.php',
481
  'WPDesk\\FS\\TableRate\\Beacon' => $baseDir . '/src/WPDesk/FS/TableRate/Beacon.php',
482
  'WPDesk\\FS\\TableRate\\Beacon\\Beacon' => $baseDir . '/src/WPDesk/FS/TableRate/Beacon/Beacon.php',
558
  'WPDesk\\FS\\TableRate\\RulesSettingsField' => $baseDir . '/src/WPDesk/FS/TableRate/RulesSettingsField.php',
559
  'WPDesk\\FS\\TableRate\\RulesTableSettings' => $baseDir . '/src/WPDesk/FS/TableRate/RulesTableSettings.php',
560
  'WPDesk\\FS\\TableRate\\ShippingMethodSingle' => $baseDir . '/src/WPDesk/FS/TableRate/ShippingMethodSingle.php',
 
561
  'WPDesk\\FS\\TableRate\\ShippingMethod\\BlockEditing\\BlockEditing' => $baseDir . '/src/WPDesk/FS/TableRate/ShippingMethod/BlockEditing/BlockEditing.php',
562
  'WPDesk\\FS\\TableRate\\ShippingMethod\\CommonMethodSettings' => $baseDir . '/src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php',
563
  'WPDesk\\FS\\TableRate\\ShippingMethod\\Convert\\ConvertAction' => $baseDir . '/src/WPDesk/FS/TableRate/ShippingMethod/Convert/ConvertAction.php',
605
  'WPDesk\\PluginBuilder\\Storage\\WordpressFilterStorage' => $vendorDir . '/wpdesk/wp-builder/src/Storage/WordpressFilterStorage.php',
606
  'WPDesk_Buildable' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php',
607
  'WPDesk_Flexible_Shipping' => $baseDir . '/classes/table-rate/shipping-method.php',
608
+ 'WPDesk_Flexible_Shipping_Admin_Notices' => $baseDir . '/classes/notices/admin-notices.php',
 
609
  'WPDesk_Flexible_Shipping_Bulk_Actions' => $baseDir . '/classes/table-rate/bulk-actions.php',
 
 
 
 
 
 
 
 
610
  'WPDesk_Flexible_Shipping_Logger_Downloader' => $baseDir . '/classes/table-rate/logger/class-logger-downloader.php',
611
  'WPDesk_Flexible_Shipping_Logger_Factory' => $baseDir . '/classes/table-rate/logger/class-logger-factory.php',
612
  'WPDesk_Flexible_Shipping_Logger_Settings' => $baseDir . '/classes/table-rate/logger/class-logger-settings.php',
 
 
 
613
  'WPDesk_Flexible_Shipping_Method_Created_Tracker_Deactivation_Data' => $baseDir . '/classes/tracker/class-method-created-tracker-deactivation-data.php',
614
  'WPDesk_Flexible_Shipping_Multicurrency' => $baseDir . '/classes/table-rate/multicurrency.php',
615
  'WPDesk_Flexible_Shipping_Multilingual' => $baseDir . '/classes/table-rate/multilingual.php',
616
  'WPDesk_Flexible_Shipping_Order_Item_Meta' => $baseDir . '/classes/table-rate/order-item-meta.php',
 
 
 
 
 
 
617
  'WPDesk_Flexible_Shipping_Settings' => $baseDir . '/classes/table-rate/flexible-shipping-settings.php',
 
618
  'WPDesk_Flexible_Shipping_Shipment_Ajax' => $baseDir . '/classes/wp-wpdesk-fs-shipment/metabox/ajax.php',
 
 
 
 
619
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Dimension' => $baseDir . '/classes/table-rate/class-shortcode-unit-dimension.php',
620
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Weight' => $baseDir . '/classes/table-rate/class-shortcode-unit-weight.php',
 
621
  'WPDesk_Flexible_Shipping_Tracker' => $baseDir . '/classes/tracker/tracker.php',
 
 
622
  'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => $baseDir . '/classes/table-rate/logger/class-woocommerce-context-logger.php',
623
  'WPDesk_Has_Plugin_Info' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php',
624
  'WPDesk_Plugin_Info' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Plugin_Info.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit5e2bb2f7f43fe6060cc64f56ec4704ce
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit5e2bb2f7f43fe6060cc64f56ec4704ce
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit5e2bb2f7f43fe6060cc64f56ec4704ce', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit5e2bb2f7f43fe6060cc64f56ec4704ce', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit5e2bb2f7f43fe6060cc64f56ec4704ce
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequire5e2bb2f7f43fe6060cc64f56ec4704ce($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequire5e2bb2f7f43fe6060cc64f56ec4704ce($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInite6a0a8b5b22ff56576b816fc78d3ff4e
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInite6a0a8b5b22ff56576b816fc78d3ff4e', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInite6a0a8b5b22ff56576b816fc78d3ff4e', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInite6a0a8b5b22ff56576b816fc78d3ff4e::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInite6a0a8b5b22ff56576b816fc78d3ff4e::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequiree6a0a8b5b22ff56576b816fc78d3ff4e($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequiree6a0a8b5b22ff56576b816fc78d3ff4e($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce
8
  {
9
  public static $files = array (
10
  '0509b34a4bd7aebefeac629c9dc8a978' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/notice-functions.php',
@@ -164,6 +164,7 @@ class ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce
164
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\LocalCodeceptionTrait' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/LocalCodeceptionTrait.php',
165
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareCodeceptionDb' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareCodeceptionDb.php',
166
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareLocalCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTests.php',
 
167
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareWordpressForCodeception' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareWordpressForCodeception.php',
168
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
169
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunLocalCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunLocalCodeceptionTests.php',
@@ -175,6 +176,22 @@ class ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce
175
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginCompatibility' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginCompatibility.php',
176
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginCompatibilityChecker' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginCompatibilityChecker.php',
177
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginDetails' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginDetails.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  'FSVendor\\WPDesk\\FS\\TableRate\\AbstractOptions' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/AbstractOptions.php',
179
  'FSVendor\\WPDesk\\FS\\TableRate\\BasedOnOptions' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/BasedOnOptions.php',
180
  'FSVendor\\WPDesk\\FS\\TableRate\\CalculationMethodOptions' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/CalculationMethodOptions.php',
@@ -406,6 +423,20 @@ class ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce
406
  'FSVendor\\WPDesk_Basic_Requirement_Checker_Factory' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker_Factory.php',
407
  'FSVendor\\WPDesk_Basic_Requirement_Checker_With_Update_Disable' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker_With_Update_Disable.php',
408
  'FSVendor\\WPDesk_Buildable' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  'FSVendor\\WPDesk_Has_Plugin_Info' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php',
410
  'FSVendor\\WPDesk_Helper_List_Table' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/Page/License/views/class-wpdesk-helper-list-table.php',
411
  'FSVendor\\WPDesk_Logger' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-logs/src/deprecated/wpdesk-logger.php',
@@ -483,10 +514,10 @@ class ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce
483
  'WPDesk\\FS\\Onboarding\\TableRate\\PopupData' => __DIR__ . '/../..' . '/src/WPDesk/FS/Onboarding/TableRate/PopupData.php',
484
  'WPDesk\\FS\\Onboarding\\TableRate\\Tracker' => __DIR__ . '/../..' . '/src/WPDesk/FS/Onboarding/TableRate/Tracker.php',
485
  'WPDesk\\FS\\Plugin\\PluginActivation' => __DIR__ . '/../..' . '/src/WPDesk/FS/Plugin/PluginActivation.php',
486
- 'WPDesk\\FS\\Rate\\RateNotice' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/abstract-rate.php',
487
- 'WPDesk\\FS\\Rate\\RateNoticeImplementation' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/rate-notice-implementation.php',
488
- 'WPDesk\\FS\\Rate\\RateNoticeInterface' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/interface-rate.php',
489
- 'WPDesk\\FS\\Rate\\WPDesk_Flexible_Shipping_Rate_Notice' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notice.php',
490
  'WPDesk\\FS\\Shipment\\SubscriptionsIntegration' => __DIR__ . '/../..' . '/src/WPDesk/FS/Shipment/SubscriptionsIntegration.php',
491
  'WPDesk\\FS\\TableRate\\Beacon' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Beacon.php',
492
  'WPDesk\\FS\\TableRate\\Beacon\\Beacon' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Beacon/Beacon.php',
@@ -568,7 +599,6 @@ class ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce
568
  'WPDesk\\FS\\TableRate\\RulesSettingsField' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/RulesSettingsField.php',
569
  'WPDesk\\FS\\TableRate\\RulesTableSettings' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/RulesTableSettings.php',
570
  'WPDesk\\FS\\TableRate\\ShippingMethodSingle' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ShippingMethodSingle.php',
571
- 'WPDesk\\FS\\TableRate\\ShippingMethodTrait' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ShippingMethodTrait.php',
572
  'WPDesk\\FS\\TableRate\\ShippingMethod\\BlockEditing\\BlockEditing' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ShippingMethod/BlockEditing/BlockEditing.php',
573
  'WPDesk\\FS\\TableRate\\ShippingMethod\\CommonMethodSettings' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php',
574
  'WPDesk\\FS\\TableRate\\ShippingMethod\\Convert\\ConvertAction' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ShippingMethod/Convert/ConvertAction.php',
@@ -616,46 +646,20 @@ class ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce
616
  'WPDesk\\PluginBuilder\\Storage\\WordpressFilterStorage' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Storage/WordpressFilterStorage.php',
617
  'WPDesk_Buildable' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php',
618
  'WPDesk_Flexible_Shipping' => __DIR__ . '/../..' . '/classes/table-rate/shipping-method.php',
619
- 'WPDesk_Flexible_Shipping_Add_Shipping' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php',
620
- 'WPDesk_Flexible_Shipping_Admin_Notices' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/admin-notices.php',
621
  'WPDesk_Flexible_Shipping_Bulk_Actions' => __DIR__ . '/../..' . '/classes/table-rate/bulk-actions.php',
622
- 'WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-cancel-shipment-exception.php',
623
- 'WPDesk_Flexible_Shipping_Get_Label_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-get-label-exception.php',
624
- 'WPDesk_Flexible_Shipping_Integration_Label_Builder' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/label/class-integration-label-builder.php',
625
- 'WPDesk_Flexible_Shipping_Label_Not_Available_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-label-not-available-exception.php',
626
- 'WPDesk_Flexible_Shipping_Labels_Builder' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/label/interface-labels-builder.php',
627
- 'WPDesk_Flexible_Shipping_Labels_Bulk_Action_Handler' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/label/class-labels-bulk-action-handler.php',
628
- 'WPDesk_Flexible_Shipping_Labels_File_Creator' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/label/class-labels-file-creator.php',
629
- 'WPDesk_Flexible_Shipping_Labels_File_Dispatcher' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/label/class-labels-file-dispatcher.php',
630
  'WPDesk_Flexible_Shipping_Logger_Downloader' => __DIR__ . '/../..' . '/classes/table-rate/logger/class-logger-downloader.php',
631
  'WPDesk_Flexible_Shipping_Logger_Factory' => __DIR__ . '/../..' . '/classes/table-rate/logger/class-logger-factory.php',
632
  'WPDesk_Flexible_Shipping_Logger_Settings' => __DIR__ . '/../..' . '/classes/table-rate/logger/class-logger-settings.php',
633
- 'WPDesk_Flexible_Shipping_Manifest' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/manifest/class-manifest.php',
634
- 'WPDesk_Flexible_Shipping_Manifest_FS' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/manifest/class-manifest-fs.php',
635
- 'WPDesk_Flexible_Shipping_Manifest_Interface' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/manifest/interface-manifest.php',
636
  'WPDesk_Flexible_Shipping_Method_Created_Tracker_Deactivation_Data' => __DIR__ . '/../..' . '/classes/tracker/class-method-created-tracker-deactivation-data.php',
637
  'WPDesk_Flexible_Shipping_Multicurrency' => __DIR__ . '/../..' . '/classes/table-rate/multicurrency.php',
638
  'WPDesk_Flexible_Shipping_Multilingual' => __DIR__ . '/../..' . '/classes/table-rate/multilingual.php',
639
  'WPDesk_Flexible_Shipping_Order_Item_Meta' => __DIR__ . '/../..' . '/classes/table-rate/order-item-meta.php',
640
- 'WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rest-api/interface-rest-api-order-data-provider.php',
641
- 'WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider_Default' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-provider-default.php',
642
- 'WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Providers_Collection' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-providers-collection.php',
643
- 'WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Providers_Factory' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-data-providers-factory.php',
644
- 'WPDesk_Flexible_Shipping_Rest_Api_Order_Response_Data_Appender' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rest-api/class-rest-api-order-response-data-appender.php',
645
- 'WPDesk_Flexible_Shipping_Send_Shipment_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-send-shipment-exception.php',
646
  'WPDesk_Flexible_Shipping_Settings' => __DIR__ . '/../..' . '/classes/table-rate/flexible-shipping-settings.php',
647
- 'WPDesk_Flexible_Shipping_Shipment' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/shipment/class-shipment.php',
648
  'WPDesk_Flexible_Shipping_Shipment_Ajax' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/metabox/ajax.php',
649
- 'WPDesk_Flexible_Shipping_Shipment_CPT' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/shipment/cpt-shipment.php',
650
- 'WPDesk_Flexible_Shipping_Shipment_Interface' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/shipment/interface-shipment.php',
651
- 'WPDesk_Flexible_Shipping_Shipment_Plan_Exceeded_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-plan-exceeded-exception.php',
652
- 'WPDesk_Flexible_Shipping_Shipping_Manifest_CPT' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/manifest/cpt-shipping-manifest.php',
653
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Dimension' => __DIR__ . '/../..' . '/classes/table-rate/class-shortcode-unit-dimension.php',
654
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Weight' => __DIR__ . '/../..' . '/classes/table-rate/class-shortcode-unit-weight.php',
655
- 'WPDesk_Flexible_Shipping_Single_Label_File_Dispatcher' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/label/class-single-label-file-dispatcher.php',
656
  'WPDesk_Flexible_Shipping_Tracker' => __DIR__ . '/../..' . '/classes/tracker/tracker.php',
657
- 'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-file-exception.php',
658
- 'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php',
659
  'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => __DIR__ . '/../..' . '/classes/table-rate/logger/class-woocommerce-context-logger.php',
660
  'WPDesk_Has_Plugin_Info' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php',
661
  'WPDesk_Plugin_Info' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Plugin_Info.php',
@@ -670,10 +674,10 @@ class ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce
670
  public static function getInitializer(ClassLoader $loader)
671
  {
672
  return \Closure::bind(function () use ($loader) {
673
- $loader->prefixLengthsPsr4 = ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::$prefixLengthsPsr4;
674
- $loader->prefixDirsPsr4 = ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::$prefixDirsPsr4;
675
- $loader->fallbackDirsPsr4 = ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::$fallbackDirsPsr4;
676
- $loader->classMap = ComposerStaticInit5e2bb2f7f43fe6060cc64f56ec4704ce::$classMap;
677
 
678
  }, null, ClassLoader::class);
679
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInite6a0a8b5b22ff56576b816fc78d3ff4e
8
  {
9
  public static $files = array (
10
  '0509b34a4bd7aebefeac629c9dc8a978' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/notice-functions.php',
164
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\LocalCodeceptionTrait' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/LocalCodeceptionTrait.php',
165
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareCodeceptionDb' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareCodeceptionDb.php',
166
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareLocalCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTests.php',
167
+ 'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareParallelCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareParallelCodeceptionTests.php',
168
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareWordpressForCodeception' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareWordpressForCodeception.php',
169
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
170
  'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunLocalCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunLocalCodeceptionTests.php',
176
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginCompatibility' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginCompatibility.php',
177
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginCompatibilityChecker' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginCompatibilityChecker.php',
178
  'FSVendor\\WPDesk\\FS\\Compatibility\\PluginDetails' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-compatibility/src/PluginDetails.php',
179
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Assets' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Assets.php',
180
+ 'FSVendor\\WPDesk\\FS\\Shipment\\CustomPostType' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/CustomPostType.php',
181
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Label\\LabelsBulkActionHandler' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsBulkActionHandler.php',
182
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Label\\LabelsFileCreator' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsFileCreator.php',
183
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Label\\LabelsFileDispatcher' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsFileDispatcher.php',
184
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Label\\SingleLabelFileDispatcher' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/SingleLabelFileDispatcher.php',
185
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Manifest\\ManifestCustomPostType' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/CustomPostType.php',
186
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Metabox\\Ajax' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Metabox/Ajax.php',
187
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Order\\AddShippingMetabox' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Order/AddShippingMetabox.php',
188
+ 'FSVendor\\WPDesk\\FS\\Shipment\\RestApi\\OrderDataProvider' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvider.php',
189
+ 'FSVendor\\WPDesk\\FS\\Shipment\\RestApi\\OrderDataProviderDefault' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProviderDefault.php',
190
+ 'FSVendor\\WPDesk\\FS\\Shipment\\RestApi\\OrderDataProvidersCollection' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvidersCollection.php',
191
+ 'FSVendor\\WPDesk\\FS\\Shipment\\RestApi\\OrderDataProvidersFactory' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvidersFactory.php',
192
+ 'FSVendor\\WPDesk\\FS\\Shipment\\RestApi\\OrderResponseDataAppender' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderResponseDataAppender.php',
193
+ 'FSVendor\\WPDesk\\FS\\Shipment\\ShipmentFunctionality' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/ShipmentFunctionality.php',
194
+ 'FSVendor\\WPDesk\\FS\\Shipment\\Subscriptions\\SubscriptionsIntegration' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Subscriptions/SubscriptionsIntegration.php',
195
  'FSVendor\\WPDesk\\FS\\TableRate\\AbstractOptions' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/AbstractOptions.php',
196
  'FSVendor\\WPDesk\\FS\\TableRate\\BasedOnOptions' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/BasedOnOptions.php',
197
  'FSVendor\\WPDesk\\FS\\TableRate\\CalculationMethodOptions' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/CalculationMethodOptions.php',
423
  'FSVendor\\WPDesk_Basic_Requirement_Checker_Factory' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker_Factory.php',
424
  'FSVendor\\WPDesk_Basic_Requirement_Checker_With_Update_Disable' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker_With_Update_Disable.php',
425
  'FSVendor\\WPDesk_Buildable' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php',
426
+ 'FSVendor\\WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-cancel-shipment-exception.php',
427
+ 'FSVendor\\WPDesk_Flexible_Shipping_Get_Label_Exception' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-get-label-exception.php',
428
+ 'FSVendor\\WPDesk_Flexible_Shipping_Integration_Label_Builder' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/label/class-integration-label-builder.php',
429
+ 'FSVendor\\WPDesk_Flexible_Shipping_Label_Not_Available_Exception' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-label-not-available-exception.php',
430
+ 'FSVendor\\WPDesk_Flexible_Shipping_Labels_Builder' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/label/interface-labels-builder.php',
431
+ 'FSVendor\\WPDesk_Flexible_Shipping_Manifest' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/class-manifest.php',
432
+ 'FSVendor\\WPDesk_Flexible_Shipping_Manifest_FS' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/class-manifest-fs.php',
433
+ 'FSVendor\\WPDesk_Flexible_Shipping_Manifest_Interface' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/interface-manifest.php',
434
+ 'FSVendor\\WPDesk_Flexible_Shipping_Send_Shipment_Exception' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-send-shipment-exception.php',
435
+ 'FSVendor\\WPDesk_Flexible_Shipping_Shipment' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/shipment/class-shipment.php',
436
+ 'FSVendor\\WPDesk_Flexible_Shipping_Shipment_Interface' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/shipment/interface-shipment.php',
437
+ 'FSVendor\\WPDesk_Flexible_Shipping_Shipment_Plan_Exceeded_Exception' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-plan-exceeded-exception.php',
438
+ 'FSVendor\\WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-unable-to-create-tmp-file-exception.php',
439
+ 'FSVendor\\WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php',
440
  'FSVendor\\WPDesk_Has_Plugin_Info' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php',
441
  'FSVendor\\WPDesk_Helper_List_Table' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/Page/License/views/class-wpdesk-helper-list-table.php',
442
  'FSVendor\\WPDesk_Logger' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-logs/src/deprecated/wpdesk-logger.php',
514
  'WPDesk\\FS\\Onboarding\\TableRate\\PopupData' => __DIR__ . '/../..' . '/src/WPDesk/FS/Onboarding/TableRate/PopupData.php',
515
  'WPDesk\\FS\\Onboarding\\TableRate\\Tracker' => __DIR__ . '/../..' . '/src/WPDesk/FS/Onboarding/TableRate/Tracker.php',
516
  'WPDesk\\FS\\Plugin\\PluginActivation' => __DIR__ . '/../..' . '/src/WPDesk/FS/Plugin/PluginActivation.php',
517
+ 'WPDesk\\FS\\Rate\\RateNotice' => __DIR__ . '/../..' . '/classes/notices/abstract-rate.php',
518
+ 'WPDesk\\FS\\Rate\\RateNoticeImplementation' => __DIR__ . '/../..' . '/classes/notices/rate-notice-implementation.php',
519
+ 'WPDesk\\FS\\Rate\\RateNoticeInterface' => __DIR__ . '/../..' . '/classes/notices/interface-rate.php',
520
+ 'WPDesk\\FS\\Rate\\WPDesk_Flexible_Shipping_Rate_Notice' => __DIR__ . '/../..' . '/classes/notices/rate-notice.php',
521
  'WPDesk\\FS\\Shipment\\SubscriptionsIntegration' => __DIR__ . '/../..' . '/src/WPDesk/FS/Shipment/SubscriptionsIntegration.php',
522
  'WPDesk\\FS\\TableRate\\Beacon' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Beacon.php',
523
  'WPDesk\\FS\\TableRate\\Beacon\\Beacon' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Beacon/Beacon.php',
599
  'WPDesk\\FS\\TableRate\\RulesSettingsField' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/RulesSettingsField.php',
600
  'WPDesk\\FS\\TableRate\\RulesTableSettings' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/RulesTableSettings.php',
601
  'WPDesk\\FS\\TableRate\\ShippingMethodSingle' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ShippingMethodSingle.php',
 
602
  'WPDesk\\FS\\TableRate\\ShippingMethod\\BlockEditing\\BlockEditing' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ShippingMethod/BlockEditing/BlockEditing.php',
603
  'WPDesk\\FS\\TableRate\\ShippingMethod\\CommonMethodSettings' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php',
604
  'WPDesk\\FS\\TableRate\\ShippingMethod\\Convert\\ConvertAction' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ShippingMethod/Convert/ConvertAction.php',
646
  'WPDesk\\PluginBuilder\\Storage\\WordpressFilterStorage' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Storage/WordpressFilterStorage.php',
647
  'WPDesk_Buildable' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php',
648
  'WPDesk_Flexible_Shipping' => __DIR__ . '/../..' . '/classes/table-rate/shipping-method.php',
649
+ 'WPDesk_Flexible_Shipping_Admin_Notices' => __DIR__ . '/../..' . '/classes/notices/admin-notices.php',
 
650
  'WPDesk_Flexible_Shipping_Bulk_Actions' => __DIR__ . '/../..' . '/classes/table-rate/bulk-actions.php',
 
 
 
 
 
 
 
 
651
  'WPDesk_Flexible_Shipping_Logger_Downloader' => __DIR__ . '/../..' . '/classes/table-rate/logger/class-logger-downloader.php',
652
  'WPDesk_Flexible_Shipping_Logger_Factory' => __DIR__ . '/../..' . '/classes/table-rate/logger/class-logger-factory.php',
653
  'WPDesk_Flexible_Shipping_Logger_Settings' => __DIR__ . '/../..' . '/classes/table-rate/logger/class-logger-settings.php',
 
 
 
654
  'WPDesk_Flexible_Shipping_Method_Created_Tracker_Deactivation_Data' => __DIR__ . '/../..' . '/classes/tracker/class-method-created-tracker-deactivation-data.php',
655
  'WPDesk_Flexible_Shipping_Multicurrency' => __DIR__ . '/../..' . '/classes/table-rate/multicurrency.php',
656
  'WPDesk_Flexible_Shipping_Multilingual' => __DIR__ . '/../..' . '/classes/table-rate/multilingual.php',
657
  'WPDesk_Flexible_Shipping_Order_Item_Meta' => __DIR__ . '/../..' . '/classes/table-rate/order-item-meta.php',
 
 
 
 
 
 
658
  'WPDesk_Flexible_Shipping_Settings' => __DIR__ . '/../..' . '/classes/table-rate/flexible-shipping-settings.php',
 
659
  'WPDesk_Flexible_Shipping_Shipment_Ajax' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/metabox/ajax.php',
 
 
 
 
660
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Dimension' => __DIR__ . '/../..' . '/classes/table-rate/class-shortcode-unit-dimension.php',
661
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Weight' => __DIR__ . '/../..' . '/classes/table-rate/class-shortcode-unit-weight.php',
 
662
  'WPDesk_Flexible_Shipping_Tracker' => __DIR__ . '/../..' . '/classes/tracker/tracker.php',
 
 
663
  'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => __DIR__ . '/../..' . '/classes/table-rate/logger/class-woocommerce-context-logger.php',
664
  'WPDesk_Has_Plugin_Info' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php',
665
  'WPDesk_Plugin_Info' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Plugin_Info.php',
674
  public static function getInitializer(ClassLoader $loader)
675
  {
676
  return \Closure::bind(function () use ($loader) {
677
+ $loader->prefixLengthsPsr4 = ComposerStaticInite6a0a8b5b22ff56576b816fc78d3ff4e::$prefixLengthsPsr4;
678
+ $loader->prefixDirsPsr4 = ComposerStaticInite6a0a8b5b22ff56576b816fc78d3ff4e::$prefixDirsPsr4;
679
+ $loader->fallbackDirsPsr4 = ComposerStaticInite6a0a8b5b22ff56576b816fc78d3ff4e::$fallbackDirsPsr4;
680
+ $loader->classMap = ComposerStaticInite6a0a8b5b22ff56576b816fc78d3ff4e::$classMap;
681
 
682
  }, null, ClassLoader::class);
683
  }
vendor/composer/installed.json CHANGED
@@ -210,6 +210,44 @@
210
  "issues": "https://gitlab.com/api/v4/projects/22556334/issues"
211
  }
212
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  {
214
  "name": "wpdesk/wp-wpdesk-helper-override",
215
  "version": "1.1.0",
210
  "issues": "https://gitlab.com/api/v4/projects/22556334/issues"
211
  }
212
  },
213
+ {
214
+ "name": "wpdesk/wp-wpdesk-fs-shipment-interfaces",
215
+ "version": "1.0.3",
216
+ "version_normalized": "1.0.3.0",
217
+ "source": {
218
+ "type": "git",
219
+ "url": "https://gitlab.com/wpdesk/predators/library/wp-wpdesk-fs-shipment-interfaces.git",
220
+ "reference": "17a821b0cf72caf6ac6dc48e6239256e6ade34df"
221
+ },
222
+ "dist": {
223
+ "type": "zip",
224
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fpredators%2Flibrary%2Fwp-wpdesk-fs-shipment-interfaces/repository/archive.zip?sha=17a821b0cf72caf6ac6dc48e6239256e6ade34df",
225
+ "reference": "17a821b0cf72caf6ac6dc48e6239256e6ade34df",
226
+ "shasum": ""
227
+ },
228
+ "require": {
229
+ "php": ">=5.6"
230
+ },
231
+ "require-dev": {
232
+ "10up/wp_mock": "^0.2.0",
233
+ "phpunit/phpunit": "<7",
234
+ "squizlabs/php_codesniffer": "^3.4.2",
235
+ "wp-coding-standards/wpcs": "^0.14.1"
236
+ },
237
+ "time": "2021-07-01T08:42:48+00:00",
238
+ "type": "library",
239
+ "installation-source": "dist",
240
+ "notification-url": "https://packagist.org/downloads/",
241
+ "authors": [
242
+ {
243
+ "name": "Krzysiek",
244
+ "email": "krzysiek@wpdesk.pl"
245
+ }
246
+ ],
247
+ "support": {
248
+ "issues": "https://gitlab.com/api/v4/projects/27813970/issues"
249
+ }
250
+ },
251
  {
252
  "name": "wpdesk/wp-wpdesk-helper-override",
253
  "version": "1.1.0",
vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/.gitignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /vendor/
2
+ .idea
3
+ build-coverage
4
+ swagger
5
+ composer.lock
vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ ## [1.0.3] - 2021-06-30
2
+ ### Removed
3
+ - libraries
4
+
5
+ ## [1.0.2] - 2021-06-30
6
+ ### Removed
7
+ - REST API classes
8
+
9
+ ## [1.0.0] - 2021-06-30
10
+ ### Added
11
+ - Init
vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/apigen.neon ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ destination: docs
2
+ templateConfig: /app/theme-woocommerce/config.neon
3
+ extensions: [php]
4
+ source:
5
+ - classes
6
+ exclude:
7
+ - vendor
8
+ - tests
9
+ - languages
10
+
11
+ charset: [UTF-8]
12
+ main: Wordpress plugin
13
+ title: Plugin template more info
14
+ baseUrl: "/"
15
+
16
+ templateTheme: default
17
+ php: false
18
+ sourceCode: false
19
+ tree: true
20
+ deprecated: false
21
+ todo: false
22
+ download: false
23
+
24
+ accessLevels:
25
+ - public
26
+ - private
27
+ - protected
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-cancel-shipment-exception.php RENAMED
File without changes
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-get-label-exception.php RENAMED
File without changes
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-label-not-available-exception.php RENAMED
File without changes
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-send-shipment-exception.php RENAMED
File without changes
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-shipment-plan-exceeded-exception.php RENAMED
File without changes
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-shipment-unable-to-create-tmp-file-exception.php RENAMED
File without changes
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php RENAMED
File without changes
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/label/class-integration-label-builder.php RENAMED
File without changes
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/label/interface-labels-builder.php RENAMED
File without changes
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/manifest/class-manifest-fs.php RENAMED
@@ -1,8 +1,5 @@
1
  <?php
2
 
3
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
-
5
-
6
  class WPDesk_Flexible_Shipping_Manifest_FS extends WPDesk_Flexible_Shipping_Manifest implements WPDesk_Flexible_Shipping_Manifest_Interface {
7
 
8
  /**
1
  <?php
2
 
 
 
 
3
  class WPDesk_Flexible_Shipping_Manifest_FS extends WPDesk_Flexible_Shipping_Manifest implements WPDesk_Flexible_Shipping_Manifest_Interface {
4
 
5
  /**
vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/class-manifest.php ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class WPDesk_Flexible_Shipping_Shipment
5
+ */
6
+ abstract class WPDesk_Flexible_Shipping_Manifest {
7
+
8
+ /**
9
+ * @var int
10
+ */
11
+ private $id;
12
+
13
+ /**
14
+ * @var WP_Post
15
+ * Post assigned to manifest
16
+ */
17
+ private $post;
18
+
19
+ /**
20
+ * @var bool
21
+ * True if assigned post ich changed. Used when saving post
22
+ */
23
+ private $save_post = false;
24
+
25
+ /**
26
+ * @var null
27
+ * Holds old status when manifest status is changed
28
+ */
29
+ private $old_status = null;
30
+
31
+ /**
32
+ * @var bool
33
+ * True when status changing
34
+ */
35
+ private $status_changed = false;
36
+
37
+ /**
38
+ * @var array
39
+ * Manifest metadata (from postmeta table)
40
+ */
41
+ private $meta_data = array();
42
+
43
+ /**
44
+ * @var bool
45
+ * True when manifest metadata loaded
46
+ */
47
+ private $meta_data_loaded = false;
48
+
49
+ /**
50
+ * @var array
51
+ * Holds changed metadata keys. Used when saving manifest
52
+ */
53
+ private $meta_data_save_keys = array();
54
+
55
+ /**
56
+ * WPDesk_Flexible_Shipping_Manifest constructor.
57
+ *
58
+ * @param int|WPDesk_Flexible_Shipping_Manifest|WP_Post $manifest Manifest.
59
+ * @param WC_Order|null $order Order.
60
+ */
61
+ public function __construct( $manifest, $order = null ) {
62
+ if ( is_numeric( $manifest ) ) {
63
+ $this->id = absint( $manifest );
64
+ $this->post = get_post( $this->id );
65
+ } elseif ( $manifest instanceof WPDesk_Flexible_Shipping_Manifest ) {
66
+ $this->id = absint( $manifest->get_id() );
67
+ $this->post = $manifest->get_post();
68
+ } elseif ( isset( $manifest->ID ) ) {
69
+ $this->id = absint( $manifest->ID );
70
+ $this->post = $manifest;
71
+ }
72
+ $this->order = $order;
73
+ }
74
+
75
+ /**
76
+ * @return mixed
77
+ */
78
+ public function get_id() {
79
+ return $this->id;
80
+ }
81
+
82
+ /**
83
+ * @return mixed
84
+ */
85
+ public function get_post() {
86
+ return $this->post;
87
+ }
88
+
89
+ /**
90
+ * @param string $meta_key
91
+ * @param null|string $default
92
+ * @return array|string|null
93
+ */
94
+ public function get_meta( $meta_key = '', $default = null ) {
95
+ $this->load_meta_data();
96
+ if ( $meta_key == '' ) {
97
+ return $this->meta_data;
98
+ }
99
+ if ( isset( $this->meta_data[$meta_key] ) ) {
100
+ return maybe_unserialize( $this->meta_data[$meta_key][0] );
101
+ }
102
+ else {
103
+ return $default;
104
+ }
105
+ }
106
+
107
+ /**
108
+ * @param string $meta_key
109
+ * @param int|string|array|object|null $value
110
+ */
111
+ public function set_meta( $meta_key, $value ) {
112
+ $this->load_meta_data();
113
+ if ( !isset( $this->meta_data[$meta_key] ) ) {
114
+ $this->meta_data[$meta_key] = array();
115
+ }
116
+ $this->meta_data[$meta_key][0] = $value;
117
+ $this->meta_data_save_keys[$meta_key] = $meta_key;
118
+ }
119
+
120
+ /**
121
+ * @param string $meta_key
122
+ */
123
+ public function delete_meta( $meta_key ) {
124
+ unset( $this->meta_data[$meta_key] );
125
+ $this->meta_data_save_keys[$meta_key] = $meta_key;
126
+ }
127
+
128
+ /**
129
+ * Saves manifest data to database.
130
+ */
131
+ public function save() {
132
+ if ( $this->save_post ) {
133
+ wp_update_post($this->post);
134
+ $this->save_post = false;
135
+ }
136
+ foreach ( $this->meta_data_save_keys as $key ) {
137
+ if ( isset( $this->meta_data[$key] ) ) {
138
+ update_post_meta( $this->id, $key, $this->meta_data[$key][0] );
139
+ }
140
+ else {
141
+ delete_post_meta( $this->id, $key );
142
+ }
143
+ unset( $this->meta_data_save_keys[$key] );
144
+ }
145
+ if ( $this->status_changed ) {
146
+ do_action( 'flexible_shipping_manifest_status_updated', $this->old_status, $this->post->post_status, $this );
147
+ $this->status_changed = false;
148
+ $this->old_status = null;
149
+ }
150
+ }
151
+
152
+ /**
153
+ * Loads all meta data from postmeta
154
+ */
155
+ public function load_meta_data() {
156
+ if ( !$this->meta_data_loaded ) {
157
+ $this->meta_data = get_post_meta( $this->id );
158
+ $this->meta_data_loaded = true;
159
+ }
160
+ }
161
+
162
+ /**
163
+ * @return array|null
164
+ * Returns integration assigned to manifest
165
+ */
166
+ public function get_integration() {
167
+ return $this->get_meta( '_integration' );
168
+ }
169
+
170
+ /**
171
+ * @return string
172
+ */
173
+ public function get_status() {
174
+ return $this->post->post_status;
175
+ }
176
+
177
+ public function get_date() {
178
+ return $this->post->post_date;
179
+ }
180
+
181
+ /**
182
+ * @param string $new_status
183
+ */
184
+ public function update_status( $new_status ) {
185
+ $this->old_status = $this->post->post_status;
186
+ $this->post->post_status = $new_status;
187
+ $this->save_post = true;
188
+ $this->status_changed = true;
189
+ }
190
+
191
+
192
+ /**
193
+ * @param mixed $shipments
194
+ */
195
+ public function add_shipments( $shipments ) {
196
+ if ( !is_array( $shipments ) ) {
197
+ $shipments = array( $shipments );
198
+ }
199
+ $shipments_ids = $this->get_meta( '_shipments', array() );
200
+ foreach ( $shipments as $shipment ) {
201
+ /* @var WPDesk_Flexible_Shipping_Shipment $shipment */
202
+ $shipment->add_to_manifest( $this );
203
+ $shipment->save();
204
+ $shipments_ids[] = $shipment->get_id();
205
+ }
206
+ $this->set_meta( '_shipments', $shipments_ids );
207
+ $this->save();
208
+ }
209
+
210
+ }
{classes → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/manifest/functions.php RENAMED
File without changes
vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/interface-manifest.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ interface WPDesk_Flexible_Shipping_Manifest_Interface {
4
+
5
+ /**
6
+ * @return array
7
+ * Returns manifest data in array
8
+ * file_name => file name for manifest
9
+ * content => pdf content
10
+ */
11
+ public function get_manifest();
12
+
13
+ /**
14
+ * @return string
15
+ * Returns manifest number
16
+ */
17
+ public function get_number();
18
+
19
+ /**
20
+ * @return null
21
+ * Generates manifest (ie. in API)
22
+ */
23
+ public function generate();
24
+
25
+ /**
26
+ * @return null
27
+ * Cancels manifest (ie. in API)
28
+ */
29
+ public function cancel();
30
+
31
+ }
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/shipment/class-shipment.php RENAMED
File without changes
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/shipment/functions.php RENAMED
File without changes
{classes/wp-wpdesk-fs-shipment → vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes}/shipment/interface-shipment.php RENAMED
File without changes
vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/composer.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "wpdesk/wp-wpdesk-fs-shipment-interfaces",
3
+ "authors": [
4
+ {
5
+ "name": "Krzysiek",
6
+ "email": "krzysiek@wpdesk.pl"
7
+ }
8
+ ],
9
+ "config": {
10
+ "platform": {
11
+ "php": "5.6"
12
+ },
13
+ "sort-packages": true
14
+ },
15
+ "require": {
16
+ "php": ">=5.6"
17
+ },
18
+ "require-dev": {
19
+ "10up/wp_mock": "^0.2.0",
20
+ "phpunit/phpunit": "<7",
21
+ "squizlabs/php_codesniffer": "^3.4.2",
22
+ "wp-coding-standards/wpcs": "^0.14.1"
23
+ },
24
+ "autoload": {
25
+ },
26
+ "autoload-dev": {
27
+ },
28
+ "scripts": {
29
+ "phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
30
+ "phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
31
+ "phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
32
+ "phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage"
33
+ }
34
+ }
vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/phpunit-integration.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <phpunit bootstrap="tests/integration/bootstrap.php"
2
+ backupGlobals="false"
3
+ >
4
+ <testsuites>
5
+ <testsuite>
6
+ <directory prefix="Test" suffix=".php">./tests/integration</directory>
7
+ </testsuite>
8
+ </testsuites>
9
+
10
+ <filter>
11
+ <whitelist>
12
+ <directory suffix=".php">src</directory>
13
+ </whitelist>
14
+ </filter>
15
+
16
+ <logging>
17
+ <log type="junit" target="build-coverage/report.junit.xml"/>
18
+ <log type="coverage-html" target="build-coverage/coverage" charset="UTF-8" yui="true" highlight="true"/>
19
+ <log type="coverage-text" target="build-coverage/coverage.txt"/>
20
+ <log type="coverage-clover" target="build-coverage/clover.xml"/>
21
+ </logging>
22
+
23
+ <php>
24
+ <env name="WP_DEVELOP_DIR" value="/tmp/wordpress-develop"/>
25
+ <env name="WC_DEVELOP_DIR" value="/tmp/woocommerce"/>
26
+ </php>
27
+
28
+ </phpunit>
vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces/phpunit-unit.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <phpunit bootstrap="tests/unit/bootstrap.php">
2
+ <testsuites>
3
+ <testsuite>
4
+ <directory prefix="Test" suffix=".php">./tests/unit/</directory>
5
+ </testsuite>
6
+ </testsuites>
7
+
8
+ <filter>
9
+ <whitelist>
10
+ <directory suffix=".php">src</directory>
11
+ </whitelist>
12
+ </filter>
13
+
14
+ <logging>
15
+ <log type="junit" target="build-coverage/report.junit.xml"/>
16
+ <log type="coverage-html" target="build-coverage/coverage" charset="UTF-8" yui="true" highlight="true"/>
17
+ <log type="coverage-text" target="build-coverage/coverage.txt"/>
18
+ <log type="coverage-clover" target="build-coverage/clover.xml"/>
19
+ </logging>
20
+
21
+ </phpunit>
vendor_prefixed/wpdesk/wp-code-sniffer/composer.json CHANGED
@@ -11,7 +11,7 @@
11
  "homepage": "https:\/\/gitlab.com\/wpdesk\/wp-code-sniffer",
12
  "type": "phpcodesniffer-standard",
13
  "prefer-stable": true,
14
- "version": "1.2.1",
15
  "authors": [
16
  {
17
  "name": "grola",
11
  "homepage": "https:\/\/gitlab.com\/wpdesk\/wp-code-sniffer",
12
  "type": "phpcodesniffer-standard",
13
  "prefer-stable": true,
14
+ "version": "1.2.3",
15
  "authors": [
16
  {
17
  "name": "grola",
vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/CommandProvider.php CHANGED
@@ -5,6 +5,7 @@ namespace FSVendor\WPDesk\Composer\Codeception;
5
  use FSVendor\WPDesk\Composer\Codeception\Commands\CreateCodeceptionTests;
6
  use FSVendor\WPDesk\Composer\Codeception\Commands\PrepareCodeceptionDb;
7
  use FSVendor\WPDesk\Composer\Codeception\Commands\PrepareLocalCodeceptionTests;
 
8
  use FSVendor\WPDesk\Composer\Codeception\Commands\PrepareWordpressForCodeception;
9
  use FSVendor\WPDesk\Composer\Codeception\Commands\RunCodeceptionTests;
10
  use FSVendor\WPDesk\Composer\Codeception\Commands\RunLocalCodeceptionTests;
@@ -15,6 +16,6 @@ class CommandProvider implements \FSVendor\Composer\Plugin\Capability\CommandPro
15
  {
16
  public function getCommands()
17
  {
18
- return [new \FSVendor\WPDesk\Composer\Codeception\Commands\CreateCodeceptionTests(), new \FSVendor\WPDesk\Composer\Codeception\Commands\RunCodeceptionTests(), new \FSVendor\WPDesk\Composer\Codeception\Commands\RunLocalCodeceptionTests(), new \FSVendor\WPDesk\Composer\Codeception\Commands\PrepareCodeceptionDb(), new \FSVendor\WPDesk\Composer\Codeception\Commands\PrepareWordpressForCodeception(), new \FSVendor\WPDesk\Composer\Codeception\Commands\PrepareLocalCodeceptionTests()];
19
  }
20
  }
5
  use FSVendor\WPDesk\Composer\Codeception\Commands\CreateCodeceptionTests;
6
  use FSVendor\WPDesk\Composer\Codeception\Commands\PrepareCodeceptionDb;
7
  use FSVendor\WPDesk\Composer\Codeception\Commands\PrepareLocalCodeceptionTests;
8
+ use FSVendor\WPDesk\Composer\Codeception\Commands\PrepareParallelCodeceptionTests;
9
  use FSVendor\WPDesk\Composer\Codeception\Commands\PrepareWordpressForCodeception;
10
  use FSVendor\WPDesk\Composer\Codeception\Commands\RunCodeceptionTests;
11
  use FSVendor\WPDesk\Composer\Codeception\Commands\RunLocalCodeceptionTests;
16
  {
17
  public function getCommands()
18
  {
19
+ return [new \FSVendor\WPDesk\Composer\Codeception\Commands\CreateCodeceptionTests(), new \FSVendor\WPDesk\Composer\Codeception\Commands\RunCodeceptionTests(), new \FSVendor\WPDesk\Composer\Codeception\Commands\RunLocalCodeceptionTests(), new \FSVendor\WPDesk\Composer\Codeception\Commands\PrepareCodeceptionDb(), new \FSVendor\WPDesk\Composer\Codeception\Commands\PrepareWordpressForCodeception(), new \FSVendor\WPDesk\Composer\Codeception\Commands\PrepareLocalCodeceptionTests(), new \FSVendor\WPDesk\Composer\Codeception\Commands\PrepareParallelCodeceptionTests()];
20
  }
21
  }
vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareParallelCodeceptionTests.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor\WPDesk\Composer\Codeception\Commands;
4
+
5
+ use FSVendor\Symfony\Component\Console\Input\InputArgument;
6
+ use FSVendor\Symfony\Component\Console\Input\InputInterface;
7
+ use FSVendor\Symfony\Component\Console\Output\OutputInterface;
8
+ use FSVendor\Symfony\Component\Yaml\Exception\ParseException;
9
+ use FSVendor\Symfony\Component\Yaml\Yaml;
10
+ /**
11
+ * Split test to multiple directories for parallel running in CI.
12
+ *
13
+ * @package WPDesk\Composer\Codeception\Commands
14
+ */
15
+ class PrepareParallelCodeceptionTests extends \FSVendor\WPDesk\Composer\Codeception\Commands\BaseCommand
16
+ {
17
+ const NUMBER_OF_JOBS = 'number_of_jobs';
18
+ /**
19
+ * Configure command.
20
+ */
21
+ protected function configure()
22
+ {
23
+ parent::configure();
24
+ $this->setName('prepare-parallel-codeception-tests')->setDescription('Prepare parallel codeception tests.')->setDefinition(array(new \FSVendor\Symfony\Component\Console\Input\InputArgument(self::NUMBER_OF_JOBS, \FSVendor\Symfony\Component\Console\Input\InputArgument::OPTIONAL, 'Number of jobs.', '4')));
25
+ }
26
+ /**
27
+ * Execute command.
28
+ *
29
+ * @param InputInterface $input
30
+ * @param OutputInterface $output
31
+ * @return void
32
+ */
33
+ protected function execute(\FSVendor\Symfony\Component\Console\Input\InputInterface $input, \FSVendor\Symfony\Component\Console\Output\OutputInterface $output)
34
+ {
35
+ $numberOfJobs = (int) $input->getArgument(self::NUMBER_OF_JOBS);
36
+ $acceptanceTestsDir = \getcwd() . '/tests/codeception/tests/acceptance';
37
+ for ($i = 1; $i <= $numberOfJobs; $i++) {
38
+ $parallelDir = $acceptanceTestsDir . '/' . $i;
39
+ if (!\file_exists($parallelDir)) {
40
+ \mkdir($parallelDir);
41
+ }
42
+ }
43
+ $currentIndex = 1;
44
+ $files = \scandir($acceptanceTestsDir);
45
+ foreach ($files as $fileName) {
46
+ $fileFullPath = $acceptanceTestsDir . '/' . $fileName;
47
+ if (!\is_dir($fileFullPath)) {
48
+ $targetPath = $acceptanceTestsDir . '/' . $currentIndex . '/' . $fileName;
49
+ \copy($fileFullPath, $targetPath);
50
+ $currentIndex++;
51
+ if ($currentIndex > $numberOfJobs) {
52
+ $currentIndex = 1;
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-cancel-shipment-exception.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * Class WPDesk_Flexible_Shipping_Send_Shipment_Exception
7
+ */
8
+ class WPDesk_Flexible_Shipping_Cancel_Shipment_Exception extends \RuntimeException
9
+ {
10
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-get-label-exception.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * Class WPDesk_Flexible_Shipping_Send_Shipment_Exception
7
+ */
8
+ class WPDesk_Flexible_Shipping_Get_Label_Exception extends \RuntimeException
9
+ {
10
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-label-not-available-exception.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * Class WPDesk_Flexible_Shipping_Send_Shipment_Exception
7
+ */
8
+ class WPDesk_Flexible_Shipping_Label_Not_Available_Exception extends \RuntimeException
9
+ {
10
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-send-shipment-exception.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * Class WPDesk_Flexible_Shipping_Send_Shipment_Exception
7
+ */
8
+ class WPDesk_Flexible_Shipping_Send_Shipment_Exception extends \RuntimeException
9
+ {
10
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-plan-exceeded-exception.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * Class WPDesk_Flexible_Shipping_Send_Shipment_Exception
7
+ */
8
+ class WPDesk_Flexible_Shipping_Shipment_Plan_Exceeded_Exception extends \RuntimeException
9
+ {
10
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-unable-to-create-tmp-file-exception.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * .
7
+ */
8
+ class WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception extends \RuntimeException
9
+ {
10
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * .
7
+ */
8
+ class WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception extends \RuntimeException
9
+ {
10
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/label/class-integration-label-builder.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * Labels builder.
7
+ *
8
+ * @package Flexible Shipping
9
+ */
10
+ /**
11
+ * Abstract for labels builders.
12
+ */
13
+ abstract class WPDesk_Flexible_Shipping_Integration_Label_Builder implements \FSVendor\WPDesk_Flexible_Shipping_Labels_Builder
14
+ {
15
+ /**
16
+ * Integration ID.
17
+ *
18
+ * @var string
19
+ */
20
+ private $integration_id;
21
+ /**
22
+ * Shipments.
23
+ *
24
+ * @var WPDesk_Flexible_Shipping_Shipment_Interface[]
25
+ */
26
+ protected $shipments = array();
27
+ /**
28
+ * .
29
+ *
30
+ * @param string $integration_id .
31
+ */
32
+ public function __construct($integration_id)
33
+ {
34
+ $this->integration_id = $integration_id;
35
+ }
36
+ /**
37
+ * Get integration id.
38
+ *
39
+ * @return string
40
+ */
41
+ public function get_integration_id()
42
+ {
43
+ return $this->integration_id;
44
+ }
45
+ /**
46
+ * .
47
+ *
48
+ * @param WPDesk_Flexible_Shipping_Shipment $shipment .
49
+ */
50
+ public function add_shipment(\FSVendor\WPDesk_Flexible_Shipping_Shipment $shipment)
51
+ {
52
+ $this->shipments[] = $shipment;
53
+ }
54
+ /**
55
+ * Get labels for shipments.
56
+ *
57
+ * @return array
58
+ */
59
+ public abstract function get_labels_for_shipments();
60
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/label/interface-labels-builder.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * Label builder.
7
+ *
8
+ * @package Flexible Shipping
9
+ */
10
+ /**
11
+ * Interface for labels builder.
12
+ */
13
+ interface WPDesk_Flexible_Shipping_Labels_Builder
14
+ {
15
+ /**
16
+ * Get integration id.
17
+ *
18
+ * @return string
19
+ */
20
+ public function get_integration_id();
21
+ /**
22
+ * Get labels for shipments.
23
+ *
24
+ * @return array
25
+ * Returns array of labels. Each label is array with fields:
26
+ * content: label file content (ie. pdf file content) as string
27
+ * file_name: label file name
28
+ */
29
+ public function get_labels_for_shipments();
30
+ /**
31
+ * .
32
+ *
33
+ * @param WPDesk_Flexible_Shipping_Shipment $shipment .
34
+ */
35
+ public function add_shipment(\FSVendor\WPDesk_Flexible_Shipping_Shipment $shipment);
36
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/class-manifest-fs.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ class WPDesk_Flexible_Shipping_Manifest_FS extends \FSVendor\WPDesk_Flexible_Shipping_Manifest implements \FSVendor\WPDesk_Flexible_Shipping_Manifest_Interface
6
+ {
7
+ /**
8
+ * @return array
9
+ * Returns manifest data in array
10
+ * file_name => file name for manifest
11
+ * content => pdf content
12
+ */
13
+ public function get_manifest()
14
+ {
15
+ return null;
16
+ }
17
+ /**
18
+ * @return string
19
+ * Returns manifest number
20
+ */
21
+ public function get_number()
22
+ {
23
+ return null;
24
+ }
25
+ /**
26
+ * @return null
27
+ * Generates manifest (ie. in API)
28
+ */
29
+ public function generate()
30
+ {
31
+ return null;
32
+ }
33
+ /**
34
+ * @return null
35
+ * Cancels manifest (ie. in API)
36
+ */
37
+ public function cancel()
38
+ {
39
+ return null;
40
+ }
41
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/class-manifest.php ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * Class WPDesk_Flexible_Shipping_Shipment
7
+ */
8
+ abstract class WPDesk_Flexible_Shipping_Manifest
9
+ {
10
+ /**
11
+ * @var int
12
+ */
13
+ private $id;
14
+ /**
15
+ * @var WP_Post
16
+ * Post assigned to manifest
17
+ */
18
+ private $post;
19
+ /**
20
+ * @var bool
21
+ * True if assigned post ich changed. Used when saving post
22
+ */
23
+ private $save_post = \false;
24
+ /**
25
+ * @var null
26
+ * Holds old status when manifest status is changed
27
+ */
28
+ private $old_status = null;
29
+ /**
30
+ * @var bool
31
+ * True when status changing
32
+ */
33
+ private $status_changed = \false;
34
+ /**
35
+ * @var array
36
+ * Manifest metadata (from postmeta table)
37
+ */
38
+ private $meta_data = array();
39
+ /**
40
+ * @var bool
41
+ * True when manifest metadata loaded
42
+ */
43
+ private $meta_data_loaded = \false;
44
+ /**
45
+ * @var array
46
+ * Holds changed metadata keys. Used when saving manifest
47
+ */
48
+ private $meta_data_save_keys = array();
49
+ /**
50
+ * WPDesk_Flexible_Shipping_Manifest constructor.
51
+ *
52
+ * @param int|WPDesk_Flexible_Shipping_Manifest|WP_Post $manifest Manifest.
53
+ * @param WC_Order|null $order Order.
54
+ */
55
+ public function __construct($manifest, $order = null)
56
+ {
57
+ if (\is_numeric($manifest)) {
58
+ $this->id = \absint($manifest);
59
+ $this->post = \get_post($this->id);
60
+ } elseif ($manifest instanceof \FSVendor\WPDesk_Flexible_Shipping_Manifest) {
61
+ $this->id = \absint($manifest->get_id());
62
+ $this->post = $manifest->get_post();
63
+ } elseif (isset($manifest->ID)) {
64
+ $this->id = \absint($manifest->ID);
65
+ $this->post = $manifest;
66
+ }
67
+ $this->order = $order;
68
+ }
69
+ /**
70
+ * @return mixed
71
+ */
72
+ public function get_id()
73
+ {
74
+ return $this->id;
75
+ }
76
+ /**
77
+ * @return mixed
78
+ */
79
+ public function get_post()
80
+ {
81
+ return $this->post;
82
+ }
83
+ /**
84
+ * @param string $meta_key
85
+ * @param null|string $default
86
+ * @return array|string|null
87
+ */
88
+ public function get_meta($meta_key = '', $default = null)
89
+ {
90
+ $this->load_meta_data();
91
+ if ($meta_key == '') {
92
+ return $this->meta_data;
93
+ }
94
+ if (isset($this->meta_data[$meta_key])) {
95
+ return \maybe_unserialize($this->meta_data[$meta_key][0]);
96
+ } else {
97
+ return $default;
98
+ }
99
+ }
100
+ /**
101
+ * @param string $meta_key
102
+ * @param int|string|array|object|null $value
103
+ */
104
+ public function set_meta($meta_key, $value)
105
+ {
106
+ $this->load_meta_data();
107
+ if (!isset($this->meta_data[$meta_key])) {
108
+ $this->meta_data[$meta_key] = array();
109
+ }
110
+ $this->meta_data[$meta_key][0] = $value;
111
+ $this->meta_data_save_keys[$meta_key] = $meta_key;
112
+ }
113
+ /**
114
+ * @param string $meta_key
115
+ */
116
+ public function delete_meta($meta_key)
117
+ {
118
+ unset($this->meta_data[$meta_key]);
119
+ $this->meta_data_save_keys[$meta_key] = $meta_key;
120
+ }
121
+ /**
122
+ * Saves manifest data to database.
123
+ */
124
+ public function save()
125
+ {
126
+ if ($this->save_post) {
127
+ \wp_update_post($this->post);
128
+ $this->save_post = \false;
129
+ }
130
+ foreach ($this->meta_data_save_keys as $key) {
131
+ if (isset($this->meta_data[$key])) {
132
+ \update_post_meta($this->id, $key, $this->meta_data[$key][0]);
133
+ } else {
134
+ \delete_post_meta($this->id, $key);
135
+ }
136
+ unset($this->meta_data_save_keys[$key]);
137
+ }
138
+ if ($this->status_changed) {
139
+ \do_action('flexible_shipping_manifest_status_updated', $this->old_status, $this->post->post_status, $this);
140
+ $this->status_changed = \false;
141
+ $this->old_status = null;
142
+ }
143
+ }
144
+ /**
145
+ * Loads all meta data from postmeta
146
+ */
147
+ public function load_meta_data()
148
+ {
149
+ if (!$this->meta_data_loaded) {
150
+ $this->meta_data = \get_post_meta($this->id);
151
+ $this->meta_data_loaded = \true;
152
+ }
153
+ }
154
+ /**
155
+ * @return array|null
156
+ * Returns integration assigned to manifest
157
+ */
158
+ public function get_integration()
159
+ {
160
+ return $this->get_meta('_integration');
161
+ }
162
+ /**
163
+ * @return string
164
+ */
165
+ public function get_status()
166
+ {
167
+ return $this->post->post_status;
168
+ }
169
+ public function get_date()
170
+ {
171
+ return $this->post->post_date;
172
+ }
173
+ /**
174
+ * @param string $new_status
175
+ */
176
+ public function update_status($new_status)
177
+ {
178
+ $this->old_status = $this->post->post_status;
179
+ $this->post->post_status = $new_status;
180
+ $this->save_post = \true;
181
+ $this->status_changed = \true;
182
+ }
183
+ /**
184
+ * @param mixed $shipments
185
+ */
186
+ public function add_shipments($shipments)
187
+ {
188
+ if (!\is_array($shipments)) {
189
+ $shipments = array($shipments);
190
+ }
191
+ $shipments_ids = $this->get_meta('_shipments', array());
192
+ foreach ($shipments as $shipment) {
193
+ /* @var WPDesk_Flexible_Shipping_Shipment $shipment */
194
+ $shipment->add_to_manifest($this);
195
+ $shipment->save();
196
+ $shipments_ids[] = $shipment->get_id();
197
+ }
198
+ $this->set_meta('_shipments', $shipments_ids);
199
+ $this->save();
200
+ }
201
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/functions.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ if (!\defined('ABSPATH')) {
6
+ exit;
7
+ }
8
+ // Exit if accessed directly
9
+ function fs_manifest_integration_exists($integration)
10
+ {
11
+ $class_name = 'WPDesk_Flexible_Shipping_Manifest' . '_' . $integration;
12
+ if (\class_exists($class_name)) {
13
+ return \true;
14
+ }
15
+ return \false;
16
+ }
17
+ function fs_create_manifest($integration)
18
+ {
19
+ $post_title = \sprintf(\__('Shipping manifest %s, %s', 'flexible-shipping'), $integration, \date_i18n(\get_option('date_format')));
20
+ $post_title = \apply_filters('flexible_shipping_manifest_post_title_' . $integration, $post_title);
21
+ $manifest_post = array('post_title' => $post_title, 'post_type' => 'shipping_manifest', 'post_status' => 'publish');
22
+ $manifest_id = \wp_insert_post($manifest_post);
23
+ \update_post_meta($manifest_id, '_integration', $integration);
24
+ return \FSVendor\fs_get_manifest($manifest_id);
25
+ }
26
+ /**
27
+ * @param $manifest_id
28
+ * @return WPDesk_Flexible_Shipping_Manifest
29
+ */
30
+ function fs_get_manifest($manifest_id)
31
+ {
32
+ $integration = \get_post_meta($manifest_id, '_integration', \true);
33
+ $class_name = 'WPDesk_Flexible_Shipping_Manifest';
34
+ if (\class_exists($class_name . '_' . $integration)) {
35
+ $class_name = $class_name . '_' . $integration;
36
+ } else {
37
+ $class_name = 'WPDesk_Flexible_Shipping_Manifest_FS';
38
+ }
39
+ return new $class_name($manifest_id);
40
+ }
41
+ function fs_delete_manifest($manifest)
42
+ {
43
+ $shipments_posts = \get_posts(array('posts_per_page' => -1, 'post_type' => 'shipment', 'post_status' => 'any', 'meta_key' => '_manifest', 'meta_value' => $manifest->get_id()));
44
+ foreach ($shipments_posts as $shipment_post) {
45
+ $shipment = \FSVendor\fs_get_shipment($shipment_post->ID);
46
+ $shipment->delete_meta('_manifest');
47
+ $shipment->update_status('fs-confirmed');
48
+ $shipment->save();
49
+ }
50
+ $manifest->set_meta('_shipments', array());
51
+ $manifest->update_status('trash');
52
+ $manifest->save();
53
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/manifest/interface-manifest.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ interface WPDesk_Flexible_Shipping_Manifest_Interface
6
+ {
7
+ /**
8
+ * @return array
9
+ * Returns manifest data in array
10
+ * file_name => file name for manifest
11
+ * content => pdf content
12
+ */
13
+ public function get_manifest();
14
+ /**
15
+ * @return string
16
+ * Returns manifest number
17
+ */
18
+ public function get_number();
19
+ /**
20
+ * @return null
21
+ * Generates manifest (ie. in API)
22
+ */
23
+ public function generate();
24
+ /**
25
+ * @return null
26
+ * Cancels manifest (ie. in API)
27
+ */
28
+ public function cancel();
29
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/shipment/class-shipment.php ADDED
@@ -0,0 +1,482 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * Shipment.
7
+ *
8
+ * @package Flexible Shipping
9
+ */
10
+ use Psr\Log\LoggerInterface;
11
+ /**
12
+ * Can handle shipment functionality.
13
+ */
14
+ abstract class WPDesk_Flexible_Shipping_Shipment
15
+ {
16
+ const STATUS_FS_NEW = 'fs-new';
17
+ const STATUS_FS_CREATED = 'fs-created';
18
+ const STATUS_FS_CONFIRMED = 'fs-confirmed';
19
+ const STATUS_FS_FAILED = 'fs-failed';
20
+ const STATUS_FS_MANIFEST = 'fs-manifest';
21
+ const CREATED_VIA = 'created_via';
22
+ const SENT_VIA_METABOX = 'metabox';
23
+ const SENT_VIA_BULK = 'bulk';
24
+ const SENT_VIA_AUTO = 'auto';
25
+ const SENT_VIA = '_sent_via';
26
+ const NOT_SET = 'not_set';
27
+ const LABEL_ACTION_DOWNLOAD = 'download';
28
+ const LABEL_ACTION_OPEN = 'open';
29
+ /**
30
+ * Logger provided by Flexible Shipping plugin.
31
+ *
32
+ * @var LoggerInterface
33
+ */
34
+ protected static $fs_logger;
35
+ /**
36
+ * @var int
37
+ */
38
+ private $id;
39
+ /**
40
+ * @var WP_Post
41
+ * Post assigned to shipment
42
+ */
43
+ private $post;
44
+ /**
45
+ * @var null|WC_Order
46
+ * WC_Order assigned to shipment
47
+ */
48
+ private $order = null;
49
+ /**
50
+ * @var bool
51
+ * True if assigned post ich changed. Used when saving post
52
+ */
53
+ private $save_post = \false;
54
+ /**
55
+ * @var null
56
+ * Holds old status when shipment status is changed
57
+ */
58
+ private $old_status = null;
59
+ /**
60
+ * @var bool
61
+ * True when status changing
62
+ */
63
+ private $status_changed = \false;
64
+ /**
65
+ * @var array
66
+ * Shipment metadata (from postmeta table)
67
+ */
68
+ private $meta_data = array();
69
+ /**
70
+ * @var bool
71
+ * True when shipment metadata loaded
72
+ */
73
+ private $meta_data_loaded = \false;
74
+ /**
75
+ * @var array
76
+ * Holds changed metadata keys. Used when saving shipment
77
+ */
78
+ private $meta_data_save_keys = array();
79
+ /**
80
+ * @var string
81
+ * Context for order metabox
82
+ */
83
+ private $order_metabox_context = 'side';
84
+ /**
85
+ * WPDesk_Flexible_Shipping_Shipment constructor.
86
+ *
87
+ * @param int|WP_Post|WPDesk_Flexible_Shipping_Shipment $shipment Shipment or shipment ID.
88
+ * @param WC_Order|null $order Order.
89
+ */
90
+ public function __construct($shipment, $order = null)
91
+ {
92
+ if (\is_numeric($shipment)) {
93
+ $this->id = \absint($shipment);
94
+ $this->post = \get_post($this->id);
95
+ } elseif ($shipment instanceof \FSVendor\WPDesk_Flexible_Shipping_Shipment) {
96
+ $this->id = \absint($shipment->get_id());
97
+ $this->post = $shipment->get_post();
98
+ } elseif (isset($shipment->ID)) {
99
+ $this->id = \absint($shipment->ID);
100
+ $this->post = $shipment;
101
+ }
102
+ $this->order = $order;
103
+ }
104
+ /**
105
+ * @return mixed
106
+ */
107
+ public function get_id()
108
+ {
109
+ return $this->id;
110
+ }
111
+ /**
112
+ * @return mixed
113
+ */
114
+ public function get_post()
115
+ {
116
+ return $this->post;
117
+ }
118
+ /**
119
+ * Set logger. This logger is set by Flexible Shipping plugin.
120
+ *
121
+ * @param LoggerInterface $fs_logger .
122
+ */
123
+ public static function set_fs_logger(\Psr\Log\LoggerInterface $fs_logger)
124
+ {
125
+ static::$fs_logger = $fs_logger;
126
+ }
127
+ /**
128
+ * @return string
129
+ */
130
+ public function get_order_metabox_context()
131
+ {
132
+ return $this->order_metabox_context;
133
+ }
134
+ /**
135
+ * @param string $order_metabox_context .
136
+ */
137
+ public function set_order_metabox_context($order_metabox_context)
138
+ {
139
+ $this->order_metabox_context = $order_metabox_context;
140
+ }
141
+ /**
142
+ * @param string $meta_key .
143
+ */
144
+ public function delete_meta($meta_key)
145
+ {
146
+ unset($this->meta_data[$meta_key]);
147
+ $this->meta_data_save_keys[$meta_key] = $meta_key;
148
+ }
149
+ /**
150
+ * Saves shipment data to database.
151
+ */
152
+ public function save()
153
+ {
154
+ if ($this->save_post) {
155
+ \wp_update_post($this->post);
156
+ $this->fs_log('debug', 'Shipment post saved', array('post' => $this->post));
157
+ $this->save_post = \false;
158
+ }
159
+ foreach ($this->meta_data_save_keys as $key) {
160
+ if (isset($this->meta_data[$key])) {
161
+ \update_post_meta($this->id, $key, $this->meta_data[$key][0]);
162
+ $this->fs_log('debug', 'Shipment meta data saved', array('key' => $key, 'value' => $this->meta_data[$key][0]));
163
+ } else {
164
+ \delete_post_meta($this->id, $key);
165
+ $this->fs_log('debug', 'Shipment meta data deleted', array('key' => $key));
166
+ }
167
+ unset($this->meta_data_save_keys[$key]);
168
+ }
169
+ if ($this->status_changed) {
170
+ \do_action('flexible_shipping_shipment_status_updated', $this->old_status, $this->post->post_status, $this);
171
+ $this->status_changed = \false;
172
+ $this->old_status = null;
173
+ }
174
+ }
175
+ /**
176
+ * Writes log message to log provided by Flexible Shipping plugin.
177
+ *
178
+ * @param mixed $level .
179
+ * @param string $message .
180
+ * @param array $context .
181
+ */
182
+ private function fs_log($level, $message, array $context = array())
183
+ {
184
+ if (static::$fs_logger) {
185
+ $context['order_id'] = $this->get_order()->get_id();
186
+ $context['shipment_id'] = $this->get_id();
187
+ $current_user = \wp_get_current_user();
188
+ $context['user_id'] = $current_user->ID;
189
+ if (isset($_SERVER['REQUEST_URI'])) {
190
+ $context['request_uri'] = \sanitize_text_field(\wp_unslash($_SERVER['REQUEST_URI']));
191
+ }
192
+ static::$fs_logger->log($level, $message, $context);
193
+ }
194
+ }
195
+ /**
196
+ * @return WC_Order
197
+ */
198
+ public function get_order()
199
+ {
200
+ if (null === $this->order) {
201
+ $this->order = \wc_get_order($this->post->post_parent);
202
+ }
203
+ return $this->order;
204
+ }
205
+ /**
206
+ * @return string|null
207
+ * Returns integration assigned to shipment
208
+ */
209
+ public function get_integration()
210
+ {
211
+ return $this->get_meta('_integration');
212
+ }
213
+ /**
214
+ * @param string $meta_key .
215
+ * @param null|string $default .
216
+ *
217
+ * @return array|string|null
218
+ */
219
+ public function get_meta($meta_key = '', $default = null)
220
+ {
221
+ $this->load_meta_data();
222
+ if ('' === $meta_key) {
223
+ return $this->meta_data;
224
+ }
225
+ if (isset($this->meta_data[$meta_key])) {
226
+ return \maybe_unserialize($this->meta_data[$meta_key][0]);
227
+ } else {
228
+ return $default;
229
+ }
230
+ return null;
231
+ }
232
+ /**
233
+ * @return array
234
+ */
235
+ public function get_meta_data()
236
+ {
237
+ $this->load_meta_data();
238
+ return $this->meta_data;
239
+ }
240
+ /**
241
+ * Loads all meta data from postmeta
242
+ */
243
+ public function load_meta_data()
244
+ {
245
+ if (!$this->meta_data_loaded) {
246
+ $this->meta_data = \get_post_meta($this->id);
247
+ $this->meta_data_loaded = \true;
248
+ }
249
+ }
250
+ /**
251
+ * @return string
252
+ * Returns URL for admin metabox for this shipment
253
+ */
254
+ public function get_order_metabox_url()
255
+ {
256
+ return \admin_url('post.php?post=' . $this->get_order_id() . '&action=edit#shipment_meta_box_' . $this->get_id());
257
+ }
258
+ /**
259
+ * @return int
260
+ */
261
+ public function get_order_id()
262
+ {
263
+ return $this->post->post_parent;
264
+ }
265
+ /**
266
+ * @return string
267
+ */
268
+ public function get_status_for_shipping_column()
269
+ {
270
+ $statuses = array(self::STATUS_FS_NEW => 'new', self::STATUS_FS_CREATED => 'created', self::STATUS_FS_CONFIRMED => 'confirmed', self::STATUS_FS_FAILED => 'error', self::STATUS_FS_MANIFEST => 'manifest');
271
+ return $statuses[$this->get_status()];
272
+ }
273
+ /**
274
+ * @return string
275
+ */
276
+ public function get_status()
277
+ {
278
+ return $this->post->post_status;
279
+ }
280
+ /**
281
+ * @return null|string
282
+ * Returns URL for label
283
+ */
284
+ public function get_label_url()
285
+ {
286
+ if (\in_array($this->get_status(), array(self::STATUS_FS_NEW, self::STATUS_FS_CREATED, self::STATUS_FS_FAILED))) {
287
+ return null;
288
+ }
289
+ $label_url_args = array('action' => 'flexible_shipping_get_label', 'label_action' => $this->get_label_action(), 'shipment_id' => $this->get_id());
290
+ $label_url = \add_query_arg($label_url_args, \admin_url('admin-post.php'));
291
+ return \wp_nonce_url($label_url, 'flexible_shipping_get_label');
292
+ }
293
+ /**
294
+ * Should open label?
295
+ * By default label should be downloaded. Integration can override this method when label should be opened in browser.
296
+ *
297
+ * @return bool
298
+ */
299
+ protected function get_label_action()
300
+ {
301
+ return self::LABEL_ACTION_DOWNLOAD;
302
+ }
303
+ /**
304
+ * @param string $new_status .
305
+ */
306
+ public function update_status($new_status)
307
+ {
308
+ $this->old_status = $this->post->post_status;
309
+ $this->post->post_status = $new_status;
310
+ $this->save_post = \true;
311
+ $this->status_changed = \true;
312
+ }
313
+ /**
314
+ * @param WPDesk_Flexible_Shipping_Manifest $manifest .
315
+ */
316
+ public function add_to_manifest(\FSVendor\WPDesk_Flexible_Shipping_Manifest $manifest)
317
+ {
318
+ $this->set_meta('_manifest', $manifest->get_id());
319
+ }
320
+ /**
321
+ * @param string $meta_key .
322
+ * @param int|string|array|object|null $value .
323
+ */
324
+ public function set_meta($meta_key, $value)
325
+ {
326
+ $this->load_meta_data();
327
+ if (!isset($this->meta_data[$meta_key])) {
328
+ $this->meta_data[$meta_key] = array();
329
+ }
330
+ $this->meta_data[$meta_key][0] = $value;
331
+ $this->meta_data_save_keys[$meta_key] = $meta_key;
332
+ }
333
+ /**
334
+ * @return bool
335
+ */
336
+ public function label_avaliable()
337
+ {
338
+ if (\in_array($this->get_status(), array(self::STATUS_FS_CONFIRMED, self::STATUS_FS_MANIFEST))) {
339
+ return \true;
340
+ }
341
+ return \false;
342
+ }
343
+ /**
344
+ * Displays shipping column in orders list view.
345
+ * Must be overwritten!
346
+ */
347
+ public function shipping_column()
348
+ {
349
+ echo \esc_html(\__('Please override shipping_column method!', 'flexible-shipping'));
350
+ echo '<pre>';
351
+ \print_r($this->post);
352
+ echo '</pre>';
353
+ echo '<pre>';
354
+ \print_r($this->meta_data);
355
+ echo '</pre>';
356
+ }
357
+ /**
358
+ * Is status fs-new?
359
+ *
360
+ * @return bool
361
+ */
362
+ public function is_status_fs_new()
363
+ {
364
+ return self::STATUS_FS_NEW === $this->get_status();
365
+ }
366
+ /**
367
+ * Is status fs-created?
368
+ *
369
+ * @return bool
370
+ */
371
+ public function is_status_fs_created()
372
+ {
373
+ return self::STATUS_FS_CREATED === $this->get_status();
374
+ }
375
+ /**
376
+ * Is status fs-confirmed?
377
+ *
378
+ * @return bool
379
+ */
380
+ public function is_status_fs_confirmed()
381
+ {
382
+ return self::STATUS_FS_CONFIRMED === $this->get_status();
383
+ }
384
+ /**
385
+ * Is status fs-failed?
386
+ *
387
+ * @return bool
388
+ */
389
+ public function is_status_fs_failed()
390
+ {
391
+ return self::STATUS_FS_FAILED === $this->get_status();
392
+ }
393
+ /**
394
+ * Is status fs-manifest?
395
+ *
396
+ * @return bool
397
+ */
398
+ public function is_status_fs_manifest()
399
+ {
400
+ return self::STATUS_FS_MANIFEST === $this->get_status();
401
+ }
402
+ /**
403
+ * Set created via checkout.
404
+ */
405
+ public function set_created_via_checkout()
406
+ {
407
+ $this->set_created_via('checkout');
408
+ }
409
+ /**
410
+ * Set created via.
411
+ *
412
+ * @param string $created_via Created via.
413
+ */
414
+ public function set_created_via($created_via)
415
+ {
416
+ $this->set_meta(self::CREATED_VIA, $created_via);
417
+ }
418
+ /**
419
+ * Set created via add shipment.
420
+ */
421
+ public function set_created_via_add_shipment()
422
+ {
423
+ $this->set_created_via('add_shipment');
424
+ }
425
+ /**
426
+ * Get created via.
427
+ *
428
+ * @return string
429
+ */
430
+ public function get_created_via()
431
+ {
432
+ return $this->get_meta(self::CREATED_VIA, self::NOT_SET);
433
+ }
434
+ /**
435
+ * Set sent via bulk.
436
+ */
437
+ public function set_sent_via_bulk()
438
+ {
439
+ $this->set_sent_via(self::SENT_VIA_BULK);
440
+ }
441
+ /**
442
+ * Set sent via.
443
+ *
444
+ * @param string $sent_via .
445
+ */
446
+ public function set_sent_via($sent_via)
447
+ {
448
+ $this->set_meta(self::SENT_VIA, $sent_via);
449
+ }
450
+ /**
451
+ * Set sent via auto.
452
+ */
453
+ public function set_sent_via_auto()
454
+ {
455
+ $this->set_sent_via(self::SENT_VIA_AUTO);
456
+ }
457
+ /**
458
+ * Set sent via metabox.
459
+ */
460
+ public function set_sent_via_metabox()
461
+ {
462
+ $this->set_sent_via(self::SENT_VIA_METABOX);
463
+ }
464
+ /**
465
+ * Get sent via.
466
+ *
467
+ * @return string
468
+ */
469
+ public function get_sent_via()
470
+ {
471
+ return $this->get_meta(self::SENT_VIA, self::NOT_SET);
472
+ }
473
+ /**
474
+ * Get meta shipping method.
475
+ *
476
+ * @return WC_Order_Item_Shipping
477
+ */
478
+ protected function get_meta_shipping_method()
479
+ {
480
+ return $this->get_meta('_shipping_method');
481
+ }
482
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/shipment/functions.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * Shipments functions.
7
+ *
8
+ * @package Flexible Shipping
9
+ */
10
+ /**
11
+ * @param string $integration .
12
+ *
13
+ * @return string
14
+ */
15
+ function fs_shipment_integration_class($integration)
16
+ {
17
+ return \apply_filters('flexible_shipping_shipment_class', 'WPDesk_Flexible_Shipping_Shipment_' . $integration, $integration);
18
+ }
19
+ /**
20
+ * @param string $integration .
21
+ *
22
+ * @return bool
23
+ */
24
+ function fs_shipment_integration_exists($integration)
25
+ {
26
+ return \class_exists(\FSVendor\fs_shipment_integration_class($integration));
27
+ }
28
+ /**
29
+ * @param string $integration .
30
+ * @param string $order_type .
31
+ *
32
+ * @return false
33
+ */
34
+ function fs_integration_supports_order_type($integration, $order_type)
35
+ {
36
+ $supports = \true;
37
+ if ('shop_subscription' === $order_type) {
38
+ $supports = \false;
39
+ $class_name = \FSVendor\fs_shipment_integration_class($integration);
40
+ if (\class_exists($class_name)) {
41
+ $supports = $class_name::is_subscriptions_supported();
42
+ }
43
+ }
44
+ return $supports;
45
+ }
46
+ /**
47
+ * @param WC_Abstract_Order $order Order.
48
+ * @param array $fs_method Flexible shipping method.
49
+ *
50
+ * @return WPDesk_Flexible_Shipping_Shipment
51
+ */
52
+ function fs_create_shipment($order, $fs_method)
53
+ {
54
+ if (\version_compare(\WC_VERSION, '2.7', '<')) {
55
+ $order_id = $order->id;
56
+ } else {
57
+ $order_id = $order->get_id();
58
+ }
59
+ $integration = $fs_method['method_integration'];
60
+ // Translators: order id and integration.
61
+ $post_title = \sprintf(\__('Shipment for order %s, %s', 'flexible-shipping'), $order_id, $integration);
62
+ // phpcs:ignore.
63
+ $post_title = \apply_filters('flexible_shipping_shipment_post_title_' . $integration, $post_title, $fs_method);
64
+ $shipment_post = array('post_title' => $post_title, 'post_type' => 'shipment', 'post_status' => 'fs-new', 'post_parent' => $order_id);
65
+ $shipment_id = \wp_insert_post($shipment_post);
66
+ \update_post_meta($shipment_id, '_integration', $integration);
67
+ return \FSVendor\fs_get_shipment($shipment_id, $order);
68
+ }
69
+ /**
70
+ * Returns shipments for order.
71
+ * Shipments are ordered from oldest to newest.
72
+ *
73
+ * @param int $order_id .
74
+ * @param string|null $integration .
75
+ *
76
+ * @return WPDesk_Flexible_Shipping_Shipment[]
77
+ */
78
+ function fs_get_order_shipments($order_id, $integration = null)
79
+ {
80
+ $shipments_posts_query = array('nopaging' => \true, 'post_parent' => $order_id, 'post_type' => 'shipment', 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC');
81
+ if (!empty($integration)) {
82
+ $shipments_posts_query['meta_key'] = '_integration';
83
+ $shipments_posts_query['meta_value'] = $integration;
84
+ }
85
+ $shipments_posts = \get_posts($shipments_posts_query);
86
+ $shipments = array();
87
+ if (\count($shipments_posts)) {
88
+ $order = \wc_get_order($order_id);
89
+ foreach ($shipments_posts as $shipment_post) {
90
+ $integration = \get_post_meta($shipment_post->ID, '_integration', \true);
91
+ if (\FSVendor\fs_shipment_integration_exists($integration)) {
92
+ $shipments[] = \FSVendor\fs_get_shipment($shipment_post->ID, $order);
93
+ }
94
+ }
95
+ }
96
+ return $shipments;
97
+ }
98
+ /**
99
+ * Get shipment.
100
+ *
101
+ * @param int $shipment_id Shipment id.
102
+ * @param WC_Order|null $order Order.
103
+ *
104
+ * @return WPDesk_Flexible_Shipping_Shipment
105
+ */
106
+ function fs_get_shipment($shipment_id, $order = null)
107
+ {
108
+ $integration = \get_post_meta($shipment_id, '_integration', \true);
109
+ $class_name = 'WPDesk_Flexible_Shipping_Shipment';
110
+ $integration_class_name = \FSVendor\fs_shipment_integration_class($integration);
111
+ if (\class_exists($integration_class_name)) {
112
+ $class_name = $integration_class_name;
113
+ }
114
+ return new $class_name($shipment_id, $order);
115
+ }
116
+ /**
117
+ * @param WC_Abstract_Order $order Order.
118
+ *
119
+ * @return float
120
+ */
121
+ function fs_calculate_order_weight($order)
122
+ {
123
+ $weight = 0;
124
+ if (\count($order->get_items()) > 0) {
125
+ foreach ($order->get_items() as $item) {
126
+ if ($item['product_id'] > 0) {
127
+ $product = $item->get_product();
128
+ $product_weight = $product->get_weight();
129
+ if (!$product->is_virtual() && \is_numeric($product_weight)) {
130
+ $weight += \floatval($product->get_weight()) * \floatval($item['qty']);
131
+ }
132
+ }
133
+ }
134
+ }
135
+ return $weight;
136
+ }
137
+ /**
138
+ * @param array $package .
139
+ *
140
+ * @return float|int
141
+ */
142
+ function fs_calculate_package_weight($package)
143
+ {
144
+ $weight = 0;
145
+ foreach ($package['contents'] as $item) {
146
+ $weight += \floatval($item['data']->get_weight()) * \floatval($item['quantity']);
147
+ }
148
+ return $weight;
149
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/classes/shipment/interface-shipment.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ * Interface WPDesk_Flexible_Shipping_Shipment_Interface
7
+ *
8
+ * @package Flexible Shipping
9
+ */
10
+ /**
11
+ * Shipping.
12
+ */
13
+ interface WPDesk_Flexible_Shipping_Shipment_Interface
14
+ {
15
+ /**
16
+ * @param string $meta_key .
17
+ * @param null|string $default .
18
+ *
19
+ * @return array|string|null
20
+ */
21
+ public function get_meta($meta_key = '', $default = null);
22
+ /**
23
+ * @param string $meta_key .
24
+ * @param int|string|array|object|null $value .
25
+ */
26
+ public function set_meta($meta_key, $value);
27
+ /**
28
+ * @return array
29
+ */
30
+ public function get_meta_data();
31
+ /**
32
+ * @param array $fs_method .
33
+ * @param array $package .
34
+ *
35
+ * @return void
36
+ * Executes on woocommerce checkout when order is created
37
+ */
38
+ public function checkout(array $fs_method, $package);
39
+ /**
40
+ * Displays metabox in woocommerce order.
41
+ *
42
+ * @return void
43
+ */
44
+ public function order_metabox();
45
+ /**
46
+ * Returns woocommerce metabox title.
47
+ *
48
+ * @return string
49
+ */
50
+ public function get_order_metabox_title();
51
+ /**
52
+ * @param string $action .
53
+ * @param array $data .
54
+ *
55
+ * @return void
56
+ * Executes on ajax request. $data contains all woocommerce order metabox fields values from metabox generated in order_metabox() method.
57
+ */
58
+ public function ajax_request($action, $data);
59
+ /**
60
+ * @return string
61
+ * Returns error message
62
+ */
63
+ public function get_error_message();
64
+ /**
65
+ * @return string
66
+ * Returns tracking number for shipment
67
+ */
68
+ public function get_tracking_number();
69
+ /**
70
+ * @return string
71
+ * Returns tracking URL for shipping
72
+ */
73
+ public function get_tracking_url();
74
+ /**
75
+ * @return array
76
+ * Return label data foe shipping in array:
77
+ * 'label_format' => 'pdf'
78
+ * 'content' => pdf content,
79
+ * 'file_name' => file name for label
80
+ */
81
+ public function get_label();
82
+ /**
83
+ * @return mixed
84
+ */
85
+ public function get_after_order_table();
86
+ /**
87
+ * @return mixed
88
+ */
89
+ public function get_email_after_order_table();
90
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment-interfaces/composer.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "wpdesk\/wp-wpdesk-fs-shipment-interfaces",
3
+ "authors": [
4
+ {
5
+ "name": "Krzysiek",
6
+ "email": "krzysiek@wpdesk.pl"
7
+ }
8
+ ],
9
+ "config": {
10
+ "platform": {
11
+ "php": "5.6"
12
+ },
13
+ "sort-packages": true
14
+ },
15
+ "require": {
16
+ "php": ">=5.6"
17
+ },
18
+ "require-dev": {
19
+ "10up\/wp_mock": "^0.2.0",
20
+ "phpunit\/phpunit": "<7",
21
+ "squizlabs\/php_codesniffer": "^3.4.2",
22
+ "wp-coding-standards\/wpcs": "^0.14.1"
23
+ },
24
+ "autoload": {},
25
+ "autoload-dev": {},
26
+ "scripts": {
27
+ "phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
28
+ "phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
29
+ "phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
30
+ "phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage"
31
+ }
32
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/assets/css/admin.css ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* order metabox */
2
+ .flexible_shipping_shipment_content p select {
3
+ max-width: 95%;
4
+ }
5
+
6
+ .flexible_shipping_shipment_content span.description {
7
+ display: block;
8
+ }
9
+
10
+ .fs-saas-button-cancel-created {
11
+ float: right;
12
+ color: #a00;
13
+ margin-top: 5px;
14
+ }
15
+
16
+ .fs-saas-button-cancel-created:hover {
17
+ color: #a00;
18
+ cursor: pointer;
19
+ }
20
+
21
+ .flexible_shipping_shipment_content input[type=checkbox] {
22
+ float: left;
23
+ margin-right: 5px;
24
+ margin-top: 2px !important;
25
+ opacity: 1;
26
+ border-color: #888;
27
+ }
28
+
29
+ .flexible_shipping_shipment_content input[type=checkbox]:disabled {
30
+ opacity: 0.7;
31
+ border-color: rgba( 51, 51, 51, 0.5 );
32
+ }
33
+
34
+ .flexible_shipping_shipment_content p.fs-saas-status {
35
+ }
36
+
37
+ .flexible_shipping_shipment_content p.fs-saas-status span {
38
+ font-weight: bold;
39
+ color: #444;
40
+ }
41
+
42
+ .flexible_shipping_shipment_content p.fs-saas-status-fs-new {
43
+ color: #ffba00;
44
+ }
45
+
46
+ .flexible_shipping_shipment_content p.fs-saas-status-fs-created {
47
+ color: #d0c21f;
48
+ }
49
+
50
+ .flexible_shipping_shipment_content p.fs-saas-status-fs-confirmed {
51
+ color: #444;
52
+ }
53
+
54
+ .flexible_shipping_shipment_content p.fs-saas-status-fs-failed {
55
+ color: #a00;
56
+ }
57
+
58
+ .flexible_shipping_shipment_content p.fs-saas-status-fs-manifest {
59
+ color: #2ea2cc;
60
+ }
61
+
62
+ .flexible_shipping_shipment_content p.connection-error {
63
+ font-weight: bold;
64
+ color: #a00;
65
+ }
66
+
67
+ .flexible_shipping_shipment_content span.optional {
68
+ display: none;
69
+ }
70
+ .flexible_shipping_shipment_message {
71
+ color: green;
72
+ }
73
+
74
+ .flexible_shipping_shipment_message_error {
75
+ color: #a00 !important;
76
+ }
77
+
78
+ .flexible_shipping_shipment_message_error span {
79
+ color: #444;
80
+ font-weight: bold;
81
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/assets/js/admin.js ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function fs_select2() {
2
+ let elements = jQuery( '.fs_select2' );
3
+ if ( elements.length ) {
4
+ if (jQuery.fn.selectWoo) {
5
+ elements.selectWoo();
6
+ } else {
7
+ elements.select2();
8
+ }
9
+ }
10
+ }
11
+
12
+ function fs_shipment_removeParam(key, sourceURL) {
13
+ var rtn = sourceURL.split("?")[0],
14
+ param,
15
+ params_arr = [],
16
+ queryString = (sourceURL.indexOf("?") !== -1) ? sourceURL.split("?")[1] : "";
17
+ if (queryString !== "") {
18
+ params_arr = queryString.split("&");
19
+ for (var i = params_arr.length - 1; i >= 0; i -= 1) {
20
+ param = params_arr[i].split("=")[0];
21
+ if (param === key) {
22
+ params_arr.splice(i, 1);
23
+ }
24
+ }
25
+ rtn = rtn + "?" + params_arr.join("&");
26
+ }
27
+ return rtn;
28
+ }
29
+
30
+ function fs_shipment_trimChar(string, charToRemove) {
31
+ while(string.charAt(0)==charToRemove) {
32
+ string = string.substring(1);
33
+ }
34
+
35
+ while(string.charAt(string.length-1)==charToRemove) {
36
+ string = string.substring(0,string.length-1);
37
+ }
38
+
39
+ return string;
40
+ }
41
+
42
+
43
+ // Order functions
44
+ function fs_id( element ) {
45
+ return jQuery(element).closest('.flexible_shipping_shipment').attr('data-id');
46
+ }
47
+
48
+ function fs_data_set_val( data, name, val ) {
49
+ if ( typeof name == 'undefined' ) {
50
+ return data;
51
+ }
52
+ if ( name.indexOf("[") == -1 ) {
53
+ data[name] = val;
54
+ }
55
+ else {
56
+ var names = name.split("[");
57
+ var data2 = data;
58
+ var data3 = data;
59
+ var name2 = '';
60
+ jQuery.each(names,function(index,name) {
61
+ name2 = name.replace("]","");
62
+ if ( typeof data2[name2] == 'undefined' ) {
63
+ data2[name2] = {};
64
+ }
65
+ data3 = data2;
66
+ data2 = data2[name2];
67
+ });
68
+ data3[name2] = val;
69
+ }
70
+ return data;
71
+ }
72
+
73
+ function fs_ajax(button, id, fs_action) {
74
+ jQuery('.button-shipping').attr('disabled', true);
75
+ jQuery(button).parent().find('.spinner').css({visibility: 'visible'});
76
+ var data = {};
77
+
78
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_content input, #flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_content select, #flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_content textarea').each(function () {
79
+ if (jQuery(this).attr('type') == 'radio') {
80
+ data = fs_data_set_val( data, jQuery(this).attr('name'), jQuery('#flexible_shipping_shipment_' + id + ' input[name=' + jQuery(this).attr('name') + ']:checked').val() );
81
+ }
82
+ else if (jQuery(this).attr('type') == 'checkbox') {
83
+ if (jQuery(this).is(':checked')) {
84
+ data = fs_data_set_val( data, jQuery(this).attr('name'), jQuery(this).val() );
85
+ }
86
+ else {
87
+ data = fs_data_set_val( data, jQuery(this).attr('name'), '' );
88
+ }
89
+ }
90
+ else {
91
+ data = fs_data_set_val( data, jQuery(this).attr('name'), jQuery(this).val() );
92
+ }
93
+ });
94
+
95
+ var nonce = jQuery('#flexible_shipping_shipment_nonce_' + id).val();
96
+
97
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').hide();
98
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').removeClass("flexible_shipping_shipment_message_error");
99
+
100
+ jQuery.ajax({
101
+ url: fs_shipment_admin.ajax_url,
102
+ type: 'POST',
103
+ data: {
104
+ fs_action: fs_action,
105
+ action: 'flexible_shipping',
106
+ nonce: nonce,
107
+ shipment_id: id,
108
+ data: data,
109
+ },
110
+ dataType: 'json',
111
+ }).done(function (response) {
112
+ if (response) {
113
+ if (response == '0') {
114
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').show();
115
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').html("Invalid response: 0");
116
+ }
117
+ else if (response.status == 'success') {
118
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_content').html(response.content);
119
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').hide();
120
+ if ( typeof response.message != 'undefined' ) {
121
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').show();
122
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').html(response.message);
123
+ }
124
+ }
125
+ else {
126
+ if ( typeof response.content !== 'undefined' ) {
127
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_content').html(response.content);
128
+ }
129
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').addClass("flexible_shipping_shipment_message_error");
130
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').show();
131
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').html(response.message);
132
+ }
133
+ }
134
+ else {
135
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').addClass("flexible_shipping_shipment_message_error");
136
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').show();
137
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').html("Request failed: invalid method?");
138
+ }
139
+ }).always(function () {
140
+ jQuery('.button-shipping').attr('disabled', false);
141
+ jQuery('.shipping-spinner').parent().find('.spinner').css({visibility: 'hidden'});
142
+ fs_select2();
143
+ jQuery('#flexible_shipping_shipment_' + id).trigger( "flexible_shipping_ajax_fs_action_after" );
144
+ }).fail(function (jqXHR, textStatus) {
145
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').addClass("flexible_shipping_shipment_message_error");
146
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').show();
147
+ jQuery('#flexible_shipping_shipment_' + id + ' .flexible_shipping_shipment_message').html("Request failed: " + textStatus + " " + jqXHR.status);
148
+ })
149
+ }
150
+
151
+ jQuery(document).ready(function(){
152
+ if ( jQuery('#flexible_shipping_labels_url').length ) {
153
+ window.location.href = jQuery('#flexible_shipping_labels_url').attr('href');
154
+ }
155
+
156
+ if ( jQuery('a.shipping_manifest_download').length == 1 ) {
157
+ window.location.href = jQuery('a.shipping_manifest_download').attr('href');
158
+ }
159
+
160
+ if ( typeof window.history.pushState == 'function' ) {
161
+ var url = document.location.href;
162
+ var url2 = document.location.href;
163
+ url = fs_shipment_removeParam('bulk_flexible_shipping_labels', url);
164
+ url = fs_shipment_removeParam('bulk_flexible_shipping_send', url);
165
+ url = fs_shipment_removeParam('bulk_flexible_shipping_manifests', url);
166
+ url = fs_shipment_removeParam('bulk_flexible_shipping_no_labels_created', url);
167
+ url = fs_shipment_trimChar(url,'?');
168
+ if ( url != url2 ) {
169
+ window.history.pushState({}, "", url);
170
+ }
171
+ }
172
+ });
173
+
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/composer.json ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "wpdesk\/wp-wpdesk-fs-shipment",
3
+ "authors": [
4
+ {
5
+ "name": "Krzysiek",
6
+ "email": "krzysiek@wpdesk.pl"
7
+ }
8
+ ],
9
+ "config": {
10
+ "platform": {
11
+ "php": "5.6"
12
+ },
13
+ "sort-packages": true
14
+ },
15
+ "require": {
16
+ "php": ">=5.6",
17
+ "wpdesk\/wp-mutex": "^1.1",
18
+ "wpdesk\/wp-plugin-flow": "^2.9",
19
+ "wpdesk\/wp-wpdesk-fs-shipment-interfaces": "^1.0"
20
+ },
21
+ "require-dev": {
22
+ "10up\/wp_mock": "^0.2.0",
23
+ "phpunit\/phpunit": "<7",
24
+ "squizlabs\/php_codesniffer": "^3.4.2",
25
+ "wp-coding-standards\/wpcs": "^0.14.1"
26
+ },
27
+ "autoload": {
28
+ "psr-4": {
29
+ "FSVendor\\": "src"
30
+ }
31
+ },
32
+ "autoload-dev": {},
33
+ "extra": {
34
+ "text-domain": "wp-wpdesk-fs-shipment",
35
+ "translations-folder": "lang",
36
+ "po-files": {
37
+ "pl_PL": "pl_PL.po"
38
+ }
39
+ },
40
+ "scripts": {
41
+ "phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
42
+ "phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
43
+ "phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
44
+ "phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage"
45
+ }
46
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Assets.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class ShipmentFunctionality
5
+ *
6
+ * @package WPDesk\FS\Shipment
7
+ */
8
+ namespace FSVendor\WPDesk\FS\Shipment;
9
+
10
+ use Psr\Log\LoggerInterface;
11
+ use FSVendor\WPDesk\FS\Shipment\Label\SingleLabelFileDispatcher;
12
+ use FSVendor\WPDesk\FS\Shipment\Manifest\ManifestCustomPostType;
13
+ use FSVendor\WPDesk\FS\Shipment\Metabox\Ajax;
14
+ use FSVendor\WPDesk\FS\Shipment\Order\AddShippingMetabox;
15
+ use FSVendor\WPDesk\FS\Shipment\RestApi\OrderResponseDataAppender;
16
+ use FSVendor\WPDesk\FS\Shipment\Subscriptions\SubscriptionsIntegration;
17
+ use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
18
+ /**
19
+ * Can load shipment functionality.
20
+ */
21
+ class Assets implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable
22
+ {
23
+ /**
24
+ * @var string
25
+ */
26
+ private $assets_url;
27
+ /**
28
+ * @var string
29
+ */
30
+ private $scripts_version;
31
+ /**
32
+ * Assets constructor.
33
+ *
34
+ * @param string $assets_url .
35
+ * @param string $scripts_version .
36
+ */
37
+ public function __construct($assets_url, $scripts_version)
38
+ {
39
+ $this->assets_url = $assets_url;
40
+ $this->scripts_version = $scripts_version;
41
+ }
42
+ /**
43
+ * Hooks.
44
+ */
45
+ public function hooks()
46
+ {
47
+ \add_action('admin_enqueue_scripts', [$this, 'admin_enqueue_scripts']);
48
+ }
49
+ /**
50
+ * Admin enqueue scripts.
51
+ */
52
+ public function admin_enqueue_scripts()
53
+ {
54
+ if ($this->should_enqueue_admin_scripts()) {
55
+ \wp_register_script('fs_shipment_admin', \trailingslashit($this->assets_url) . 'js/admin.js', array('jquery'), $this->scripts_version);
56
+ \wp_localize_script('fs_shipment_admin', 'fs_shipment_admin', array('ajax_url' => \admin_url('admin-ajax.php')));
57
+ \wp_enqueue_script('fs_shipment_admin');
58
+ \wp_enqueue_style('fs_shipment_admin', \trailingslashit($this->assets_url) . 'css/admin.css', array(), $this->scripts_version);
59
+ }
60
+ }
61
+ /**
62
+ * Should enqueue admin scripts?
63
+ */
64
+ private function should_enqueue_admin_scripts()
65
+ {
66
+ $current_screen = \get_current_screen();
67
+ $wc_screen_id = \sanitize_title(\__('WooCommerce', 'woocommerce'));
68
+ if (\in_array($current_screen->post_type, array('shop_order', 'shop_subscription'), \true) || $wc_screen_id . '_page_wc-settings' === $current_screen->id) {
69
+ return \true;
70
+ }
71
+ return \false;
72
+ }
73
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/CustomPostType.php ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class CustomPostType
5
+ *
6
+ * @package WPDesk\FS\Shipment
7
+ */
8
+ namespace FSVendor\WPDesk\FS\Shipment;
9
+
10
+ use FSVendor\WPDesk\Mutex\WordpressPostMutex;
11
+ use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
12
+ /**
13
+ * Can register custom post type.
14
+ */
15
+ class CustomPostType implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable
16
+ {
17
+ const POST_TYPE_SHIPMENT = 'shipment';
18
+ /**
19
+ * Is order processed on checkout?
20
+ *
21
+ * @var bool
22
+ */
23
+ private $is_order_processed_on_checkout = \false;
24
+ /**
25
+ * Hooks.
26
+ */
27
+ public function hooks()
28
+ {
29
+ $last_priority = \PHP_INT_MAX;
30
+ \add_action('init', array($this, 'register_post_types'), 20);
31
+ \add_action('add_meta_boxes', array($this, 'add_meta_boxes'), 20, 2);
32
+ \add_action('woocommerce_checkout_update_order_meta', array($this, 'create_shipping_for_order'), $last_priority);
33
+ \add_action('woocommerce_order_details_after_order_table', array($this, 'woocommerce_order_details_after_order_table'));
34
+ \add_action('woocommerce_email_after_order_table', array($this, 'woocommerce_email_after_order_table'), 10, 2);
35
+ }
36
+ /**
37
+ * Register post types.
38
+ */
39
+ public function register_post_types()
40
+ {
41
+ if (\post_type_exists(self::POST_TYPE_SHIPMENT)) {
42
+ return;
43
+ }
44
+ \register_post_type(self::POST_TYPE_SHIPMENT, array('labels' => array('name' => \__('Shipments', 'flexible-shipping'), 'singular_name' => \__('Shipment', 'flexible-shipping'), 'menu_name' => \__('Shipments', 'flexible-shipping'), 'parent_item_colon' => '', 'all_items' => \__('Shipments', 'flexible-shipping'), 'view_item' => \__('View Shipments', 'flexible-shipping'), 'add_new_item' => \__('Add new Shipment', 'flexible-shipping'), 'add_new' => \__('Add new Shipment', 'flexible-shipping'), 'edit_item' => \__('Edit Shipment', 'flexible-shipping'), 'update_item' => \__('Save Shipment', 'flexible-shipping'), 'search_items' => \__('Search Shipments', 'flexible-shipping'), 'not_found' => \__('Shipment not found', 'flexible-shipping'), 'not_found_in_trash' => \__('Shipment not found in trash', 'flexible-shipping')), 'description' => \__('Shipments.', 'flexible-shipping'), 'public' => \false, 'show_ui' => \false, 'capability_type' => 'post', 'capabilities' => array(), 'map_meta_cap' => \true, 'publicly_queryable' => \false, 'exclude_from_search' => \true, 'hierarchical' => \false, 'query_var' => \true, 'supports' => array('title'), 'has_archive' => \false, 'show_in_nav_menus' => \true, 'menu_icon' => 'dashicons-upload'));
45
+ $shipment_statuses = \apply_filters('flexible_shipping_register_shipment_statuses', array('fs-new' => array('label' => \_x('New', 'Shipment status', 'flexible-shipping'), 'public' => \false, 'exclude_from_search' => \false, 'show_in_admin_all_list' => \true, 'show_in_admin_status_list' => \true, 'label_count' => \_n_noop('New <span class="count">(%s)</span>', 'New <span class="count">(%s)</span>', 'flexible-shipping')), 'fs-created' => array('label' => \_x('Created', 'Shipment status', 'flexible-shipping'), 'public' => \false, 'exclude_from_search' => \false, 'show_in_admin_all_list' => \true, 'show_in_admin_status_list' => \true, 'label_count' => \_n_noop('Created <span class="count">(%s)</span>', 'Created <span class="count">(%s)</span>', 'flexible-shipping')), 'fs-confirmed' => array('label' => \_x('Confirmed', 'Shipment status', 'flexible-shipping'), 'public' => \false, 'exclude_from_search' => \false, 'show_in_admin_all_list' => \true, 'show_in_admin_status_list' => \true, 'label_count' => \_n_noop('Confirmed <span class="count">(%s)</span>', 'Confirmed <span class="count">(%s)</span>', 'flexible-shipping')), 'fs-manifest' => array('label' => \_x('Manifest created', 'Shipment status', 'flexible-shipping'), 'public' => \false, 'exclude_from_search' => \false, 'show_in_admin_all_list' => \true, 'show_in_admin_status_list' => \true, 'label_count' => \_n_noop('Confirmed <span class="count">(%s)</span>', 'Confirmed <span class="count">(%s)</span>', 'flexible-shipping')), 'fs-failed' => array('label' => \_x('Failed', 'Shipment status', 'flexible-shipping'), 'public' => \false, 'exclude_from_search' => \false, 'show_in_admin_all_list' => \true, 'show_in_admin_status_list' => \true, 'label_count' => \_n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'flexible-shipping'))));
46
+ foreach ($shipment_statuses as $shipment_status => $values) {
47
+ \register_post_status($shipment_status, $values);
48
+ }
49
+ }
50
+ /**
51
+ * Prepares class name for integration.
52
+ *
53
+ * @param string $integration .
54
+ *
55
+ * @return string
56
+ */
57
+ public function prepare_integration_class_name($integration)
58
+ {
59
+ return \apply_filters('flexible_shipping_shipment_class', 'WPDesk_Flexible_Shipping_Shipment_' . $integration, $integration);
60
+ }
61
+ /**
62
+ * @param string $post_type .
63
+ * @param \WP_Post $post .
64
+ */
65
+ public function add_meta_boxes($post_type, $post)
66
+ {
67
+ if (self::POST_TYPE_SHIPMENT === $post_type) {
68
+ \add_meta_box('shipment_meta_box', \__('Shipment data', 'flexible-shipping'), array($this, 'metabox'), 'shipment', 'normal', 'high');
69
+ }
70
+ if (\in_array($post_type, array('shop_order', 'shop_subscription'), \true)) {
71
+ $shipments = fs_get_order_shipments($post->ID);
72
+ foreach ($shipments as $shipment) {
73
+ if ($this->should_add_metabox($shipment)) {
74
+ $args = array('shipment' => $shipment);
75
+ \add_meta_box('shipment_meta_box_' . $shipment->get_id(), $shipment->get_order_metabox_title(), array($this, 'order_metabox'), null, $shipment->get_order_metabox_context(), 'default', $args);
76
+ }
77
+ }
78
+ }
79
+ }
80
+ /**
81
+ * @param \WPDesk_Flexible_Shipping_Shipment $shipment .
82
+ *
83
+ * @return bool
84
+ */
85
+ private function should_add_metabox($shipment)
86
+ {
87
+ $avaliable_integrations = \apply_filters('flexible_shipping_add_shipping_options', array());
88
+ return isset($avaliable_integrations[$shipment->get_integration()]);
89
+ }
90
+ /**
91
+ * @param WP_Post $post .
92
+ * @param array $args .
93
+ */
94
+ public function order_metabox($post, $args)
95
+ {
96
+ /** @var WPDesk_Flexible_Shipping_Shipment $shipment */
97
+ $shipment = $args['args']['shipment'];
98
+ $shipment_id = $shipment->get_id();
99
+ $message = $shipment->get_error_message();
100
+ $message_heading = $shipment->get_order_metabox_title();
101
+ $message_css_style = '';
102
+ include 'views/order-metabox.php';
103
+ }
104
+ /**
105
+ * .
106
+ */
107
+ public function metabox()
108
+ {
109
+ global $post;
110
+ echo '<pre>';
111
+ \print_r($post);
112
+ echo '</pre>';
113
+ $meta_data = \get_post_meta($post->ID);
114
+ foreach ($meta_data as $key => $val) {
115
+ echo '<pre>';
116
+ echo \esc_html($key);
117
+ echo ' = ';
118
+ \print_r(\maybe_unserialize($val[0]));
119
+ echo '</pre>';
120
+ }
121
+ }
122
+ /**
123
+ * Get Flexible Shipping method from order shipping method meta data.
124
+ *
125
+ * @param WC_Order_Item_Shipping $shipping_method .
126
+ *
127
+ * @return array
128
+ */
129
+ private function get_fs_method_from_order_shipping_method($shipping_method)
130
+ {
131
+ $fs_method = array();
132
+ if (isset($shipping_method['item_meta']) && isset($shipping_method['item_meta']['_fs_method'])) {
133
+ $fs_method = $shipping_method['item_meta']['_fs_method'];
134
+ }
135
+ return $fs_method;
136
+ }
137
+ /**
138
+ * Create shipment for order and shipping method.
139
+ *
140
+ * @param \WC_Order $order Order.
141
+ * @param array $fs_method Flexible Shipping shipping method.
142
+ * @param string $shipping_id Shipping Id.
143
+ * @param \WC_Order_Item_Shipping $shipping_method Shipping method.
144
+ * @param array $packages Packages.
145
+ * @param int $package_id Package Id.
146
+ *
147
+ * @return \WPDesk_Flexible_Shipping_Shipment
148
+ */
149
+ private function create_shipment_for_order_and_fs_shipping_method(\WC_Order $order, array $fs_method, $shipping_id, \WC_Order_Item_Shipping $shipping_method, array $packages, $package_id)
150
+ {
151
+ $shipment = fs_create_shipment($order, $fs_method);
152
+ $shipment->set_meta('_fs_method', $fs_method);
153
+ $shipment->set_meta('_shipping_id', $shipping_id);
154
+ $shipment->set_meta('_shipping_method', $shipping_method);
155
+ $shipment->set_created_via_checkout();
156
+ $shipment->checkout($fs_method, $packages[$package_id]);
157
+ $shipment->save();
158
+ return $shipment;
159
+ }
160
+ /**
161
+ * Create shipping for order.
162
+ *
163
+ * @param int $order_id .
164
+ */
165
+ public function create_shipping_for_order($order_id)
166
+ {
167
+ $order = \wc_get_order($order_id);
168
+ if ($order && !$this->is_order_processed_on_checkout) {
169
+ $mutex = \FSVendor\WPDesk\Mutex\WordpressPostMutex::fromOrder($order);
170
+ $mutex->acquireLock();
171
+ $shipments = fs_get_order_shipments($order_id);
172
+ if (0 === \count($shipments)) {
173
+ $this->is_order_processed_on_checkout = \true;
174
+ $this->create_shipping_for_order_and_cart($order, \WC()->cart);
175
+ }
176
+ $mutex->releaseLock();
177
+ }
178
+ }
179
+ /**
180
+ * @param \WC_Order $order .
181
+ * @param \WC_Cart $cart .
182
+ */
183
+ public function create_shipping_for_order_and_cart($order, $cart)
184
+ {
185
+ global $fs_package_id;
186
+ $order_shipping_methods = $order->get_shipping_methods();
187
+ $packages = $cart->get_shipping_packages();
188
+ $package_id = -1;
189
+ foreach ($order_shipping_methods as $shipping_id => $shipping_method) {
190
+ $package_id++;
191
+ $fs_package_id = $package_id;
192
+ $fs_method = $this->get_fs_method_from_order_shipping_method($shipping_method);
193
+ if (!empty($fs_method['method_integration'])) {
194
+ $integration = $fs_method['method_integration'];
195
+ if (fs_shipment_integration_exists($integration) && $this->is_order_type_supported_by_integration($order->get_type(), $integration)) {
196
+ $shipment = $this->create_shipment_for_order_and_fs_shipping_method($order, $fs_method, $shipping_id, $shipping_method, $packages, $package_id);
197
+ /**
198
+ * Do actions when shipment is created via checkout.
199
+ *
200
+ * @param WPDesk_Flexible_Shipping_Shipment $shipment Created shipment.
201
+ */
202
+ \do_action('flexible_shipping_checkout_shipment_created', $shipment);
203
+ }
204
+ }
205
+ }
206
+ }
207
+ /**
208
+ * @param string $order_type .
209
+ * @param string $integration .
210
+ *
211
+ * @return bool
212
+ */
213
+ private function is_order_type_supported_by_integration($order_type, $integration)
214
+ {
215
+ $supported = 'shop_order' === $order_type;
216
+ $supported = \apply_filters('flexible-shipping/shipment/supported-order-type/' . $integration, $supported, $order_type);
217
+ return \is_bool($supported) ? $supported : \false;
218
+ }
219
+ /**
220
+ * Hook woocommerce_order_details_after_order_table.
221
+ *
222
+ * @param \WC_Abstract_Order $order Order.
223
+ */
224
+ public function woocommerce_order_details_after_order_table($order)
225
+ {
226
+ $order_id = $order->get_id();
227
+ $shipments = fs_get_order_shipments($order_id);
228
+ foreach ($shipments as $shipment) {
229
+ echo \wp_kses_post($shipment->get_after_order_table());
230
+ }
231
+ }
232
+ /**
233
+ * @param \WC_Order $order .
234
+ * @param bool $sent_to_admin .
235
+ */
236
+ public function woocommerce_email_after_order_table($order, $sent_to_admin)
237
+ {
238
+ $order_id = $order->get_id();
239
+ $shipments = fs_get_order_shipments($order_id);
240
+ foreach ($shipments as $shipment) {
241
+ echo \wp_kses_post($shipment->get_email_after_order_table());
242
+ }
243
+ }
244
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsBulkActionHandler.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Labels builders.
5
+ *
6
+ * @package Flexible Shipping
7
+ */
8
+ namespace FSVendor\WPDesk\FS\Shipment\Label;
9
+
10
+ /**
11
+ * Can create labels for shipments.
12
+ */
13
+ class LabelsBulkActionHandler
14
+ {
15
+ /**
16
+ * Builders.
17
+ *
18
+ * @var LabelsBulkActionHandler
19
+ */
20
+ private static $labels_builder;
21
+ /**
22
+ * Labels builders collection.
23
+ *
24
+ * @var \WPDesk_Flexible_Shipping_Labels_Builder[]
25
+ */
26
+ private $builders_collection = array();
27
+ /**
28
+ * Shipments.
29
+ *
30
+ * @var \WPDesk_Flexible_Shipping_Shipment_Interface[]
31
+ */
32
+ private $shipments = array();
33
+ /**
34
+ * Add builder to builders collection.
35
+ *
36
+ * @param \WPDesk_Flexible_Shipping_Labels_Builder $builder .
37
+ */
38
+ public function add_builder($builder)
39
+ {
40
+ $this->builders_collection[$builder->get_integration_id()] = $builder;
41
+ }
42
+ /**
43
+ * Bulk process orders.
44
+ *
45
+ * @param array $orders_ids .
46
+ */
47
+ public function bulk_process_orders(array $orders_ids)
48
+ {
49
+ foreach ($orders_ids as $order_id) {
50
+ $shipments = fs_get_order_shipments($order_id);
51
+ foreach ($shipments as $shipment) {
52
+ $this->add_shipment($shipment);
53
+ }
54
+ }
55
+ }
56
+ /**
57
+ * Add shipment to labels builder.
58
+ *
59
+ * @param \WPDesk_Flexible_Shipping_Shipment $shipment .
60
+ */
61
+ public function add_shipment($shipment)
62
+ {
63
+ if (isset($this->builders_collection[$shipment->get_integration()])) {
64
+ $this->builders_collection[$shipment->get_integration()]->add_shipment($shipment);
65
+ } else {
66
+ $this->shipments[] = $shipment;
67
+ }
68
+ }
69
+ /**
70
+ * Get labels for shipments from builders.
71
+ *
72
+ * @return array
73
+ */
74
+ private function get_labels_for_shipments_from_builders()
75
+ {
76
+ $labels = array();
77
+ foreach ($this->builders_collection as $labels_builder) {
78
+ $labels += $labels_builder->get_labels_for_shipments();
79
+ }
80
+ return $labels;
81
+ }
82
+ /**
83
+ * Get labels for shipments.
84
+ *
85
+ * @return array
86
+ * @throws \Exception
87
+ */
88
+ public function get_labels_for_shipments()
89
+ {
90
+ $labels = $this->get_labels_for_shipments_from_builders();
91
+ foreach ($this->shipments as $shipment) {
92
+ $labels[] = $shipment->get_label();
93
+ }
94
+ return $labels;
95
+ }
96
+ /**
97
+ * Get builders.
98
+ *
99
+ * @return LabelsBulkActionHandler
100
+ */
101
+ public static function get_labels_bulk_actions_handler()
102
+ {
103
+ if (empty(static::$labels_builder)) {
104
+ static::$labels_builder = new self();
105
+ }
106
+ return static::$labels_builder;
107
+ }
108
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsFileCreator.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Labels file creator.
5
+ *
6
+ * @package Flexible Shipping
7
+ */
8
+ namespace FSVendor\WPDesk\FS\Shipment\Label;
9
+
10
+ /**
11
+ * Can create labels file.
12
+ * When there is one label file it creates file from this label.
13
+ * When there is more than one label file it creates zip file with all labels.
14
+ */
15
+ class LabelsFileCreator
16
+ {
17
+ /**
18
+ * Labels.
19
+ *
20
+ * @var array
21
+ */
22
+ private $labels = array();
23
+ /**
24
+ * File name.
25
+ *
26
+ * @var string
27
+ */
28
+ private $file_name;
29
+ /**
30
+ * Tmp file name.
31
+ *
32
+ * @var string
33
+ */
34
+ private $tmp_file_name;
35
+ /**
36
+ * .
37
+ *
38
+ * @param array $labels .
39
+ * @see WPDesk_Flexible_Shipping_Integration_Label_Builder::get_labels_for_shipments()
40
+ */
41
+ public function __construct(array $labels)
42
+ {
43
+ $this->labels = $labels;
44
+ $this->prepare_file_names();
45
+ }
46
+ /**
47
+ * Create labels file.
48
+ *
49
+ * @throws \WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception .
50
+ */
51
+ public function create_labels_file()
52
+ {
53
+ if (1 === \count($this->labels)) {
54
+ \file_put_contents($this->tmp_file_name, $this->labels[0]['content']);
55
+ // phpcs:ignore
56
+ } else {
57
+ $zip = new \ZipArchive();
58
+ if (!$zip->open($this->tmp_file_name, \ZipArchive::CREATE)) {
59
+ throw new \FSVendor\WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception();
60
+ }
61
+ foreach ($this->labels as $label) {
62
+ if (isset($label['content'])) {
63
+ $zip->addFromString($label['file_name'], $label['content']);
64
+ }
65
+ }
66
+ }
67
+ }
68
+ /**
69
+ * Prepare file names.
70
+ *
71
+ * @throws \WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception .
72
+ */
73
+ private function prepare_file_names()
74
+ {
75
+ if (1 === \count($this->labels)) {
76
+ $this->file_name = $this->labels[0]['file_name'];
77
+ } else {
78
+ $this->file_name = 'labels.zip';
79
+ }
80
+ $this->tmp_file_name = @\tempnam('tmp', 'labels_');
81
+ // phpcs:ignore
82
+ if (!$this->tmp_file_name) {
83
+ throw new \FSVendor\WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception();
84
+ }
85
+ }
86
+ /**
87
+ * Get file name.
88
+ *
89
+ * @return string
90
+ */
91
+ public function get_file_name()
92
+ {
93
+ return $this->file_name;
94
+ }
95
+ /**
96
+ * Get temporary file name.
97
+ * In this file we save labels.
98
+ *
99
+ * @return string
100
+ */
101
+ public function get_tmp_file_name()
102
+ {
103
+ return $this->tmp_file_name;
104
+ }
105
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/LabelsFileDispatcher.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Labels file dispatcher.
5
+ *
6
+ * @package Flexible Shipping
7
+ */
8
+ namespace FSVendor\WPDesk\FS\Shipment\Label;
9
+
10
+ /**
11
+ * Can dispatch file to browser.
12
+ */
13
+ class LabelsFileDispatcher
14
+ {
15
+ /**
16
+ * Dispatches and delete temporary labels file.
17
+ *
18
+ * @param string $file_name Filename to send to browser.
19
+ * @param string $tmp_file_path Temporary labels file name.
20
+ */
21
+ public function dispatch_and_delete_labels_file($file_name, $tmp_file_path)
22
+ {
23
+ \header('Content-Description: File Transfer');
24
+ \header('Content-Type: application/octet-stream');
25
+ \header('Content-Disposition: attachment; filename="' . \basename($file_name) . '"');
26
+ \header('Expires: 0');
27
+ \header('Cache-Control: must-revalidate');
28
+ \header('Pragma: public');
29
+ \header('Content-Length: ' . \filesize($tmp_file_path));
30
+ \readfile($tmp_file_path);
31
+ // phpcs:ignore
32
+ \unlink($tmp_file_path);
33
+ }
34
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Label/SingleLabelFileDispatcher.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Single label file dispatcher.
5
+ *
6
+ * @package Flexible Shipping
7
+ */
8
+ namespace FSVendor\WPDesk\FS\Shipment\Label;
9
+
10
+ use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
+ /**
12
+ * Can dispatch single label file.
13
+ */
14
+ class SingleLabelFileDispatcher implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable
15
+ {
16
+ const PRIORITY_VERY_LOW = 9999999;
17
+ const DEFAULT_CONTENT_TYPE = 'application/octet-stream';
18
+ const ACTION_DOWNLOAD = 'download';
19
+ const ACTION_OPEN = 'open';
20
+ /**
21
+ * Hooks.
22
+ */
23
+ public function hooks()
24
+ {
25
+ \add_action('admin_post_flexible_shipping_get_label', array($this, 'dispatch_label_if_requested'), self::PRIORITY_VERY_LOW);
26
+ }
27
+ /**
28
+ * @param array $label_data .
29
+ *
30
+ * @return string
31
+ */
32
+ private function prepare_content_type_from_label_data(array $label_data)
33
+ {
34
+ if ('html' === $label_data['label_format']) {
35
+ return 'text/html';
36
+ }
37
+ return 'application/' . $label_data['label_format'];
38
+ }
39
+ /**
40
+ * @return string
41
+ */
42
+ private function get_action_parameter()
43
+ {
44
+ return !empty($_GET['label_action']) ? \sanitize_text_field(\wp_unslash($_GET['label_action'])) : self::ACTION_DOWNLOAD;
45
+ // phpcs:ignore
46
+ }
47
+ /**
48
+ * @param array $label_data .
49
+ *
50
+ * @return string
51
+ */
52
+ private function prepare_content_type(array $label_data)
53
+ {
54
+ if ($this->get_action_parameter() === self::ACTION_OPEN) {
55
+ return $this->prepare_content_type_from_label_data($label_data);
56
+ } else {
57
+ return self::DEFAULT_CONTENT_TYPE;
58
+ }
59
+ }
60
+ /**
61
+ * @param string $shipment_id .
62
+ */
63
+ private function dispatch_label_and_die($shipment_id)
64
+ {
65
+ $shipment = fs_get_shipment($shipment_id);
66
+ $label_data = $shipment->get_label();
67
+ \header('Content-type: ' . $this->prepare_content_type($label_data));
68
+ if ($this->get_action_parameter() === self::ACTION_DOWNLOAD) {
69
+ \header('Content-Disposition: attachment; filename=' . $label_data['file_name']);
70
+ }
71
+ echo $label_data['content'];
72
+ // phpcs:ignore
73
+ die;
74
+ }
75
+ /**
76
+ * Output shipping label.
77
+ *
78
+ * @internal
79
+ */
80
+ public function dispatch_label_if_requested()
81
+ {
82
+ \check_admin_referer('flexible_shipping_get_label');
83
+ $shipment_id = \filter_input(\INPUT_GET, 'shipment_id', \FILTER_VALIDATE_INT);
84
+ $integration = \get_post_meta($shipment_id, '_integration', \true);
85
+ if (!$integration) {
86
+ \wp_die(\__('Integration doesn\'t exists.', 'flexible-shipping'));
87
+ // phpcs:ignore
88
+ }
89
+ try {
90
+ $this->dispatch_label_and_die($shipment_id);
91
+ } catch (\FSVendor\WPDesk\FS\Shipment\Label\Exception $e) {
92
+ \wp_die(\esc_html($e->getMessage()), \esc_html(\__('Label error', 'flexible-shipping')));
93
+ }
94
+ }
95
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/CustomPostType.php ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor\WPDesk\FS\Shipment\Manifest;
4
+
5
+ use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
6
+ class ManifestCustomPostType implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable
7
+ {
8
+ public function hooks()
9
+ {
10
+ \add_action('init', array($this, 'register_post_types'), 20);
11
+ \add_action('admin_init', array($this, 'cancel_manifest'), 20);
12
+ \add_action('admin_init', array($this, 'download_manifest'), 20);
13
+ \add_action('admin_menu', array($this, 'admin_menu'), 199);
14
+ \add_action('add_meta_boxes', array($this, 'add_meta_boxes'), 20, 2);
15
+ \add_action('trash_shipping_manifest', array($this, 'trash_shipping_manifest'));
16
+ \add_filter('manage_edit-shipping_manifest_columns', array($this, 'manage_edit_shipping_manifest_columns'), 11);
17
+ \add_action('manage_shipping_manifest_posts_custom_column', array($this, 'manage_shipping_manifest_posts_custom_column'), 11);
18
+ \add_filter('post_row_actions', array($this, 'shipping_manifest_row_actions'), 10, 2);
19
+ \add_action('do_meta_boxes', array($this, 'hide_publish_metabox'));
20
+ \add_filter('woocommerce_screen_ids', array($this, 'woocommerce_screen_ids'));
21
+ \add_filter('bulk_actions-edit-shipping_manifest', array($this, 'bulk_actions_edit_shipping_manifest'));
22
+ \add_action('restrict_manage_posts', array($this, 'restrict_manage_posts'), 9999);
23
+ \add_filter('parse_query', array($this, 'parse_query'), 999);
24
+ }
25
+ /**
26
+ * Register post types.
27
+ */
28
+ public function register_post_types()
29
+ {
30
+ if (\post_type_exists('shipping_manifest')) {
31
+ return;
32
+ }
33
+ \register_post_type('shipping_manifest', array('labels' => array('name' => \__('Shipping Manifests', 'flexible-shipping'), 'singular_name' => \__('Shipping Manifest', 'flexible-shipping'), 'menu_name' => \__('Shipping Manifests', 'flexible-shipping'), 'parent_item_colon' => '', 'all_items' => \__('Shipping Manifests', 'flexible-shipping'), 'view_item' => \__('View Shipping Manifests', 'flexible-shipping'), 'add_new_item' => \__('Add new Shipping Manifest', 'flexible-shipping'), 'add_new' => \__('Add new Shipping Manifests', 'flexible-shipping'), 'edit_item' => \__('Edit Shipping Manifest', 'flexible-shipping'), 'update_item' => \__('Save Shipping Manifest', 'flexible-shipping'), 'search_items' => \__('Search Shipping Manifests', 'flexible-shipping'), 'not_found' => \__('Shipping Manifests not found', 'flexible-shipping'), 'not_found_in_trash' => \__('Shipping Manifests not found in trash', 'flexible-shipping')), 'description' => \__('Shipping Manifests.', 'flexible-shipping'), 'public' => \false, 'show_ui' => \true, 'capability_type' => 'post', 'capabilities' => array('create_posts' => \false), 'map_meta_cap' => \true, 'publicly_queryable' => \false, 'exclude_from_search' => \true, 'hierarchical' => \false, 'query_var' => \true, 'supports' => array('title'), 'has_archive' => \false, 'show_in_nav_menus' => \false, 'show_in_menu' => 'edit.php?post_type=shop_order', 'menu_icon' => 'dashicons-upload'));
34
+ }
35
+ public function admin_menu()
36
+ {
37
+ $show_in_menu = \current_user_can('manage_woocommerce') ? 'woocommerce' : \false;
38
+ if (\apply_filters('flexible_shipping_has_manifests', \false)) {
39
+ $slug = \add_submenu_page($show_in_menu, \__('Shipping Manifests', 'flexible-shipping'), \__('Shipping Manifests', 'flexible-shipping'), 'manage_woocommerce', 'edit.php?post_type=shipping_manifest');
40
+ }
41
+ }
42
+ public function add_meta_boxes($post_type, $post)
43
+ {
44
+ if ($post_type == 'shipping_manifest') {
45
+ /*
46
+ add_meta_box(
47
+ 'shipping_manifest_meta_box',
48
+ __('Shipping manifest data', 'flexible-shipping'),
49
+ array( $this, 'metabox' ),
50
+ 'shipping_manifest',
51
+ 'normal',
52
+ 'high'
53
+ );
54
+ */
55
+ \add_meta_box('shipping_manifest_shipments', \__('Shipments', 'flexible-shipping'), array($this, 'shipments_metabox'), 'shipping_manifest', 'normal', 'high');
56
+ }
57
+ }
58
+ public function metabox()
59
+ {
60
+ global $post;
61
+ echo '<pre>';
62
+ \print_r($post);
63
+ echo '</pre>';
64
+ $meta_data = \get_post_meta($post->ID);
65
+ foreach ($meta_data as $key => $val) {
66
+ echo '<pre>';
67
+ echo $key;
68
+ echo ' = ';
69
+ \print_r(\maybe_unserialize($val[0]));
70
+ echo '</pre>';
71
+ }
72
+ }
73
+ public function shipments_metabox()
74
+ {
75
+ global $post;
76
+ $manifest = fs_get_manifest($post->ID);
77
+ $shipments_array = $manifest->get_meta('_shipments', array());
78
+ $shipments = array();
79
+ foreach ($shipments_array as $shipment_id) {
80
+ $shipments[] = fs_get_shipment($shipment_id);
81
+ }
82
+ include 'views/manifest-metabox.php';
83
+ /*
84
+ echo "<pre>";
85
+ print_r($shipments);
86
+ echo "</pre>";
87
+ */
88
+ }
89
+ public function manage_edit_shipping_manifest_columns($columns)
90
+ {
91
+ unset($columns['title']);
92
+ unset($columns['date']);
93
+ unset($columns['cb']);
94
+ $columns['manifest_date'] = \__('Date', 'flexible-shipping');
95
+ $columns['integration'] = \__('Integration', 'flexible-shipping');
96
+ $columns['external_number'] = \__('Number', 'flexible-shipping');
97
+ $columns['shipment_count'] = \__('Shipments count', 'flexible-shipping');
98
+ $columns['actions'] = \__('Actions', 'flexible-shipping');
99
+ return $columns;
100
+ }
101
+ public function shipping_manifest_row_actions($actions, $post)
102
+ {
103
+ if ($post->post_type == 'shipping_manifest') {
104
+ $actions = array();
105
+ }
106
+ return $actions;
107
+ }
108
+ public function manage_shipping_manifest_posts_custom_column($column)
109
+ {
110
+ global $post;
111
+ global $manifest;
112
+ $integrations = \apply_filters('flexible_shipping_integration_options', array());
113
+ if (empty($manifest) || $manifest->get_id() != $post->ID) {
114
+ $manifest = fs_get_manifest($post->ID);
115
+ }
116
+ if ($column == 'manifest_date') {
117
+ echo $manifest->get_date();
118
+ }
119
+ if ($column == 'integration') {
120
+ echo $integrations[$manifest->get_integration()];
121
+ }
122
+ if ($column == 'external_number') {
123
+ $download_manifest_url = \admin_url('edit.php?post_type=shipping_manifest&flexible_shipping_download_manifest=' . $manifest->get_id() . '&nonce=' . \wp_create_nonce('flexible_shipping_download_manifest'));
124
+ include 'views/column-number.php';
125
+ }
126
+ if ($column == 'shipment_count') {
127
+ echo \count($manifest->get_meta('_shipments', array()));
128
+ }
129
+ if ($column == 'actions') {
130
+ if ($manifest->get_status() != 'trash') {
131
+ $download_manifest_url = \admin_url('edit.php?post_type=shipping_manifest&flexible_shipping_download_manifest=' . $manifest->get_id() . '&nonce=' . \wp_create_nonce('flexible_shipping_download_manifest'));
132
+ $cancel_url = \admin_url('edit.php?post_type=shipping_manifest&flexible_shipping_cancel_manifest=' . $manifest->get_id() . '&nonce=' . \wp_create_nonce('flexible_shipping_cancel_manifest'));
133
+ include 'views/column-actions.php';
134
+ }
135
+ }
136
+ }
137
+ public function woocommerce_screen_ids($screen_ids)
138
+ {
139
+ $screen_ids[] = 'edit-shipping_manifest';
140
+ $screen_ids[] = 'shipping_manifest';
141
+ return $screen_ids;
142
+ }
143
+ public function bulk_actions_edit_shipping_manifest($bulk_actions)
144
+ {
145
+ $bulk_actions = array();
146
+ return $bulk_actions;
147
+ }
148
+ public function cancel_manifest()
149
+ {
150
+ if (!empty($_GET['flexible_shipping_cancel_manifest']) && !empty($_GET['nonce'])) {
151
+ $nonce = \sanitize_text_field($_GET['nonce']);
152
+ if (!\wp_verify_nonce($nonce, 'flexible_shipping_cancel_manifest')) {
153
+ echo \__('Invalid nonce!', 'flexible-shipping');
154
+ exit;
155
+ }
156
+ $sendback = \admin_url('edit.php?post_type=shipping_manifest');
157
+ try {
158
+ $shipping_manifest_id = \sanitize_key($_GET['flexible_shipping_cancel_manifest']);
159
+ $shipping_manifest = fs_get_manifest($shipping_manifest_id);
160
+ $shipping_manifest->cancel();
161
+ fs_delete_manifest($shipping_manifest);
162
+ \wp_redirect($sendback);
163
+ exit;
164
+ } catch (\FSVendor\WPDesk\FS\Shipment\Manifest\Exception $e) {
165
+ \wp_redirect($sendback);
166
+ exit;
167
+ }
168
+ }
169
+ }
170
+ public function download_manifest()
171
+ {
172
+ if (!empty($_GET['flexible_shipping_download_manifest']) && !empty($_GET['nonce'])) {
173
+ $nonce = \sanitize_text_field($_GET['nonce']);
174
+ if (!\wp_verify_nonce($nonce, 'flexible_shipping_download_manifest')) {
175
+ echo \__('Invalid nonce!', 'flexible-shipping');
176
+ }
177
+ try {
178
+ $shipping_manifest_id = \sanitize_key($_GET['flexible_shipping_download_manifest']);
179
+ $shipping_manifest = fs_get_manifest($shipping_manifest_id);
180
+ $manifest = $shipping_manifest->get_manifest();
181
+ \header("Content-type: application/octet-stream");
182
+ \header("Content-Disposition: attachment; filename=" . $manifest['file_name']);
183
+ echo $manifest['content'];
184
+ } catch (\FSVendor\WPDesk\FS\Shipment\Manifest\Exception $e) {
185
+ echo $e->getMessage();
186
+ }
187
+ exit;
188
+ }
189
+ }
190
+ public function hide_publish_metabox()
191
+ {
192
+ \remove_meta_box('submitdiv', 'shipping_manifest', 'side');
193
+ }
194
+ public function trash_shipping_manifest($post_id)
195
+ {
196
+ $manifest = fs_get_manifest($post_id);
197
+ $shipments_posts = \get_posts(array('posts_per_page' => -1, 'post_type' => 'shipment', 'post_status' => 'any', 'meta_key' => '_manifest', 'meta_value' => $post_id));
198
+ foreach ($shipments_posts as $shipment_post) {
199
+ $shipment = fs_get_shipment($shipment_post->ID);
200
+ $shipment->delete_meta('_manifest');
201
+ $shipment->update_status('fs-confirmed');
202
+ $shipment->save();
203
+ }
204
+ $manifest->delete_meta('_shipments');
205
+ $manifest->save();
206
+ }
207
+ public function restrict_manage_posts()
208
+ {
209
+ global $typenow;
210
+ if ('shipping_manifest' == $typenow) {
211
+ $integrations = \apply_filters('flexible_shipping_integration_options', array());
212
+ foreach ($integrations as $key => $integration) {
213
+ if (!\class_exists('WPDesk_Flexible_Shipping_Manifest_' . $key)) {
214
+ unset($integrations[$key]);
215
+ }
216
+ }
217
+ $integration = '';
218
+ if (isset($_GET['flexible_shipping_integration_filter'])) {
219
+ $integration = \sanitize_key($_GET['flexible_shipping_integration_filter']);
220
+ }
221
+ include 'views/filter-form.php';
222
+ }
223
+ }
224
+ /**
225
+ * @param WP_Query $query .
226
+ */
227
+ public function parse_query($query)
228
+ {
229
+ global $pagenow;
230
+ if ('edit.php' == $pagenow && \is_admin() && isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'shipping_manifest') {
231
+ $integration = '';
232
+ if (isset($_GET['flexible_shipping_integration_filter'])) {
233
+ $integration = \sanitize_key($_GET['flexible_shipping_integration_filter']);
234
+ }
235
+ if ($integration != '') {
236
+ if ($integration != '') {
237
+ if (!isset($query->query_vars['meta_query'])) {
238
+ $query->query_vars['meta_query'] = array();
239
+ }
240
+ $meta_query = array();
241
+ $meta_query['key'] = '_integration';
242
+ $meta_query['value'] = $integration;
243
+ $query->query_vars['meta_query'][] = $meta_query;
244
+ }
245
+ }
246
+ }
247
+ }
248
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/views/column-actions.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ *
7
+ */
8
+ ?><a class="button button-primary" target="_blank" href="<?php
9
+ echo $download_manifest_url;
10
+ ?>"><?php
11
+ \_e('Download', 'flexible-shipping');
12
+ ?></a>
13
+ <a class="button" href="<?php
14
+ echo $cancel_url;
15
+ ?>"><?php
16
+ \_e('Cancel', 'flexible-shipping');
17
+ ?></a><?php
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/views/column-number.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ *
7
+ */
8
+ ?><a target="_blank" href="<?php
9
+ echo $download_manifest_url;
10
+ ?>"><?php
11
+ echo $manifest->get_number();
12
+ ?></a><?php
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/views/filter-form.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ *
7
+ */
8
+ ?><div class="alignleft actions">
9
+ <select name="flexible_shipping_integration_filter">
10
+ <option value=""><?php
11
+ \_e('All manifests', 'flexible-shipping');
12
+ ?></option>
13
+ <optgroup label="<?php
14
+ \_e('Integration', 'flexible-shipping');
15
+ ?>">
16
+ <?php
17
+ foreach ($integrations as $key => $val) {
18
+ ?>
19
+ <option value="<?php
20
+ echo $key;
21
+ ?>" <?php
22
+ echo $key == $integration ? 'selected' : '';
23
+ ?>><?php
24
+ echo $val;
25
+ ?></option>
26
+ <?php
27
+ }
28
+ ?>
29
+ </optgroup>
30
+ </select>
31
+ </div>
32
+ <?php
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Manifest/views/manifest-metabox.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ *
7
+ */
8
+ ?><table class="wp-list-table widefat fixed striped">
9
+ <thead>
10
+ <tr>
11
+ <th>
12
+ </th>
13
+ <th>
14
+ <?php
15
+ \_e('Shipment', 'flexible-shipping');
16
+ ?>
17
+ </th>
18
+ <th>
19
+ <?php
20
+ \_e('Order', 'flexible-shipping');
21
+ ?>
22
+ </th>
23
+ </tr>
24
+ </thead>
25
+
26
+ <tbody id="the-list">
27
+ <?php
28
+ $count = 0;
29
+ ?>
30
+ <?php
31
+ foreach ($shipments as $shipment) {
32
+ ?>
33
+ <?php
34
+ $count++;
35
+ $order = $shipment->get_order();
36
+ if (\version_compare(\WC_VERSION, '2.7', '<')) {
37
+ $order_id = $order->id;
38
+ } else {
39
+ $order_id = $order->get_id();
40
+ }
41
+ ?>
42
+ <tr>
43
+ <td>
44
+ <?php
45
+ echo $count;
46
+ ?>
47
+ </td>
48
+ <td>
49
+ <a href="<?php
50
+ echo $shipment->get_order_metabox_url();
51
+ ?>"><?php
52
+ echo $shipment->get_tracking_number();
53
+ ?></a>
54
+ </td>
55
+ <td>
56
+ <a href="<?php
57
+ echo \admin_url('post.php?action=edit&post=' . $order_id);
58
+ ?>"><?php
59
+ echo $order->get_order_number();
60
+ ?></a>
61
+ </td>
62
+ </tr>
63
+ <?php
64
+ }
65
+ ?>
66
+ </tbody>
67
+
68
+ <tfoot>
69
+ <tr>
70
+ <th>
71
+ </th>
72
+ <th>
73
+ <?php
74
+ \_e('Shipment', 'flexible-shipping');
75
+ ?>
76
+ </th>
77
+ <th>
78
+ <?php
79
+ \_e('Order', 'flexible-shipping');
80
+ ?>
81
+ </th>
82
+ </tr>
83
+ </tfoot>
84
+
85
+ </table><?php
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Metabox/Ajax.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor\WPDesk\FS\Shipment\Metabox;
4
+
5
+ use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
6
+ class Ajax implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable
7
+ {
8
+ public function hooks()
9
+ {
10
+ \add_action('wp_ajax_flexible_shipping', array($this, 'wp_ajax_flexible_shipping'));
11
+ }
12
+ public function wp_ajax_flexible_shipping()
13
+ {
14
+ $json = array('status' => 'fail');
15
+ $json['message'] = \__('Unknown error!', 'flexible-shipping');
16
+ if (empty($_REQUEST['nonce']) || !\wp_verify_nonce(\sanitize_text_field($_REQUEST['nonce']), 'flexible_shipping_shipment_nonce')) {
17
+ $json['status'] = 'fail';
18
+ $json['message'] = \__('Nonce verification error! Invalid request.', 'flexible-shipping');
19
+ } else {
20
+ if (empty($_REQUEST['shipment_id'])) {
21
+ $json['status'] = 'fail';
22
+ $json['message'] = \__('No shipment id!', 'flexible-shipping');
23
+ } else {
24
+ if (empty($_REQUEST['data']) || !\is_array($_REQUEST['data'])) {
25
+ $json['status'] = 'fail';
26
+ $json['message'] = \__('No data!', 'flexible-shipping');
27
+ } else {
28
+ $shipment = fs_get_shipment(\intval($_REQUEST['shipment_id']));
29
+ $action = \sanitize_key($_REQUEST['fs_action']);
30
+ $data = $_REQUEST['data'];
31
+ try {
32
+ $ajax_request = $shipment->ajax_request($action, $data);
33
+ if (\is_array($ajax_request)) {
34
+ $json['content'] = $ajax_request['content'];
35
+ $json['message'] = '';
36
+ if (isset($ajax_request['message'])) {
37
+ $json['message'] = $ajax_request['message'];
38
+ }
39
+ } else {
40
+ $json['content'] = $ajax_request;
41
+ $json['message'] = '';
42
+ if ($action == 'save') {
43
+ $json['message'] = \__('Saved', 'flexible-shipping');
44
+ }
45
+ if ($action == 'send') {
46
+ $json['message'] = \__('Created', 'flexible-shipping');
47
+ }
48
+ }
49
+ $json['status'] = 'success';
50
+ if (!empty($ajax_request['status'])) {
51
+ $json['status'] = $ajax_request['status'];
52
+ }
53
+ } catch (\Exception $e) {
54
+ $json['status'] = 'fail';
55
+ $json['message'] = $e->getMessage();
56
+ }
57
+ }
58
+ }
59
+ }
60
+ echo \json_encode($json);
61
+ die;
62
+ }
63
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Order/AddShippingMetabox.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class WPDesk_Flexible_Shipping_Add_Shipping
5
+ *
6
+ * @package Flexible Shipping
7
+ */
8
+ namespace FSVendor\WPDesk\FS\Shipment\Order;
9
+
10
+ use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
+ /**
12
+ * Can display maetabox and add new shipment.
13
+ */
14
+ class AddShippingMetabox implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable
15
+ {
16
+ /**
17
+ * Shipping added?
18
+ *
19
+ * @var bool
20
+ */
21
+ private $shipping_added = \false;
22
+ /**
23
+ * Hooks.
24
+ */
25
+ public function hooks()
26
+ {
27
+ \add_action('add_meta_boxes', array($this, 'add_meta_box'), 20, 2);
28
+ \add_action('admin_init', array($this, 'handle_add_shipping'));
29
+ }
30
+ /**
31
+ * Add shipping.
32
+ *
33
+ * @param string $integration Integration.
34
+ * @param array $get_data .
35
+ */
36
+ private function add_shipping($integration, $get_data)
37
+ {
38
+ $class_name = \apply_filters('flexible_shipping_shipment_class', 'WPDesk_Flexible_Shipping_Shipment_' . $integration, $integration);
39
+ if (\class_exists($class_name)) {
40
+ $order = \wc_get_order(\sanitize_key($get_data['post']));
41
+ if ($order) {
42
+ $order_id = $order->get_id();
43
+ $integration = \sanitize_key($get_data['fs_add_shipping']);
44
+ // Translators: order id and integration.
45
+ $post_title = \sprintf(\__('Shipment for order %1$s, %2$s', 'flexible-shipping'), $order_id, $integration);
46
+ $shipment_post = array('post_title' => $post_title, 'post_type' => 'shipment', 'post_status' => 'fs-new', 'post_parent' => $order_id);
47
+ $shipment_id = \wp_insert_post($shipment_post);
48
+ \update_post_meta($shipment_id, '_integration', $integration);
49
+ $shipment = fs_get_shipment($shipment_id, $order);
50
+ $shipment->set_created_via_add_shipment();
51
+ if (\method_exists($shipment, 'admin_add_shipment')) {
52
+ $shipment->admin_add_shipment();
53
+ }
54
+ $shipment->save();
55
+ $this->shipping_added = \true;
56
+ }
57
+ }
58
+ }
59
+ /**
60
+ * Handle add shipping.
61
+ */
62
+ public function handle_add_shipping()
63
+ {
64
+ if (isset($_GET['fs_add_shipping']) && isset($_GET['post']) && isset($_GET['_wpnonce'])) {
65
+ if (\wp_verify_nonce(\sanitize_key(\wp_unslash($_GET['_wpnonce'])), 'fs_add_shipping')) {
66
+ $integration = \sanitize_key($_GET['fs_add_shipping']);
67
+ $this->add_shipping($integration, $_GET);
68
+ }
69
+ }
70
+ }
71
+ /**
72
+ * Add metabox.
73
+ *
74
+ * @param string $post_type Post type.
75
+ * @param WP_Post $post Post.
76
+ */
77
+ public function add_meta_box($post_type, $post)
78
+ {
79
+ if ('shop_order' === $post_type) {
80
+ $select_options = \apply_filters('flexible_shipping_add_shipping_options', array());
81
+ if (\count($select_options)) {
82
+ $select_options = \array_merge(array('' => \__('Select integration', 'flexible-shipping')), $select_options);
83
+ $args = array('select_options' => $select_options, 'order_id' => $post->ID);
84
+ \add_meta_box('add_shipping_meta_box', \__('Add shipping', 'flexible-shipping'), array($this, 'display_order_metabox'), 'shop_order', 'side', 'default', $args);
85
+ }
86
+ }
87
+ }
88
+ /**
89
+ * Display order metabox.
90
+ *
91
+ * @param WP_Post $post Post.
92
+ * @param array $args Args.
93
+ */
94
+ public function display_order_metabox($post, $args)
95
+ {
96
+ $select_options = $args['args']['select_options'];
97
+ $order_id = $args['args']['order_id'];
98
+ $add_shipping_url = \admin_url('post.php?post=' . $order_id . '&action=edit');
99
+ $add_shipping_url = \wp_nonce_url($add_shipping_url, 'fs_add_shipping');
100
+ $add_shipping_url = \str_replace('&amp;', '&', $add_shipping_url);
101
+ include 'views/html-order-add_shipping-metabox.php';
102
+ }
103
+ }
{classes/wp-wpdesk-fs-shipment → vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Order}/views/html-order-add_shipping-metabox.php RENAMED
@@ -1,18 +1,22 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <?php
3
 
 
 
 
 
 
4
  $params = array(
5
- 'type' => 'select',
6
- 'options' => $select_options,
7
- 'class' => array('first','paczkomaty'),
8
- //'label' => __( 'Integration ', 'flexible-shipping' ),
9
- 'id' => 'fs_add_shipping',
10
  );
11
-
12
- woocommerce_form_field( 'fs_add_shipping', $params );
13
-
14
  ?>
15
- <button id="fs_add_shipping_button" class="button button-primary" href="" disabled="disabled"><?php _e( 'Add', 'flexible-shipping' ); ?></button>
 
 
16
  <script type="text/javascript">
17
  jQuery('#fs_add_shipping').change(function(){
18
  if ( jQuery(this).val() != '' ) {
@@ -24,17 +28,20 @@ woocommerce_form_field( 'fs_add_shipping', $params );
24
  })
25
  jQuery('#fs_add_shipping_button').click(function(e){
26
  e.preventDefault();
27
- window.location.href = '<?php echo $add_shipping_url; ?>' + '&fs_add_shipping=' + jQuery('#fs_add_shipping').val();
 
 
28
  });
29
  if ( typeof window.history.pushState == 'function' ) {
30
  var url = document.location.href;
31
  var url2 = document.location.href;
32
- url = fs_removeParam('_wpnonce', url);
33
- url = fs_removeParam('fs_add_shipping', url);
34
- url = fs_trimChar(url,'?');
35
  if ( url != url2 ) {
36
  window.history.pushState({}, "", url);
37
  }
38
  }
39
  </script>
40
 
 
 
1
  <?php
2
 
3
+ namespace FSVendor;
4
+
5
+ if (!\defined('ABSPATH')) {
6
+ exit;
7
+ }
8
  $params = array(
9
+ 'type' => 'select',
10
+ 'options' => $select_options,
11
+ 'class' => array('first', 'paczkomaty'),
12
+ //'label' => __( 'Integration ', 'flexible-shipping' ),
13
+ 'id' => 'fs_add_shipping',
14
  );
15
+ \woocommerce_form_field('fs_add_shipping', $params);
 
 
16
  ?>
17
+ <button id="fs_add_shipping_button" class="button button-primary" href="" disabled="disabled"><?php
18
+ \_e('Add', 'flexible-shipping');
19
+ ?></button>
20
  <script type="text/javascript">
21
  jQuery('#fs_add_shipping').change(function(){
22
  if ( jQuery(this).val() != '' ) {
28
  })
29
  jQuery('#fs_add_shipping_button').click(function(e){
30
  e.preventDefault();
31
+ window.location.href = '<?php
32
+ echo $add_shipping_url;
33
+ ?>' + '&fs_add_shipping=' + jQuery('#fs_add_shipping').val();
34
  });
35
  if ( typeof window.history.pushState == 'function' ) {
36
  var url = document.location.href;
37
  var url2 = document.location.href;
38
+ url = fs_shipment_removeParam('_wpnonce', url);
39
+ url = fs_shipment_removeParam('fs_add_shipping', url);
40
+ url = fs_shipment_trimChar(url,'?');
41
  if ( url != url2 ) {
42
  window.history.pushState({}, "", url);
43
  }
44
  }
45
  </script>
46
 
47
+ <?php
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvider.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor\WPDesk\FS\Shipment\RestApi;
4
+
5
+ /**
6
+ * Defines interface that REST API Order Data Provider should implement.
7
+ */
8
+ interface OrderDataProvider
9
+ {
10
+ /**
11
+ * Get data from shipment.
12
+ *
13
+ * @param \WPDesk_Flexible_Shipping_Shipment $shipment .
14
+ *
15
+ * @return array
16
+ */
17
+ public function get_data_from_shipment($shipment);
18
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProviderDefault.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class WPDesk_Flexible_Shipping_Rest_Api_Order_Data_Provider_Default
5
+ *
6
+ * @package Flexible Shipping
7
+ */
8
+ namespace FSVendor\WPDesk\FS\Shipment\RestApi;
9
+
10
+ /**
11
+ * Default data provider. Can get data from shipment.
12
+ */
13
+ class OrderDataProviderDefault implements \FSVendor\WPDesk\FS\Shipment\RestApi\OrderDataProvider
14
+ {
15
+ const FS_INTEGRATION = '_fs_integration';
16
+ const FS_METHOD = '_fs_method';
17
+ const COMMON_KEYS_TO_REMOVE = array(self::FS_METHOD, self::FS_INTEGRATION, '_shipping_method', '_package', '_packages');
18
+ /**
19
+ * Keys to remove.
20
+ *
21
+ * @var array
22
+ */
23
+ protected $keys_to_remove = array();
24
+ /**
25
+ * Get data from shipment.
26
+ *
27
+ * @param \WPDesk_Flexible_Shipping_Shipment $shipment .
28
+ *
29
+ * @return array
30
+ */
31
+ public function get_data_from_shipment($shipment)
32
+ {
33
+ return $this->remove_internal_data_from_shipment_data(\get_post_meta($shipment->get_id()));
34
+ }
35
+ /**
36
+ * Filter data.
37
+ *
38
+ * @param array $data .
39
+ *
40
+ * @return array
41
+ */
42
+ protected function remove_internal_data_from_shipment_data(array $data)
43
+ {
44
+ $keys_to_remove = \array_merge(self::COMMON_KEYS_TO_REMOVE, $this->keys_to_remove);
45
+ foreach ($keys_to_remove as $key) {
46
+ if (isset($data[$key])) {
47
+ unset($data[$key]);
48
+ }
49
+ }
50
+ return $this->format_data($data);
51
+ }
52
+ /**
53
+ * Format data.
54
+ *
55
+ * @param array $data .
56
+ *
57
+ * @return array
58
+ */
59
+ private function format_data(array $data)
60
+ {
61
+ $formatted_data = array();
62
+ foreach ($data as $key => $value) {
63
+ if (\is_array($value) && isset($value[0])) {
64
+ $formatted_data[$key] = $value[0];
65
+ } else {
66
+ $formatted_data[$key] = $value;
67
+ }
68
+ }
69
+ return $formatted_data;
70
+ }
71
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvidersCollection.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor\WPDesk\FS\Shipment\RestApi;
4
+
5
+ /**
6
+ * Data providers.
7
+ * Collects data providers and can return provider per integration or default provider.
8
+ */
9
+ class OrderDataProvidersCollection
10
+ {
11
+ /**
12
+ * Providers.
13
+ *
14
+ * @var OrderDataProvider[]
15
+ */
16
+ private $providers = array();
17
+ /**
18
+ * Add provider.
19
+ *
20
+ * @param string $integration .
21
+ * @param OrderDataProvider $provider .
22
+ */
23
+ public function set_provider($integration, \FSVendor\WPDesk\FS\Shipment\RestApi\OrderDataProvider $provider)
24
+ {
25
+ $this->providers[$integration] = $provider;
26
+ }
27
+ /**
28
+ * Get provider for integration.
29
+ *
30
+ * @param string $integration .
31
+ *
32
+ * @return OrderDataProvider
33
+ */
34
+ public function get_provider_for_integration($integration)
35
+ {
36
+ if (isset($this->providers[$integration])) {
37
+ return $this->providers[$integration];
38
+ }
39
+ return new \FSVendor\WPDesk\FS\Shipment\RestApi\OrderDataProviderDefault();
40
+ }
41
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderDataProvidersFactory.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor\WPDesk\FS\Shipment\RestApi;
4
+
5
+ /**
6
+ * Data providers factory.
7
+ */
8
+ class OrderDataProvidersFactory
9
+ {
10
+ /**
11
+ * Providers.
12
+ *
13
+ * @var OrderDataProvidersCollection
14
+ */
15
+ private static $data_providers = null;
16
+ /**
17
+ * Get data providers.
18
+ *
19
+ * @return OrderDataProvidersCollection
20
+ */
21
+ public static function get_providers()
22
+ {
23
+ if (empty(self::$data_providers)) {
24
+ self::$data_providers = new \FSVendor\WPDesk\FS\Shipment\RestApi\OrderDataProvidersCollection();
25
+ }
26
+ return self::$data_providers;
27
+ }
28
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/RestApi/OrderResponseDataAppender.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor\WPDesk\FS\Shipment\RestApi;
4
+
5
+ use WC_Order;
6
+ use WP_REST_Request;
7
+ use WP_REST_Response;
8
+ use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
9
+ use FSVendor\WPDesk_Flexible_Shipping_Shipment;
10
+ /**
11
+ * Can append shipments data to WooCommerce REST API Order response.
12
+ */
13
+ class OrderResponseDataAppender implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable
14
+ {
15
+ const REST_API_DATA_KEY = 'fs_shipping_lines';
16
+ /**
17
+ * Hooks.
18
+ */
19
+ public function hooks()
20
+ {
21
+ \add_filter('woocommerce_rest_prepare_shop_order_object', array($this, 'maybe_append_shipment_to_order_data'), 10, 3);
22
+ }
23
+ /**
24
+ * Appends shipment data if exists to order in REST API response.
25
+ *
26
+ * @param WP_REST_Response $response .
27
+ * @param WC_Order $order .
28
+ * @param WP_REST_Request $request .
29
+ *
30
+ * @return WP_REST_Response
31
+ */
32
+ public function maybe_append_shipment_to_order_data($response, $order, $request)
33
+ {
34
+ $shipments = fs_get_order_shipments($order->get_id());
35
+ if (!empty($shipments)) {
36
+ return $this->append_shipment_to_order_data($response, $order, $request, $shipments);
37
+ }
38
+ return $response;
39
+ }
40
+ /**
41
+ * Appends shipment data to order in REST API response.
42
+ *
43
+ * @param WP_REST_Response $response .
44
+ * @param WC_Order $order .
45
+ * @param WP_REST_Request $request .
46
+ * @param WPDesk_Flexible_Shipping_Shipment[] $shipments .
47
+ *
48
+ * @return WP_REST_Response
49
+ */
50
+ private function append_shipment_to_order_data($response, $order, $request, $shipments)
51
+ {
52
+ $response_data = $response->get_data();
53
+ if (empty($response_data[self::REST_API_DATA_KEY])) {
54
+ $response_data[self::REST_API_DATA_KEY] = array();
55
+ }
56
+ $providers = \FSVendor\WPDesk\FS\Shipment\RestApi\OrderDataProvidersFactory::get_providers();
57
+ foreach ($shipments as $shipment) {
58
+ $integration = $shipment->get_integration();
59
+ $data_provider = $providers->get_provider_for_integration($integration);
60
+ $response_data[self::REST_API_DATA_KEY][] = $data_provider->get_data_from_shipment($shipment);
61
+ }
62
+ $response->set_data($response_data);
63
+ return $response;
64
+ }
65
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/ShipmentFunctionality.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class ShipmentFunctionality
5
+ *
6
+ * @package WPDesk\FS\Shipment
7
+ */
8
+ namespace FSVendor\WPDesk\FS\Shipment;
9
+
10
+ use Psr\Log\LoggerInterface;
11
+ use FSVendor\WPDesk\FS\Shipment\Label\SingleLabelFileDispatcher;
12
+ use FSVendor\WPDesk\FS\Shipment\Manifest\ManifestCustomPostType;
13
+ use FSVendor\WPDesk\FS\Shipment\Metabox\Ajax;
14
+ use FSVendor\WPDesk\FS\Shipment\Order\AddShippingMetabox;
15
+ use FSVendor\WPDesk\FS\Shipment\RestApi\OrderResponseDataAppender;
16
+ use FSVendor\WPDesk\FS\Shipment\Subscriptions\SubscriptionsIntegration;
17
+ use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
18
+ /**
19
+ * Can load shipment functionality.
20
+ */
21
+ class ShipmentFunctionality implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable
22
+ {
23
+ const LOAD_PRIORITY = -1;
24
+ /**
25
+ * @var LoggerInterface
26
+ */
27
+ private $logger;
28
+ /**
29
+ * @var string
30
+ */
31
+ private $assets_url;
32
+ /**
33
+ * @var string
34
+ */
35
+ private $scripts_version;
36
+ /**
37
+ * @var bool
38
+ */
39
+ private $already_loaded = \false;
40
+ /**
41
+ * ShipmentFunctionality constructor.
42
+ *
43
+ * @param LoggerInterface $logger .
44
+ * @param string $assets_url .
45
+ * @param string $scripts_version .
46
+ */
47
+ public function __construct(\Psr\Log\LoggerInterface $logger, $assets_url, $scripts_version)
48
+ {
49
+ $this->logger = $logger;
50
+ $this->assets_url = $assets_url;
51
+ $this->scripts_version = $scripts_version;
52
+ }
53
+ /**
54
+ * Hooks.
55
+ */
56
+ public function hooks()
57
+ {
58
+ \add_action('plugins_loaded', [$this, 'load_functionality_on_init'], self::LOAD_PRIORITY);
59
+ \add_filter('flexible-shipping/shipment/load-functionality', [$this, 'load_functionality_if_not_already_loaded']);
60
+ }
61
+ /**
62
+ * @internal
63
+ */
64
+ public function load_functionality_on_init()
65
+ {
66
+ $this->already_loaded = (bool) \apply_filters('flexible-shipping/shipment/load-functionality', $this->already_loaded);
67
+ }
68
+ /**
69
+ * Load functionality if not already loaded;
70
+ *
71
+ * @param bool $already_loaded .
72
+ *
73
+ * @return bool
74
+ *
75
+ * @internal
76
+ */
77
+ public function load_functionality_if_not_already_loaded($already_loaded)
78
+ {
79
+ $class = 'WPDesk_Flexible_Shipping_Shipment';
80
+ if (!$already_loaded && !\class_exists($class)) {
81
+ $this->load_functionality();
82
+ }
83
+ $this->already_loaded = \true;
84
+ return \true;
85
+ }
86
+ /**
87
+ * Load functionalituy.
88
+ */
89
+ private function load_functionality()
90
+ {
91
+ $this->load_dependencies();
92
+ $class = 'WPDesk_Flexible_Shipping_Shipment';
93
+ $class::set_fs_logger($this->logger);
94
+ $shipment_cpt = new \FSVendor\WPDesk\FS\Shipment\CustomPostType();
95
+ $shipment_cpt->hooks();
96
+ $subscriptions_integration = new \FSVendor\WPDesk\FS\Shipment\Subscriptions\SubscriptionsIntegration($shipment_cpt);
97
+ $subscriptions_integration->hooks();
98
+ $add_shipping_metabox = new \FSVendor\WPDesk\FS\Shipment\Order\AddShippingMetabox();
99
+ $add_shipping_metabox->hooks();
100
+ $single_label_file_dispatcher = new \FSVendor\WPDesk\FS\Shipment\Label\SingleLabelFileDispatcher();
101
+ $single_label_file_dispatcher->hooks();
102
+ $metabox_ajax = new \FSVendor\WPDesk\FS\Shipment\Metabox\Ajax();
103
+ $metabox_ajax->hooks();
104
+ $manifest_cpt = new \FSVendor\WPDesk\FS\Shipment\Manifest\ManifestCustomPostType();
105
+ $manifest_cpt->hooks();
106
+ $rest_api_order_response_data_appender = new \FSVendor\WPDesk\FS\Shipment\RestApi\OrderResponseDataAppender();
107
+ $rest_api_order_response_data_appender->hooks();
108
+ $assets = new \FSVendor\WPDesk\FS\Shipment\Assets($this->assets_url, $this->scripts_version);
109
+ $assets->hooks();
110
+ }
111
+ /**
112
+ * Load dependencies.
113
+ */
114
+ private function load_dependencies()
115
+ {
116
+ $interfaces_dir = __DIR__ . '/../../../../../../../vendor/wpdesk/wp-wpdesk-fs-shipment-interfaces';
117
+ require_once $interfaces_dir . '/classes/shipment/interface-shipment.php';
118
+ require_once $interfaces_dir . '/classes/shipment/class-shipment.php';
119
+ require_once $interfaces_dir . '/classes/shipment/functions.php';
120
+ require_once $interfaces_dir . '/classes/manifest/functions.php';
121
+ require_once $interfaces_dir . '/classes/exception/class-cancel-shipment-exception.php';
122
+ require_once $interfaces_dir . '/classes/exception/class-get-label-exception.php';
123
+ require_once $interfaces_dir . '/classes/exception/class-label-not-available-exception.php';
124
+ require_once $interfaces_dir . '/classes/exception/class-send-shipment-exception.php';
125
+ require_once $interfaces_dir . '/classes/exception/class-shipment-plan-exceeded-exception.php';
126
+ require_once $interfaces_dir . '/classes/exception/class-shipment-unable-to-create-tmp-file-exception.php';
127
+ require_once $interfaces_dir . '/classes/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php';
128
+ require_once $interfaces_dir . '/classes/label/interface-labels-builder.php';
129
+ require_once $interfaces_dir . '/classes/label/class-integration-label-builder.php';
130
+ require_once $interfaces_dir . '/classes/manifest/interface-manifest.php';
131
+ require_once $interfaces_dir . '/classes/manifest/class-manifest.php';
132
+ require_once $interfaces_dir . '/classes/manifest/class-manifest-fs.php';
133
+ require_once $interfaces_dir . '/classes/manifest/functions.php';
134
+ }
135
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Subscriptions/SubscriptionsIntegration.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class SubscriptionsIntegration
5
+ *
6
+ * @package WPDesk\FS\Shipment
7
+ */
8
+ namespace FSVendor\WPDesk\FS\Shipment\Subscriptions;
9
+
10
+ use FSVendor\WPDesk\FS\Shipment\CustomPostType;
11
+ use FSVendor\WPDesk\FS\Shipment\WPDesk_Flexible_Shipping_Shipment;
12
+ use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
13
+ use function add_action;
14
+ use function add_filter;
15
+ use function apply_filters;
16
+ use function do_action;
17
+ use function FSVendor\fs_create_shipment;
18
+ use function FSVendor\fs_get_order_shipments;
19
+ /**
20
+ * Integrates Shipments with WooCommerce Subscriptions plugin.
21
+ */
22
+ class SubscriptionsIntegration implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable
23
+ {
24
+ /**
25
+ * @var CustomPostType
26
+ */
27
+ private $shipment_cpt;
28
+ /**
29
+ * SubscriptionsIntegration constructor.
30
+ *
31
+ * @param CustomPostType $shipment_cpt .
32
+ */
33
+ public function __construct(\FSVendor\WPDesk\FS\Shipment\CustomPostType $shipment_cpt)
34
+ {
35
+ $this->shipment_cpt = $shipment_cpt;
36
+ }
37
+ /**
38
+ * .
39
+ */
40
+ public function hooks()
41
+ {
42
+ $last_priority = \PHP_INT_MAX;
43
+ \add_action('woocommerce_checkout_subscription_created', array($this, 'create_shipping_for_subscription'), $last_priority, 3);
44
+ \add_filter('wcs_renewal_order_created', array($this, 'create_shipping_for_order_from_subscription'), 10, 2);
45
+ }
46
+ /**
47
+ * @param \WC_Subscription $subscription .
48
+ * @param \WC_Order $order .
49
+ * @param \WC_Cart $recurring_cart .
50
+ */
51
+ public function create_shipping_for_subscription($subscription, $order, $recurring_cart)
52
+ {
53
+ $this->shipment_cpt->create_shipping_for_order_and_cart($subscription, $recurring_cart);
54
+ }
55
+ /**
56
+ * @param \WC_Order $order .
57
+ * @param \WC_Subscription $subscription .
58
+ */
59
+ public function create_shipping_for_order_from_subscription($order, $subscription)
60
+ {
61
+ $subscription_shipments = \FSVendor\fs_get_order_shipments($subscription->get_id());
62
+ foreach ($subscription_shipments as $shipment) {
63
+ $this->create_single_shipment($shipment, $order);
64
+ }
65
+ return $order;
66
+ }
67
+ /**
68
+ * @param \WPDesk_Flexible_Shipping_Shipment $shipment .
69
+ * @param \WC_Order $order .
70
+ */
71
+ private function create_single_shipment(\FSVendor\WPDesk_Flexible_Shipping_Shipment $shipment, \WC_Order $order)
72
+ {
73
+ $meta_data = $shipment->get_meta_data();
74
+ $fs_method = $shipment->get_meta('_fs_method', array('method_integration' => $shipment->get_integration()));
75
+ $order_shipment = \FSVendor\fs_create_shipment($order, $fs_method);
76
+ $integration = $order_shipment->get_integration();
77
+ $this->setup_shipment_meta_data($meta_data, $integration, $shipment, $order_shipment);
78
+ $order_shipment->save();
79
+ /**
80
+ * New shipment created from subscription.
81
+ *
82
+ * @param WPDesk_Flexible_Shipping_Shipment $order_shipment Created shipment.
83
+ */
84
+ \do_action('flexible-shipping/shipment-from-subscription/created/' . $integration, $order_shipment);
85
+ }
86
+ /**
87
+ * @param array $meta_data .
88
+ * @param string $integration .
89
+ * @param \WPDesk_Flexible_Shipping_Shipment $shipment .
90
+ * @param \WPDesk_Flexible_Shipping_Shipment $order_shipment .
91
+ */
92
+ private function setup_shipment_meta_data(array $meta_data, $integration, \FSVendor\WPDesk_Flexible_Shipping_Shipment $shipment, \FSVendor\WPDesk_Flexible_Shipping_Shipment $order_shipment)
93
+ {
94
+ foreach ($meta_data as $meta_key => $meta_value) {
95
+ $order_shipment_meta_value = \apply_filters('flexible-shipping/shipment-from-subscription/meta-value/' . $integration, $shipment->get_meta($meta_key), $meta_key, $order_shipment);
96
+ $order_shipment->set_meta($meta_key, $order_shipment_meta_value);
97
+ }
98
+ }
99
+ }
vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/views/order-metabox.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FSVendor;
4
+
5
+ /**
6
+ *
7
+ */
8
+ ?><div class="flexible_shipping_shipment" id="flexible_shipping_shipment_<?php
9
+ echo $shipment->get_id();
10
+ ?>" data-id="<?php
11
+ echo $shipment_id;
12
+ ?>">
13
+ <?php
14
+ \wp_nonce_field('flexible_shipping_shipment_nonce', 'flexible_shipping_shipment_nonce_' . $shipment_id, \false);
15
+ ?>
16
+ <div class="flexible_shipping_shipment_content">
17
+ <?php
18
+ $shipment->order_metabox();
19
+ ?>
20
+ </div>
21
+ <div class="flexible_shipping_shipment_message flexible_shipping_shipment_message_error" style="<?php
22
+ echo $message_css_style;
23
+ ?>">
24
+ <?php
25
+ echo $message;
26
+ ?>
27
+ </div>
28
+ </div>
29
+ <?php