Changeset 2566078
- Timestamp:
- 07/16/2021 08:49:58 PM (5 years ago)
- Location:
- wc-poczta
- Files:
-
- 35 added
- 7 edited
-
tags/1.3.0 (added)
-
tags/1.3.0/LICENSE (added)
-
tags/1.3.0/assets (added)
-
tags/1.3.0/assets/css (added)
-
tags/1.3.0/assets/css/wc-poczta.min.css (added)
-
tags/1.3.0/assets/img (added)
-
tags/1.3.0/assets/img/abc-logo.png (added)
-
tags/1.3.0/assets/img/biedronka-logo.png (added)
-
tags/1.3.0/assets/img/envelo-logo.png (added)
-
tags/1.3.0/assets/img/inpost-logo.svg (added)
-
tags/1.3.0/assets/img/lewiatan-logo.png (added)
-
tags/1.3.0/assets/img/orlen-logo.svg (added)
-
tags/1.3.0/assets/img/ruch-logo.png (added)
-
tags/1.3.0/assets/img/zabka-logo.svg (added)
-
tags/1.3.0/assets/js (added)
-
tags/1.3.0/assets/js/wc-poczta-admin.min.js (added)
-
tags/1.3.0/assets/js/wc-poczta.min.js (added)
-
tags/1.3.0/code (added)
-
tags/1.3.0/code/components (added)
-
tags/1.3.0/code/components/EasyPack.php (added)
-
tags/1.3.0/code/components/Poczta.php (added)
-
tags/1.3.0/code/core (added)
-
tags/1.3.0/code/core/Actions.php (added)
-
tags/1.3.0/code/core/Bootstrap.php (added)
-
tags/1.3.0/code/core/ShippingMethod.php (added)
-
tags/1.3.0/code/core/ShippingRegistrar.php (added)
-
tags/1.3.0/code/views (added)
-
tags/1.3.0/code/views/customer.php (added)
-
tags/1.3.0/code/views/notice.php (added)
-
tags/1.3.0/code/views/summary-depracted.php (added)
-
tags/1.3.0/code/views/summary.php (added)
-
tags/1.3.0/languages (added)
-
tags/1.3.0/languages/wc_poczta-pl_PL.mo (added)
-
tags/1.3.0/readme.txt (added)
-
tags/1.3.0/wc-poczta.php (added)
-
trunk/code/components/EasyPack.php (modified) (1 diff)
-
trunk/code/components/Poczta.php (modified) (2 diffs)
-
trunk/code/core/Actions.php (modified) (6 diffs)
-
trunk/code/core/ShippingMethod.php (modified) (1 diff)
-
trunk/languages/wc_poczta-pl_PL.mo (modified) (previous)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/wc-poczta.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-poczta/trunk/code/components/EasyPack.php
r2565920 r2566078 164 164 $totalWeight = (float) $this->getCartWeight($package); 165 165 166 if ($weightLimit > 1&& $totalWeight > $weightLimit) {166 if ($weightLimit > 0 && $totalWeight > $weightLimit) { 167 167 return; //Permitted weight exceeded 168 168 } -
wc-poczta/trunk/code/components/Poczta.php
r2565920 r2566078 64 64 'options' => [ 65 65 'poczta' => __('Poczta', Bootstrap::DOMAIN), 66 'automat_placowka' => __('Post Office Pickup machine', Bootstrap::DOMAIN), 67 'automat_pocztowy' => __('Post Pickup machine', Bootstrap::DOMAIN), 68 'skrzynka_pocztowa' => __('Post mailbox', Bootstrap::DOMAIN), 69 'zabka' => __('Żabka store', Bootstrap::DOMAIN), 70 'ruch' => __('Ruch store', Bootstrap::DOMAIN), 66 71 'orlen' => __('Orlen petrol stations', Bootstrap::DOMAIN), 67 'automat_pocztowy' => __('Post Pickup machine', Bootstrap::DOMAIN), 68 'ruch' => __('Ruch store', Bootstrap::DOMAIN), 69 'zabka' => __('Żabka store', Bootstrap::DOMAIN), 72 'biedronka' => __('Biedronka store', Bootstrap::DOMAIN), 70 73 'freshmarket' => __('Freshmarket store', Bootstrap::DOMAIN), 71 74 'automat_biedronka' => __('Biedronka store Pickup machine', Bootstrap::DOMAIN), 72 75 'automat_carrefour' => __('Carrefour store Pickup machine', Bootstrap::DOMAIN), 73 'automat_placowka' => __('Post Office Pickup machine', Bootstrap::DOMAIN),74 76 'automat_spolem' => __('Społem store Pickup machine', Bootstrap::DOMAIN), 75 'skrzynka_pocztowa' => __('Post mailbox', Bootstrap::DOMAIN),76 77 'automat_lewiatan' => __('Lewiatan store Pickup machine', Bootstrap::DOMAIN), 77 78 'lewiatan' => __('Lewiatan store', Bootstrap::DOMAIN), 78 79 'abc' => __('ABC store', Bootstrap::DOMAIN), 79 80 'delikatesy_centrum' => __('Deli Center store', Bootstrap::DOMAIN), 80 'biedronka' => __('Biedronka store', Bootstrap::DOMAIN),81 81 'kaufland' => __('Kaufland store', Bootstrap::DOMAIN), 82 82 ] … … 113 113 $totalWeight = (float) $this->getCartWeight($package); 114 114 115 if ($weightLimit > 1&& $totalWeight > $weightLimit) {115 if ($weightLimit > 0 && $totalWeight > $weightLimit) { 116 116 return; //Permitted weight exceeded 117 117 } -
wc-poczta/trunk/code/core/Actions.php
r2565920 r2566078 13 13 14 14 use WP_Post; 15 use WC_Order; 15 16 16 17 final class Actions … … 54 55 add_action('woocommerce_checkout_process', [$this, 'customFieldsValidation']); 55 56 add_action('woocommerce_checkout_update_order_meta', [$this, 'customFieldsSave']); 56 add_action('woocommerce_order_details_after_customer_details', [$this, 'customDetails'], 1, 1); 57 add_action('woocommerce_after_order_details', [$this, 'customDetails'], 1, 1); 58 add_filter('woocommerce_email_order_meta', [$this, 'emailDetails'], 10, 3); 57 59 58 60 add_action('add_meta_boxes', function () { … … 196 198 $containerSuf = '</td></tr>'; 197 199 198 if ('Storefront' == $theme->Name) {200 if ('Storefront' == $theme->Name) { 199 201 $containerPre = '<tr class="wc-poczta wc-poczta-select-point"><th colspan="2">'; 200 202 $containerSuf = '</th></tr>'; … … 273 275 * @param Automattic\WooCommerce\Admin\Overrides\Order $order 274 276 */ 275 public function customDetails( $order): void277 public function customDetails(WC_Order $order): void 276 278 { 277 279 $orderId = $order->get_id(); … … 283 285 284 286 $this->bootstrap->getPluginView('customer', ['id' => $orderId, 'wcpId' => $wcpId, 'order' => $order, 'weight' => $this->getTotalWeight($order)]); 287 } 288 289 public function emailDetails($order, $sentToAdmin, $plainText) 290 { 291 $orderId = $order->get_id(); 292 $wpcId = get_post_meta($orderId, '_wcpoczta_id', true); 293 294 if (empty($wpcId)) { 295 return; 296 } 297 298 $weight = $this->getTotalWeight($order); 299 $html = ''; 300 301 if ($plainText === false) { 302 $html .= '<h2>' . __('Delivery to the pickup point', Bootstrap::DOMAIN) . '</h2>'; 303 304 $html .= '<p><strong>' . __('Pickup point', Bootstrap::DOMAIN) . ':</strong> ' . get_post_meta($orderId, '_wcpoczta_name', true); 305 $html .= '<br><strong>' . __('Phone', Bootstrap::DOMAIN) . ':</strong> ' . $order->get_billing_phone(); 306 $html .= '<br><strong>' . __('Weight', Bootstrap::DOMAIN) . ':</strong> ' . ($weight > 0 ? $weight . ' ' . get_option('woocommerce_weight_unit') : __('Unknown', Bootstrap::DOMAIN)); 307 $html .= '</p>'; 308 309 $html .= '<p><strong>' . __('Pickup point address', Bootstrap::DOMAIN) . ':</strong>'; 310 $html .= '<br>' . get_post_meta($orderId, '_wcpoczta_address', true); 311 $html .= '<br>' . get_post_meta($orderId, '_wcpoczta_zipcode', true); 312 $html .= '<br>' . get_post_meta($orderId, '_wcpoczta_city', true); 313 $html .= '</p>'; 314 } else { 315 $html .= __('Delivery to the pickup point', Bootstrap::DOMAIN) . PHP_EOL; 316 $html .= __('Pickup point', Bootstrap::DOMAIN) . ' - ' . get_post_meta($orderId, '_wcpoczta_name', true) . PHP_EOL . PHP_EOL; 317 318 $html .= __('Pickup point address', Bootstrap::DOMAIN) . ':' . PHP_EOL; 319 $html .= get_post_meta($orderId, '_wcpoczta_address', true) . PHP_EOL; 320 $html .= get_post_meta($orderId, '_wcpoczta_zipcode', true) . PHP_EOL; 321 $html .= get_post_meta($orderId, '_wcpoczta_city', true); 322 } 323 324 echo $html; 285 325 } 286 326 … … 364 404 foreach ($order->get_items() as $productId => $product) { 365 405 $quantity = $product->get_quantity(); 366 406 367 407 $product = $product->get_product(); 368 408 $productWeight = $product->get_weight(); -
wc-poczta/trunk/code/core/ShippingMethod.php
r2565920 r2566078 12 12 namespace WCPoczta\Code\Core; 13 13 14 use \WC_Shipping_Method;14 use WC_Shipping_Method; 15 15 use WCPoczta\Code\Core\Bootstrap; 16 16 -
wc-poczta/trunk/readme.txt
r2565920 r2566078 6 6 Tested up to: 5.8.0 7 7 Requires PHP: 7.4.1 8 Stable tag: wc-poczta8 Stable tag: trunk 9 9 License: GPL-3.0 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.txt … … 35 35 = Contribute = 36 36 37 WC Poczta is developed and supported by RapidDev, the creators of other WordPress solutions that are appreciated by te community. Did you find a new solution, bug fixor have a suggestion? Be sure to let us know!37 WC Poczta is developed and supported by RapidDev, the creators of other WordPress solutions that are appreciated by te community. Did you find a bug or have a suggestion? Be sure to let us know! 38 38 39 39 == Frequently asked questions == … … 77 77 = Minimum Requirements = 78 78 79 * PHP version 7.4. 6or greater (PHP 8.0.8 or greater is recommended)79 * PHP version 7.4.1 or greater (PHP 8.0.8 or greater is recommended) 80 80 * WordPress version 5.0.0 or greater (WordPress 5.7.2 or greater is recommended) 81 81 * WooCommerce version 5.0.0 or greater (WooCommerce 5.5.1 or greater is recommended) … … 102 102 == Changelog == 103 103 104 = 1.3.0 = 105 1. Fixing the weight limit 106 2. Correct the display of pickup point in order summary 107 3. Email fields added 108 104 109 = 1.2.0 = 105 110 1. Everything is new … … 125 130 == Upgrade Notice == 126 131 132 = 1.3.0 = 133 Fixing the weight limit and add custom e-mail fields. 134 127 135 = 1.2.0 = 128 136 The new version of the plug is not compatible with the old one. Be careful while updating. -
wc-poczta/trunk/wc-poczta.php
r2565920 r2566078 17 17 * License: GPL-3.0 18 18 * License URI: https://www.gnu.org/licenses/gpl-3.0.txt 19 * Version: 1. 2.019 * Version: 1.3.0 20 20 * Text Domain: wc_poczta 21 21 * Domain Path: /languages … … 40 40 require_once $pluginPath . 'code/core/' . 'ShippingRegistrar.php'; 41 41 42 \WCPoczta\Code\Core\Bootstrap::init($pluginPath, plugin_dir_url(__FILE__), '1. 2.1697');42 \WCPoczta\Code\Core\Bootstrap::init($pluginPath, plugin_dir_url(__FILE__), '1.3.156'); 43 43 } else { 44 44 add_action('admin_notices', function () {
Note: See TracChangeset
for help on using the changeset viewer.