From 1303b17de4b471928b610c692d0096d2535d2279 Mon Sep 17 00:00:00 2001 From: Jacek Pyziak Date: Fri, 13 Feb 2026 21:59:26 +0100 Subject: [PATCH] Integrations DI refactor, remove Sellasist/Baselinker, fix product-edit encoding (0.263) - New: Domain\Integrations\IntegrationsRepository + admin\Controllers\IntegrationsController (DI) - Cleanup: removed all Sellasist and Baselinker integrations from entire project - Fix: product-edit.php Polish characters (UTF-8/CP1250 double-encoding) - Update: factory\Integrations as facade (Apilo + ShopPRO only) - Tests: 212 tests, 577 assertions Co-Authored-By: Claude Opus 4.6 --- AGENTS.md | 2 +- DATABASE_STRUCTURE.md | 26 +- PROJECT_STRUCTURE.md | 44 +- REFACTORING_PLAN.md | 41 +- TESTING.md | 18 +- .../baselinker/bundling-products.php | 33 - .../integrations/baselinker-settings.php | 139 --- .../integrations/sellasist-settings.php | 119 --- .../shop-payment-method/view-list.php | 15 - .../shop-product/product-combination.php | 90 -- admin/templates/shop-product/product-edit.php | 80 +- .../shop-product/products-list-table.php | 35 - .../templates/shop-product/products-list.php | 272 +----- admin/templates/shop-statuses/status-edit.php | 29 - admin/templates/shop-statuses/view-list.php | 22 - .../shop-transport/transport-edit.php | 14 - admin/templates/shop-transport/view-list.php | 12 - admin/templates/site/main-layout.php | 10 - .../Integrations/IntegrationsRepository.php | 408 +++++++++ .../Controllers/IntegrationsController.php | 172 ++++ autoload/admin/class.Site.php | 7 + autoload/admin/controls/class.Baselinker.php | 20 - .../admin/controls/class.Integrations.php | 846 ------------------ .../controls/class.ShopPaymentMethod.php | 1 - autoload/admin/controls/class.ShopProduct.php | 4 - .../admin/controls/class.ShopStatuses.php | 6 +- .../admin/controls/class.ShopTransport.php | 4 +- autoload/admin/factory/class.Baselinker.php | 39 - autoload/admin/factory/class.Integrations.php | 288 +----- autoload/admin/factory/class.ShopProduct.php | 13 - autoload/admin/factory/class.ShopStatuses.php | 4 +- .../admin/factory/class.ShopTransport.php | 4 +- autoload/front/factory/class.Shop.php | 21 - autoload/front/factory/class.ShopOrder.php | 2 - .../front/factory/class.ShopPaymentMethod.php | 6 - autoload/front/factory/class.ShopProduct.php | 11 - autoload/front/factory/class.ShopStatuses.php | 15 - .../front/factory/class.ShopTransport.php | 6 - autoload/shop/class.Order.php | 122 --- autoload/shop/class.Product.php | 12 - autoload/shop/class.ShopStatus.php | 15 - config.php | 2 - cron.php | 404 --------- cron/cron-xml.php | 1 - .../IntegrationsRepositoryTest.php | 204 +++++ .../IntegrationsControllerTest.php | 171 ++++ tests/bootstrap.php | 1 + updates/0.20/ver_0.263.zip | Bin 0 -> 72204 bytes updates/0.20/ver_0.263_files.txt | 8 + updates/changelog.php | 9 +- updates/versions.php | 2 +- 51 files changed, 1166 insertions(+), 2663 deletions(-) delete mode 100644 admin/templates/baselinker/bundling-products.php delete mode 100644 admin/templates/integrations/baselinker-settings.php delete mode 100644 admin/templates/integrations/sellasist-settings.php create mode 100644 autoload/Domain/Integrations/IntegrationsRepository.php create mode 100644 autoload/admin/Controllers/IntegrationsController.php delete mode 100644 autoload/admin/controls/class.Baselinker.php delete mode 100644 autoload/admin/controls/class.Integrations.php delete mode 100644 autoload/admin/factory/class.Baselinker.php delete mode 100644 autoload/front/factory/class.Shop.php delete mode 100644 autoload/shop/class.ShopStatus.php create mode 100644 tests/Unit/Domain/Integrations/IntegrationsRepositoryTest.php create mode 100644 tests/Unit/admin/Controllers/IntegrationsControllerTest.php create mode 100644 updates/0.20/ver_0.263.zip create mode 100644 updates/0.20/ver_0.263_files.txt diff --git a/AGENTS.md b/AGENTS.md index 730c8be..66c39d3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -28,4 +28,4 @@ To ma pomóc zachować spójność zmian i dokumentacji. ## INNE -Przejdźmy teraz do refaktoringu wszystkiego co związane z https://shoppro.project-dc.pl/admin/articles_archive/, nowe widoki, klasy (usuwanie starych), poprawa routingu, przeszukanie innych klas pod względem zależności. Zapisz plan a później realizuj krok po kroku. \ No newline at end of file +Przejdźmy teraz do refaktoringu wszystkiego co związane z https://shoppro.project-dc.pl/admin/articles_archive/, nowe widoki, klasy (usuwanie starych), poprawa routingu, przeszukanie innych klas pod względem zależności. Zapisz plan i przedstaw mi go a po akceptacji realizuj krok po kroku w trybie Human In The Loop \ No newline at end of file diff --git a/DATABASE_STRUCTURE.md b/DATABASE_STRUCTURE.md index 44c989e..6cacc26 100644 --- a/DATABASE_STRUCTURE.md +++ b/DATABASE_STRUCTURE.md @@ -19,7 +19,7 @@ Główna tabela produktów. | vat | Stawka VAT | | ean | Kod EAN | | sku | Kod SKU | -| baselinker_product_name | Nazwa produktu w Baselinker | +| apilo_product_id | ID produktu w Apilo | | apilo_product_name | Nazwa produktu w Apilo | **Używane w:** `Domain\Product\ProductRepository`, `admin\factory\ShopProduct` @@ -319,3 +319,27 @@ Tlumaczenia kontenerow statycznych (per jezyk). **Aktualizacja 2026-02-12 (ver. 0.259):** modul `/admin/scontainers` korzysta z `Domain\Scontainers\ScontainersRepository` (DI kontroler + fasada legacy). **Aktualizacja 2026-02-12 (ver. 0.260):** modul `/admin/articles_archive` korzysta z `Domain\Article\ArticleRepository` (`listArchivedForAdmin`, `restore`, `deletePermanently`) przez `admin\Controllers\ArticlesArchiveController`. + +## pp_shop_apilo_settings +Ustawienia integracji Apilo (key-value). + +| Kolumna | Opis | +|---------|------| +| id | PK | +| name | Klucz ustawienia (np. client-id, access-token) | +| value | Wartosc ustawienia | + +**Uzywane w:** `Domain\Integrations\IntegrationsRepository`, `admin\Controllers\IntegrationsController`, `admin\factory\Integrations` + +## pp_shop_shoppro_settings +Ustawienia integracji ShopPRO (key-value). + +| Kolumna | Opis | +|---------|------| +| id | PK | +| name | Klucz ustawienia (np. domain, db_name) | +| value | Wartosc ustawienia | + +**Uzywane w:** `Domain\Integrations\IntegrationsRepository`, `admin\Controllers\IntegrationsController`, `admin\factory\Integrations` + +**Aktualizacja 2026-02-13:** modul `/admin/integrations/` korzysta z `Domain\Integrations\IntegrationsRepository` (DI kontroler + fasada legacy). Usunieto integracje Sellasist i Baselinker. diff --git a/PROJECT_STRUCTURE.md b/PROJECT_STRUCTURE.md index 7b07d2c..ce15768 100644 --- a/PROJECT_STRUCTURE.md +++ b/PROJECT_STRUCTURE.md @@ -57,26 +57,13 @@ shop\product:{product_id}:{lang_id}:{permutation_hash} ### Plik: `cron.php` -#### Sellasist -- **Aktualizacja produktów:** Linia 111-149 -- **Funkcje:** Aktualizacja cen i stanów magazynowych -- **Częstotliwość:** Co 10 minut -- **Czyszczenie cache:** Linia 146 - #### Apilo -- **Aktualizacja pojedynczego produktu:** Linia 152-176 - - Częstotliwość: Co 10 minut - - Czyszczenie cache: Linia 173 +- **Aktualizacja pojedynczego produktu:** synchronizacja cen i stanow + - Czestotliwosc: Co 10 minut +- **Synchronizacja cennika:** masowa aktualizacja cen z Apilo + - Czestotliwosc: Co 1 godzine -- **Synchronizacja cennika:** Linia 179-218 - - Częstotliwość: Co 1 godzinę - - Czyszczenie cache: Linia 212 - -#### Baselinker -- **Aktualizacja produktów:** Linia 220-289 -- **Funkcje:** Ceny, stany magazynowe, wagi -- **Częstotliwość:** Co 24 godziny (1440 minut) -- **Czyszczenie cache:** Linia 278 +**Uwaga:** Integracje Sellasist i Baselinker zostaly usuniete w ver. 0.263. ## Panel Administratora @@ -130,9 +117,10 @@ shopPRO/ ### Tabele integracji - Kolumny w `pp_shop_products`: - - `sellasist_product_id`, `sellasist_get_data_date` - - `apilo_product_id`, `apilo_get_data_date` - - `baselinker_product_id`, `baselinker_get_data_date` + - `apilo_product_id`, `apilo_product_name`, `apilo_get_data_date` +- Tabele ustawien: + - `pp_shop_apilo_settings` (key-value) + - `pp_shop_shoppro_settings` (key-value) ## Konfiguracja @@ -387,9 +375,9 @@ Aktualnie w suite są też testy modułów `Dictionaries`, `Articles` i `Users` - **UPDATE:** widoki Users przeniesione z `grid/gridEdit` na `components/table-list` i `components/form-edit` ## Aktualizacja 2026-02-12 (finalizacja Users) -- Modu users dziaa na `Domain\\User\\UserRepository` + `admin\\Controllers\\UsersController`. -- Usunito legacy klasy: `autoload/admin/controls/class.Users.php`, `autoload/admin/factory/class.Users.php`, `autoload/admin/view/class.Users.php`. -- Walidacja: przy wczonym 2FA pole `twofa_email` jest wymagane. +- Modu� users dzia�a na `Domain\\User\\UserRepository` + `admin\\Controllers\\UsersController`. +- Usuni�to legacy klasy: `autoload/admin/controls/class.Users.php`, `autoload/admin/factory/class.Users.php`, `autoload/admin/view/class.Users.php`. +- Walidacja: przy w��czonym 2FA pole `twofa_email` jest wymagane. - Widoki users przeniesione na `components/table-list` i `components/form-edit`. - **NOWE:** `Domain\\Languages\\LanguagesRepository` - repozytorium jezykow i tlumaczen (lista, zapis, usuwanie, max_order) - **NOWE:** `admin\\Controllers\\LanguagesController` - kontroler DI (`list/view_list`, `language_*`, `translation_*`) @@ -479,3 +467,11 @@ Aktualnie w suite są też testy modułów `Dictionaries`, `Articles` i `Users` - UPDATE: routing DI (`admin\\Site`) ma fabryke kontrolera `Pages`. - UPDATE: zalezne endpointy `cookie_*` i `generate_seo_link` przepiete na `/admin/pages/*`. - CLEANUP: usuniete legacy pliki `autoload/admin/controls/class.Pages.php`, `autoload/admin/view/class.Pages.php`, `autoload/admin/factory/class.Pages.php`, `admin/ajax/pages.php`. + +## Aktualizacja 2026-02-13 (Integrations refactor, ver. 0.263) +- NOWE: `Domain\Integrations\IntegrationsRepository` (settings Apilo/ShopPRO, OAuth, product linking, API fetch). +- NOWE: `admin\Controllers\IntegrationsController` (DI) dla akcji Apilo (settings, authorization, fetch lists, product CRUD) i ShopPRO (settings, product import). +- UPDATE: `admin\factory\Integrations` jako fasada delegujaca do repozytorium (tylko Apilo + ShopPRO). +- CLEANUP: **usunieto integracje Sellasist i Baselinker z calego projektu** - kontrolery, factory, szablony, referencje w cron.php, Order, ShopStatuses, ShopTransport, ShopPaymentMethod, ShopProduct, config.php, front/factory/*. +- CLEANUP: usuniete pliki: `autoload/admin/controls/class.Integrations.php`, `autoload/admin/controls/class.Baselinker.php`, `autoload/admin/factory/class.Baselinker.php`, `autoload/front/factory/class.Shop.php`, `autoload/shop/class.ShopStatus.php`, szablony sellasist/baselinker. +- Testy: **OK (212 tests, 577 assertions)**. diff --git a/REFACTORING_PLAN.md b/REFACTORING_PLAN.md index 2addebf..dd34300 100644 --- a/REFACTORING_PLAN.md +++ b/REFACTORING_PLAN.md @@ -260,12 +260,23 @@ grep -r "Product::getQuantity" . - Legacy cleanup: usuniety `autoload/admin/controls/class.Users.php` - Testy: 25 testow repozytorium (CRUD, logon, 2FA, checkLogin) + 12 testow kontrolera (kontrakty + normalizeUser) +- **Integrations** (migracja kontrolera i repozytorium + cleanup Sellasist/Baselinker) + - ✅ IntegrationsRepository - **ZMIGROWANE** (2026-02-13) 🎉 + - Nowa klasa: `Domain\Integrations\IntegrationsRepository` (settings Apilo/ShopPRO, OAuth, product linking, API fetch) + - Nowy kontroler: `admin\Controllers\IntegrationsController` (DI, instancyjny) + - Router: `admin\Site` - factory wpis dla modulu `Integrations` + - Fasada: `admin\factory\Integrations` deleguje do repozytorium (tylko Apilo + ShopPRO) + - **CLEANUP:** usunieto integracje Sellasist i Baselinker z calego projektu + - Usuniete pliki: `controls/Integrations`, `controls/Baselinker`, `factory/Baselinker`, `front/factory/Shop`, `shop/ShopStatus`, szablony sellasist/baselinker + - Wyczyszczone referencje w: cron.php, Order, ShopStatuses, ShopTransport, ShopPaymentMethod, ShopProduct, config.php, front/factory/* + - Testy: 16 nowych testow (repozytorium) + 10 testow kontrolera + - Aktualizacja: ver. 0.263 + ### 📋 Do zrobienia - Order - Category - ShopAttribute - ShopProduct (factory) -- Pages (`browse_list` i widoki drzewiaste nadal w legacy `admin\controls` / `admin\view`) ## Testowanie @@ -286,17 +297,19 @@ tests/ │ │ ├── Dictionaries/DictionariesRepositoryTest.php │ │ ├── Product/ProductRepositoryTest.php │ │ ├── Settings/SettingsRepositoryTest.php -│ │ └── User/UserRepositoryTest.php +│ │ ├── User/UserRepositoryTest.php +│ │ └── Integrations/IntegrationsRepositoryTest.php │ └── admin/ │ └── Controllers/ │ ├── ArticlesControllerTest.php │ ├── DictionariesControllerTest.php +│ ├── IntegrationsControllerTest.php │ ├── ProductArchiveControllerTest.php │ ├── SettingsControllerTest.php │ └── UsersControllerTest.php └── Integration/ ``` -**Łącznie: 119 testów, 256 asercji** +**Łącznie: 212 testów, 577 asercji** ### Przykład testu ```php @@ -381,10 +394,11 @@ vendor/bin/phpstan analyse autoload/Domain 6. **ProductArchive** ✅ (migracja kontrolera + cleanup szablonów, ver. 0.252) 7. **Filemanager** ✅ (migracja routingu + fix `Invalid Key`, ver. 0.252) 8. **Users** ✅ (repo + kontroler + 2FA + legacy cleanup, ver. 0.253) -9. **Order** -10. **Category** -11. **ShopAttribute** -12. **Pages** (`browse_list` i powiązane widoki nadal legacy) +9. **Pages** ✅ (repo + kontroler + drzewo stron + AJAX endpoints, ver. 0.262) +10. **Integrations** ✅ (repo + kontroler + cleanup Sellasist/Baselinker, ver. 0.263) +11. **Order** +12. **Category** +13. **ShopAttribute** - **Form Edit System** - Nowy uniwersalny system formularzy edycji - ✅ Klasy ViewModel: `FormFieldType`, `FormField`, `FormTab`, `FormAction`, `FormEditViewModel` @@ -589,7 +603,7 @@ Gdy `persist = true`: - **NOWE:** `admin\\Controllers\\LanguagesController` (DI) dla akcji `view_list/list`, `language_*`, `translation_*` - **UPDATE:** `admin\\factory\\Languages` jako fasada delegujaca do repozytorium - **CLEANUP:** usunieto legacy `admin\\controls\\Languages` oraz `admin\\view\\Languages` -- **UPDATE:** poprawki globalne `components/table-list` dla krotkich kolumn/filtrw +- **UPDATE:** poprawki globalne `components/table-list` dla krotkich kolumn/filtr�w ## Aktualizacja 2026-02-12 (ver. 0.255) - UPDATE: SettingsController, BannerController, DictionariesController, ArticlesController pobieraja liste jezykow przez Domain/Languages/LanguagesRepository (DI) zamiast legacy admin/factory/Languages. @@ -700,3 +714,14 @@ Gdy `persist = true`: - UPDATE: endpointy zalezne od Pages w innych modulach (`articles`, `layouts`, `shop-category`, `shop-product`) przepiete z `admin/ajax.php?a=*` na `/admin/pages/*`. - CLEANUP: usuniete `autoload/admin/controls/class.Pages.php`, `autoload/admin/view/class.Pages.php`, `autoload/admin/factory/class.Pages.php`, `admin/ajax/pages.php`; `admin/ajax.php` nie includuje juz `ajax/pages.php`. - Testy: **OK (186 tests, 478 assertions)**. + +## Aktualizacja 2026-02-13 - Integrations (/admin/integrations) +- NOWE: `Domain\Integrations\IntegrationsRepository` (settings Apilo/ShopPRO, OAuth, product linking, API fetch lists, product search/create, ShopPRO import). +- NOWE: `admin\Controllers\IntegrationsController` (DI) dla akcji: `apilo_settings`, `apilo_settings_save`, `apilo_authorization`, `get_platform_list`, `get_status_types_list`, `get_carrier_account_list`, `get_payment_types_list`, `apilo_create_product`, `apilo_product_search`, `apilo_product_select_save`, `apilo_product_select_delete`, `shoppro_settings`, `shoppro_settings_save`, `shoppro_product_import`. +- UPDATE: `admin\factory\Integrations` jako fasada delegujaca do `Domain\Integrations\IntegrationsRepository` (tylko Apilo + ShopPRO). +- **CLEANUP: usunieto integracje Sellasist i Baselinker z calego projektu:** + - Usuniete klasy: `admin\controls\Integrations`, `admin\controls\Baselinker`, `admin\factory\Baselinker`, `front\factory\Shop`, `shop\ShopStatus` + - Usuniete szablony: `integrations/sellasist-settings.php`, `integrations/baselinker-settings.php`, `admin/templates/baselinker/` + - Wyczyszczone referencje w: `cron.php`, `cron/cron-xml.php`, `shop\Order`, `admin\controls\ShopStatuses`, `admin\controls\ShopTransport`, `admin\controls\ShopPaymentMethod`, `admin\controls\ShopProduct`, `admin\factory\ShopStatuses`, `admin\factory\ShopTransport`, `admin\factory\ShopProduct`, `front\factory\ShopStatuses`, `front\factory\ShopTransport`, `front\factory\ShopPaymentMethod`, `front\factory\ShopProduct`, `front\factory\ShopOrder`, `shop\Product`, `config.php` + - Wyczyszczone szablony: `shop-statuses/*`, `shop-transport/*`, `shop-payment-method/*`, `shop-product/*`, `site/main-layout.php` +- Testy: **OK (212 tests, 577 assertions)**. diff --git a/TESTING.md b/TESTING.md index 7978a3b..5e0ed91 100644 --- a/TESTING.md +++ b/TESTING.md @@ -52,11 +52,13 @@ tests/ | | |-- Dictionaries/DictionariesRepositoryTest.php | | |-- Product/ProductRepositoryTest.php | | |-- Settings/SettingsRepositoryTest.php -| | `-- User/UserRepositoryTest.php +| | |-- User/UserRepositoryTest.php +| | `-- Integrations/IntegrationsRepositoryTest.php | `-- admin/ | `-- Controllers/ | |-- ArticlesControllerTest.php | |-- DictionariesControllerTest.php +| |-- IntegrationsControllerTest.php | |-- ProductArchiveControllerTest.php | |-- SettingsControllerTest.php | `-- UsersControllerTest.php @@ -281,3 +283,17 @@ Nowe testy dodane 2026-02-13: Zaktualizowane testy 2026-02-13: - `tests/Unit/admin/Controllers/ArticlesControllerTest.php` (konstruktor z `Domain\\Pages\\PagesRepository`) + +## Aktualizacja suite (Integrations refactor, ver. 0.263) +Ostatnio zweryfikowano: 2026-02-13 + +```text +OK (212 tests, 577 assertions) +``` + +Nowe testy dodane 2026-02-13: +- `tests/Unit/Domain/Integrations/IntegrationsRepositoryTest.php` (16 testow: getSettings, getSetting, saveSetting, linkProduct, unlinkProduct, getProductSku, apiloGetAccessToken, invalid provider, settings table mapping) +- `tests/Unit/admin/Controllers/IntegrationsControllerTest.php` (10 testow: kontrakty metod, return types, brak metod sellasist/baselinker) + +Zaktualizowane pliki: +- `tests/bootstrap.php` (dodany stub `S::remove_special_chars()`) diff --git a/admin/templates/baselinker/bundling-products.php b/admin/templates/baselinker/bundling-products.php deleted file mode 100644 index d434df2..0000000 --- a/admin/templates/baselinker/bundling-products.php +++ /dev/null @@ -1,33 +0,0 @@ -
- - - - - - - - - - products as $product ):?> - - - - - - - -
Nazwa produktuSKUProdukt w Baselinker
- - -
- -
\ No newline at end of file diff --git a/admin/templates/integrations/baselinker-settings.php b/admin/templates/integrations/baselinker-settings.php deleted file mode 100644 index 0ca02b2..0000000 --- a/admin/templates/integrations/baselinker-settings.php +++ /dev/null @@ -1,139 +0,0 @@ -
-
- Ustawienia baselinker.com -
-
-
-
-
- -
-
-
- - - - -
-
-
-
- - settings['storages_list'] );?> -
- -
-
-
- - - - -
-
-
-
-
- -
-
-
- - - - -
-
-
-
-
- -
-
-
- - - - -
-
-
-
-
- -
-
-
- - - - -
-
-
-
-
- -
-
-
- - - - -
-
-
-
-
- -
-
-
- \ No newline at end of file diff --git a/admin/templates/integrations/sellasist-settings.php b/admin/templates/integrations/sellasist-settings.php deleted file mode 100644 index 9994c4d..0000000 --- a/admin/templates/integrations/sellasist-settings.php +++ /dev/null @@ -1,119 +0,0 @@ -
-
- Ustawienia sellasist.com -
-
-
-
-
- -
-
-
- - - - -
-
-
-
-
- -
-
-
- - - - -
-
-
-
-
- -
-
-
- - - - -
-
-
-
-
- -
-
-
- - - - -
-
-
-
-
- -
-
-
- - - - -
-
-
-
-
- -
-
-
- \ No newline at end of file diff --git a/admin/templates/shop-payment-method/view-list.php b/admin/templates/shop-payment-method/view-list.php index 23961f5..4459e14 100644 --- a/admin/templates/shop-payment-method/view-list.php +++ b/admin/templates/shop-payment-method/view-list.php @@ -5,10 +5,6 @@ foreach ( $this -> apilo_payment_types_list as $payment_type ) if ( isset( $payment_type['name'] ) && isset( $payment_type['id'] ) ) $payment_types[ $payment_type['id'] ] = $payment_type['name']; } -// sellasist payment methods -$sellasist_payment_types_list = []; -foreach ( $this -> sellasist_payment_types_list as $sellasist_payment_type ) - $sellasist_payment_types_list[ $sellasist_payment_type['id'] ] = $sellasist_payment_type['title']; $grid = new \grid( 'pp_shop_payment_methods' ); $grid -> gdb_opt = $gdb; @@ -39,12 +35,6 @@ $grid -> columns_view = [ 'replace' => [ 'array' => $payment_types ], 'td' => [ 'class' => 'g-center' ], 'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ] - ], [ - 'name' => 'Typ płatności Sellasist', - 'db' => 'sellasist_payment_type_id', - 'replace' => [ 'array' => $sellasist_payment_types_list ], - 'td' => [ 'class' => 'g-center' ], - 'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ] ] ]; @@ -63,11 +53,6 @@ $grid -> columns_edit = [ 'type' => 'select', 'name' => 'Typ płatności Apilo', 'replace' => [ 'array' => $payment_types ], - ], [ - 'db' => 'sellasist_payment_type_id', - 'type' => 'select', - 'name' => 'Typ płatności Sellasist', - 'replace' => [ 'array' => $sellasist_payment_types_list ], ], [ 'name' => 'Aktywny', 'db' => 'status', diff --git a/admin/templates/shop-product/product-combination.php b/admin/templates/shop-product/product-combination.php index 3b627d0..4366c83 100644 --- a/admin/templates/shop-product/product-combination.php +++ b/admin/templates/shop-product/product-combination.php @@ -19,7 +19,6 @@ Stan magazynowy Cena netto Zam. SM 0 - Baselinker Opcje @@ -50,14 +49,6 @@ onchange="$.ajax({ type: 'POST', cache: false, url: '/admin/shop_product/product_combination_stock_0_buy_save/', data: { product_id: , stock_0_buy: $( this ).is( ':checked' ) } } );"> - - " . substr( $product['baselinker_product_name'], 0, 25 ) . "..."; - else - echo "nie przypisano "; - ?> - @@ -138,86 +129,5 @@ return false; }); - $( 'body' ).on( 'click', '.baselinker-product-search', function() { - var product_id = $( this ).attr( 'product-id' ); - - $.ajax({ - type: 'POST', - cache: false, - url: '/admin/shop_product/baselinker_product_search/', - data: { - product_id: product_id - }, - beforeSend: function() { - $( '#overlay' ).show(); - }, - success: function( response ) { - data = jQuery.parseJSON( response ); - - if ( data.status == 'SUCCESS' ) { - $('.baselinker-found-products').remove(); - var html = '
'; - html += '

