This commit is contained in:
2025-04-01 00:38:54 +02:00
parent d4d4c0c09d
commit 87da06293a
22351 changed files with 5168854 additions and 7538 deletions

View File

@@ -0,0 +1,68 @@
<?php
namespace Empik\Marketplace\Configuration;
use Empik\Marketplace\Adapter\ConfigurationAdapter;
class ExportConfiguration
{
const EXPORT_PRODUCT_FILENAME = 'PrestaShop_products.csv';
const EXPORT_OFFER_FILENAME = 'PrestaShop_offers.csv';
const EXPORT_DIR = '/modules/empikmarketplace/data/';
const EXPORT_PATH = _PS_ROOT_DIR_ . self::EXPORT_DIR;
const CSV_FIELD_SEPARATOR = ';';
const CSV_VALUE_SEPARATOR = '|';
const EXPORT_IMG_LIMIT = 10;
const EXPORT_NAME_MAX_LENGTH = 128;
const EXPORT_PRODUCTS_PER_PAGE = 10;
protected $configurationAdapter;
public function __construct(ConfigurationAdapter $configurationAdapter)
{
$this->configurationAdapter = $configurationAdapter;
}
public function getExportPath()
{
return self::EXPORT_PATH . self::EXPORT_PRODUCT_FILENAME;
}
public function getProductExportPath()
{
return self::EXPORT_PATH . self::EXPORT_PRODUCT_FILENAME;
}
public function getOfferExportPath()
{
return self::EXPORT_PATH . self::EXPORT_OFFER_FILENAME;
}
public function getCsvDelimiter()
{
return self::CSV_FIELD_SEPARATOR;
}
public function getProductIdType()
{
return $this->configurationAdapter->get('EMPIK_OFFER_IDENTIFIER');
}
public function getPriceRatio()
{
return (float)$this->configurationAdapter->get('EMPIK_PRICE_RATIO');
}
public function getAddToPrice()
{
return (float)$this->configurationAdapter->get('EMPIK_ADD_TO_PRICE');
}
public function getStockReduce()
{
return (float)$this->configurationAdapter->get('EMPIK_REDUCE_STOCK');
}
}

View File

@@ -0,0 +1,61 @@
<?php
namespace Empik\Marketplace\Configuration;
use Empik\Marketplace\Adapter\ConfigurationAdapter;
class ExportProductConfiguration
{
const EXPORT_PRODUCT_FILENAME = 'PrestaShop_products.csv';
const EXPORT_OFFER_FILENAME = 'PrestaShop_offers.csv';
const EXPORT_PATH = __DIR__ . '/../../data/';
const CSV_FIELD_SEPARATOR = ';';
const CSV_VALUE_SEPARATOR = '|';
protected $configurationAdapter;
public function __construct(ConfigurationAdapter $configurationAdapter)
{
$this->configurationAdapter = $configurationAdapter;
}
public function getExportPath()
{
return self::EXPORT_PATH . self::EXPORT_PRODUCT_FILENAME;
}
public function getProductExportPath()
{
return self::EXPORT_PATH . self::EXPORT_PRODUCT_FILENAME;
}
public function getOfferExportPath()
{
return self::EXPORT_PATH . self::EXPORT_OFFER_FILENAME;
}
public function getCsvDelimiter()
{
return self::CSV_FIELD_SEPARATOR;
}
public function getProductIdType()
{
return $this->configurationAdapter->get('EMPIK_OFFER_IDENTIFIER');
}
public function getPriceRatio()
{
return (float)$this->configurationAdapter->get('EMPIK_PRICE_RATIO');
}
public function getAddToPrice()
{
return (float)$this->configurationAdapter->get('EMPIK_ADD_TO_PRICE');
}
public function getStockReduce()
{
return (float)$this->configurationAdapter->get('EMPIK_REDUCE_STOCK');
}
}

View File

@@ -0,0 +1,11 @@
<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;