ver. 0.318: shopPRO export produktów + nowe API endpoints
- NEW: IntegrationsRepository::shopproExportProduct() — eksport produktu do zdalnej instancji shopPRO (pola główne, tłumaczenia, custom fields, zdjęcia) - NEW: sendImageToShopproApi() — wysyłka zdjęć przez API shopPRO (base64 POST) - REFACTOR: shopproImportProduct() — wydzielono shopproDb() i missingShopproSetting(); dodano security_information, producer_id, custom fields, alt zdjęcia - NEW: AttributeRepository::ensureAttributeForApi() i ensureAttributeValueForApi() — idempotent find-or-create dla słowników - NEW: API POST dictionaries/ensure_attribute — utwórz lub znajdź atrybut - NEW: API POST dictionaries/ensure_attribute_value — utwórz lub znajdź wartość - NEW: API POST products/upload_image — przyjmuje base64, zapisuje plik i DB - NEW: IntegrationsController::shoppro_product_export() — akcja admina - NEW: przycisk "Eksportuj do shopPRO" w liście produktów - NEW: pole API key w ustawieniach integracji shopPRO Tests: 765 tests, 2153 assertions — all green Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -265,6 +265,16 @@ class IntegrationsController
|
||||
exit;
|
||||
}
|
||||
|
||||
public function shoppro_product_export(): void
|
||||
{
|
||||
$productId = (int) \Shared\Helpers\Helpers::get( 'product_id' );
|
||||
$result = $this->repository->shopproExportProduct( $productId );
|
||||
|
||||
\Shared\Helpers\Helpers::alert( (string)($result['message'] ?? 'Wystapil blad podczas eksportu produktu.') );
|
||||
header( 'Location: /admin/shop_product/view_list/' );
|
||||
exit;
|
||||
}
|
||||
|
||||
private function fetchApiloListWithFeedback( string $type, string $label ): void
|
||||
{
|
||||
$result = $this->repository->apiloFetchListResult( $type );
|
||||
|
||||
@@ -140,6 +140,15 @@ class ShopProductController
|
||||
}
|
||||
}
|
||||
|
||||
if ( $shopproEnabled ) {
|
||||
$row['_actions'][] = [
|
||||
'label' => 'Eksportuj do shopPRO',
|
||||
'url' => '/admin/integrations/shoppro_product_export/product_id=' . $id,
|
||||
'class' => 'btn btn-xs btn-system',
|
||||
'confirm' => 'Na pewno chcesz wyeksportowac ten produkt do shopPRO?',
|
||||
];
|
||||
}
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user