Znaleziono ' + data.products.length + ' produktów

'; - html += ''; - html += ''; - html += '
'; - $( 'span[product-id="' + product_id + '"]' ).closest( 'td' ).append( html ); - } else if ( data.status == 'error' ) { - $.alert({ - title: 'Błąd', - content: data.msg, - type: 'red', - closeIcon: true, - closeIconClass: 'fa fa-times', - typeAnimated: true, - animation: 'opacity', - columnClass: 'col-12 col-lg-10', - theme: 'modern', - icon: 'fa fa-exclamation-triangle', - buttons: { - confirm: { - text: 'OK', - btnClass: 'btn-danger', - keys: ['enter'], - action: function() {} - } - } - }); - } - } - }); - }); - - $( 'body' ).on( 'click', '.baselinker-product-select-save', function(){ - var product_id = $( this ).attr( 'product-id' ); - var baselinker_product_id = $( '.baselinker-product-select[product-id="' + product_id + '"]' ).val(); - var baselinker_product_name = $( '.baselinker-product-select[product-id="' + product_id + '"] option:selected' ).text(); - - $.ajax({ - type: 'POST', - cache: false, - url: '/admin/shop_product/baselinker_product_select_save/', - data: { - product_id: product_id, - baselinker_product_id: baselinker_product_id, - baselinker_product_name: baselinker_product_name - }, - beforeSend: function() { - $( '#overlay' ).show(); - }, - success: function( response ) { - data = jQuery.parseJSON( response ); - - if ( data.status == 'ok' ) { - $( '.baselinker-product-select[product-id="' + product_id + '"]' ).closest( '.baselinker-found-products' ).remove(); - $( 'span[product-id="' + product_id + '"]' ).html( '' + baselinker_product_name.substr( 0, 25 ) + '...' ).removeClass( 'baselinker-product-search' ).removeClass( 'text-danger' ); - } - } - }); - }); }); \ No newline at end of file diff --git a/admin/templates/shop-product/product-edit.php b/admin/templates/shop-product/product-edit.php index e5a07a3..cb36693 100644 --- a/admin/templates/shop-product/product-edit.php +++ b/admin/templates/shop-product/product-edit.php @@ -21,15 +21,15 @@ ob_start();