Plugin Directory

Changeset 3090713


Ignore:
Timestamp:
05/22/2024 08:49:38 AM (21 months ago)
Author:
makecommerce
Message:

Release 3.5.0

Location:
makecommerce/trunk
Files:
8 added
25 edited

Legend:

Unmodified
Added
Removed
  • makecommerce/trunk/README.txt

    r3017107 r3090713  
    44Requires at least: 5.6.1
    55Tested up to: 6.3.2
    6 Stable tag: 3.4.2
     6Stable tag: 3.5.0
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    8080
    8181== Changelog ==
     82
     83= 3.5.0 2024-05-22 =
     84* Feature - Support for WooCommerce Blocks checkout
     85* Tweak - Shipment registration flow without credentials
     86* Tweak - Adjust the free shipping calculation
     87* Tweak - Removed pay later promotion options
     88* Tweak - Expiration times for transients
     89* Tweak - Additional app info fields to requests
     90* Tweak - Introduction of Shipping+ instead of TMS
     91* Tweak - Improved transaction and amount matching
     92* Fix - Incorrect query prefix
     93* Fix - Duplicate parcel machine list initializations
     94* Fix - Use of non-existing class
    8295
    8396= 3.4.2 2024-01-03 =
  • makecommerce/trunk/includes/vendor/Maksekeskus.php

    r2830541 r3090713  
    916916            "module_version" => MAKECOMMERCE_VERSION,
    917917            "platform" => "WooCommerce",
    918             "platform_version" => WC_VERSION
     918            "platform_version" => WC_VERSION,
     919            "map_enabled" => filter_var( get_option( 'mc_parcel_machine_map' ), FILTER_VALIDATE_BOOLEAN ),
     920            "geocoding_enabled" => filter_var( get_option( 'mc_map_geocoding' ), FILTER_VALIDATE_BOOLEAN ),
     921            "hpos_enabled" => filter_var( get_option( 'woocommerce_custom_orders_table_enabled' ), FILTER_VALIDATE_BOOLEAN )
    919922        );
    920923
  • makecommerce/trunk/languages/wc_makecommerce_domain-et.po

    r3012381 r3090713  
    944944msgid "Please be aware that changing the credentials to API key will affect generating labels for all old shipments. Please generate all labels needed for already created shipments before migrating to new API."
    945945msgstr "Palun pane tähele, et API võtme andmete muutmine mõjutab ka kõikide varasemate saadetiste pakisiltide loomist. Palun loo juba valmis saadetiste pakisildid enne uuele API-le üleminekut."
     946
     947msgid "Order total and transaction amount did not match! Please contact us at"
     948msgstr "Tellimuse maksumus ja tehingu summa ei ühti! Palun võta meiega ühendust aadressil"
     949
     950msgid "[email protected]"
     951msgstr "[email protected]"
     952
     953msgid "Transaction ID that was assigned to this order"
     954msgstr "Selle tellimusega seotud tehingu ID"
     955
     956msgid "Amount that was paid"
     957msgstr "Summa, mis maksti"
     958
     959msgid "use the Shipping+ service"
     960msgstr "kasuta teenust Tarne+"
     961
     962msgid "Request failed: missing credentials"
     963msgstr "Päring ebaõnnestus: puuduvad kasutajatunnused"
     964
     965msgid "Request failed: invalid sender or destination data"
     966msgstr "Päring ebaõnnestus: saatja või sihtkoha andmed on valed"
  • makecommerce/trunk/languages/wc_makecommerce_domain-lt.po

    r3012381 r3090713  
    944944msgid "Please be aware that changing the credentials to API key will affect generating labels for all old shipments. Please generate all labels needed for already created shipments before migrating to new API."
    945945msgstr "Atminkite, kad prisijungimo duomenų pakeitimas į API raktą turės įtakos visų senų siuntų etikečių generavimui. Prieš perkeldami į naują API, sugeneruokite visas reikalingas etiketes jau sukurtoms siuntoms."
     946
     947msgid "Order total and transaction amount did not match! Please contact us at"
     948msgstr "Užsakymo suma ir operacijos suma nesutapo! Prašome susisiekti su mumis"
     949
     950msgid "[email protected]"
     951msgstr "[email protected]"
     952
     953msgid "Transaction ID that was assigned to this order"
     954msgstr "Operacijos ID, kuris buvo priskirtas šiam užsakymui"
     955
     956msgid "Amount that was paid"
     957msgstr "Suma, kuri buvo sumokėta"
     958
     959msgid "use the Shipping+ service"
     960msgstr "naudotis paslauga „Siuntimas+“."
     961
     962msgid "Request failed: missing credentials"
     963msgstr "Užklausa nepavyko: trūksta prisijungimo duomenų"
     964
     965msgid "Request failed: invalid sender or destination data"
     966msgstr "Užklausa nepavyko: neteisingi siuntėjo arba paskirties duomenys"
  • makecommerce/trunk/languages/wc_makecommerce_domain-lv.po

    r3012381 r3090713  
    944944msgid "Please be aware that changing the credentials to API key will affect generating labels for all old shipments. Please generate all labels needed for already created shipments before migrating to new API."
    945945msgstr "Lūdzu, ņemiet vērā, ka akreditācijas datu maiņa uz API atslēgu ietekmēs adrešu kartes ģenerēšanu visiem iepriekšējiem sūtījumiem. Pirms migrēšanas uz jaunu API, lūdzu, izveidojiet visas nepieciešamās adrešu kartes jau izveidotajiem sūtījumiem."
     946
     947msgid "Order total and transaction amount did not match! Please contact us at"
     948msgstr "Pasūtījuma kopsumma un darījuma summa nesakrita! Lūdzu, sazinieties ar mums "
     949
     950msgid "[email protected]"
     951msgstr "[email protected]"
     952
     953msgid "Transaction ID that was assigned to this order"
     954msgstr "Darījuma ID, kas tika piešķirts šim pasūtījumam"
     955
     956msgid "Amount that was paid"
     957msgstr "Summa, kas tika samaksāta"
     958
     959msgid "use the Shipping+ service"
     960msgstr "izmantojiet pakalpojumu Piegāde+"
     961
     962msgid "Request failed: missing credentials"
     963msgstr "Pieprasījums neizdevās: trūkst akreditācijas datu"
     964
     965msgid "Request failed: invalid sender or destination data"
     966msgstr "Pieprasījums neizdevās: nederīgi sūtītāja vai galamērķa dati"
  • makecommerce/trunk/languages/wc_makecommerce_domain-ru.po

    r3012381 r3090713  
    946946msgid "Please be aware that changing the credentials to API key will affect generating labels for all old shipments. Please generate all labels needed for already created shipments before migrating to new API."
    947947msgstr "Пожалуйста, обратите внимание, что изменение учетных данных на API-ключ повлияет на генерацию этикеток для всех старых посылках. Пожалуйста, сгенерируйте все необходимые этикетки для уже созданных поставок до перехода на новый API."
     948
     949msgid "Order total and transaction amount did not match! Please contact us at"
     950msgstr "Сумма заказа и сумма транзакции не совпали! Пожалуйста, свяжитесь с нами"
     951
     952msgid "[email protected]"
     953msgstr "[email protected]"
     954
     955msgid "Transaction ID that was assigned to this order"
     956msgstr "Идентификатор транзакции, присвоенный этому заказу"
     957
     958msgid "Amount that was paid"
     959msgstr "Сумма, которая была выплачена"
     960
     961msgid "use the Shipping+ service"
     962msgstr "воспользоваться услугой Доставка+"
     963
     964msgid "Request failed: missing credentials"
     965msgstr "Запрос не выполнен: отсутствуют данные учетной записи"
     966
     967msgid "Request failed: invalid sender or destination data"
     968msgstr "Запрос не выполнен: неверные данные отправителя или места назначения."
  • makecommerce/trunk/languages/wc_makecommerce_domain.pot

    r3012381 r3090713  
    1 # Copyright (C) 2023 Maksekeskus AS
     1# Copyright (C) 2024 Maksekeskus AS
    22# This file is distributed under the GPL-2.0+.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: MakeCommerce 3.4.0\n"
     5"Project-Id-Version: MakeCommerce 3.4.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/makecommerce\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2023-12-15T11:32:23+00:00\n"
     12"POT-Creation-Date: 2024-03-20T21:48:07+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.9.0\n"
     
    310310
    311311#: payment/gateway/subscription.php:82
    312 #: payment/payment.php:289
     312#: payment/payment.php:311
    313313msgid "Transaction ID"
    314314msgstr ""
    315315
    316316#: payment/gateway/subscription.php:83
    317 #: payment/payment.php:290
     317#: payment/payment.php:312
    318318msgid "Payment option"
    319319msgstr ""
     
    374374msgstr ""
    375375
    376 #: payment/gateway/woocommerce/paylater.php:42
    377 msgid "Pay in <b>three equal parts, %s EUR per month</b>. First payment on <b>%s %s</b>"
    378 msgstr ""
    379 
    380 #: payment/gateway/woocommerce/paylater.php:45
    381 msgid "Buy now, <b>pay on the 25th of the next month</b>"
    382 msgstr ""
    383 
    384 #: payment/gateway/woocommerce/paylater.php:53
    385 msgid "Pay <b>%s EUR per month for 12 months</b>. Interest %s"
    386 msgstr ""
    387 
    388 #: payment/gateway/woocommerce/paylater.php:72
    389 msgid ""
    390 "Pay <b>%s EUR per month</b> for 12 months<br>\n"
    391 "                        <br>\n"
    392 "                        <i>Borrowing rate %s&#37;, credit amount %s€, contract conclusion fee %s€, total amount payable %s€, annual interest rate %s&#37;\n"
    393 "                        Calculation is only informative.</i>"
    394 msgstr ""
    395 
    396 #: payment/gateway/woocommerce/paylater.php:296
    397 #: payment/gateway/woocommerce/paylater.php:330
    398 msgid "Pay later Settings"
    399 msgstr ""
    400 
    401 #: payment/gateway/woocommerce/paylater.php:301
    402 msgid "Show pay later options at product view"
    403 msgstr ""
    404 
    405 #: payment/gateway/woocommerce/paylater.php:316
    406 msgid "Select desired pay later methods to show in product view"
    407 msgstr ""
    408 
    409 #: payment/gateway/woocommerce/paylater.php:319
    410 msgid "Select multiple methods by holding down Ctrl or Command button"
    411 msgstr ""
    412 
    413 #: payment/gateway/woocommerce/paylater.php:323
    414 msgid "Your shop doesn't currently offer pay later methods with Maksekeskus. Adding pay later options to your should increases number of customers and purchase amounts. Please <a target=\"_blank\" href=\"https://makecommerce.net/contact/\">get in touch</a> with us to enable pay later for your shop."
    415 msgstr ""
    416 
    417 #: payment/gateway/woocommerce/paylater.php:326
    418 msgid "This pay later feature is not available in your country yet. <a target=\"_blank\" href=\"https://makecommerce.net/contact/\">Contact us</a> for more information!"
    419 msgstr ""
    420 
    421 #: payment/gateway/woocommerce/paylater.php:414
    422 #: shipping/method/method.php:139
    423 #: shipping/shipping.php:1048
    424 msgid "Dismiss"
    425 msgstr ""
    426 
    427 #: payment/gateway/woocommerce/paylater.php:415
    428 msgid "MakeCommerce module now includes <a href=\"%s\">option to display pay later options and payment terms examples in product view</a>. Having pay later options available potentially grows your customer base as well as average shopping cart. We recommend to use this option if considerable number of purchases are above 75 euros."
    429 msgstr ""
    430 
    431 #: payment/gateway/woocommerce/paylater.php:431
    432 msgid "January"
    433 msgstr ""
    434 
    435 #: payment/gateway/woocommerce/paylater.php:432
    436 msgid "February"
    437 msgstr ""
    438 
    439 #: payment/gateway/woocommerce/paylater.php:433
    440 msgid "March"
    441 msgstr ""
    442 
    443 #: payment/gateway/woocommerce/paylater.php:434
    444 msgid "April"
    445 msgstr ""
    446 
    447 #: payment/gateway/woocommerce/paylater.php:435
    448 msgid "May"
    449 msgstr ""
    450 
    451 #: payment/gateway/woocommerce/paylater.php:436
    452 msgid "June"
    453 msgstr ""
    454 
    455 #: payment/gateway/woocommerce/paylater.php:437
    456 msgid "July"
    457 msgstr ""
    458 
    459 #: payment/gateway/woocommerce/paylater.php:438
    460 msgid "August"
    461 msgstr ""
    462 
    463 #: payment/gateway/woocommerce/paylater.php:439
    464 msgid "September"
    465 msgstr ""
    466 
    467 #: payment/gateway/woocommerce/paylater.php:440
    468 msgid "October"
    469 msgstr ""
    470 
    471 #: payment/gateway/woocommerce/paylater.php:441
    472 msgid "November"
    473 msgstr ""
    474 
    475 #: payment/gateway/woocommerce/paylater.php:442
    476 msgid "December"
    477 msgstr ""
    478 
    479 #: payment/gateway/woocommerce/paylater.php:457
    480 msgid "1st"
    481 msgstr ""
    482 
    483 #: payment/gateway/woocommerce/paylater.php:458
    484 msgid "2nd"
    485 msgstr ""
    486 
    487 #: payment/gateway/woocommerce/paylater.php:459
    488 msgid "3rd"
    489 msgstr ""
    490 
    491 #: payment/gateway/woocommerce/paylater.php:460
    492 msgid "4th"
    493 msgstr ""
    494 
    495 #: payment/gateway/woocommerce/paylater.php:461
    496 msgid "5th"
    497 msgstr ""
    498 
    499 #: payment/gateway/woocommerce/paylater.php:462
    500 msgid "6th"
    501 msgstr ""
    502 
    503 #: payment/gateway/woocommerce/paylater.php:463
    504 msgid "7th"
    505 msgstr ""
    506 
    507 #: payment/gateway/woocommerce/paylater.php:464
    508 msgid "8th"
    509 msgstr ""
    510 
    511 #: payment/gateway/woocommerce/paylater.php:465
    512 msgid "9th"
    513 msgstr ""
    514 
    515 #: payment/gateway/woocommerce/paylater.php:466
    516 msgid "10th"
    517 msgstr ""
    518 
    519 #: payment/gateway/woocommerce/paylater.php:467
    520 msgid "11th"
    521 msgstr ""
    522 
    523 #: payment/gateway/woocommerce/paylater.php:468
    524 msgid "12th"
    525 msgstr ""
    526 
    527 #: payment/gateway/woocommerce/paylater.php:469
    528 msgid "13th"
    529 msgstr ""
    530 
    531 #: payment/gateway/woocommerce/paylater.php:470
    532 msgid "14th"
    533 msgstr ""
    534 
    535 #: payment/gateway/woocommerce/paylater.php:471
    536 msgid "15th"
    537 msgstr ""
    538 
    539 #: payment/gateway/woocommerce/paylater.php:472
    540 msgid "16th"
    541 msgstr ""
    542 
    543 #: payment/gateway/woocommerce/paylater.php:473
    544 msgid "17th"
    545 msgstr ""
    546 
    547 #: payment/gateway/woocommerce/paylater.php:474
    548 msgid "18th"
    549 msgstr ""
    550 
    551 #: payment/gateway/woocommerce/paylater.php:475
    552 msgid "19th"
    553 msgstr ""
    554 
    555 #: payment/gateway/woocommerce/paylater.php:476
    556 msgid "20th"
    557 msgstr ""
    558 
    559 #: payment/gateway/woocommerce/paylater.php:477
    560 msgid "21st"
    561 msgstr ""
    562 
    563 #: payment/gateway/woocommerce/paylater.php:478
    564 msgid "22nd"
    565 msgstr ""
    566 
    567 #: payment/gateway/woocommerce/paylater.php:479
    568 msgid "23rd"
    569 msgstr ""
    570 
    571 #: payment/gateway/woocommerce/paylater.php:480
    572 msgid "24th"
    573 msgstr ""
    574 
    575 #: payment/gateway/woocommerce/paylater.php:481
    576 msgid "25th"
    577 msgstr ""
    578 
    579 #: payment/gateway/woocommerce/paylater.php:482
    580 msgid "26th"
    581 msgstr ""
    582 
    583 #: payment/gateway/woocommerce/paylater.php:483
    584 msgid "27th"
    585 msgstr ""
    586 
    587 #: payment/gateway/woocommerce/paylater.php:484
    588 msgid "28th"
    589 msgstr ""
    590 
    591 #: payment/gateway/woocommerce/paylater.php:485
    592 msgid "29th"
    593 msgstr ""
    594 
    595 #: payment/gateway/woocommerce/paylater.php:486
    596 msgid "30th"
    597 msgstr ""
    598 
    599 #: payment/gateway/woocommerce/paylater.php:487
    600 msgid "31st"
    601 msgstr ""
    602 
    603 #: payment/gateway/woocommerce/woocommerce.php:129
     376#: payment/gateway/woocommerce/woocommerce.php:124
    604377msgid "Enable/Disable"
    605378msgstr ""
    606379
    607 #: payment/gateway/woocommerce/woocommerce.php:131
     380#: payment/gateway/woocommerce/woocommerce.php:126
    608381msgid "Enable MakeCommerce payments"
    609382msgstr ""
    610383
    611 #: payment/gateway/woocommerce/woocommerce.php:141
     384#: payment/gateway/woocommerce/woocommerce.php:136
    612385msgid "MakeCommerce API"
    613386msgstr ""
    614387
     388#: payment/gateway/woocommerce/woocommerce.php:137
     389msgid "Go to <a href=\"%s\">API settings</a> to fill in the credentials"
     390msgstr ""
     391
    615392#: payment/gateway/woocommerce/woocommerce.php:142
    616 msgid "Go to <a href=\"%s\">API settings</a> to fill in the credentials"
    617 msgstr ""
    618 
    619 #: payment/gateway/woocommerce/woocommerce.php:147
    620393msgid "User Interface"
    621394msgstr ""
    622395
    623 #: payment/gateway/woocommerce/woocommerce.php:153
     396#: payment/gateway/woocommerce/woocommerce.php:148
    624397msgid "Set as default selection"
    625398msgstr ""
    626399
    627 #: payment/gateway/woocommerce/woocommerce.php:154
     400#: payment/gateway/woocommerce/woocommerce.php:149
    628401msgid "MakeCommerce payments widget will be selected by default"
    629402msgstr ""
    630403
     404#: payment/gateway/woocommerce/woocommerce.php:156
     405msgid "Display MC payment channels as"
     406msgstr ""
     407
     408#: payment/gateway/woocommerce/woocommerce.php:160
     409msgid "List"
     410msgstr ""
     411
    631412#: payment/gateway/woocommerce/woocommerce.php:161
    632 msgid "Display MC payment channels as"
    633 msgstr ""
    634 
    635 #: payment/gateway/woocommerce/woocommerce.php:165
    636 msgid "List"
    637 msgstr ""
    638 
    639 #: payment/gateway/woocommerce/woocommerce.php:166
    640413msgid "Grouped to widget"
    641414msgstr ""
    642415
    643 #: payment/gateway/woocommerce/woocommerce.php:176
    644 #: payment/gateway/woocommerce/woocommerce.php:186
     416#: payment/gateway/woocommerce/woocommerce.php:171
     417#: payment/gateway/woocommerce/woocommerce.php:181
    645418msgid "Payments widget title"
    646419msgstr ""
    647420
    648 #: payment/gateway/woocommerce/woocommerce.php:178
    649 #: payment/gateway/woocommerce/woocommerce.php:188
     421#: payment/gateway/woocommerce/woocommerce.php:173
     422#: payment/gateway/woocommerce/woocommerce.php:183
    650423msgid "Appropriate title may depend on the configuration you have made, i.e. 'pay with bank-link or credit card', 'pay with bank-links' or 'payment methods'"
    651424msgstr ""
    652425
    653 #: payment/gateway/woocommerce/woocommerce.php:179
     426#: payment/gateway/woocommerce/woocommerce.php:174
    654427msgid "Pay with bank-links or credit card"
    655428msgstr ""
    656429
     430#: payment/gateway/woocommerce/woocommerce.php:191
     431msgid "MC payment channels display style"
     432msgstr ""
     433
     434#: payment/gateway/woocommerce/woocommerce.php:195
     435msgid "Logo"
     436msgstr ""
     437
    657438#: payment/gateway/woocommerce/woocommerce.php:196
    658 msgid "MC payment channels display style"
    659 msgstr ""
    660 
    661 #: payment/gateway/woocommerce/woocommerce.php:200
    662 msgid "Logo"
    663 msgstr ""
    664 
    665 #: payment/gateway/woocommerce/woocommerce.php:201
    666439msgid "Text & logo"
    667440msgstr ""
    668441
    669 #: payment/gateway/woocommerce/woocommerce.php:202
     442#: payment/gateway/woocommerce/woocommerce.php:197
    670443msgid "Text"
    671444msgstr ""
    672445
     446#: payment/gateway/woocommerce/woocommerce.php:203
     447msgid "Size of payment channel logos"
     448msgstr ""
     449
     450#: payment/gateway/woocommerce/woocommerce.php:207
     451msgid "Small"
     452msgstr ""
     453
    673454#: payment/gateway/woocommerce/woocommerce.php:208
    674 msgid "Size of payment channel logos"
    675 msgstr ""
    676 
    677 #: payment/gateway/woocommerce/woocommerce.php:212
    678 msgid "Small"
    679 msgstr ""
    680 
    681 #: payment/gateway/woocommerce/woocommerce.php:213
    682455msgid "Medium"
    683456msgstr ""
    684457
    685 #: payment/gateway/woocommerce/woocommerce.php:214
     458#: payment/gateway/woocommerce/woocommerce.php:209
    686459msgid "Large"
    687460msgstr ""
    688461
    689 #: payment/gateway/woocommerce/woocommerce.php:220
     462#: payment/gateway/woocommerce/woocommerce.php:215
    690463msgid "Group bank-links by countries"
    691464msgstr ""
    692465
    693 #: payment/gateway/woocommerce/woocommerce.php:227
     466#: payment/gateway/woocommerce/woocommerce.php:222
    694467msgid "Hide country selector"
    695468msgstr ""
    696469
    697 #: payment/gateway/woocommerce/woocommerce.php:228
     470#: payment/gateway/woocommerce/woocommerce.php:223
    698471msgid "Do not display country selector (flags) at payment methods"
    699472msgstr ""
    700473
     474#: payment/gateway/woocommerce/woocommerce.php:229
     475msgid "Country selector style"
     476msgstr ""
     477
     478#: payment/gateway/woocommerce/woocommerce.php:233
     479msgid "Flag"
     480msgstr ""
     481
    701482#: payment/gateway/woocommerce/woocommerce.php:234
    702 msgid "Country selector style"
    703 msgstr ""
    704 
    705 #: payment/gateway/woocommerce/woocommerce.php:238
    706 msgid "Flag"
    707 msgstr ""
    708 
    709 #: payment/gateway/woocommerce/woocommerce.php:239
    710483msgid "Dropdown"
    711484msgstr ""
    712485
    713 #: payment/gateway/woocommerce/woocommerce.php:245
     486#: payment/gateway/woocommerce/woocommerce.php:240
    714487msgid "Define custom order of payment countries"
    715488msgstr ""
    716489
     490#: payment/gateway/woocommerce/woocommerce.php:242
     491msgid "If you want to change default order, insert a comma separated list of 2 char country codes. i.e. - ee, lv, lt, fi (international = other)"
     492msgstr ""
     493
    717494#: payment/gateway/woocommerce/woocommerce.php:247
    718 msgid "If you want to change default order, insert a comma separated list of 2 char country codes. i.e. - ee, lv, lt, fi (international = other)"
    719 msgstr ""
    720 
    721 #: payment/gateway/woocommerce/woocommerce.php:252
    722495msgid "Define custom order of payment channels"
    723496msgstr ""
    724497
    725 #: payment/gateway/woocommerce/woocommerce.php:254
     498#: payment/gateway/woocommerce/woocommerce.php:249
    726499msgid "If you want to change default order, put here comma separated list of channels. i,e, - seb,lhv,swedbank. see more on the module home page (link above)"
    727500msgstr ""
    728501
     502#: payment/gateway/woocommerce/woocommerce.php:258
     503msgid "Credit Card Settings"
     504msgstr ""
     505
    729506#: payment/gateway/woocommerce/woocommerce.php:263
    730 msgid "Credit Card Settings"
    731 msgstr ""
    732 
    733 #: payment/gateway/woocommerce/woocommerce.php:268
    734507msgid "Prefill Credit Card form with customer data"
    735508msgstr ""
    736509
    737 #: payment/gateway/woocommerce/woocommerce.php:271
     510#: payment/gateway/woocommerce/woocommerce.php:266
    738511msgid "It will pass user Name and e-mail address to the Credit Card dialog to make the form filling easier"
    739512msgstr ""
    740513
    741 #: payment/gateway/woocommerce/woocommerce.php:277
     514#: payment/gateway/woocommerce/woocommerce.php:270
    742515msgid "Advanced Settings"
    743516msgstr ""
    744517
    745 #: payment/gateway/woocommerce/woocommerce.php:282
     518#: payment/gateway/woocommerce/woocommerce.php:275
    746519msgid "Disable automatic cancelled payment status update"
    747520msgstr ""
    748521
     522#: payment/gateway/woocommerce/woocommerce.php:276
     523msgid "Disable automatic order status updates for cancelled payments by MakeCommerce"
     524msgstr ""
     525
     526#: payment/gateway/woocommerce/woocommerce.php:279
     527msgid "Disable MakeCommerce from updating order statuses for cancelled payments and let WooCommerce handle the status change"
     528msgstr ""
     529
    749530#: payment/gateway/woocommerce/woocommerce.php:283
    750 msgid "Disable automatic order status updates for cancelled payments by MakeCommerce"
    751 msgstr ""
    752 
    753 #: payment/gateway/woocommerce/woocommerce.php:286
    754 msgid "Disable MakeCommerce from updating order statuses for cancelled payments and let WooCommerce handle the status change"
    755 msgstr ""
    756 
    757 #: payment/gateway/woocommerce/woocommerce.php:290
    758531msgid "Disable automatic expired payment status update"
    759532msgstr ""
    760533
    761 #: payment/gateway/woocommerce/woocommerce.php:291
     534#: payment/gateway/woocommerce/woocommerce.php:284
    762535msgid "Disable automatic order status updates for expired payments by MakeCommerce"
    763536msgstr ""
    764537
     538#: payment/gateway/woocommerce/woocommerce.php:287
     539msgid "Disable MakeCommerce from updating order statuses for expired payments and let WooCommerce handle the status change"
     540msgstr ""
     541
     542#: payment/gateway/woocommerce/woocommerce.php:292
     543msgid "Update payment methods"
     544msgstr ""
     545
     546#: payment/gateway/woocommerce/woocommerce.php:293
     547msgid "Update"
     548msgstr ""
     549
    765550#: payment/gateway/woocommerce/woocommerce.php:294
    766 msgid "Disable MakeCommerce from updating order statuses for expired payments and let WooCommerce handle the status change"
    767 msgstr ""
    768 
    769 #: payment/gateway/woocommerce/woocommerce.php:299
    770 msgid "Update payment methods"
    771 msgstr ""
    772 
    773 #: payment/gateway/woocommerce/woocommerce.php:300
    774 msgid "Update"
    775 msgstr ""
    776 
    777 #: payment/gateway/woocommerce/woocommerce.php:301
    778551msgid "This will update shop configuration from MakeCommerce servers."
    779552msgstr ""
    780553
    781 #: payment/gateway/woocommerce/woocommerce.php:410
     554#: payment/gateway/woocommerce/woocommerce.php:393
    782555msgid "Please select suitable payment option!"
    783556msgstr ""
    784557
    785 #: payment/gateway/woocommerce/woocommerce.php:493
     558#: payment/gateway/woocommerce/woocommerce.php:476
    786559msgid "An error occured when trying to process payment!"
    787560msgstr ""
    788561
    789 #: payment/payment.php:139
     562#: payment/payment.php:140
    790563msgid "Payment failed"
    791564msgstr ""
    792565
    793 #: payment/payment.php:142
     566#: payment/payment.php:143
    794567msgid "Payment transaction cancelled"
    795568msgstr ""
    796569
    797 #: payment/payment.php:145
     570#: payment/payment.php:146
    798571msgid "Payment transaction expired"
     572msgstr ""
     573
     574#: payment/payment.php:231
     575msgid "Order total and transaction amount did not match! Please contact us at"
     576msgstr ""
     577
     578#: payment/payment.php:232
     579msgid "[email protected]"
     580msgstr ""
     581
     582#: payment/payment.php:235
     583msgid "Transaction ID that was assigned to this order"
     584msgstr ""
     585
     586#: payment/payment.php:239
     587msgid "Amount that was paid"
    799588msgstr ""
    800589
     
    842631msgstr ""
    843632
    844 #: shipping/method/courier/courier.php:28
     633#: shipping/method/courier/courier.php:30
    845634msgid "courier"
    846635msgstr ""
    847636
    848 #: shipping/method/courier/courier.php:38
     637#: shipping/method/courier/courier.php:40
    849638msgid "courier (MC)"
    850639msgstr ""
     
    900689msgstr ""
    901690
    902 #: shipping/method/courier/smartpost.php:60
     691#: shipping/method/courier/smartpost.php:65
    903692msgid "Pick courier arrival time window"
    904693msgstr ""
    905694
    906 #: shipping/method/courier/smartpost.php:64
     695#: shipping/method/courier/smartpost.php:69
    907696#: shipping/order.php:192
    908697#: shipping/order.php:428
     
    910699msgstr ""
    911700
    912 #: shipping/method/courier/smartpost.php:65
     701#: shipping/method/courier/smartpost.php:70
    913702msgid "Worktime (09:00..17:00)"
    914703msgstr ""
    915704
    916 #: shipping/method/courier/smartpost.php:66
     705#: shipping/method/courier/smartpost.php:71
    917706msgid "After worktime (17:00..21:00)"
    918707msgstr ""
     
    920709#: shipping/method/method.php:138
    921710msgid "Update here"
     711msgstr ""
     712
     713#: shipping/method/method.php:139
     714#: shipping/shipping.php:1079
     715msgid "Dismiss"
    922716msgstr ""
    923717
     
    1039833#: shipping/method/parcelmachine/dpd.php:32
    1040834#: shipping/method/parcelmachine/omniva.php:32
    1041 msgid "use MakeCommerce transport mediation service"
     835msgid "use the Shipping+ service"
    1042836msgstr ""
    1043837
     
    1110904msgstr ""
    1111905
    1112 #: shipping/method/parcelmachine/parcelmachine.php:65
     906#: shipping/method/parcelmachine/parcelmachine.php:67
    1113907msgid "parcelmachine"
    1114908msgstr ""
    1115909
    1116 #: shipping/method/parcelmachine/parcelmachine.php:75
     910#: shipping/method/parcelmachine/parcelmachine.php:77
    1117911msgid "parcel machine (MC)"
    1118912msgstr ""
    1119913
    1120 #: shipping/method/parcelmachine/parcelmachine.php:86
     914#: shipping/method/parcelmachine/parcelmachine.php:88
    1121915msgid "Prioritize"
    1122916msgstr ""
    1123917
    1124 #: shipping/method/parcelmachine/parcelmachine.php:88
     918#: shipping/method/parcelmachine/parcelmachine.php:90
    1125919msgid "Bigger cities will be on top of list, others sorted alphabetically"
    1126920msgstr ""
    1127921
    1128 #: shipping/method/parcelmachine/parcelmachine.php:93
     922#: shipping/method/parcelmachine/parcelmachine.php:95
    1129923msgid "Short names"
    1130924msgstr ""
    1131925
    1132 #: shipping/method/parcelmachine/parcelmachine.php:95
     926#: shipping/method/parcelmachine/parcelmachine.php:97
    1133927msgid "Display only parcel machine names, without addresses"
    1134928msgstr ""
    1135929
    1136 #: shipping/method/parcelmachine/parcelmachine.php:100
     930#: shipping/method/parcelmachine/parcelmachine.php:102
    1137931msgid "Search"
    1138932msgstr ""
    1139933
    1140 #: shipping/method/parcelmachine/parcelmachine.php:102
     934#: shipping/method/parcelmachine/parcelmachine.php:104
    1141935msgid "Make parcel machine selection searchable"
    1142936msgstr ""
    1143937
    1144 #: shipping/method/parcelmachine/parcelmachine.php:138
    1145 #: shipping/shipping.php:768
     938#: shipping/method/parcelmachine/parcelmachine.php:144
     939#: shipping/shipping.php:789
    1146940msgid "-- select parcel machine --"
    1147941msgstr ""
    1148942
    1149 #: shipping/method/parcelmachine/parcelmachine.php:163
     943#: shipping/method/parcelmachine/parcelmachine.php:169
    1150944msgid "Choose machine from map"
    1151945msgstr ""
    1152946
    1153 #: shipping/method/parcelmachine/parcelmachine.php:445
     947#: shipping/method/parcelmachine/parcelmachine.php:451
    1154948msgid "The transport mediation service is already enabled for your shop. You are good to go!"
    1155949msgstr ""
    1156950
    1157 #: shipping/method/parcelmachine/parcelmachine.php:446
     951#: shipping/method/parcelmachine/parcelmachine.php:452
    1158952msgid "The transport mediation service is NOT ENABLED enabled for your shop. Please go to merchant portal to activate it!"
    1159953msgstr ""
    1160954
    1161 #: shipping/method/parcelmachine/parcelmachine.php:447
     955#: shipping/method/parcelmachine/parcelmachine.php:453
    1162956msgid "There was an error with your request. Please try again."
    1163957msgstr ""
     
    12391033msgstr ""
    12401034
    1241 #: shipping/shipping.php:1049
     1035#: shipping/shipping.php:486
     1036msgid "Request failed: missing credentials"
     1037msgstr ""
     1038
     1039#: shipping/shipping.php:503
     1040msgid "Request failed: invalid sender or destination data"
     1041msgstr ""
     1042
     1043#: shipping/shipping.php:1080
    12421044msgid "Unable to use Google Geocoding:"
    12431045msgstr ""
    12441046
    1245 #: shipping/shipping.php:1050
     1047#: shipping/shipping.php:1081
    12461048msgid "Check your app settings or"
    12471049msgstr ""
    12481050
    1249 #: shipping/shipping.php:1052
     1051#: shipping/shipping.php:1083
    12501052msgid "update the key here"
    12511053msgstr ""
  • makecommerce/trunk/makecommerce.php

    r3017107 r3090713  
    1010 * Plugin URI:            https://makecommerce.net/
    1111 * Description:           Adds MakeCommerce payment gateway and Itella/Omniva/DPD parcel machine shipping methods to WooCommerce checkout
    12  * Version:               3.4.2
     12 * Version:               3.5.0
    1313 * Author:                Maksekeskus AS
    1414 * Author URI:            https://makecommerce.net/
     
    3232 * Start at version 3.0.0 and use SemVer - https://semver.org
    3333 */
    34 define( 'MAKECOMMERCE_VERSION', '3.4.2' );
     34define( 'MAKECOMMERCE_VERSION', '3.5.0' );
    3535define( 'MAKECOMMERCE_PLUGIN_ID', 'makecommerce' );
    3636
     
    4747register_deactivation_hook( __FILE__, 'deactivate_makecommerce' );
    4848
    49 // Declare HPOS compatibility - true / false
    5049add_action( 'before_woocommerce_init', function() {
    5150    if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
     51        // Declare HPOS compatibility - true / false
    5252        \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
     53
     54        // Declare Blocks compatibility - true / false
     55        \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, true );
    5356    }
    5457} );
  • makecommerce/trunk/payment/gateway/gateway.php

    r3013223 r3090713  
    147147            add_filter( 'woocommerce_gateway_title', array( $this, 'override_payment_method_string' ), 25, 2 );
    148148        }
    149 
    150         //add pay later block to product
    151         if ( isset( $this->settings["pl_show_on_product_pages"] ) ) {
    152             if ( $this->settings["pl_show_on_product_pages"] == "yes" && !empty( $this->settings["pl_show_methods"] )) {
    153                 add_action( 'woocommerce_before_add_to_cart_button', array( $this, 'add_pay_later_block_to_product' ), 10, 0 );
    154                 add_action( 'woocommerce_add_to_cart_redirect', array( $this, 'added_to_cart_via_paylater_redirect' ), 10, 0 );
    155                 add_action( 'woocommerce_after_checkout_form', array( $this, 'autoselect_chosen_paylater_method' ), 10, 1 );
    156             }
    157         }
    158149    }
    159150
  • makecommerce/trunk/payment/gateway/woocommerce/js/mc_method_list.js

    r2830541 r3090713  
    11jQuery(document).ready(function($) {
    22
    3     function method_list_set(pick = false) {
     3    function method_list_set() {
    44
    5         if (pick) {
    6             MC_METHOD_LIST.pick = pick; //allows changing payment method country after it has been automatically selected via paylater
    7         }
    8 
    9         var selectedCountry = MC_METHOD_LIST.country;
     5        var selectedCountry = '';
    106
    117        if ( jQuery('.li.makecommerce-picker-country').length == 1 ) {
     
    1915           
    2016            jQuery('body').on('change', 'select[name=makecommerce_country_picker_select]', function() {
    21                 if (MC_METHOD_LIST.pick) {
    22                     selectedCountry = jQuery(this).val();
    23                 }
     17                selectedCountry = jQuery(this).val();
    2418
    2519                jQuery('input[name=makecommerce_country_picker]').removeAttr('checked');
     
    3024
    3125                if (jQuery(this).is(":checked")) {
    32                     if (MC_METHOD_LIST.pick) {
    33                         selectedCountry = jQuery(this).val();
    34                     }
     26                    selectedCountry = jQuery(this).val();
    3527
    3628                    jQuery('select[name=makecommerce_country_picker_select]').val(selectedCountry);
     
    7365    //update also on checkout ajax updates
    7466    jQuery( document.body ).on( 'updated_checkout', function() {
    75         method_list_set(true);
     67        method_list_set();
    7668    });
    7769});
  • makecommerce/trunk/payment/gateway/woocommerce/methods.php

    r2993221 r3090713  
    3838        global $wpdb;
    3939
     40        $internationalMethods = [
     41            'revolut' => 'revolut',
     42            'n26' => 'n26'
     43        ];
     44
    4045        $manual_renewals = false;
    4146        $has_subscriptions = false;
     
    6671                    if ( !$has_subscriptions || $manual_renewals ) {
    6772                        $banklinks[] = $banklinks_grouped[$method->country][] = $method;
     73                        if ( in_array( $method->name, $internationalMethods ) ) {
     74                            $intMethod = clone( $method );
     75                            $intMethod->country = 'other';
     76                            $banklinks[] = $banklinks_grouped['other'][] = $intMethod;
     77                            unset( $internationalMethods[$method->name] );
     78                        }
    6879                    }
    6980                } elseif ( $method->type == 'card' ) {
     
    356367
    357368            //dont show other countries if there are no card payments available.
    358             if ( $this->cards ) {
     369            if ( $this->cards && empty( $this->banklinks_grouped['other'] ) ) {
    359370                $this->banklinks_grouped['other'] = array();
    360371            }
     
    518529                }
    519530            }
    520         } else if ( $country == 'other' ) {
     531        } else if ( $country == 'other' && empty( $this->banklinks_grouped['other'] ) ) {
    521532            echo '<p class="no-methods">'. _e( 'No payment methods for selected country' ,'wc_makecommerce_domain' ) .'</p>';
    522533        }
  • makecommerce/trunk/payment/gateway/woocommerce/woocommerce.php

    r3017107 r3090713  
    66use MakeCommerce\Payment\Gateway\WooCommerce\Banklink;
    77use MakeCommerce\Payment\Gateway\WooCommerce\Creditcard;
    8 use MakeCommerce\Payment\Gateway\WooCommerce\Paylater;
    98
    109class WooCommerce extends Gateway {
    1110    use Banklink;
    1211    use Creditcard;
    13     use Paylater;
    1412
    1513    public $id = MAKECOMMERCE_PLUGIN_ID;
    16     public $version = '3.4.2';
     14    public $version = '3.5.0';
    1715   
    1816    public $payment_return_url;
     
    3129    private WooCommerce\Methods $methods;
    3230
     31    public function get_methods() {
     32        return $this->methods;
     33    }
     34
    3335    /**
    3436     * Construct the parent and payment gateway
     
    5557        $this->has_fields = true;
    5658
    57         //add paylater first time notice
    58         add_action( 'admin_notices', array( $this, 'paylater_first_time_notice' ) );
     59        //Add Blocks
     60        add_action( 'woocommerce_blocks_loaded', [$this, 'woocommerce_blocks_support'] );
    5961    }
    6062
     
    272274        );
    273275
    274         $this->set_pay_later_settings();
    275 
    276276        $this->form_fields['adv_title'] = array(
    277277            'title' => '<hr><br>'.__( 'Advanced Settings', 'wc_makecommerce_domain' ),
     
    309309     */
    310310    public function set_gateway_hooks() {
     311        global $wp_filter;
    311312
    312313        add_filter( 'query_vars', array( $this, 'return_trigger' ) );
     
    317318       
    318319        if ( $this->init == false ) {
    319             add_action( 'woocommerce_receipt_' . $this->id, array( $this, 'receipt_page' ) );
     320            if ( !isset( $wp_filter['woocommerce_receipt_' . $this->id] ) ) {
     321                add_action( 'woocommerce_receipt_' . $this->id, array( $this, 'receipt_page' ) );
     322            }
    320323            wp_enqueue_script( 'jquery');
    321324            wp_enqueue_style( 'makecommerce', plugins_url( '/css/makecommerce.css', __FILE__ ), array(), $this->version );
     
    348351            );
    349352        }
    350 
    351         //widget/methods logic
    352         $country = '';
    353         $pick = true;
    354         if ( WC()->session->get( 'mc_selected_paylater_method' ) !== NULL ) {
    355             $country = WC()->session->get( 'mc_selected_paylater_method_country' );
    356             $pick = false;
    357         }
    358353       
    359354        \MakeCommerce::mc_enqueue_script(
     
    362357            [
    363358                'id' => $this->id,
    364                 'country' => $country,
    365359                'settings' => $this->settings,
    366                 'pick' => $pick
    367360            ],
    368361            [ 'jquery' ]
     
    405398        global $woocommerce;
    406399
    407         $selected = isset( $_POST['PRESELECTED_METHOD_' . $this->id] ) ? sanitize_text_field( $_POST['PRESELECTED_METHOD_' . $this->id] ) : false;
     400        $selected = false;
     401
     402        if ( isset( $_POST['PRESELECTED_METHOD_' . $this->id] ) ) {
     403            $selected = sanitize_text_field( $_POST['PRESELECTED_METHOD_' . $this->id] );
     404        } elseif ( isset( $_POST['preselected_method_' . $this->id] ) ) {
     405            $selected = sanitize_text_field( $_POST['preselected_method_' . $this->id] );
     406        }
    408407
    409408        if ( !$selected ) {
     
    426425        $order = wc_get_order( $orderId );
    427426
    428         $selected = isset( $_POST['PRESELECTED_METHOD_' . $this->id] ) ? sanitize_text_field( $_POST['PRESELECTED_METHOD_' . $this->id] ) : false;
     427        $selected = false;
     428
     429        if ( isset( $_POST['PRESELECTED_METHOD_' . $this->id] ) ) {
     430            $selected = sanitize_text_field( $_POST['PRESELECTED_METHOD_' . $this->id] );
     431        } elseif ( isset( $_POST['preselected_method_' . $this->id] ) ) {
     432            $selected = sanitize_text_field( $_POST['preselected_method_' . $this->id] );
     433        }
    429434
    430435        if ( !empty( $selected ) ) {
     
    619624        }
    620625    }
     626
     627    public function woocommerce_blocks_support() {
     628        if ( class_exists( \Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType::class ) ) {
     629            require_once plugin_dir_path(__FILE__) . 'blocks/woocommerceblocks.php';
     630            add_action(
     631                'woocommerce_blocks_payment_method_type_registration',
     632                function( \Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) {
     633                    $payment_method_registry->register( new WooCommerceBlocks );
     634                }
     635            );
     636        }
     637    }
    621638}
  • makecommerce/trunk/payment/payment.php

    r3017107 r3090713  
    187187            if ( !empty( $data['message_type'] ) ) {
    188188
    189                 if ( $data['message_type'] == 'payment_return' ) {
     189                if ( $data['message_type'] === 'payment_return' ) {
    190190
    191191                    $transactionId = $data['transaction'];
    192192                    $reference = $data['reference'];
    193193                    $paymentStatus = $data['status'];
    194                 }
    195 
    196                 if ( $data['message_type'] == 'token_return' ) {
     194                    $totalAmount = $data['amount'];
     195                }
     196
     197                if ( $data['message_type'] === 'token_return' ) {
    197198                    if ( !empty( $data['transaction']['reference'] ) ) {
    198199                        $reference = $data['transaction']['reference'];
     
    221222
    222223        $returnUrl = $order->get_checkout_order_received_url();
     224
     225        // Only check sums if $totalAmount is set
     226        // Trx total and order total did not match
     227        if ( isset( $totalAmount ) && $totalAmount != $order->get_total() ) {
     228
     229            if ( $paymentStatus == 'COMPLETED' ) {
     230                $notes[] = sprintf('%s: %s.',
     231                    __( 'Order total and transaction amount did not match! Please contact us at', 'wc_makecommerce_domain' ),
     232                    __( '[email protected]', 'wc_makecommerce_domain' )
     233                );
     234                $notes[] = sprintf('%s: %s.',
     235                    __( 'Transaction ID that was assigned to this order', 'wc_makecommerce_domain' ),
     236                    '<a target=_blank href="'.$api->getEnvUrls()->merchantUrl.'merchant/shop/deals/detail.html?id='. $transactionId .'">'.$transactionId.'</a>'
     237                );
     238                $notes[] = sprintf('%s: %s€',
     239                    __( 'Amount that was paid', 'wc_makecommerce_domain' ),
     240                    $totalAmount
     241                );
     242
     243                $order->add_order_note( implode( "\r\n", $notes ) );
     244
     245                // Empty the cart so the customer is not tempted to pay again
     246                $woocommerce->cart->empty_cart();
     247
     248                return $returnUrl;
     249            }
     250
     251            // If the payment was not complete then send the customer back to checkout
     252            return wc_get_checkout_url();
     253        }
    223254
    224255        if ( $paymentStatus == 'EXPIRED' || $paymentStatus == 'CANCELLED' || $paymentStatus == 'COMPLETED' ) {
     
    317348        global $wpdb;
    318349
    319         if ( OrderUtil::custom_orders_table_usage_is_enabled() ) {
     350        if ( class_exists( OrderUtil::class )
     351            && OrderUtil::custom_orders_table_usage_is_enabled()
     352        ) {
    320353            // HPOS
    321354            $results = $wpdb->get_results(
    322355                $wpdb->prepare("
    323                     SELECT wp_wc_orders.id
    324                     FROM wp_wc_orders
    325                     INNER JOIN wp_wc_orders_meta AS meta ON meta.order_id = wp_wc_orders.id AND meta.meta_key = %s
     356                    SELECT {$wpdb->prefix}wc_orders.id
     357                    FROM {$wpdb->prefix}wc_orders
     358                    INNER JOIN {$wpdb->prefix}wc_orders_meta AS meta ON meta.order_id = {$wpdb->prefix}wc_orders.id AND meta.meta_key = %s
    326359                    WHERE meta.meta_value = %s
    327360                    ",
  • makecommerce/trunk/shipping/js/parcelmachine_searchable.js

    r2713348 r3090713  
    1 jQuery(function(){
    2    
    3     jQuery(document).on('updated_checkout', function() {
    4         searchable_selectbox();
    5     });
     1jQuery(document).on('updated_checkout', function() {
     2    searchable_selectbox();
     3});
    64
    7     jQuery(document).ready(function() {
    8         searchable_selectbox();
    9     });
     5jQuery(document).ready(function() {
     6    searchable_selectbox();
     7});
    108
    11     function searchable_selectbox() {
     9function searchable_selectbox(selectbox = null) {
    1210
     11    if (!selectbox) {
    1312        $selectBox = jQuery('.parcel-machine-select-box-searchable');
     13    } else {
     14        $selectBox = selectbox;
     15    }
    1416
    15         $json = {
    16             placeholder: MC_PARCELMACHINE_SEARCHABLE_JS[0]['placeholder'],
    17             width: '100%',
    18             dropdownAutoWidth: true,
    19             containerCssClass: 'parcel-machine-select-box',
    20             dropdownCssClass: 'makecommerce-selectbox-dropdown'
     17    $json = {
     18        placeholder: MC_PARCELMACHINE_SEARCHABLE_JS[0]['placeholder'],
     19        width: '100%',
     20        dropdownAutoWidth: true,
     21        containerCssClass: 'parcel-machine-select-box',
     22        dropdownCssClass: 'makecommerce-selectbox-dropdown'
     23    }
     24
     25    //It seems that some plugins or themes forcibly remove selectWoo
     26    //Check if selectWoo
     27    try {
     28        if (typeof $selectBox.selectWoo === "function") {
     29            $selectBox.selectWoo($json);
     30            focus($selectBox);
     31
     32        } else {
     33            //selectWoo didnt exist, try select2 or do nothing
     34            if (typeof $selectBox.select2 === "function") {
     35                $selectBox.select2($json);
     36                focus($selectBox);
     37            }
    2138        }
    2239
    23         //It seems that some plugins or themes forcibly remove selectWoo
    24         //Check if selectWoo
    25         try {
    26             if (typeof $selectBox.selectWoo === "function") {
    27                 $selectBox.selectWoo($json);
    28                 focus($selectBox);
    29                
    30             } else {
    31                 //selectWoo didnt exist, try select2 or do nothing
    32                 if (typeof $selectBox.select2 === "function") {
    33                     $selectBox.select2($json);
    34                     focus($selectBox);
    35                 }
    36             }
    37 
    38             function focus($selectBox) {
    39                 $selectBox.on('select2:open', function (e) {
    40                     //this is ran using timeout because otherwise another event defocuses the element, most likely the click itself.
    41                     $searchField = jQuery('.select2-container--open').find('input.select2-search__field')[0];
    42                     setTimeout(function() { jQuery($searchField).focus(); }, 1);
    43                 });
    44             }
    45         } catch {}
    46     }
    47 });
     40        function focus($selectBox) {
     41            $selectBox.on('select2:open', function (e) {
     42                //this is ran using timeout because otherwise another event defocuses the element, most likely the click itself.
     43                $searchField = jQuery('.select2-container--open').find('input.select2-search__field')[0];
     44                setTimeout(function() { jQuery($searchField).focus(); }, 1);
     45            });
     46        }
     47    } catch {}
     48}
  • makecommerce/trunk/shipping/method/courier/smartpost.php

    r3012381 r3090713  
    4545    public function set_method_hooks() {
    4646
    47         add_filter( 'woocommerce_review_order_after_shipping' , array( $this, 'add_smartpost_courier_checkout_fields' ) );
     47        $priority = 15;
     48
    4849        add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'add_order_meta' ) );
     50
     51        if ( ! $this->check_filter_hook_initialization( 'woocommerce_review_order_after_shipping', $priority ) ) {
     52            add_filter( 'woocommerce_review_order_after_shipping' , array( $this, 'add_smartpost_courier_checkout_fields' ), $priority );
     53        }
    4954    }
    5055
     
    5661    public function add_smartpost_courier_checkout_fields( $fragment ) {
    5762
    58         echo '
    59         <tr style="display: none;" class="parcel_machine_checkout parcel_machine_checkout_courier_' . mb_strtolower($this->ext ) . '">
     63        echo self::prepare_smartpost_courier_checkout_fields( $this->id );
     64    }
     65
     66    public static function prepare_smartpost_courier_checkout_fields( $id, $table = true ) {
     67        $ext = explode( '_', $id )[1];
     68
     69        if ( !$table ) {
     70            return '
     71                <p class="smartpost-courier-text">'.__('Pick courier arrival time window', 'wc_makecommerce_domain').'</p>
     72                <p class="form-row smartpost-courier-text" id="' . esc_attr( $id ) . '_field">
     73                    <select class="select parcel-machine-select-box-time" name="' . esc_attr( $id ) . '" id="' . esc_attr( $id ) . '">
     74                        <option value="1">' . __( 'Any time', 'wc_makecommerce_domain' ) . '</option>
     75                        <option value="2">' . __( 'Worktime (09:00..17:00)', 'wc_makecommerce_domain' ) . '</option>
     76                        <option value="3">' . __( 'After worktime (17:00..21:00)', 'wc_makecommerce_domain' ) . '</option>
     77                    </select>
     78                </p>
     79            ';
     80        }
     81
     82        return '
     83        <tr style="display: none;" class="parcel_machine_checkout parcel_machine_checkout_courier_' . mb_strtolower($ext ) . '">
    6084            <th>'.__('Pick courier arrival time window', 'wc_makecommerce_domain').'</th>
    6185            <td>
    62                 <p class="form-row" id="' . esc_attr( $this->id ) . '_field">
    63                     <select class="select parcel-machine-select-box-time" name="' . esc_attr( $this->id ) . '" id="' . esc_attr( $this->id ) . '">
     86                <p class="form-row" id="' . esc_attr( $id ) . '_field">
     87                    <select class="select parcel-machine-select-box-time" name="' . esc_attr( $id ) . '" id="' . esc_attr( $id ) . '">
    6488                        <option value="1">' . __( 'Any time', 'wc_makecommerce_domain' ) . '</option>
    6589                        <option value="2">' . __( 'Worktime (09:00..17:00)', 'wc_makecommerce_domain' ) . '</option>
  • makecommerce/trunk/shipping/method/method.php

    r3012381 r3090713  
    387387        $free_shipping_min_amount = $this->instance_settings['free_shipping_min_amount'];
    388388
    389         if ( $free_shipping_min_amount && $package['contents_cost'] >= $free_shipping_min_amount ) {
     389        if ( $free_shipping_min_amount && $package['cart_subtotal'] >= $free_shipping_min_amount ) {
    390390            $rate["cost"] = 0;
    391391        }
     
    662662
    663663    /**
     664     * Checks if an object of a class already has the filter initialized
     665     * Returns true if it is added, false if it is not
     666     *
     667     * @since 3.4.3
     668     */
     669    public function check_filter_hook_initialization( $filter, $priority = 10 ) {
     670
     671        global $wp_filter;
     672        $hook = $wp_filter[$filter];
     673
     674        // Check if the object instance is already registered as a callback
     675        foreach ( $hook->callbacks[$priority] ?? [] as $callback ) {
     676            if ( is_array($callback['function'] ) && $callback['function'][0]->id === $this->id ) {
     677                return true;
     678            }
     679        }
     680
     681        return false;
     682    }
     683
     684    /**
    664685     * Initializes method type, required function for all method types
    665686     *
  • makecommerce/trunk/shipping/method/parcelmachine/dpd.php

    r3012381 r3090713  
    3030            'options' => [
    3131                false => __( 'use my own DPD contract', 'wc_makecommerce_domain' ),
    32                 true => __( 'use MakeCommerce transport mediation service', 'wc_makecommerce_domain' ),
     32                true => __( 'use the Shipping+ service', 'wc_makecommerce_domain' ),
    3333            ],
    3434            'default' => false,
  • makecommerce/trunk/shipping/method/parcelmachine/omniva.php

    r3012381 r3090713  
    3030            'options' => array(
    3131                false => __( 'use my own Omniva contract', 'wc_makecommerce_domain' ),
    32                 true => __( 'use MakeCommerce transport mediation service', 'wc_makecommerce_domain' ),
     32                true => __( 'use the Shipping+ service', 'wc_makecommerce_domain' ),
    3333                ),
    3434            'default' => false,
  • makecommerce/trunk/shipping/method/parcelmachine/parcelmachine.php

    r3013223 r3090713  
    114114    public function set_method_type_hooks() {
    115115
    116         //add parcelmachines selectbox to checkout
    117         add_filter( 'woocommerce_review_order_after_shipping' , array( $this, 'add_parcelmachine_checkout_fields' ) );
     116        $priority = 15;
    118117
    119118        //add shipping metadata to order
    120119        add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'add_parcelmachine_order_meta' ) );
     120
     121        if ( ! $this->check_filter_hook_initialization( 'woocommerce_review_order_after_shipping', $priority ) ) {
     122            //add parcel machines select box to checkout
     123            add_filter( 'woocommerce_review_order_after_shipping' , array( $this, 'add_parcelmachine_checkout_fields' ), $priority );
     124        }
    121125    }
    122126
     
    127131     */
    128132    public function add_parcelmachine_checkout_fields() {
    129 
    130         $this->order_country = WC()->customer->get_shipping_country();
    131 
    132         //get all parcelmachines
    133         $aptopts = [ 'use_white_apts' => $this->use_white_apts ];
    134         $machines = \MakeCommerce\Shipping::mk_get_machines( $this->ext, $this->order_country, $aptopts );
     133        echo self::prepare_parcelmachine_checkout_html( $this->id );
     134    }
     135
     136    /**
     137     * Prepare parcelmachine specific checkout fields
     138     *
     139     * @since  3.5.0
     140     */
     141    public static function prepare_parcelmachine_checkout_html( $id, $table = true ) {
     142
     143        $options = get_option( 'woocommerce_' . $id . '_settings', [] );
     144        $ext = explode( '_', $id, 2 )[1];
     145
     146        if ( empty( $options ) ) {
     147            return '';
     148        }
     149
     150        $country = WC()->customer->get_shipping_country();
     151
     152        $aptopts = [ 'use_white_apts' => $options['use_white_apts'] ?? null ];
     153        $machines = \MakeCommerce\Shipping::mk_get_machines( $ext, $country, $aptopts );
    135154
    136155        //sort machines
    137         $machines = $this->sort_machines( $machines );
     156        $machines = self::sort_machines( $machines, $options['prioritization'] );
    138157
    139158        // Create new class and placeholder for searchable parcel machines
    140159        $placeholder = __( '-- select parcel machine --', 'wc_makecommerce_domain' );
    141         $searchable_class = ''; 
    142         if ( $this->searchable_parcelmachines === 'yes' ) {
    143             $searchable_class = ' parcel-machine-select-box-searchable'; 
     160        $searchable_class = '';
     161        if ( $options['searchable_parcelmachines'] === 'yes' ) {
     162            $searchable_class = ' parcel-machine-select-box-searchable';
    144163            $placeholder = '';
    145164        }
    146165
    147         $html = '
    148         <tr style="display: none;" class="parcel_machine_checkout parcel_machine_checkout_parcelmachine_' . mb_strtolower( $this->ext ) . '">
    149             <td colspan="2">
    150                 <p class="form-row" id="' . esc_attr( $this->id ) . '_field">
    151                     <select class="select parcel-machine-select-box' . $searchable_class . '" name="' . esc_attr( $this->id ) . '" id="' . esc_attr( $this->id ) . '">
    152                         <option value="">' . $placeholder . '</option>
     166        $html = '';
     167
     168        if ($table ) {
     169            $html .= '
     170                <tr style="display: none;" class="parcel_machine_checkout parcel_machine_checkout_parcelmachine_' . mb_strtolower( $ext ) . '">
     171                    <td colspan="2">
     172                ';
     173        }
     174
     175        $html .= '
     176            <p class="form-row" id="' . esc_attr( $id ) . '_field">
     177                <select class="select parcel-machine-select-box' . $searchable_class . '" name="' . esc_attr( $id ) . '" id="' . esc_attr( $id ) . '">
     178                    <option value="">' . $placeholder . '</option>
    153179        ';
    154180
    155         $html .= $this->create_parcelmachine_html( $machines, $this->short_office_names );
     181        $html .= self::create_parcelmachine_html( $machines, $options['short_office_names'] );
    156182
    157183        $html .= '
     
    159185                </p>';
    160186
    161         if ( self::map_enabled() ) {
     187        if ( $table && self::map_enabled() ) {
    162188            $html .= '
    163189            <div class="mc_pmmap_choose_button">
     
    165191                <p>' . __( 'Choose machine from map', 'wc_makecommerce_domain' ) . '</p>
    166192            </div>
    167             ';
    168         }
    169 
    170         $html .= '
    171             </td>
    172         </tr>
    173         ';
    174 
    175         echo $html;
     193            ';
     194        }
     195
     196        if ($table ) {
     197                $html .= '
     198                </td>
     199            </tr>
     200            ';
     201        }
     202
     203        return $html;
    176204    }
    177205
     
    373401     * @since 3.0.0
    374402     */
    375     private function sort_machines( $machines ) {
    376 
    377         if ( $this->prioritization === 'yes' ) {
    378            
     403    private static function sort_machines( $machines, $prioritization ) {
     404
     405        if ( $prioritization === 'yes' ) {
     406
    379407            usort( $machines, function( $a, $b ) {
    380408
  • makecommerce/trunk/shipping/shipping.php

    r3012381 r3090713  
    286286                $order->update_meta_data( '_parcel_machine_shipment_id', "" );
    287287
    288                 set_transient( '_set_parcel_machine_meta_transient', true );
     288                set_transient( '_set_parcel_machine_meta_transient', true, 5 );
    289289
    290290                $order->save();
     
    356356                $order->update_meta_data( '_parcel_machine_shipment_id', "" );
    357357
    358                 set_transient( '_update_courier_meta_transient', true );
     358                set_transient( '_update_courier_meta_transient', true, 5 );
    359359
    360360                $order->save();
     
    482482                    // Move on to next post if the function returned empty values
    483483                    if ( empty( $shipping_request['credentials'][$carrier_uc] ) && empty( $transport_class->settings['use_mk_contract'] ) ) {
     484                        $order->update_meta_data(
     485                            '_parcel_machine_error',
     486                            __( 'Request failed: missing credentials', 'wc_makecommerce_domain' )
     487                        );
     488                        $order->save();
    484489                        continue;
    485490                    }
     
    493498                );
    494499
    495                 if ( !$sr_order ) continue;
     500                if ( !$sr_order ) {
     501                    $order->update_meta_data(
     502                        '_parcel_machine_error',
     503                        __( 'Request failed: invalid sender or destination data', 'wc_makecommerce_domain' )
     504                    );
     505                    $order->save();
     506                    continue;
     507                }
    496508
    497509                if ( $carrier_uc === 'LP_EXPRESS_LT' ) {
     
    863875        }
    864876
    865         $shipping_request['credentials'][$carrier_uc]['carrier'] = $carrier_uc;
    866 
    867877        if ( !empty( $transport_class->settings['api_key'] ) ) {
    868878            $shipping_request['credentials'][$carrier_uc]['apiKey'] = $transport_class->settings['api_key'];
     
    875885        if ( !empty( $transport_class->settings['service_password'] ) ) {
    876886            $shipping_request['credentials'][$carrier_uc]['password'] = $transport_class->settings['service_password'];
     887        }
     888
     889        // Check if any other credentials are added
     890        // If not, then leave empty to skip registering
     891        if ( !empty( $shipping_request['credentials'][$carrier_uc] ) ) {
     892            $shipping_request['credentials'][$carrier_uc]['carrier'] = $carrier_uc;
    877893        }
    878894
     
    922938            $sender['building'] = !empty( $transport_class->settings['shop_building'] ) ? $transport_class->settings['shop_building'] : '';
    923939            $sender['apartment'] = !empty( $transport_class->settings['shop_apartment'] ) ? $transport_class->settings['shop_apartment'] : '';
     940        }
     941
     942        // If every value in sender except for country is empty, stop request
     943        // Country is a list, cant be empty after saving
     944        if ( count( array_filter( $sender ) ) <= 1 ) {
     945            return;
    924946        }
    925947
Note: See TracChangeset for help on using the changeset viewer.