Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1fc36e4403 | |||
| c0cdaaf638 |
@@ -36,7 +36,7 @@ composer test
|
||||
|
||||
PHPUnit 9.6 via `phpunit.phar`. Bootstrap: `tests/bootstrap.php`. Config: `phpunit.xml`.
|
||||
|
||||
Current suite: **687 tests, 1971 assertions**.
|
||||
Current suite: **730 tests, 2066 assertions**.
|
||||
|
||||
### Creating Updates
|
||||
See `docs/UPDATE_INSTRUCTIONS.md` for the full procedure. Updates are ZIP packages in `updates/0.XX/`. Never include `*.md` files, `updates/changelog.php`, or root `.htaccess` in update ZIPs.
|
||||
|
||||
@@ -534,6 +534,127 @@ class AttributeRepository
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Zwraca aktywne atrybuty z wartościami i wielojęzycznymi nazwami dla REST API.
|
||||
*
|
||||
* @return array<int, array<string, mixed>>
|
||||
*/
|
||||
public function listForApi(): array
|
||||
{
|
||||
// 1. Get all active attribute IDs (1 query)
|
||||
$rows = $this->db->select('pp_shop_attributes', ['id', 'type', 'status'], [
|
||||
'status' => 1,
|
||||
'ORDER' => ['o' => 'ASC'],
|
||||
]);
|
||||
if (!is_array($rows) || empty($rows)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$attrIds = [];
|
||||
foreach ($rows as $row) {
|
||||
$id = (int)($row['id'] ?? 0);
|
||||
if ($id > 0) {
|
||||
$attrIds[] = $id;
|
||||
}
|
||||
}
|
||||
if (empty($attrIds)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// 2. Batch load ALL attribute translations (1 query)
|
||||
$allAttrTranslations = $this->db->select(
|
||||
'pp_shop_attributes_langs',
|
||||
['attribute_id', 'lang_id', 'name'],
|
||||
['attribute_id' => $attrIds]
|
||||
);
|
||||
$attrNamesMap = [];
|
||||
if (is_array($allAttrTranslations)) {
|
||||
foreach ($allAttrTranslations as $t) {
|
||||
$aId = (int)($t['attribute_id'] ?? 0);
|
||||
$langId = (string)($t['lang_id'] ?? '');
|
||||
if ($aId > 0 && $langId !== '') {
|
||||
$attrNamesMap[$aId][$langId] = (string)($t['name'] ?? '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Batch load ALL values for those attribute IDs (1 query)
|
||||
$allValueRows = $this->db->select(
|
||||
'pp_shop_attributes_values',
|
||||
['id', 'attribute_id', 'is_default', 'impact_on_the_price'],
|
||||
[
|
||||
'attribute_id' => $attrIds,
|
||||
'ORDER' => ['id' => 'ASC'],
|
||||
]
|
||||
);
|
||||
$valuesByAttr = [];
|
||||
$allValueIds = [];
|
||||
if (is_array($allValueRows)) {
|
||||
foreach ($allValueRows as $vRow) {
|
||||
$valueId = (int)($vRow['id'] ?? 0);
|
||||
$attrId = (int)($vRow['attribute_id'] ?? 0);
|
||||
if ($valueId > 0 && $attrId > 0) {
|
||||
$valuesByAttr[$attrId][] = $vRow;
|
||||
$allValueIds[] = $valueId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Batch load ALL value translations (1 query)
|
||||
$valueNamesMap = [];
|
||||
if (!empty($allValueIds)) {
|
||||
$allValueTranslations = $this->db->select(
|
||||
'pp_shop_attributes_values_langs',
|
||||
['value_id', 'lang_id', 'name'],
|
||||
['value_id' => $allValueIds]
|
||||
);
|
||||
if (is_array($allValueTranslations)) {
|
||||
foreach ($allValueTranslations as $vt) {
|
||||
$vId = (int)($vt['value_id'] ?? 0);
|
||||
$langId = (string)($vt['lang_id'] ?? '');
|
||||
if ($vId > 0 && $langId !== '') {
|
||||
$valueNamesMap[$vId][$langId] = (string)($vt['name'] ?? '');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Assemble result in-memory
|
||||
$result = [];
|
||||
foreach ($rows as $row) {
|
||||
$attributeId = (int)($row['id'] ?? 0);
|
||||
if ($attributeId <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$names = isset($attrNamesMap[$attributeId]) ? $attrNamesMap[$attributeId] : [];
|
||||
|
||||
$values = [];
|
||||
if (isset($valuesByAttr[$attributeId])) {
|
||||
foreach ($valuesByAttr[$attributeId] as $vRow) {
|
||||
$valueId = (int)$vRow['id'];
|
||||
$impact = $vRow['impact_on_the_price'];
|
||||
$values[] = [
|
||||
'id' => $valueId,
|
||||
'names' => isset($valueNamesMap[$valueId]) ? $valueNamesMap[$valueId] : [],
|
||||
'is_default' => (int)($vRow['is_default'] ?? 0),
|
||||
'impact_on_the_price' => ($impact !== null && $impact !== '') ? (float)$impact : null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$result[] = [
|
||||
'id' => $attributeId,
|
||||
'type' => (int)($row['type'] ?? 0),
|
||||
'status' => (int)($row['status'] ?? 0),
|
||||
'names' => $names,
|
||||
'values' => $values,
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{sql: string, params: array<string, mixed>}
|
||||
*/
|
||||
|
||||
@@ -508,6 +508,31 @@ class ProductRepository
|
||||
$params[':promoted'] = (int)$promotedFilter;
|
||||
}
|
||||
|
||||
// Attribute filters: attribute_{id} = {value_id}
|
||||
$attrFilters = isset($filters['attributes']) && is_array($filters['attributes']) ? $filters['attributes'] : [];
|
||||
$attrIdx = 0;
|
||||
foreach ($attrFilters as $attrId => $valueId) {
|
||||
$attrId = (int)$attrId;
|
||||
$valueId = (int)$valueId;
|
||||
if ($attrId <= 0 || $valueId <= 0) {
|
||||
continue;
|
||||
}
|
||||
$paramAttr = ':attr_id_' . $attrIdx;
|
||||
$paramVal = ':attr_val_' . $attrIdx;
|
||||
$where[] = "EXISTS (
|
||||
SELECT 1
|
||||
FROM pp_shop_products AS psp_var{$attrIdx}
|
||||
INNER JOIN pp_shop_products_attributes AS pspa{$attrIdx}
|
||||
ON pspa{$attrIdx}.product_id = psp_var{$attrIdx}.id
|
||||
WHERE psp_var{$attrIdx}.parent_id = psp.id
|
||||
AND pspa{$attrIdx}.attribute_id = {$paramAttr}
|
||||
AND pspa{$attrIdx}.value_id = {$paramVal}
|
||||
)";
|
||||
$params[$paramAttr] = $attrId;
|
||||
$params[$paramVal] = $valueId;
|
||||
$attrIdx++;
|
||||
}
|
||||
|
||||
$whereSql = implode(' AND ', $where);
|
||||
|
||||
$sqlCount = "
|
||||
@@ -681,18 +706,413 @@ class ProductRepository
|
||||
}
|
||||
}
|
||||
|
||||
// Attributes
|
||||
// Attributes (enriched with names) — batch-loaded
|
||||
$attributes = $this->db->select('pp_shop_products_attributes', ['attribute_id', 'value_id'], ['product_id' => $id]);
|
||||
$result['attributes'] = [];
|
||||
if (is_array($attributes)) {
|
||||
if (is_array($attributes) && !empty($attributes)) {
|
||||
$attrIds = [];
|
||||
$valueIds = [];
|
||||
foreach ($attributes as $attr) {
|
||||
$attrIds[] = (int)$attr['attribute_id'];
|
||||
$valueIds[] = (int)$attr['value_id'];
|
||||
}
|
||||
$attrNamesMap = $this->batchLoadAttributeNames($attrIds);
|
||||
$valueNamesMap = $this->batchLoadValueNames($valueIds);
|
||||
$attrTypesMap = $this->batchLoadAttributeTypes($attrIds);
|
||||
|
||||
foreach ($attributes as $attr) {
|
||||
$attrId = (int)$attr['attribute_id'];
|
||||
$valId = (int)$attr['value_id'];
|
||||
$result['attributes'][] = [
|
||||
'attribute_id' => (int)$attr['attribute_id'],
|
||||
'value_id' => (int)$attr['value_id'],
|
||||
'attribute_id' => $attrId,
|
||||
'attribute_type' => isset($attrTypesMap[$attrId]) ? $attrTypesMap[$attrId] : 0,
|
||||
'attribute_names' => isset($attrNamesMap[$attrId]) ? $attrNamesMap[$attrId] : [],
|
||||
'value_id' => $valId,
|
||||
'value_names' => isset($valueNamesMap[$valId]) ? $valueNamesMap[$valId] : [],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Variants (only for parent products)
|
||||
if (empty($product['parent_id'])) {
|
||||
$result['variants'] = $this->findVariantsForApi($id);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pobiera warianty produktu z atrybutami i tłumaczeniami dla REST API.
|
||||
*
|
||||
* @param int $productId ID produktu nadrzędnego
|
||||
* @return array Lista wariantów
|
||||
*/
|
||||
public function findVariantsForApi(int $productId): array
|
||||
{
|
||||
$stmt = $this->db->query(
|
||||
'SELECT id, permutation_hash, sku, ean, price_brutto, price_brutto_promo,
|
||||
price_netto, price_netto_promo, quantity, stock_0_buy, weight, status
|
||||
FROM pp_shop_products
|
||||
WHERE parent_id = :pid
|
||||
ORDER BY id ASC',
|
||||
[':pid' => $productId]
|
||||
);
|
||||
|
||||
$rows = $stmt ? $stmt->fetchAll(\PDO::FETCH_ASSOC) : [];
|
||||
if (!is_array($rows)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Collect all variant IDs, then load attributes in batch
|
||||
$variantIds = [];
|
||||
foreach ($rows as $row) {
|
||||
$variantIds[] = (int)$row['id'];
|
||||
}
|
||||
|
||||
// Load all attributes for all variants at once
|
||||
$allAttrsRaw = [];
|
||||
if (!empty($variantIds)) {
|
||||
$allAttrsRaw = $this->db->select('pp_shop_products_attributes', ['product_id', 'attribute_id', 'value_id'], ['product_id' => $variantIds]);
|
||||
if (!is_array($allAttrsRaw)) {
|
||||
$allAttrsRaw = [];
|
||||
}
|
||||
}
|
||||
|
||||
// Group by variant and collect unique IDs for batch loading
|
||||
$attrsByVariant = [];
|
||||
$allAttrIds = [];
|
||||
$allValueIds = [];
|
||||
foreach ($allAttrsRaw as $a) {
|
||||
$pid = (int)$a['product_id'];
|
||||
$aId = (int)$a['attribute_id'];
|
||||
$vId = (int)$a['value_id'];
|
||||
$attrsByVariant[$pid][] = ['attribute_id' => $aId, 'value_id' => $vId];
|
||||
$allAttrIds[] = $aId;
|
||||
$allValueIds[] = $vId;
|
||||
}
|
||||
|
||||
$attrNamesMap = $this->batchLoadAttributeNames($allAttrIds);
|
||||
$valueNamesMap = $this->batchLoadValueNames($allValueIds);
|
||||
|
||||
$variants = [];
|
||||
foreach ($rows as $row) {
|
||||
$variantId = (int)$row['id'];
|
||||
$variantAttrs = [];
|
||||
if (isset($attrsByVariant[$variantId])) {
|
||||
foreach ($attrsByVariant[$variantId] as $a) {
|
||||
$aId = $a['attribute_id'];
|
||||
$vId = $a['value_id'];
|
||||
$variantAttrs[] = [
|
||||
'attribute_id' => $aId,
|
||||
'attribute_names' => isset($attrNamesMap[$aId]) ? $attrNamesMap[$aId] : [],
|
||||
'value_id' => $vId,
|
||||
'value_names' => isset($valueNamesMap[$vId]) ? $valueNamesMap[$vId] : [],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$variants[] = [
|
||||
'id' => $variantId,
|
||||
'permutation_hash' => $row['permutation_hash'],
|
||||
'sku' => $row['sku'],
|
||||
'ean' => $row['ean'],
|
||||
'price_brutto' => $row['price_brutto'] !== null ? (float)$row['price_brutto'] : null,
|
||||
'price_brutto_promo' => $row['price_brutto_promo'] !== null ? (float)$row['price_brutto_promo'] : null,
|
||||
'price_netto' => $row['price_netto'] !== null ? (float)$row['price_netto'] : null,
|
||||
'price_netto_promo' => $row['price_netto_promo'] !== null ? (float)$row['price_netto_promo'] : null,
|
||||
'quantity' => (int)$row['quantity'],
|
||||
'stock_0_buy' => (int)($row['stock_0_buy'] ?? 0),
|
||||
'weight' => $row['weight'] !== null ? (float)$row['weight'] : null,
|
||||
'status' => (int)$row['status'],
|
||||
'attributes' => $variantAttrs,
|
||||
];
|
||||
}
|
||||
|
||||
return $variants;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pobiera pojedynczy wariant po ID dla REST API.
|
||||
*
|
||||
* @param int $variantId ID wariantu
|
||||
* @return array|null Dane wariantu lub null
|
||||
*/
|
||||
public function findVariantForApi(int $variantId): ?array
|
||||
{
|
||||
$row = $this->db->get('pp_shop_products', '*', ['id' => $variantId]);
|
||||
if (!$row || empty($row['parent_id'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$attrs = $this->db->select('pp_shop_products_attributes', ['attribute_id', 'value_id'], ['product_id' => $variantId]);
|
||||
$variantAttrs = [];
|
||||
if (is_array($attrs) && !empty($attrs)) {
|
||||
$attrIds = [];
|
||||
$valueIds = [];
|
||||
foreach ($attrs as $a) {
|
||||
$attrIds[] = (int)$a['attribute_id'];
|
||||
$valueIds[] = (int)$a['value_id'];
|
||||
}
|
||||
$attrNamesMap = $this->batchLoadAttributeNames($attrIds);
|
||||
$valueNamesMap = $this->batchLoadValueNames($valueIds);
|
||||
|
||||
foreach ($attrs as $a) {
|
||||
$aId = (int)$a['attribute_id'];
|
||||
$vId = (int)$a['value_id'];
|
||||
$variantAttrs[] = [
|
||||
'attribute_id' => $aId,
|
||||
'attribute_names' => isset($attrNamesMap[$aId]) ? $attrNamesMap[$aId] : [],
|
||||
'value_id' => $vId,
|
||||
'value_names' => isset($valueNamesMap[$vId]) ? $valueNamesMap[$vId] : [],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => (int)$row['id'],
|
||||
'parent_id' => (int)$row['parent_id'],
|
||||
'permutation_hash' => $row['permutation_hash'],
|
||||
'sku' => $row['sku'],
|
||||
'ean' => $row['ean'],
|
||||
'price_brutto' => $row['price_brutto'] !== null ? (float)$row['price_brutto'] : null,
|
||||
'price_brutto_promo' => $row['price_brutto_promo'] !== null ? (float)$row['price_brutto_promo'] : null,
|
||||
'price_netto' => $row['price_netto'] !== null ? (float)$row['price_netto'] : null,
|
||||
'price_netto_promo' => $row['price_netto_promo'] !== null ? (float)$row['price_netto_promo'] : null,
|
||||
'quantity' => (int)$row['quantity'],
|
||||
'stock_0_buy' => (int)($row['stock_0_buy'] ?? 0),
|
||||
'weight' => $row['weight'] !== null ? (float)$row['weight'] : null,
|
||||
'status' => (int)$row['status'],
|
||||
'attributes' => $variantAttrs,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Tworzy nowy wariant (kombinację) produktu przez API.
|
||||
*
|
||||
* @param int $parentId ID produktu nadrzędnego
|
||||
* @param array $data Dane wariantu (attributes, sku, ean, price_brutto, etc.)
|
||||
* @return array|null ['id' => int, 'permutation_hash' => string] lub null przy błędzie
|
||||
*/
|
||||
public function createVariantForApi(int $parentId, array $data): ?array
|
||||
{
|
||||
$parent = $this->db->get('pp_shop_products', ['id', 'archive', 'parent_id', 'vat'], ['id' => $parentId]);
|
||||
if (!$parent) {
|
||||
return null;
|
||||
}
|
||||
if (!empty($parent['archive'])) {
|
||||
return null;
|
||||
}
|
||||
if (!empty($parent['parent_id'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$attributes = isset($data['attributes']) && is_array($data['attributes']) ? $data['attributes'] : [];
|
||||
if (empty($attributes)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Build permutation hash
|
||||
ksort($attributes);
|
||||
$hashParts = [];
|
||||
foreach ($attributes as $attrId => $valueId) {
|
||||
$hashParts[] = (int)$attrId . '-' . (int)$valueId;
|
||||
}
|
||||
$permutationHash = implode('|', $hashParts);
|
||||
|
||||
// Check duplicate
|
||||
$existing = $this->db->count('pp_shop_products', [
|
||||
'AND' => [
|
||||
'parent_id' => $parentId,
|
||||
'permutation_hash' => $permutationHash,
|
||||
],
|
||||
]);
|
||||
if ($existing > 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$insertData = [
|
||||
'parent_id' => $parentId,
|
||||
'permutation_hash' => $permutationHash,
|
||||
'vat' => $parent['vat'] ?? 0,
|
||||
'sku' => isset($data['sku']) ? (string)$data['sku'] : null,
|
||||
'ean' => isset($data['ean']) ? (string)$data['ean'] : null,
|
||||
'price_brutto' => isset($data['price_brutto']) ? (float)$data['price_brutto'] : null,
|
||||
'price_netto' => isset($data['price_netto']) ? (float)$data['price_netto'] : null,
|
||||
'quantity' => isset($data['quantity']) ? (int)$data['quantity'] : 0,
|
||||
'stock_0_buy' => isset($data['stock_0_buy']) ? (int)$data['stock_0_buy'] : 0,
|
||||
'weight' => isset($data['weight']) ? (float)$data['weight'] : null,
|
||||
'status' => 1,
|
||||
];
|
||||
|
||||
$this->db->insert('pp_shop_products', $insertData);
|
||||
$variantId = (int)$this->db->id();
|
||||
if ($variantId <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Insert attribute rows
|
||||
foreach ($attributes as $attrId => $valueId) {
|
||||
$this->db->insert('pp_shop_products_attributes', [
|
||||
'product_id' => $variantId,
|
||||
'attribute_id' => (int)$attrId,
|
||||
'value_id' => (int)$valueId,
|
||||
]);
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => $variantId,
|
||||
'permutation_hash' => $permutationHash,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Aktualizuje wariant produktu przez API.
|
||||
*
|
||||
* @param int $variantId ID wariantu
|
||||
* @param array $data Pola do aktualizacji
|
||||
* @return bool true jeśli sukces
|
||||
*/
|
||||
public function updateVariantForApi(int $variantId, array $data): bool
|
||||
{
|
||||
$variant = $this->db->get('pp_shop_products', ['id', 'parent_id'], ['id' => $variantId]);
|
||||
if (!$variant || empty($variant['parent_id'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$casts = [
|
||||
'sku' => 'string',
|
||||
'ean' => 'string',
|
||||
'price_brutto' => 'float_or_null',
|
||||
'price_netto' => 'float_or_null',
|
||||
'price_brutto_promo' => 'float_or_null',
|
||||
'price_netto_promo' => 'float_or_null',
|
||||
'quantity' => 'int',
|
||||
'stock_0_buy' => 'int',
|
||||
'weight' => 'float_or_null',
|
||||
'status' => 'int',
|
||||
];
|
||||
|
||||
$updateData = [];
|
||||
foreach ($casts as $field => $type) {
|
||||
if (array_key_exists($field, $data)) {
|
||||
$value = $data[$field];
|
||||
if ($type === 'string') {
|
||||
$updateData[$field] = ($value !== null) ? (string)$value : '';
|
||||
} elseif ($type === 'int') {
|
||||
$updateData[$field] = (int)$value;
|
||||
} elseif ($type === 'float_or_null') {
|
||||
$updateData[$field] = ($value !== null && $value !== '') ? (float)$value : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($updateData)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->db->update('pp_shop_products', $updateData, ['id' => $variantId]);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Usuwa wariant produktu przez API.
|
||||
*
|
||||
* @param int $variantId ID wariantu
|
||||
* @return bool true jeśli sukces
|
||||
*/
|
||||
public function deleteVariantForApi(int $variantId): bool
|
||||
{
|
||||
$variant = $this->db->get('pp_shop_products', ['id', 'parent_id'], ['id' => $variantId]);
|
||||
if (!$variant || empty($variant['parent_id'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->db->delete('pp_shop_products_langs', ['product_id' => $variantId]);
|
||||
$this->db->delete('pp_shop_products_attributes', ['product_id' => $variantId]);
|
||||
$this->db->delete('pp_shop_products', ['id' => $variantId]);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch-loads attribute names for multiple attribute IDs.
|
||||
*
|
||||
* @param int[] $attrIds
|
||||
* @return array<int, array<string, string>> [attrId => [langId => name]]
|
||||
*/
|
||||
private function batchLoadAttributeNames(array $attrIds): array
|
||||
{
|
||||
if (empty($attrIds)) {
|
||||
return [];
|
||||
}
|
||||
$translations = $this->db->select(
|
||||
'pp_shop_attributes_langs',
|
||||
['attribute_id', 'lang_id', 'name'],
|
||||
['attribute_id' => array_values(array_unique($attrIds))]
|
||||
);
|
||||
$result = [];
|
||||
if (is_array($translations)) {
|
||||
foreach ($translations as $t) {
|
||||
$aId = (int)($t['attribute_id'] ?? 0);
|
||||
$langId = (string)($t['lang_id'] ?? '');
|
||||
if ($aId > 0 && $langId !== '') {
|
||||
$result[$aId][$langId] = (string)($t['name'] ?? '');
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch-loads value names for multiple value IDs.
|
||||
*
|
||||
* @param int[] $valueIds
|
||||
* @return array<int, array<string, string>> [valueId => [langId => name]]
|
||||
*/
|
||||
private function batchLoadValueNames(array $valueIds): array
|
||||
{
|
||||
if (empty($valueIds)) {
|
||||
return [];
|
||||
}
|
||||
$translations = $this->db->select(
|
||||
'pp_shop_attributes_values_langs',
|
||||
['value_id', 'lang_id', 'name'],
|
||||
['value_id' => array_values(array_unique($valueIds))]
|
||||
);
|
||||
$result = [];
|
||||
if (is_array($translations)) {
|
||||
foreach ($translations as $t) {
|
||||
$vId = (int)($t['value_id'] ?? 0);
|
||||
$langId = (string)($t['lang_id'] ?? '');
|
||||
if ($vId > 0 && $langId !== '') {
|
||||
$result[$vId][$langId] = (string)($t['name'] ?? '');
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch-loads attribute types for multiple attribute IDs.
|
||||
*
|
||||
* @param int[] $attrIds
|
||||
* @return array<int, int> [attrId => type]
|
||||
*/
|
||||
private function batchLoadAttributeTypes(array $attrIds): array
|
||||
{
|
||||
if (empty($attrIds)) {
|
||||
return [];
|
||||
}
|
||||
$rows = $this->db->select(
|
||||
'pp_shop_attributes',
|
||||
['id', 'type'],
|
||||
['id' => array_values(array_unique($attrIds))]
|
||||
);
|
||||
$result = [];
|
||||
if (is_array($rows)) {
|
||||
foreach ($rows as $row) {
|
||||
$result[(int)$row['id']] = (int)($row['type'] ?? 0);
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,13 +92,15 @@ class ApiRouter
|
||||
},
|
||||
'products' => function () use ($db) {
|
||||
$productRepo = new \Domain\Product\ProductRepository($db);
|
||||
return new Controllers\ProductsApiController($productRepo);
|
||||
$attrRepo = new \Domain\Attribute\AttributeRepository($db);
|
||||
return new Controllers\ProductsApiController($productRepo, $attrRepo);
|
||||
},
|
||||
'dictionaries' => function () use ($db) {
|
||||
$statusRepo = new \Domain\ShopStatus\ShopStatusRepository($db);
|
||||
$transportRepo = new \Domain\Transport\TransportRepository($db);
|
||||
$paymentRepo = new \Domain\PaymentMethod\PaymentMethodRepository($db);
|
||||
return new Controllers\DictionariesApiController($statusRepo, $transportRepo, $paymentRepo);
|
||||
$attrRepo = new \Domain\Attribute\AttributeRepository($db);
|
||||
return new Controllers\DictionariesApiController($statusRepo, $transportRepo, $paymentRepo, $attrRepo);
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
namespace api\Controllers;
|
||||
|
||||
use api\ApiRouter;
|
||||
use Domain\Attribute\AttributeRepository;
|
||||
use Domain\ShopStatus\ShopStatusRepository;
|
||||
use Domain\Transport\TransportRepository;
|
||||
use Domain\PaymentMethod\PaymentMethodRepository;
|
||||
@@ -11,15 +12,18 @@ class DictionariesApiController
|
||||
private $statusRepo;
|
||||
private $transportRepo;
|
||||
private $paymentRepo;
|
||||
private $attrRepo;
|
||||
|
||||
public function __construct(
|
||||
ShopStatusRepository $statusRepo,
|
||||
TransportRepository $transportRepo,
|
||||
PaymentMethodRepository $paymentRepo
|
||||
PaymentMethodRepository $paymentRepo,
|
||||
AttributeRepository $attrRepo
|
||||
) {
|
||||
$this->statusRepo = $statusRepo;
|
||||
$this->transportRepo = $transportRepo;
|
||||
$this->paymentRepo = $paymentRepo;
|
||||
$this->attrRepo = $attrRepo;
|
||||
}
|
||||
|
||||
public function statuses(): void
|
||||
@@ -79,4 +83,15 @@ class DictionariesApiController
|
||||
|
||||
ApiRouter::sendSuccess($result);
|
||||
}
|
||||
|
||||
public function attributes(): void
|
||||
{
|
||||
if (!ApiRouter::requireMethod('GET')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$attributes = $this->attrRepo->listForApi();
|
||||
|
||||
ApiRouter::sendSuccess($attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,18 @@
|
||||
namespace api\Controllers;
|
||||
|
||||
use api\ApiRouter;
|
||||
use Domain\Attribute\AttributeRepository;
|
||||
use Domain\Product\ProductRepository;
|
||||
|
||||
class ProductsApiController
|
||||
{
|
||||
private $productRepo;
|
||||
private $attrRepo;
|
||||
|
||||
public function __construct(ProductRepository $productRepo)
|
||||
public function __construct(ProductRepository $productRepo, AttributeRepository $attrRepo)
|
||||
{
|
||||
$this->productRepo = $productRepo;
|
||||
$this->attrRepo = $attrRepo;
|
||||
}
|
||||
|
||||
public function list(): void
|
||||
@@ -25,6 +28,20 @@ class ProductsApiController
|
||||
'promoted' => isset($_GET['promoted']) ? $_GET['promoted'] : '',
|
||||
];
|
||||
|
||||
// Attribute filters: attribute_{id}={value_id}
|
||||
$attrFilters = [];
|
||||
foreach ($_GET as $key => $value) {
|
||||
if (strpos($key, 'attribute_') === 0) {
|
||||
$attrId = (int)substr($key, 10);
|
||||
if ($attrId > 0 && (int)$value > 0) {
|
||||
$attrFilters[$attrId] = (int)$value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($attrFilters)) {
|
||||
$filters['attributes'] = $attrFilters;
|
||||
}
|
||||
|
||||
$sort = isset($_GET['sort']) ? $_GET['sort'] : 'id';
|
||||
$sortDir = isset($_GET['sort_dir']) ? $_GET['sort_dir'] : 'DESC';
|
||||
$page = max(1, (int)(isset($_GET['page']) ? $_GET['page'] : 1));
|
||||
@@ -90,6 +107,11 @@ class ProductsApiController
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_numeric($body['price_brutto']) || (float)$body['price_brutto'] < 0) {
|
||||
ApiRouter::sendError('BAD_REQUEST', 'price_brutto must be a non-negative number', 400);
|
||||
return;
|
||||
}
|
||||
|
||||
$formData = $this->mapApiToFormData($body);
|
||||
|
||||
$productId = $this->productRepo->saveProduct($formData);
|
||||
@@ -139,6 +161,141 @@ class ProductsApiController
|
||||
ApiRouter::sendSuccess($updated);
|
||||
}
|
||||
|
||||
public function variants(): void
|
||||
{
|
||||
if (!ApiRouter::requireMethod('GET')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$id = (int)(isset($_GET['id']) ? $_GET['id'] : 0);
|
||||
if ($id <= 0) {
|
||||
ApiRouter::sendError('BAD_REQUEST', 'Missing or invalid id parameter', 400);
|
||||
return;
|
||||
}
|
||||
|
||||
$product = $this->productRepo->find($id);
|
||||
if ($product === null) {
|
||||
ApiRouter::sendError('NOT_FOUND', 'Product not found', 404);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!empty($product['parent_id'])) {
|
||||
ApiRouter::sendError('BAD_REQUEST', 'Cannot get variants of a variant product', 400);
|
||||
return;
|
||||
}
|
||||
|
||||
$variants = $this->productRepo->findVariantsForApi($id);
|
||||
|
||||
// Available attributes for this product
|
||||
$allAttributes = $this->attrRepo->listForApi();
|
||||
$usedAttrIds = [];
|
||||
foreach ($variants as $variant) {
|
||||
foreach ($variant['attributes'] as $a) {
|
||||
$usedAttrIds[(int)$a['attribute_id']] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$availableAttributes = [];
|
||||
foreach ($allAttributes as $attr) {
|
||||
if (isset($usedAttrIds[$attr['id']])) {
|
||||
$availableAttributes[] = $attr;
|
||||
}
|
||||
}
|
||||
|
||||
ApiRouter::sendSuccess([
|
||||
'product_id' => $id,
|
||||
'available_attributes' => $availableAttributes,
|
||||
'variants' => $variants,
|
||||
]);
|
||||
}
|
||||
|
||||
public function create_variant(): void
|
||||
{
|
||||
if (!ApiRouter::requireMethod('POST')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$parentId = (int)(isset($_GET['id']) ? $_GET['id'] : 0);
|
||||
if ($parentId <= 0) {
|
||||
ApiRouter::sendError('BAD_REQUEST', 'Missing or invalid id parameter', 400);
|
||||
return;
|
||||
}
|
||||
|
||||
$body = ApiRouter::getJsonBody();
|
||||
if ($body === null) {
|
||||
ApiRouter::sendError('BAD_REQUEST', 'Missing or invalid JSON body', 400);
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($body['attributes']) || !is_array($body['attributes'])) {
|
||||
ApiRouter::sendError('BAD_REQUEST', 'Missing or empty attributes', 400);
|
||||
return;
|
||||
}
|
||||
|
||||
$result = $this->productRepo->createVariantForApi($parentId, $body);
|
||||
if ($result === null) {
|
||||
ApiRouter::sendError('BAD_REQUEST', 'Cannot create variant: parent not found, is archived, is itself a variant, or combination already exists', 400);
|
||||
return;
|
||||
}
|
||||
|
||||
$variant = $this->productRepo->findVariantForApi($result['id']);
|
||||
|
||||
http_response_code(201);
|
||||
echo json_encode([
|
||||
'status' => 'ok',
|
||||
'data' => $variant !== null ? $variant : $result,
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
public function update_variant(): void
|
||||
{
|
||||
if (!ApiRouter::requireMethod('PUT')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$variantId = (int)(isset($_GET['id']) ? $_GET['id'] : 0);
|
||||
if ($variantId <= 0) {
|
||||
ApiRouter::sendError('BAD_REQUEST', 'Missing or invalid id parameter', 400);
|
||||
return;
|
||||
}
|
||||
|
||||
$body = ApiRouter::getJsonBody();
|
||||
if ($body === null) {
|
||||
ApiRouter::sendError('BAD_REQUEST', 'Missing or invalid JSON body', 400);
|
||||
return;
|
||||
}
|
||||
|
||||
$success = $this->productRepo->updateVariantForApi($variantId, $body);
|
||||
if (!$success) {
|
||||
ApiRouter::sendError('NOT_FOUND', 'Variant not found', 404);
|
||||
return;
|
||||
}
|
||||
|
||||
$variant = $this->productRepo->findVariantForApi($variantId);
|
||||
ApiRouter::sendSuccess($variant);
|
||||
}
|
||||
|
||||
public function delete_variant(): void
|
||||
{
|
||||
if (!ApiRouter::requireMethod('DELETE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$variantId = (int)(isset($_GET['id']) ? $_GET['id'] : 0);
|
||||
if ($variantId <= 0) {
|
||||
ApiRouter::sendError('BAD_REQUEST', 'Missing or invalid id parameter', 400);
|
||||
return;
|
||||
}
|
||||
|
||||
$success = $this->productRepo->deleteVariantForApi($variantId);
|
||||
if (!$success) {
|
||||
ApiRouter::sendError('NOT_FOUND', 'Variant not found', 404);
|
||||
return;
|
||||
}
|
||||
|
||||
ApiRouter::sendSuccess(['id' => $variantId, 'deleted' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mapuje dane z JSON API na format oczekiwany przez saveProduct().
|
||||
*
|
||||
|
||||
157
docs/API.md
157
docs/API.md
@@ -152,6 +152,7 @@ Parametry filtrowania (opcjonalne):
|
||||
| `search` | string | Szukaj po nazwie, EAN lub SKU |
|
||||
| `status` | int (0/1) | Filtruj po statusie (1 = aktywny, 0 = nieaktywny) |
|
||||
| `promoted` | int (0/1) | Filtruj po promocji |
|
||||
| `attribute_{id}` | int | Filtruj po atrybucie — `attribute_1=3` oznacza atrybut 1 = wartosc 3 (wiele filtrow AND) |
|
||||
| `sort` | string | Sortuj po: id, name, price_brutto, status, promoted, quantity (domyslnie id) |
|
||||
| `sort_dir` | string | Kierunek: ASC lub DESC (domyslnie DESC) |
|
||||
| `page` | int | Numer strony (domyslnie 1) |
|
||||
@@ -244,7 +245,33 @@ Odpowiedz:
|
||||
],
|
||||
"categories": [1, 5],
|
||||
"attributes": [
|
||||
{"attribute_id": 1, "value_id": 3}
|
||||
{
|
||||
"attribute_id": 1,
|
||||
"attribute_type": 1,
|
||||
"attribute_names": {"pl": "Kolor", "en": "Color"},
|
||||
"value_id": 3,
|
||||
"value_names": {"pl": "Czerwony", "en": "Red"}
|
||||
}
|
||||
],
|
||||
"variants": [
|
||||
{
|
||||
"id": 101,
|
||||
"permutation_hash": "1-3|2-5",
|
||||
"sku": "PROD-001-RED-L",
|
||||
"ean": null,
|
||||
"price_brutto": 109.99,
|
||||
"price_brutto_promo": null,
|
||||
"price_netto": 89.42,
|
||||
"price_netto_promo": null,
|
||||
"quantity": 5,
|
||||
"stock_0_buy": 0,
|
||||
"weight": 0.5,
|
||||
"status": 1,
|
||||
"attributes": [
|
||||
{"attribute_id": 1, "attribute_names": {"pl": "Kolor"}, "value_id": 3, "value_names": {"pl": "Czerwony"}},
|
||||
{"attribute_id": 2, "attribute_names": {"pl": "Rozmiar"}, "value_id": 5, "value_names": {"pl": "L"}}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -306,6 +333,104 @@ Partial update — wystarczy przeslac tylko zmienione pola. Pola nieprzeslane za
|
||||
|
||||
Odpowiedz: pelne dane produktu (jak w `get`).
|
||||
|
||||
### Warianty produktow
|
||||
|
||||
#### Lista wariantow produktu
|
||||
```
|
||||
GET api.php?endpoint=products&action=variants&id={product_id}
|
||||
```
|
||||
|
||||
Zwraca warianty produktu nadrzednego wraz z dostepnymi atrybutami.
|
||||
|
||||
Odpowiedz:
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"data": {
|
||||
"product_id": 1,
|
||||
"available_attributes": [
|
||||
{
|
||||
"id": 1,
|
||||
"type": 1,
|
||||
"status": 1,
|
||||
"names": {"pl": "Kolor", "en": "Color"},
|
||||
"values": [
|
||||
{"id": 3, "names": {"pl": "Czerwony", "en": "Red"}, "is_default": 0, "impact_on_the_price": null},
|
||||
{"id": 4, "names": {"pl": "Niebieski", "en": "Blue"}, "is_default": 0, "impact_on_the_price": 10.0}
|
||||
]
|
||||
}
|
||||
],
|
||||
"variants": [
|
||||
{
|
||||
"id": 101,
|
||||
"permutation_hash": "1-3",
|
||||
"sku": "PROD-001-RED",
|
||||
"ean": null,
|
||||
"price_brutto": 109.99,
|
||||
"price_brutto_promo": null,
|
||||
"price_netto": 89.42,
|
||||
"price_netto_promo": null,
|
||||
"quantity": 5,
|
||||
"stock_0_buy": 0,
|
||||
"weight": 0.5,
|
||||
"status": 1,
|
||||
"attributes": [
|
||||
{"attribute_id": 1, "attribute_names": {"pl": "Kolor"}, "value_id": 3, "value_names": {"pl": "Czerwony"}}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Tworzenie wariantu
|
||||
```
|
||||
POST api.php?endpoint=products&action=create_variant&id={product_id}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"attributes": {"1": 3, "2": 5},
|
||||
"sku": "PROD-001-RED-L",
|
||||
"ean": "5901234123458",
|
||||
"price_brutto": 109.99,
|
||||
"quantity": 5,
|
||||
"weight": 0.5
|
||||
}
|
||||
```
|
||||
|
||||
Wymagane: `attributes` (mapa attribute_id -> value_id, min. 1). Kombinacja atrybutow musi byc unikalna.
|
||||
|
||||
Odpowiedz (HTTP 201): pelne dane wariantu.
|
||||
|
||||
#### Aktualizacja wariantu
|
||||
```
|
||||
PUT api.php?endpoint=products&action=update_variant&id={variant_id}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"sku": "PROD-001-RED-XL",
|
||||
"price_brutto": 119.99,
|
||||
"quantity": 3
|
||||
}
|
||||
```
|
||||
|
||||
Partial update — mozna zmienic: sku, ean, price_brutto, price_netto, price_brutto_promo, price_netto_promo, quantity, stock_0_buy, weight, status.
|
||||
|
||||
Odpowiedz: pelne dane wariantu.
|
||||
|
||||
#### Usuwanie wariantu
|
||||
```
|
||||
DELETE api.php?endpoint=products&action=delete_variant&id={variant_id}
|
||||
```
|
||||
|
||||
Odpowiedz:
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"data": {"id": 101, "deleted": true}
|
||||
}
|
||||
```
|
||||
|
||||
### Slowniki
|
||||
|
||||
#### Lista statusow zamowien
|
||||
@@ -336,6 +461,32 @@ GET api.php?endpoint=dictionaries&action=transports
|
||||
GET api.php?endpoint=dictionaries&action=payment_methods
|
||||
```
|
||||
|
||||
#### Lista atrybutow
|
||||
```
|
||||
GET api.php?endpoint=dictionaries&action=attributes
|
||||
```
|
||||
|
||||
Zwraca aktywne atrybuty z wartosciami i wielojezycznymi nazwami.
|
||||
|
||||
Odpowiedz:
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"type": 1,
|
||||
"status": 1,
|
||||
"names": {"pl": "Kolor", "en": "Color"},
|
||||
"values": [
|
||||
{"id": 3, "names": {"pl": "Czerwony"}, "is_default": 0, "impact_on_the_price": null},
|
||||
{"id": 4, "names": {"pl": "Niebieski"}, "is_default": 1, "impact_on_the_price": 10.0}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Polling
|
||||
|
||||
Aby pobierac tylko nowe/zmienione zamowienia, uzyj parametru `updated_since`:
|
||||
@@ -362,5 +513,5 @@ UPDATE pp_settings SET value = 'twoj-klucz-api' WHERE param = 'api_key';
|
||||
- Router: `\api\ApiRouter` (`autoload/api/ApiRouter.php`)
|
||||
- Kontrolery: `autoload/api/Controllers/`
|
||||
- `OrdersApiController` — zamowienia (5 akcji)
|
||||
- `ProductsApiController` — produkty (4 akcje: list, get, create, update)
|
||||
- `DictionariesApiController` — slowniki (3 akcje)
|
||||
- `ProductsApiController` — produkty (8 akcji: list, get, create, update, variants, create_variant, update_variant, delete_variant)
|
||||
- `DictionariesApiController` — slowniki (4 akcje: statuses, transports, payment_methods, attributes)
|
||||
|
||||
@@ -4,6 +4,19 @@ Logi zmian z migracji na Domain-Driven Architecture. Najnowsze na gorze.
|
||||
|
||||
---
|
||||
|
||||
## ver. 0.302 (2026-02-22) - REST API: warianty produktow, atrybuty, filtrowanie
|
||||
|
||||
- **NEW**: API wariantow produktow — CRUD: `variants`, `create_variant`, `update_variant`, `delete_variant`
|
||||
- **NEW**: API slownik atrybutow — `dictionaries/attributes` z wielojezycznymi nazwami i wartosciami
|
||||
- **NEW**: Filtrowanie produktow po atrybutach w `products/list` — parametry `attribute_{id}={value_id}`
|
||||
- **NEW**: Wzbogacone atrybuty w `products/get` — nazwy atrybutow i wartosci z tlumaczeniami
|
||||
- **NEW**: Warianty w odpowiedzi `products/get` — lista wariantow z atrybutami dla produktow nadrzednych
|
||||
- **NEW**: Walidacja `price_brutto` przy tworzeniu produktu (musi byc nieujemna liczba)
|
||||
- **NEW**: Batch-loading atrybutow i wartosci (4 zapytania zamiast N+1) w `AttributeRepository::listForApi()`
|
||||
- **NEW**: 43 nowe testy jednostkowe (730 total, 2066 assertions)
|
||||
|
||||
---
|
||||
|
||||
## ver. 0.301 (2026-02-22) - Mobile responsive: filtry tabel i szczegoly zamowienia
|
||||
|
||||
- **NEW**: Filtry w tabelach admina domyslnie ukryte — przycisk toggle z ikona filtra, badge z liczba aktywnych filtrow
|
||||
|
||||
@@ -23,7 +23,7 @@ composer test # standard
|
||||
## Aktualny stan
|
||||
|
||||
```text
|
||||
OK (692 tests, 1988 assertions)
|
||||
OK (730 tests, 2066 assertions)
|
||||
```
|
||||
|
||||
Zweryfikowano: 2026-02-21 (ver. 0.300)
|
||||
|
||||
@@ -101,13 +101,13 @@ Aktualizacje znajdują się w folderze `updates/0.XX/` gdzie XX oznacza dziesią
|
||||
|
||||
**WAŻNE:** W archiwum ZIP NIE powinno być folderu z nazwą wersji. Struktura ZIP zaczyna się bezpośrednio od katalogów projektu (admin/, autoload/, itp.).
|
||||
|
||||
## Status bieżącej aktualizacji (ver. 0.301)
|
||||
## Status bieżącej aktualizacji (ver. 0.302)
|
||||
|
||||
- Wersja udostępniona: `0.301` (data: 2026-02-22).
|
||||
- Wersja udostępniona: `0.302` (data: 2026-02-22).
|
||||
- Pliki publikacyjne:
|
||||
- `updates/0.30/ver_0.301.zip`
|
||||
- `updates/0.30/ver_0.302.zip`
|
||||
- Pliki metadanych aktualizacji:
|
||||
- `updates/changelog.php`
|
||||
- `updates/versions.php` (`$current_ver = 301`)
|
||||
- `updates/versions.php` (`$current_ver = 302`)
|
||||
- Weryfikacja testów przed publikacją:
|
||||
- `OK (692 tests, 1988 assertions)`
|
||||
- `OK (730 tests, 2066 assertions)`
|
||||
|
||||
@@ -359,4 +359,81 @@ class AttributeRepositoryTest extends TestCase
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// --- listForApi ---
|
||||
|
||||
public function testListForApiReturnsActiveAttributesWithValues(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('select')
|
||||
->willReturnCallback(function ($table, $columns, $where) {
|
||||
if ($table === 'pp_shop_attributes') {
|
||||
return [
|
||||
['id' => '5', 'type' => '0', 'status' => '1'],
|
||||
];
|
||||
}
|
||||
if ($table === 'pp_shop_attributes_langs') {
|
||||
return [
|
||||
['attribute_id' => '5', 'lang_id' => 'pl', 'name' => 'Rozmiar'],
|
||||
['attribute_id' => '5', 'lang_id' => 'en', 'name' => 'Size'],
|
||||
];
|
||||
}
|
||||
if ($table === 'pp_shop_attributes_values') {
|
||||
return [
|
||||
['id' => '12', 'attribute_id' => '5', 'is_default' => '1', 'impact_on_the_price' => null],
|
||||
['id' => '13', 'attribute_id' => '5', 'is_default' => '0', 'impact_on_the_price' => '10.00'],
|
||||
];
|
||||
}
|
||||
if ($table === 'pp_shop_attributes_values_langs') {
|
||||
return [
|
||||
['value_id' => '12', 'lang_id' => 'pl', 'name' => 'M'],
|
||||
['value_id' => '12', 'lang_id' => 'en', 'name' => 'M'],
|
||||
['value_id' => '13', 'lang_id' => 'pl', 'name' => 'L'],
|
||||
['value_id' => '13', 'lang_id' => 'en', 'name' => 'L'],
|
||||
];
|
||||
}
|
||||
if ($table === 'pp_langs') {
|
||||
return [['id' => 'pl', 'start' => 1, 'o' => 1]];
|
||||
}
|
||||
return [];
|
||||
});
|
||||
|
||||
$repository = new AttributeRepository($mockDb);
|
||||
$result = $repository->listForApi();
|
||||
|
||||
$this->assertCount(1, $result);
|
||||
$this->assertSame(5, $result[0]['id']);
|
||||
$this->assertSame(0, $result[0]['type']);
|
||||
$this->assertSame(1, $result[0]['status']);
|
||||
$this->assertSame('Rozmiar', $result[0]['names']['pl']);
|
||||
$this->assertSame('Size', $result[0]['names']['en']);
|
||||
$this->assertCount(2, $result[0]['values']);
|
||||
$this->assertSame(12, $result[0]['values'][0]['id']);
|
||||
$this->assertSame(1, $result[0]['values'][0]['is_default']);
|
||||
$this->assertNull($result[0]['values'][0]['impact_on_the_price']);
|
||||
$this->assertSame(13, $result[0]['values'][1]['id']);
|
||||
$this->assertSame(10.0, $result[0]['values'][1]['impact_on_the_price']);
|
||||
}
|
||||
|
||||
public function testListForApiReturnsEmptyWhenNoAttributes(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('select')
|
||||
->willReturnCallback(function ($table) {
|
||||
if ($table === 'pp_shop_attributes') {
|
||||
return [];
|
||||
}
|
||||
if ($table === 'pp_langs') {
|
||||
return [['id' => 'pl', 'start' => 1, 'o' => 1]];
|
||||
}
|
||||
return [];
|
||||
});
|
||||
|
||||
$repository = new AttributeRepository($mockDb);
|
||||
$result = $repository->listForApi();
|
||||
|
||||
$this->assertSame([], $result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -877,4 +877,419 @@ class ProductRepositoryTest extends TestCase
|
||||
|
||||
$this->assertEquals([], $repository->promotedProductIdsCached(6));
|
||||
}
|
||||
|
||||
// --- findVariantsForApi ---
|
||||
|
||||
public function testFindVariantsForApiReturnsVariants(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockStmt = new class {
|
||||
public function fetchAll($mode = null): array
|
||||
{
|
||||
return [
|
||||
[
|
||||
'id' => '101',
|
||||
'permutation_hash' => '5-12|7-18',
|
||||
'sku' => 'SKU-M-RED',
|
||||
'ean' => null,
|
||||
'price_brutto' => '109.99',
|
||||
'price_brutto_promo' => null,
|
||||
'price_netto' => '89.42',
|
||||
'price_netto_promo' => null,
|
||||
'quantity' => '5',
|
||||
'stock_0_buy' => '0',
|
||||
'weight' => null,
|
||||
'status' => '1',
|
||||
],
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
$mockDb->method('query')->willReturn($mockStmt);
|
||||
$mockDb->method('select')->willReturnCallback(function ($table, $columns, $where) {
|
||||
if ($table === 'pp_shop_products_attributes') {
|
||||
return [
|
||||
['product_id' => '101', 'attribute_id' => '5', 'value_id' => '12'],
|
||||
['product_id' => '101', 'attribute_id' => '7', 'value_id' => '18'],
|
||||
];
|
||||
}
|
||||
if ($table === 'pp_shop_attributes_langs') {
|
||||
return [
|
||||
['attribute_id' => '5', 'lang_id' => 'pl', 'name' => 'Rozmiar'],
|
||||
['attribute_id' => '7', 'lang_id' => 'pl', 'name' => 'Kolor'],
|
||||
];
|
||||
}
|
||||
if ($table === 'pp_shop_attributes_values_langs') {
|
||||
return [
|
||||
['value_id' => '12', 'lang_id' => 'pl', 'name' => 'M'],
|
||||
['value_id' => '18', 'lang_id' => 'pl', 'name' => 'Czerwony'],
|
||||
];
|
||||
}
|
||||
return [];
|
||||
});
|
||||
$mockDb->method('get')->willReturn(0);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->findVariantsForApi(1);
|
||||
|
||||
$this->assertCount(1, $result);
|
||||
$this->assertSame(101, $result[0]['id']);
|
||||
$this->assertSame('5-12|7-18', $result[0]['permutation_hash']);
|
||||
$this->assertSame('SKU-M-RED', $result[0]['sku']);
|
||||
$this->assertSame(109.99, $result[0]['price_brutto']);
|
||||
$this->assertSame(5, $result[0]['quantity']);
|
||||
$this->assertCount(2, $result[0]['attributes']);
|
||||
}
|
||||
|
||||
public function testFindVariantsForApiReturnsEmptyWhenNoVariants(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockStmt = new class {
|
||||
public function fetchAll($mode = null): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
$mockDb->method('query')->willReturn($mockStmt);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->findVariantsForApi(1);
|
||||
|
||||
$this->assertSame([], $result);
|
||||
}
|
||||
|
||||
// --- findVariantForApi ---
|
||||
|
||||
public function testFindVariantForApiReturnsVariant(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturnCallback(function ($table, $columns, $where) {
|
||||
if ($table === 'pp_shop_products') {
|
||||
return [
|
||||
'id' => '101',
|
||||
'parent_id' => '1',
|
||||
'permutation_hash' => '5-12',
|
||||
'sku' => 'SKU-M',
|
||||
'ean' => null,
|
||||
'price_brutto' => '99.99',
|
||||
'price_brutto_promo' => null,
|
||||
'price_netto' => '81.29',
|
||||
'price_netto_promo' => null,
|
||||
'quantity' => '10',
|
||||
'stock_0_buy' => '0',
|
||||
'weight' => null,
|
||||
'status' => '1',
|
||||
];
|
||||
}
|
||||
return null;
|
||||
});
|
||||
$mockDb->method('select')->willReturnCallback(function ($table) {
|
||||
if ($table === 'pp_shop_products_attributes') {
|
||||
return [['attribute_id' => '5', 'value_id' => '12']];
|
||||
}
|
||||
if ($table === 'pp_shop_attributes_langs') {
|
||||
return [['attribute_id' => '5', 'lang_id' => 'pl', 'name' => 'Rozmiar']];
|
||||
}
|
||||
if ($table === 'pp_shop_attributes_values_langs') {
|
||||
return [['value_id' => '12', 'lang_id' => 'pl', 'name' => 'M']];
|
||||
}
|
||||
return [];
|
||||
});
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->findVariantForApi(101);
|
||||
|
||||
$this->assertNotNull($result);
|
||||
$this->assertSame(101, $result['id']);
|
||||
$this->assertSame(1, $result['parent_id']);
|
||||
$this->assertSame('5-12', $result['permutation_hash']);
|
||||
$this->assertSame(99.99, $result['price_brutto']);
|
||||
$this->assertCount(1, $result['attributes']);
|
||||
}
|
||||
|
||||
public function testFindVariantForApiReturnsNullForNonVariant(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturn([
|
||||
'id' => '1',
|
||||
'parent_id' => null,
|
||||
'permutation_hash' => '',
|
||||
]);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->findVariantForApi(1);
|
||||
|
||||
$this->assertNull($result);
|
||||
}
|
||||
|
||||
public function testFindVariantForApiReturnsNullForNonexistent(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
$mockDb->method('get')->willReturn(null);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->findVariantForApi(999);
|
||||
|
||||
$this->assertNull($result);
|
||||
}
|
||||
|
||||
// --- createVariantForApi ---
|
||||
|
||||
public function testCreateVariantForApiSuccess(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$callCount = 0;
|
||||
$mockDb->method('get')->willReturnCallback(function ($table, $columns, $where) use (&$callCount) {
|
||||
$callCount++;
|
||||
if ($callCount === 1) {
|
||||
// Parent exists
|
||||
return ['id' => '1', 'archive' => '0', 'parent_id' => null, 'vat' => '23'];
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
$mockDb->method('count')->willReturn(0);
|
||||
$mockDb->method('insert')->willReturn(true);
|
||||
$mockDb->method('id')->willReturn(101);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->createVariantForApi(1, [
|
||||
'attributes' => [5 => 12, 7 => 18],
|
||||
'sku' => 'SKU-M-RED',
|
||||
'price_brutto' => 109.99,
|
||||
'quantity' => 5,
|
||||
]);
|
||||
|
||||
$this->assertNotNull($result);
|
||||
$this->assertSame(101, $result['id']);
|
||||
$this->assertSame('5-12|7-18', $result['permutation_hash']);
|
||||
}
|
||||
|
||||
public function testCreateVariantForApiReturnsNullForArchivedParent(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturn([
|
||||
'id' => '1', 'archive' => '1', 'parent_id' => null, 'vat' => '23',
|
||||
]);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->createVariantForApi(1, [
|
||||
'attributes' => [5 => 12],
|
||||
]);
|
||||
|
||||
$this->assertNull($result);
|
||||
}
|
||||
|
||||
public function testCreateVariantForApiReturnsNullWhenParentIsVariant(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturn([
|
||||
'id' => '101', 'archive' => '0', 'parent_id' => '1', 'vat' => '23',
|
||||
]);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->createVariantForApi(101, [
|
||||
'attributes' => [5 => 12],
|
||||
]);
|
||||
|
||||
$this->assertNull($result);
|
||||
}
|
||||
|
||||
public function testCreateVariantForApiReturnsNullForEmptyAttributes(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturn([
|
||||
'id' => '1', 'archive' => '0', 'parent_id' => null, 'vat' => '23',
|
||||
]);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->createVariantForApi(1, ['attributes' => []]);
|
||||
|
||||
$this->assertNull($result);
|
||||
}
|
||||
|
||||
public function testCreateVariantForApiReturnsNullForDuplicateHash(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturn([
|
||||
'id' => '1', 'archive' => '0', 'parent_id' => null, 'vat' => '23',
|
||||
]);
|
||||
$mockDb->method('count')->willReturn(1);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->createVariantForApi(1, [
|
||||
'attributes' => [5 => 12],
|
||||
]);
|
||||
|
||||
$this->assertNull($result);
|
||||
}
|
||||
|
||||
// --- updateVariantForApi ---
|
||||
|
||||
public function testUpdateVariantForApiSuccess(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturn([
|
||||
'id' => '101', 'parent_id' => '1',
|
||||
]);
|
||||
|
||||
$mockDb->expects($this->once())->method('update');
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->updateVariantForApi(101, [
|
||||
'sku' => 'NEW-SKU',
|
||||
'price_brutto' => 119.99,
|
||||
]);
|
||||
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
public function testUpdateVariantForApiReturnsFalseForNonVariant(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturn([
|
||||
'id' => '1', 'parent_id' => null,
|
||||
]);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->updateVariantForApi(1, ['sku' => 'NEW']);
|
||||
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
public function testUpdateVariantForApiReturnsFalseForNonexistent(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
$mockDb->method('get')->willReturn(null);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->updateVariantForApi(999, ['sku' => 'NEW']);
|
||||
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
public function testUpdateVariantForApiFiltersUnallowedFields(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturn([
|
||||
'id' => '101', 'parent_id' => '1',
|
||||
]);
|
||||
|
||||
$mockDb->expects($this->once())
|
||||
->method('update')
|
||||
->with(
|
||||
'pp_shop_products',
|
||||
$this->callback(function ($data) {
|
||||
return isset($data['sku'])
|
||||
&& !isset($data['parent_id'])
|
||||
&& !isset($data['permutation_hash']);
|
||||
}),
|
||||
$this->anything()
|
||||
);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$repository->updateVariantForApi(101, [
|
||||
'sku' => 'NEW',
|
||||
'parent_id' => 999,
|
||||
'permutation_hash' => 'hacked',
|
||||
]);
|
||||
}
|
||||
|
||||
public function testUpdateVariantForApiCastsTypes(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturn([
|
||||
'id' => '101', 'parent_id' => '1',
|
||||
]);
|
||||
|
||||
$mockDb->expects($this->once())
|
||||
->method('update')
|
||||
->with(
|
||||
'pp_shop_products',
|
||||
$this->callback(function ($data) {
|
||||
return $data['sku'] === '123'
|
||||
&& $data['price_brutto'] === 99.99
|
||||
&& $data['quantity'] === 5
|
||||
&& $data['weight'] === null
|
||||
&& $data['status'] === 1;
|
||||
}),
|
||||
$this->anything()
|
||||
);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$repository->updateVariantForApi(101, [
|
||||
'sku' => 123,
|
||||
'price_brutto' => '99.99',
|
||||
'quantity' => '5',
|
||||
'weight' => '',
|
||||
'status' => '1',
|
||||
]);
|
||||
}
|
||||
|
||||
// --- deleteVariantForApi ---
|
||||
|
||||
public function testDeleteVariantForApiSuccess(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturn([
|
||||
'id' => '101', 'parent_id' => '1',
|
||||
]);
|
||||
|
||||
$deleteCalls = [];
|
||||
$mockDb->expects($this->exactly(3))
|
||||
->method('delete')
|
||||
->willReturnCallback(function ($table, $where) use (&$deleteCalls) {
|
||||
$deleteCalls[] = ['table' => $table, 'where' => $where];
|
||||
return true;
|
||||
});
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->deleteVariantForApi(101);
|
||||
|
||||
$this->assertTrue($result);
|
||||
$this->assertSame('pp_shop_products_langs', $deleteCalls[0]['table']);
|
||||
$this->assertSame(['product_id' => 101], $deleteCalls[0]['where']);
|
||||
$this->assertSame('pp_shop_products_attributes', $deleteCalls[1]['table']);
|
||||
$this->assertSame('pp_shop_products', $deleteCalls[2]['table']);
|
||||
}
|
||||
|
||||
public function testDeleteVariantForApiReturnsFalseForNonVariant(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
|
||||
$mockDb->method('get')->willReturn([
|
||||
'id' => '1', 'parent_id' => null,
|
||||
]);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->deleteVariantForApi(1);
|
||||
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
public function testDeleteVariantForApiReturnsFalseForNonexistent(): void
|
||||
{
|
||||
$mockDb = $this->createMock(\medoo::class);
|
||||
$mockDb->method('get')->willReturn(null);
|
||||
|
||||
$repository = new ProductRepository($mockDb);
|
||||
$result = $repository->deleteVariantForApi(999);
|
||||
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace Tests\Unit\api\Controllers;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use api\Controllers\DictionariesApiController;
|
||||
use Domain\Attribute\AttributeRepository;
|
||||
use Domain\ShopStatus\ShopStatusRepository;
|
||||
use Domain\Transport\TransportRepository;
|
||||
use Domain\PaymentMethod\PaymentMethodRepository;
|
||||
@@ -12,6 +13,7 @@ class DictionariesApiControllerTest extends TestCase
|
||||
private $mockStatusRepo;
|
||||
private $mockTransportRepo;
|
||||
private $mockPaymentRepo;
|
||||
private $mockAttrRepo;
|
||||
private $controller;
|
||||
|
||||
protected function setUp(): void
|
||||
@@ -19,11 +21,13 @@ class DictionariesApiControllerTest extends TestCase
|
||||
$this->mockStatusRepo = $this->createMock(ShopStatusRepository::class);
|
||||
$this->mockTransportRepo = $this->createMock(TransportRepository::class);
|
||||
$this->mockPaymentRepo = $this->createMock(PaymentMethodRepository::class);
|
||||
$this->mockAttrRepo = $this->createMock(AttributeRepository::class);
|
||||
|
||||
$this->controller = new DictionariesApiController(
|
||||
$this->mockStatusRepo,
|
||||
$this->mockTransportRepo,
|
||||
$this->mockPaymentRepo
|
||||
$this->mockPaymentRepo,
|
||||
$this->mockAttrRepo
|
||||
);
|
||||
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
@@ -136,4 +140,50 @@ class DictionariesApiControllerTest extends TestCase
|
||||
|
||||
$this->assertSame(405, http_response_code());
|
||||
}
|
||||
|
||||
// --- attributes ---
|
||||
|
||||
public function testAttributesReturnsFormattedList(): void
|
||||
{
|
||||
$this->mockAttrRepo->method('listForApi')
|
||||
->willReturn([
|
||||
[
|
||||
'id' => 5,
|
||||
'type' => 0,
|
||||
'status' => 1,
|
||||
'names' => ['pl' => 'Rozmiar', 'en' => 'Size'],
|
||||
'values' => [
|
||||
[
|
||||
'id' => 12,
|
||||
'names' => ['pl' => 'M', 'en' => 'M'],
|
||||
'is_default' => 1,
|
||||
'impact_on_the_price' => null,
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
ob_start();
|
||||
$this->controller->attributes();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$json = json_decode($output, true);
|
||||
$this->assertSame('ok', $json['status']);
|
||||
$this->assertCount(1, $json['data']);
|
||||
$this->assertSame(5, $json['data'][0]['id']);
|
||||
$this->assertSame('Rozmiar', $json['data'][0]['names']['pl']);
|
||||
$this->assertCount(1, $json['data'][0]['values']);
|
||||
$this->assertSame(12, $json['data'][0]['values'][0]['id']);
|
||||
}
|
||||
|
||||
public function testAttributesRejectsPostMethod(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
|
||||
ob_start();
|
||||
$this->controller->attributes();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(405, http_response_code());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,17 +3,20 @@ namespace Tests\Unit\api\Controllers;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use api\Controllers\ProductsApiController;
|
||||
use Domain\Attribute\AttributeRepository;
|
||||
use Domain\Product\ProductRepository;
|
||||
|
||||
class ProductsApiControllerTest extends TestCase
|
||||
{
|
||||
private $mockRepo;
|
||||
private $mockAttrRepo;
|
||||
private $controller;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->mockRepo = $this->createMock(ProductRepository::class);
|
||||
$this->controller = new ProductsApiController($this->mockRepo);
|
||||
$this->mockAttrRepo = $this->createMock(AttributeRepository::class);
|
||||
$this->controller = new ProductsApiController($this->mockRepo, $this->mockAttrRepo);
|
||||
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$_GET = [];
|
||||
@@ -405,4 +408,257 @@ class ProductsApiControllerTest extends TestCase
|
||||
$this->assertSame(7, $result['producer_id']);
|
||||
$this->assertSame(2, $result['product_unit']);
|
||||
}
|
||||
|
||||
// --- variants ---
|
||||
|
||||
public function testVariantsReturnsVariantsList(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$_GET['id'] = '1';
|
||||
|
||||
$this->mockRepo->method('find')
|
||||
->with(1)
|
||||
->willReturn(['id' => 1, 'parent_id' => null]);
|
||||
|
||||
$this->mockRepo->method('findVariantsForApi')
|
||||
->with(1)
|
||||
->willReturn([
|
||||
[
|
||||
'id' => 101,
|
||||
'permutation_hash' => '5-12',
|
||||
'sku' => 'SKU-M',
|
||||
'attributes' => [['attribute_id' => 5, 'value_id' => 12]],
|
||||
],
|
||||
]);
|
||||
|
||||
$this->mockAttrRepo->method('listForApi')
|
||||
->willReturn([
|
||||
['id' => 5, 'type' => 0, 'status' => 1, 'names' => ['pl' => 'Rozmiar'], 'values' => []],
|
||||
]);
|
||||
|
||||
ob_start();
|
||||
$this->controller->variants();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$json = json_decode($output, true);
|
||||
$this->assertSame('ok', $json['status']);
|
||||
$this->assertSame(1, $json['data']['product_id']);
|
||||
$this->assertCount(1, $json['data']['variants']);
|
||||
$this->assertCount(1, $json['data']['available_attributes']);
|
||||
}
|
||||
|
||||
public function testVariantsReturns400WhenMissingId(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
|
||||
ob_start();
|
||||
$this->controller->variants();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(400, http_response_code());
|
||||
}
|
||||
|
||||
public function testVariantsReturns404WhenProductNotFound(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$_GET['id'] = '999';
|
||||
|
||||
$this->mockRepo->method('find')->willReturn(null);
|
||||
|
||||
ob_start();
|
||||
$this->controller->variants();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(404, http_response_code());
|
||||
}
|
||||
|
||||
public function testVariantsReturns400ForVariantProduct(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$_GET['id'] = '101';
|
||||
|
||||
$this->mockRepo->method('find')
|
||||
->with(101)
|
||||
->willReturn(['id' => 101, 'parent_id' => 1]);
|
||||
|
||||
ob_start();
|
||||
$this->controller->variants();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(400, http_response_code());
|
||||
}
|
||||
|
||||
public function testVariantsRejectsPostMethod(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
$_GET['id'] = '1';
|
||||
|
||||
ob_start();
|
||||
$this->controller->variants();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(405, http_response_code());
|
||||
}
|
||||
|
||||
// --- create_variant ---
|
||||
|
||||
public function testCreateVariantRejectsGetMethod(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$_GET['id'] = '1';
|
||||
|
||||
ob_start();
|
||||
$this->controller->create_variant();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(405, http_response_code());
|
||||
}
|
||||
|
||||
public function testCreateVariantReturns400WhenMissingId(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
|
||||
ob_start();
|
||||
$this->controller->create_variant();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(400, http_response_code());
|
||||
}
|
||||
|
||||
public function testCreateVariantReturns400WhenNoBody(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'POST';
|
||||
$_GET['id'] = '1';
|
||||
|
||||
ob_start();
|
||||
$this->controller->create_variant();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(400, http_response_code());
|
||||
}
|
||||
|
||||
// --- update_variant ---
|
||||
|
||||
public function testUpdateVariantRejectsGetMethod(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$_GET['id'] = '101';
|
||||
|
||||
ob_start();
|
||||
$this->controller->update_variant();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(405, http_response_code());
|
||||
}
|
||||
|
||||
public function testUpdateVariantReturns400WhenMissingId(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'PUT';
|
||||
|
||||
ob_start();
|
||||
$this->controller->update_variant();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(400, http_response_code());
|
||||
}
|
||||
|
||||
public function testUpdateVariantReturns400WhenNoBody(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'PUT';
|
||||
$_GET['id'] = '101';
|
||||
|
||||
ob_start();
|
||||
$this->controller->update_variant();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(400, http_response_code());
|
||||
}
|
||||
|
||||
// --- delete_variant ---
|
||||
|
||||
public function testDeleteVariantRejectsGetMethod(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$_GET['id'] = '101';
|
||||
|
||||
ob_start();
|
||||
$this->controller->delete_variant();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(405, http_response_code());
|
||||
}
|
||||
|
||||
public function testDeleteVariantReturns400WhenMissingId(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'DELETE';
|
||||
|
||||
ob_start();
|
||||
$this->controller->delete_variant();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(400, http_response_code());
|
||||
}
|
||||
|
||||
public function testDeleteVariantReturns404WhenNotFound(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'DELETE';
|
||||
$_GET['id'] = '999';
|
||||
|
||||
$this->mockRepo->method('deleteVariantForApi')
|
||||
->with(999)
|
||||
->willReturn(false);
|
||||
|
||||
ob_start();
|
||||
$this->controller->delete_variant();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertSame(404, http_response_code());
|
||||
}
|
||||
|
||||
public function testDeleteVariantSuccess(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'DELETE';
|
||||
$_GET['id'] = '101';
|
||||
|
||||
$this->mockRepo->method('deleteVariantForApi')
|
||||
->with(101)
|
||||
->willReturn(true);
|
||||
|
||||
ob_start();
|
||||
$this->controller->delete_variant();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$json = json_decode($output, true);
|
||||
$this->assertSame('ok', $json['status']);
|
||||
$this->assertSame(101, $json['data']['id']);
|
||||
$this->assertTrue($json['data']['deleted']);
|
||||
}
|
||||
|
||||
// --- list with attribute filter ---
|
||||
|
||||
public function testListPassesAttributeFilters(): void
|
||||
{
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$_GET['attribute_5'] = '12';
|
||||
$_GET['attribute_7'] = '18';
|
||||
|
||||
$this->mockRepo->expects($this->once())
|
||||
->method('listForApi')
|
||||
->with(
|
||||
$this->callback(function ($filters) {
|
||||
return isset($filters['attributes'])
|
||||
&& $filters['attributes'][5] === 12
|
||||
&& $filters['attributes'][7] === 18;
|
||||
}),
|
||||
$this->anything(),
|
||||
$this->anything(),
|
||||
$this->anything(),
|
||||
$this->anything()
|
||||
)
|
||||
->willReturn(['items' => [], 'total' => 0, 'page' => 1, 'per_page' => 50]);
|
||||
|
||||
ob_start();
|
||||
$this->controller->list();
|
||||
ob_get_clean();
|
||||
}
|
||||
}
|
||||
|
||||
BIN
updates/0.30/ver_0.301.zip
Normal file
BIN
updates/0.30/ver_0.301.zip
Normal file
Binary file not shown.
26
updates/0.30/ver_0.301_manifest.json
Normal file
26
updates/0.30/ver_0.301_manifest.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"changelog": "NEW - Ukrywalne filtry tabel, mobilna wersja szczegółów zamówienia",
|
||||
"version": "0.301",
|
||||
"files": {
|
||||
"added": [
|
||||
"admin/layout/style-css/order-details-mobile.css"
|
||||
],
|
||||
"deleted": [
|
||||
|
||||
],
|
||||
"modified": [
|
||||
"admin/layout/style-css/table-list.css",
|
||||
"admin/templates/components/table-list.php",
|
||||
"admin/templates/shop-order/order-details.php",
|
||||
"admin/templates/site/main-layout.php"
|
||||
]
|
||||
},
|
||||
"checksum_zip": "sha256:e823d9ff8d4e41a65a68bfc46d854db4c4e3dab6d39ca38207a4894a45d7be0f",
|
||||
"sql": [
|
||||
|
||||
],
|
||||
"date": "2026-02-22",
|
||||
"directories_deleted": [
|
||||
|
||||
]
|
||||
}
|
||||
BIN
updates/0.30/ver_0.302.zip
Normal file
BIN
updates/0.30/ver_0.302.zip
Normal file
Binary file not shown.
19
updates/0.30/ver_0.302_manifest.json
Normal file
19
updates/0.30/ver_0.302_manifest.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"version": "0.302",
|
||||
"date": "2026-02-22",
|
||||
"checksum_zip": "sha256:9a105e21eefa97b885d75f000be958e0604f119a01f0266ffc8ecdb34b346a7c",
|
||||
"files": {
|
||||
"modified": [
|
||||
"autoload/Domain/Attribute/AttributeRepository.php",
|
||||
"autoload/Domain/Product/ProductRepository.php",
|
||||
"autoload/api/ApiRouter.php",
|
||||
"autoload/api/Controllers/DictionariesApiController.php",
|
||||
"autoload/api/Controllers/ProductsApiController.php"
|
||||
],
|
||||
"added": [],
|
||||
"deleted": []
|
||||
},
|
||||
"directories_deleted": [],
|
||||
"sql": [],
|
||||
"changelog": "NEW - REST API wariantow produktow (CRUD), slownik atrybutow, filtrowanie po atrybutach, wzbogacone atrybuty z tlumaczeniami"
|
||||
}
|
||||
@@ -1,5 +1,11 @@
|
||||
<b>ver. 0.302 - 22.02.2026</b><br />
|
||||
NEW - REST API wariantów produktów (CRUD), słownik atrybutów, filtrowanie po atrybutach, wzbogacone atrybuty z tłumaczeniami
|
||||
<hr>
|
||||
<b>ver. 0.301 - 22.02.2026</b><br />
|
||||
NEW - Ukrywalne filtry tabel, mobilna wersja szczegółów zamówienia
|
||||
<hr>
|
||||
<b>ver. 0.300 - 21.02.2026</b><br />
|
||||
- NEW - System aktualizacji oparty na manifestach JSON (checksum SHA256, backup plików, automatyczny build)
|
||||
- NEW - System aktualizacji oparty na manifestach JSON (checksum SHA256, backup plikĂłw, automatyczny build)
|
||||
- NEW - Panel logu aktualizacji w panelu admina
|
||||
<hr>
|
||||
<b>ver. 0.299 - 21.02.2026</b><br />
|
||||
@@ -9,31 +15,31 @@
|
||||
- FIX - kilka poprawek po aktualizacji
|
||||
<hr>
|
||||
<b>ver. 0.297 - 19.02.2026</b><br />
|
||||
- NEW - REST API produktów (lista, szczegóły, tworzenie, aktualizacja)
|
||||
- NEW - Endpoint products z filtrowaniem, sortowaniem i paginacją
|
||||
- NEW - Partial update produktów (tylko zmienione pola)
|
||||
- NEW - REST API produktów (lista, szczegóły, tworzenie, aktualizacja)
|
||||
- NEW - Endpoint products z filtrowaniem, sortowaniem i paginacjÄ…
|
||||
- NEW - Partial update produktĂłw (tylko zmienione pola)
|
||||
<hr>
|
||||
<b>ver. 0.296 - 19.02.2026</b><br />
|
||||
- NEW - REST API zamówień dla ordersPRO (lista, szczegóły, zmiana statusu, płatności)
|
||||
- NEW - Endpointy słownikowe (statusy, transporty, metody płatności)
|
||||
- NEW - REST API zamówień dla ordersPRO (lista, szczegóły, zmiana statusu, płatności)
|
||||
- NEW - Endpointy słownikowe (statusy, transporty, metody płatności)
|
||||
- NEW - Autentykacja API przez X-Api-Key header
|
||||
- NEW - Kolumna updated_at w pp_shop_orders (polling zmian)
|
||||
<hr>
|
||||
<b>ver. 0.295 - 19.02.2026</b><br />
|
||||
- NEW - Edycja produktów w zamówieniu z panelu admina (dodawanie, usuwanie, zmiana ilości/cen)
|
||||
- NEW - Wyszukiwarka produktów AJAX w formularzu edycji zamówienia
|
||||
- NEW - Automatyczna korekta stanów magazynowych i przeliczanie kosztu dostawy
|
||||
- FIX - Cena promo w zamówieniu = 0 gdy identyczna z ceną bazową
|
||||
- NEW - Edycja produktów w zamówieniu z panelu admina (dodawanie, usuwanie, zmiana ilości/cen)
|
||||
- NEW - Wyszukiwarka produktĂłw AJAX w formularzu edycji zamĂłwienia
|
||||
- NEW - Automatyczna korekta stanĂłw magazynowych i przeliczanie kosztu dostawy
|
||||
- FIX - Cena promo w zamĂłwieniu = 0 gdy identyczna z cenÄ… bazowÄ…
|
||||
<hr>
|
||||
<b>ver. 0.294 - 19.02.2026</b><br />
|
||||
- FIX - Code review zakończony (96/96 klas, ~1144 metod): 27 fixów across all layers
|
||||
- FIX - Code review zakończony (96/96 klas, ~1144 metod): 27 fixów across all layers
|
||||
- FIX - Domain: null guard na query()->fetchAll() w 8 repozytoriach, redundancja DI w PromotionRepository
|
||||
- FIX - Admin: null safety find() ?: [] w 10 kontrolerach, null guard w App logowaniu/2FA
|
||||
- FIX - Front: LayoutEngine undefined $level + $_GET null check, ShopBasketController missing global $lang_id
|
||||
- FIX - Shared: Helpers $_GET null check + bug 'png' → 'image/png' (Imagick lossless WebP nigdy nie działał)
|
||||
- FIX - Shared: Helpers $_GET null check + bug 'png' → 'image/png' (Imagick lossless WebP nigdy nie działał)
|
||||
<hr>
|
||||
<b>ver. 0.293 - 19.02.2026</b><br />
|
||||
- FIX - ArticleRepository: SQL injection fix (addslashes→parameterized), uproszczenie articleDetailsFrontend
|
||||
- FIX - ArticleRepository: SQL injection fix (addslashes→parameterized), uproszczenie articleDetailsFrontend
|
||||
- FIX - AttributeRepository: martwy class_exists('\S') blokowal czyszczenie cache/temp
|
||||
- FIX - CategoryRepository: martwy class_exists('\S') blokowal generowanie linkow SEO kategorii
|
||||
- FIX - BannerRepository: parametryzacja dat w SQL + null guard na query()
|
||||
@@ -52,12 +58,12 @@
|
||||
- UPDATE - front\controls\Site przemianowany na front\App (router, camelCase: checkUrlParams, pageTitle)
|
||||
- UPDATE - front\view\Site przemianowany na front\LayoutEngine (layout engine, camelCase: cookieInformation)
|
||||
- CLEANUP - usuniete autoload/front/controls/ i autoload/front/view/ (puste foldery + pliki legacy)
|
||||
- UPDATE - usuniecie 12 legacy klas z autoload/shop/ (~2363 linii) — pelna migracja na Domain-Driven Architecture
|
||||
- UPDATE - usuniecie 12 legacy klas z autoload/shop/ (~2363 linii) — pelna migracja na Domain-Driven Architecture
|
||||
- UPDATE - class.Order.php: logika Apilo sync i email statusu przeniesiona do OrderAdminService
|
||||
- UPDATE - class.Product.php: ~20 metod przeniesionych do ProductRepository, calculate_basket_product_price do BasketCalculator
|
||||
- FIX - findCached(): stale Redis cache z obiektami \shop\Product powodowal ceny 0,00 zl
|
||||
- FIX - szablony: konwersja object access na array access po migracji Product
|
||||
- UPDATE - AttributeRepository::getAttributeValueById() — dodano Redis cache
|
||||
- UPDATE - AttributeRepository::getAttributeValueById() — dodano Redis cache
|
||||
- CLEANUP - katalog autoload/shop/ pusty, zero referencji \shop\ w aktywnym kodzie
|
||||
<hr>
|
||||
<b>ver. 0.291 - 17.02.2026</b><br />
|
||||
@@ -101,17 +107,17 @@
|
||||
- FIX - Tpl::render() branch 3: sprawdzal templates_user ale ladowal templates
|
||||
<hr>
|
||||
<b>ver. 0.284 - 16.02.2026</b><br />
|
||||
- CLEANUP - usunieta klasa DbModel (base ORM) — logika wbudowana bezposrednio w shop\Promotion
|
||||
- CLEANUP - usunieta klasa DbModel (base ORM) — logika wbudowana bezposrednio w shop\Promotion
|
||||
<hr>
|
||||
<b>ver. 0.283 - 16.02.2026</b><br />
|
||||
- UPDATE - migracja class.S.php do Shared\Helpers\Helpers (~140 plikow przepietych)
|
||||
- UPDATE - migracja class.Html.php do Shared\Html\Html
|
||||
- UPDATE - migracja class.Email.php do Shared\Email\Email
|
||||
- UPDATE - migracja class.Image.php do Shared\Image\ImageManipulator
|
||||
- UPDATE - migracja class.Log.php do Shared\Log\Log (usunieta — logika przeniesiona)
|
||||
- UPDATE - migracja class.Log.php do Shared\Log\Log (usunieta — logika przeniesiona)
|
||||
- CLEANUP - usunieta class.Mobile_Detect.php (przestarzala detekcja UA)
|
||||
- CLEANUP - usunieto 12 nieuzywanych metod z klasy S
|
||||
- FIX - array_cartesian_product() — blad iteracji po niezdefiniowanej zmiennej
|
||||
- FIX - array_cartesian_product() — blad iteracji po niezdefiniowanej zmiennej
|
||||
<hr>
|
||||
<b>ver. 0.282 - 16.02.2026</b><br />
|
||||
- UPDATE - Cache cleanup: eliminacja legacy class.Cache.php, migracja CacheHandler i RedisConnection do Shared\Cache namespace
|
||||
@@ -123,7 +129,7 @@
|
||||
<hr>
|
||||
<b>ver. 0.281 - 16.02.2026</b><br />
|
||||
- UPDATE - migracja Banners frontend: factory + view do Domain/Views (DI)
|
||||
- NEW - `front\Views\Banners` — czysty VIEW (banners, mainBanner)
|
||||
- NEW - `front\Views\Banners` — czysty VIEW (banners, mainBanner)
|
||||
- UPDATE - `BannerRepository` rozszerzony o 2 metody frontendowe (banners, mainBanner) z Redis cache
|
||||
- UPDATE - `front\view\Site::show()` przepiety na repo + Views
|
||||
- CLEANUP - usuniete: front\factory\Banners, front\view\Banners
|
||||
@@ -131,10 +137,10 @@
|
||||
<hr>
|
||||
<b>ver. 0.280 - 16.02.2026</b><br />
|
||||
- UPDATE - migracja Articles frontend: factory + view + encja do Domain/Views (DI)
|
||||
- NEW - `front\Views\Articles` — czysty VIEW + utility (renderowanie, generateTableOfContents, generateHeadersIds, getImage)
|
||||
- NEW - `front\Views\Articles` — czysty VIEW + utility (renderowanie, generateTableOfContents, generateHeadersIds, getImage)
|
||||
- UPDATE - `ArticleRepository` rozszerzony o 8 metod frontendowych (z Redis cache)
|
||||
- UPDATE - `front\view\Site::show()` — 5 sekcji przepietych na repo + Views
|
||||
- UPDATE - `front\controls\Site::route()` — single article + page_type switch przepiete na repo + Views
|
||||
- UPDATE - `front\view\Site::show()` — 5 sekcji przepietych na repo + Views
|
||||
- UPDATE - `front\controls\Site::route()` — single article + page_type switch przepiete na repo + Views
|
||||
- UPDATE - 5 szablonow `templates/articles/*` przepietych na `\front\Views\Articles::`
|
||||
- CLEANUP - usuniete: `class.Article` (encja + metody statyczne), `front\factory\Settings` (fasada)
|
||||
- FIX - eliminacja `global $lang` z `articleNoindex()`, eliminacja zaleznosci od `front\factory\Pages::page_sort()`
|
||||
@@ -145,22 +151,22 @@
|
||||
- UPDATE - nowy namespace `front\Controllers` z `NewsletterController` (DI via factory closures)
|
||||
- UPDATE - nowy namespace `front\Views` z `Languages` i `Newsletter` (czyste VIEW, statyczne metody)
|
||||
- UPDATE - routing frontend: `Site::getControllerFactories()` z fallback na stare kontrolery
|
||||
- FIX - `newsletter_unsubscribe()` — poprawiona skladnia medoo `delete()` (2 argumenty zamiast 3)
|
||||
- UPDATE - eliminacja fasady `front\factory\Languages` — 26 zaleznosci przepietych na `LanguagesRepository`
|
||||
- FIX - `newsletter_unsubscribe()` — poprawiona skladnia medoo `delete()` (2 argumenty zamiast 3)
|
||||
- UPDATE - eliminacja fasady `front\factory\Languages` — 26 zaleznosci przepietych na `LanguagesRepository`
|
||||
- CLEANUP - usuniete: `front\factory\Languages`, `front\factory\Newsletter`, `front\view\Languages`, `front\view\Newsletter`, `front\controls\Newsletter`
|
||||
- UPDATE - testy: `OK (437 tests, 1398 assertions)`
|
||||
<hr>
|
||||
<b>ver. 0.278 - 16.02.2026</b><br />
|
||||
- UPDATE - migracja Settings + Languages do wspolnych klas Domain (z cache Redis)
|
||||
- FIX - `get_single_settings_value()` — parametr `$param` poprawnie uzywany (wczesniej hardcoded `firm_name`)
|
||||
- FIX - `get_single_settings_value()` — parametr `$param` poprawnie uzywany (wczesniej hardcoded `firm_name`)
|
||||
<hr>
|
||||
<b>ver. 0.277 - 16.02.2026</b><br />
|
||||
- NEW - migracja modulu `ShopProduct` (factory) — pelna migracja ~40 metod do `ProductRepository` + ~30 akcji w `ShopProductController`
|
||||
- NEW - migracja modulu `ShopProduct` (factory) — pelna migracja ~40 metod do `ProductRepository` + ~30 akcji w `ShopProductController`
|
||||
- NEW - migracja modulu `Dashboard` do Domain + DI (`DashboardRepository`, `DashboardController`)
|
||||
- NEW - migracja modulu `Update` do Domain + DI (`UpdateRepository`, `UpdateController`)
|
||||
- UPDATE - klasa `admin\Site` przemianowana na `admin\App` (plik `App.php`)
|
||||
- UPDATE - refaktoring routingu — usunieto fallback na stare kontrolery, uproszczony routing
|
||||
- UPDATE - template `update/main-view.php` — panele zamiast `gridEdit`, `$.confirm()` zamiast `$.prompt()`
|
||||
- UPDATE - refaktoring routingu — usunieto fallback na stare kontrolery, uproszczony routing
|
||||
- UPDATE - template `update/main-view.php` — panele zamiast `gridEdit`, `$.confirm()` zamiast `$.prompt()`
|
||||
- CLEANUP - usuniete stare foldery: `autoload/admin/controls/`, `autoload/admin/factory/`, `autoload/admin/view/`
|
||||
- CLEANUP - usuniete legacy: `class.Dashboard.php` (controls/shop), `class.Update.php` (controls/factory/view), `class.Articles.php` (factory), `class.Page.php` (view), `class.ShopProduct.php` (controls/factory/view)
|
||||
- UPDATE - `front\factory\Newsletter` przepieta na `ArticleRepository::articlesByDateAdd()`
|
||||
@@ -249,12 +255,12 @@
|
||||
- UPDATE - pliki aktualizacji: `updates/0.20/ver_0.268.zip`, `ver_0.268_files.txt`
|
||||
<hr>
|
||||
<b>ver. 0.267 - 13.02.2026</b><br />
|
||||
- FIX - front: poprawione dobieranie layoutu dla kategorii/produktu/koszyka i innych stron modułowych (fallback do layoutu domyślnego)
|
||||
- FIX - produkt/koszyk: poprawiona obsługa ilości dla kombinacji (stan 0 po dodaniu do koszyka, limit max, odczyt `stock_0_buy`)
|
||||
- FIX - produkt: usunięty błąd JS `TypeError: $(...).visible is not a function` (zamiana na `:visible`)
|
||||
- FIX - SEO redirecty produktów: blokada konfliktów po kopiowaniu URL oraz utwardzone wykrywanie pętli redirectów (`lang_id` + graf przejść)
|
||||
- UPDATE - admin: `input-switch` zapisuje wartość `on` (spójnie z obsługą pól checkbox w formularzach)
|
||||
- CLEANUP - usunięte pliki: `apilo-bck`, `geocode-cache.php`
|
||||
- FIX - front: poprawione dobieranie layoutu dla kategorii/produktu/koszyka i innych stron modułowych (fallback do layoutu domyślnego)
|
||||
- FIX - produkt/koszyk: poprawiona obsługa ilości dla kombinacji (stan 0 po dodaniu do koszyka, limit max, odczyt `stock_0_buy`)
|
||||
- FIX - produkt: usunięty błąd JS `TypeError: $(...).visible is not a function` (zamiana na `:visible`)
|
||||
- FIX - SEO redirecty produktów: blokada konfliktów po kopiowaniu URL oraz utwardzone wykrywanie pętli redirectów (`lang_id` + graf przejść)
|
||||
- UPDATE - admin: `input-switch` zapisuje wartość `on` (spójnie z obsługą pól checkbox w formularzach)
|
||||
- CLEANUP - usunięte pliki: `apilo-bck`, `geocode-cache.php`
|
||||
- UPDATE - testy: `OK (235 tests, 682 assertions)`
|
||||
- UPDATE - pliki aktualizacji: `updates/0.20/ver_0.267.zip`, `ver_0.267_files.txt`, `ver_0.267_sql.txt`
|
||||
<hr>
|
||||
@@ -328,7 +334,7 @@
|
||||
<hr><b>ver. 0.257 - 12.02.2026</b><br />
|
||||
- NEW - migracja modulu `Newsletter` do architektury Domain + DI (`Domain\\Newsletter\\NewsletterRepository`, `Domain\\Newsletter\\NewsletterPreviewRenderer`, `admin\\Controllers\\NewsletterController`)
|
||||
- UPDATE - widoki `/admin/newsletter/*` przepiete z legacy `grid/gridEdit` na nowe komponenty (`components/table-list`, `components/form-edit`) + nowy endpoint `/admin/newsletter/preview/`
|
||||
- UPDATE - routing DI (`admin\\Site`) rozszerzony o moduł `Newsletter`
|
||||
- UPDATE - routing DI (`admin\\Site`) rozszerzony o moduł `Newsletter`
|
||||
- UPDATE - `admin\\factory\\Newsletter` dziala jako fasada do nowego repozytorium (backward compatibility)
|
||||
- UPDATE - `front\\factory\\Newsletter` nie korzysta juz z `admin\\view\\Newsletter`
|
||||
- CLEANUP - usuniete legacy klasy `autoload/admin/controls/class.Newsletter.php`, `autoload/admin/view/class.Newsletter.php`
|
||||
@@ -349,7 +355,7 @@
|
||||
- UPDATE - migracja widokow languages (`languages-list`, `language-edit`, `translations-list`, `translation-edit`) na `components/table-list` i `components/form-edit`
|
||||
- UPDATE - routing DI dla `Languages` w `admin\\Site` oraz kompatybilna fasada `admin\\factory\\Languages` delegujaca do repozytorium
|
||||
- UPDATE - naprawiono zapis edycji jezyka (ID jezyka pobierane z URL przy edycji)
|
||||
- UPDATE - globalne poprawki UX filtrów w `components/table-list` (kompaktowe kolumny `Aktywny`/`Domyslny`, spacing i pelna szerokosc selecta)
|
||||
- UPDATE - globalne poprawki UX filtrĂłw w `components/table-list` (kompaktowe kolumny `Aktywny`/`Domyslny`, spacing i pelna szerokosc selecta)
|
||||
- CLEANUP - usuniete legacy klasy: `autoload/admin/controls/class.Languages.php`, `autoload/admin/view/class.Languages.php`
|
||||
<hr>
|
||||
<b>ver. 0.253 - 12.02.2026</b><br />
|
||||
@@ -412,74 +418,74 @@
|
||||
- UPDATE - refaktoryzacja: article_save przeniesiony do Domain\Article\ArticleRepository::save() z prywatnymi helperami
|
||||
- UPDATE - refaktoryzacja: article_delete przeniesiony do Domain\Article\ArticleRepository::archive()
|
||||
- UPDATE - ArticlesController: nowe akcje save() i delete() z DI
|
||||
- UPDATE - admin\factory\Articles::article_save() i articles_set_archive() delegują do repozytorium (kompatybilność)
|
||||
- UPDATE - admin\factory\Articles::article_save() i articles_set_archive() delegują do repozytorium (kompatybilność)
|
||||
<hr><b>ver. 0.243</b><br />
|
||||
- UPDATE - refaktoryzacja: cleanup nieprzypisanych plików/zdjęć artykułów przeniesiony do Domain\Article\ArticleRepository
|
||||
- UPDATE - ArticlesController::edit() używa repozytorium do cleanupu, a admin\factory\Articles zachowuje delegowanie (kompatybilność)
|
||||
- UPDATE - refaktoryzacja: cleanup nieprzypisanych plików/zdjęć artykułów przeniesiony do Domain\Article\ArticleRepository
|
||||
- UPDATE - ArticlesController::edit() używa repozytorium do cleanupu, a admin\factory\Articles zachowuje delegowanie (kompatybilność)
|
||||
<hr><b>ver. 0.242</b><br />
|
||||
- NEW - refaktoryzacja: Domain\Article\ArticleRepository + migracja article_edit do admin\Controllers\ArticlesController (DI)
|
||||
- UPDATE - admin\factory\Articles::article_details() deleguje do nowego repozytorium (kompatybilność zachowana)
|
||||
- UPDATE - metody przejęte przez nowe kontrolery oznaczone jako @deprecated w legacy kontrolerach admin\controls
|
||||
- UPDATE - admin\factory\Articles::article_details() deleguje do nowego repozytorium (kompatybilność zachowana)
|
||||
- UPDATE - metody przejęte przez nowe kontrolery oznaczone jako @deprecated w legacy kontrolerach admin\controls
|
||||
<hr><b>ver. 0.241</b><br />
|
||||
- NEW - refaktoryzacja: admin\Controllers\ProductArchiveController - archiwum produktów z DI
|
||||
- NEW - refaktoryzacja: admin\Controllers\ProductArchiveController - archiwum produktĂłw z DI
|
||||
- NEW - ProductRepository::archive(), unarchive() - operacje archiwizacji w repozytorium
|
||||
- FIX - naprawiono SQL w liście archiwum (puste wyszukiwanie filtrowało wszystkie wyniki)
|
||||
- FIX - naprawiono brakujący filtr archive = 1 w zapytaniu bez wyszukiwania
|
||||
- UPDATE - wyczyszczono szablony archiwum (usunięto zbędne funkcje: apilo, baselinker, duplikowanie)
|
||||
- FIX - naprawiono SQL w liście archiwum (puste wyszukiwanie filtrowało wszystkie wyniki)
|
||||
- FIX - naprawiono brakujÄ…cy filtr archive = 1 w zapytaniu bez wyszukiwania
|
||||
- UPDATE - wyczyszczono szablony archiwum (usunięto zbędne funkcje: apilo, baselinker, duplikowanie)
|
||||
<hr>
|
||||
<b>ver. 0.240</b><br />
|
||||
- NEW - refaktoryzacja: Domain\Settings\SettingsRepository + admin\Controllers\SettingsController (architektura Domain-Driven)
|
||||
- NEW - refaktoryzacja: Domain\Cache\CacheRepository - czyszczenie cache z obsługą Redis
|
||||
- FIX - komunikat potwierdzenia zapisu ustawień w panelu administratora
|
||||
- NEW - refaktoryzacja: Domain\Cache\CacheRepository - czyszczenie cache z obsługą Redis
|
||||
- FIX - komunikat potwierdzenia zapisu ustawień w panelu administratora
|
||||
- FIX - naprawiono element #content w layoucie admina (powiadomienia grid.js)
|
||||
<hr><b>ver. 0.239</b><br />
|
||||
- NEW - refaktoryzacja: Domain\Banner\BannerRepository + admin\Controllers\BannerController (pełna migracja kontrolera)
|
||||
- NEW - refaktoryzacja: Domain\Banner\BannerRepository + admin\Controllers\BannerController (pełna migracja kontrolera)
|
||||
- NEW - refaktoryzacja: Domain\Product\ProductRepository::getPrice(), getName() - migracja kolejnych metod
|
||||
- NEW - router admin z obsługą nowych kontrolerów (fallback na stare)
|
||||
- UPDATE - shop\Product::get_product_price(), get_product_name() używają nowego repozytorium (kompatybilność zachowana)
|
||||
- NEW - router admin z obsługą nowych kontrolerów (fallback na stare)
|
||||
- UPDATE - shop\Product::get_product_price(), get_product_name() używają nowego repozytorium (kompatybilność zachowana)
|
||||
<hr>
|
||||
<b>ver. 0.238</b><br />
|
||||
- NEW - refaktoryzacja: Domain\Product\ProductRepository - pierwsza klasa w nowej architekturze Domain-Driven
|
||||
- NEW - Dependency Injection zamiast global variables
|
||||
- UPDATE - shop\Product::get_product_quantity() używa teraz nowego repozytorium (kompatybilność zachowana)
|
||||
- UPDATE - shop\Product::get_product_quantity() używa teraz nowego repozytorium (kompatybilność zachowana)
|
||||
<hr>
|
||||
<b>ver. 0.237</b><br />
|
||||
- NEW - automatyczne czyszczenie cache produktu po aktualizacji przez CRON (Sellasist, Apilo, Baselinker)
|
||||
- UPDATE - przycisk "Wyczyść cache" w panelu administratora z obsługą AJAX i komunikatami o postępie
|
||||
- UPDATE - przycisk "Wyczyść cache" w panelu administratora z obsługą AJAX i komunikatami o postępie
|
||||
<hr>
|
||||
<b>ver. 0.236</b><br />
|
||||
- FIX - zabezpieczenie przed duplikatami zamówień w Apilo - automatyczne pobieranie ID zamówienia przy błędzie "idExternal już wykorzystywany"
|
||||
- FIX - zabezpieczenie przed duplikatami zamówień w Apilo - automatyczne pobieranie ID zamówienia przy błędzie "idExternal już wykorzystywany"
|
||||
<hr>
|
||||
<b>ver. 0.235</b><br />
|
||||
- FIX - poprawka funkcji aktualizacji
|
||||
<hr>
|
||||
<b>ver. 0.234</b><br />
|
||||
- NEW - przycisk zaznaczania zamówienia jako wysłane do trustmate.io
|
||||
- NEW - przycisk zaznaczania zamówienia jako wysłane do trustmate.io
|
||||
<hr>
|
||||
<b>ver. 0.232</b><br />
|
||||
- NEW - opcje GPSR
|
||||
<hr>
|
||||
<b>ver. 0.231</b><br />
|
||||
- FIX - poprawki bezpieczeństwa + dwuetapowa weryfikacja logowania
|
||||
- FIX - poprawki bezpieczeństwa + dwuetapowa weryfikacja logowania
|
||||
<hr>
|
||||
<b>ver. 0.230</b><br />
|
||||
- FIX - poprawki bezpieczeństwa
|
||||
- FIX - poprawki bezpieczeństwa
|
||||
<hr>
|
||||
<b>ver. 0.229</b><br />
|
||||
- NEW - pola dodatkowe z opcją wymagane/niewymagane
|
||||
- NEW - pola dodatkowe z opcjÄ… wymagane/niewymagane
|
||||
<hr>
|
||||
<b>ver. 0.228</b><br />
|
||||
- NEW - cron do wysyłania zamówień do trustmate.io
|
||||
- NEW - cron do wysyłania zamówień do trustmate.io
|
||||
<hr>
|
||||
<b>ver. 0.227</b><br />
|
||||
- NEW - historia kodów rabatowych
|
||||
- NEW - historia kodĂłw rabatowych
|
||||
<hr>
|
||||
<b>ver. 0.226</b><br />
|
||||
- NEW - dodanie opcji faktury do zamówienia
|
||||
- NEW - dodanie opcji faktury do zamĂłwienia
|
||||
<hr>
|
||||
<b>ver. 0.225</b><br />
|
||||
- NEW - przycisk czyszczenia cache<br>
|
||||
- NEW - ponowne wysyłanie zamówienia do apilo
|
||||
- NEW - ponowne wysyłanie zamówienia do apilo
|
||||
<hr>
|
||||
<b>ver. 0.224</b><br />
|
||||
- NEW - sortowanie form dostawy
|
||||
@@ -491,20 +497,20 @@
|
||||
- NEW - integracja z Orlen Paczka
|
||||
<hr>
|
||||
<b>ver. 0.221</b><br />
|
||||
- NEW - Automatyczne przekierowania adresów URL produktów, zmiany w pliku htaccess
|
||||
- NEW - Automatyczne przekierowania adresĂłw URL produktĂłw, zmiany w pliku htaccess
|
||||
<hr>
|
||||
<b>ver. 0.220</b><br />
|
||||
- NEW - Dodanie możliwości wyświetlenia na strone ostatnio dodane produkty [PRODUKTY_NEW] lub [PRODUKTY_NEW:10].<br>
|
||||
- NEW - Dodanie możliwości wyświetlenia na strone popularnych produktów [PRODUKTY_TOP] lub [PRODUKTY_TOP:10].
|
||||
- NEW - Dodanie możliwości wyświetlenia na strone ostatnio dodane produkty [PRODUKTY_NEW] lub [PRODUKTY_NEW:10].<br>
|
||||
- NEW - Dodanie możliwości wyświetlenia na strone popularnych produktów [PRODUKTY_TOP] lub [PRODUKTY_TOP:10].
|
||||
<hr>
|
||||
<b>ver. 0.219</b><br />
|
||||
- NEW - Dodanie możliwości zmiany daty w artykułach
|
||||
- NEW - Dodanie możliwości zmiany daty w artykułach
|
||||
<hr>
|
||||
<b>ver. 0.218</b><br />
|
||||
- NEW - indywidualny kod GTM
|
||||
<hr>
|
||||
<b>ver. 0.217</b><br />
|
||||
- NEW - zwiększenie obsługi REDIS
|
||||
- NEW - zwiększenie obsługi REDIS
|
||||
<hr>
|
||||
<b>ver. 0.216</b><br />
|
||||
- NEW - aktualizacja api i cron (apilo)
|
||||
@@ -519,43 +525,43 @@
|
||||
- FIX - wyliczenie darmowej dostawy
|
||||
<hr>
|
||||
<b>ver. 0.212</b><br />
|
||||
- NEW - zmiany w zapisywaniu zamówienia do apilo
|
||||
- NEW - zmiany w zapisywaniu zamĂłwienia do apilo
|
||||
<hr>
|
||||
<b>ver. 0.211</b><br />
|
||||
- NEW - Debugowanie apilo + wyświetlanie podkategorii
|
||||
- NEW - Debugowanie apilo + wyświetlanie podkategorii
|
||||
<hr>
|
||||
<b>ver. 0.210</b><br />
|
||||
- NEW - dodatkowe pola w widoku produktów
|
||||
- NEW - dodatkowe pola w widoku produktĂłw
|
||||
<hr>
|
||||
<b>ver. 0.209</b><br />
|
||||
- NEW - zmiany w widoku produktów (panel administratora)
|
||||
- NEW - zmiany w widoku produktĂłw (panel administratora)
|
||||
<hr>
|
||||
<b>ver. 0.208</b><br />
|
||||
- NEW - zmiany w wyszukiwarce produktów
|
||||
- NEW - zmiany w wyszukiwarce produktĂłw
|
||||
<hr>
|
||||
<b>ver. 0.204-0.207</b><br />
|
||||
- NEW - htaccess update
|
||||
<hr>
|
||||
<b>ver. 0.204-0.206</b><br />
|
||||
- NEW - wysyłanie produktów do apilo
|
||||
- NEW - wysyłanie produktów do apilo
|
||||
<hr>
|
||||
<b>ver. 0.203</b><br />
|
||||
- NEW - zmiana sposobu wyliczania cen produkty z dodatkami
|
||||
<hr>
|
||||
<b>ver. 0.202</b><br />
|
||||
- NEW - dodano "główne zdjęcie" w edycji artykułu
|
||||
- NEW - dodano "główne zdjęcie" w edycji artykułu
|
||||
<hr>
|
||||
<b>ver. 0.201</b><br />
|
||||
- FIX - aktualizacja statusów na podstawie baselinkera
|
||||
- FIX - aktualizacja statusĂłw na podstawie baselinkera
|
||||
<hr>
|
||||
<b>ver. 0.200</b><br />
|
||||
- NEW - wysyłanie produktów do baselinker
|
||||
- NEW - wysyłanie produktów do baselinker
|
||||
<hr>
|
||||
<b>ver. 0.199</b><br />
|
||||
- NEW - usprawnienie edycji danych do XML
|
||||
<hr>
|
||||
<b>ver. 0.198</b><br />
|
||||
- NEW - automatyczne generowanie kodów SKU
|
||||
- NEW - automatyczne generowanie kodĂłw SKU
|
||||
<hr>
|
||||
<b>ver. 0.197</b><br />
|
||||
- FIX - poprawki w Dashboard
|
||||
@@ -564,7 +570,7 @@
|
||||
- FIX - integracja z apilo.com
|
||||
<hr>
|
||||
<b>ver. 0.195</b><br />
|
||||
- FIX - aktualizacja statusów
|
||||
- FIX - aktualizacja statusĂłw
|
||||
<hr>
|
||||
<b>ver. 0.194</b><br />
|
||||
- UPDATE - integracja apilo
|
||||
@@ -573,46 +579,46 @@
|
||||
- UPDATE - aktualizacja synchronizacji z baselinker
|
||||
<hr>
|
||||
<b>ver. 0.192</b><br />
|
||||
- NEW - pobieranie statusów z sellasist
|
||||
- NEW - pobieranie statusĂłw z sellasist
|
||||
<hr>
|
||||
<b>ver. 0.191</b><br />
|
||||
- NEW - integracja z selasist
|
||||
<hr>
|
||||
<b>ver. 0.190</b><br />
|
||||
- FIX - produkty powiązane
|
||||
- FIX - produkty powiÄ…zane
|
||||
<hr>
|
||||
<b>ver. 0.189</b><br />
|
||||
- FIX - ceny promocyjne produktów z dodatkiem
|
||||
- FIX - ceny promocyjne produktĂłw z dodatkiem
|
||||
<hr>
|
||||
<b>ver. 0.188</b><br />
|
||||
- NEW - widok listy produktów
|
||||
- NEW - widok listy produktĂłw
|
||||
<hr>
|
||||
<b>ver. 0.187</b><br />
|
||||
- FIX - pobieranie cen z APILO
|
||||
<hr>
|
||||
<b>ver. 0.186</b><br />
|
||||
- FIX - dodawanie do koszyka tych samych produktów ale z różną personalizacją
|
||||
- FIX - dodawanie do koszyka tych samych produktów ale z różną personalizacją
|
||||
<hr>
|
||||
<b>ver. 0.185</b><br />
|
||||
- FIX - masowa edycja produktów
|
||||
- FIX - masowa edycja produktĂłw
|
||||
<hr>
|
||||
<b>ver. 0.184</b><br />
|
||||
- NEW - druga część integracji z apilo, masowa edycja produktów
|
||||
- NEW - druga część integracji z apilo, masowa edycja produktów
|
||||
<hr>
|
||||
<b>ver. 0.183</b><br />
|
||||
- NEW - pierwsza część integracji z apilo
|
||||
- NEW - pierwsza część integracji z apilo
|
||||
<hr>
|
||||
<b>ver. 0.182</b><br />
|
||||
- FIX - layout
|
||||
<hr>
|
||||
<b>ver. 0.181</b><br />
|
||||
- NEW - infinitescroll - opcja włączy/wyłącz
|
||||
- NEW - infinitescroll - opcja włączy/wyłącz
|
||||
<hr>
|
||||
<b>ver. 0.180</b><br />
|
||||
- NEW - aktualizacja dashboard
|
||||
<hr>
|
||||
<b>ver. 0.179</b><br />
|
||||
- NEW - obsługa EAN
|
||||
- NEW - obsługa EAN
|
||||
<hr>
|
||||
<b>ver. 0.177, 0.178</b><br />
|
||||
- FIX - custom_label
|
||||
@@ -628,7 +634,7 @@
|
||||
<hr>
|
||||
<b>ver. 0.173</b><br />
|
||||
- NEW - duplikowanie produktu wraz z kombinacjami
|
||||
- NEW - dodanie przechodzenia pomiędzy zamówienia (poprzednie/następne zamówienie)
|
||||
- NEW - dodanie przechodzenia pomiędzy zamówienia (poprzednie/następne zamówienie)
|
||||
<hr>
|
||||
<b>ver. 0.172</b><br />
|
||||
- FIX - poprawki w Cache
|
||||
@@ -640,22 +646,22 @@
|
||||
- NEW - usuwanie cache produktu przy zapisie
|
||||
<hr>
|
||||
<b>ver. 0.169</b><br />
|
||||
- FIX - poprawki w liście produktów
|
||||
- FIX - poprawki w liście produktów
|
||||
<hr>
|
||||
<b>ver. 0.168</b><br />
|
||||
- NEW - archiwum produktów
|
||||
- NEW - archiwum produktĂłw
|
||||
<hr>
|
||||
<b>ver. 0.167</b><br />
|
||||
- NEW - dodanie obsługi cen i stanów magazynowych kombinacji produktów
|
||||
- NEW - dodanie obsługi cen i stanów magazynowych kombinacji produktów
|
||||
<hr>
|
||||
<b>ver. 0.166</b><br />
|
||||
- NEW - współpraca z GTM
|
||||
- NEW - współpraca z GTM
|
||||
<hr>
|
||||
<b>ver. 0.164/5</b><br />
|
||||
- FIX - ukrywanie produktów nieaktywnych
|
||||
- FIX - ukrywanie produktĂłw nieaktywnych
|
||||
<hr>
|
||||
<b>ver. 0.163</b><br />
|
||||
- NEW - automatyczne podpowiadanie produktów do zestawu na podstawie wcześniejszych zakupów klientów
|
||||
- NEW - automatyczne podpowiadanie produktów do zestawu na podstawie wcześniejszych zakupów klientów
|
||||
<hr>
|
||||
<b>ver. 0.162</b><br />
|
||||
- NEW - GA4
|
||||
@@ -671,7 +677,7 @@
|
||||
- FIX - cron Baselinker
|
||||
<hr>
|
||||
<b>ver. 0.158</b><br />
|
||||
- UPDATE - poprawa kolorystyki przycisków
|
||||
- UPDATE - poprawa kolorystyki przyciskĂłw
|
||||
<hr>
|
||||
<b>ver. 0.157</b><br />
|
||||
- NEW - szybka zmiana statusu produktu
|
||||
@@ -683,10 +689,10 @@
|
||||
- NEW - infinite scroll w widoku kategorii
|
||||
<hr>
|
||||
<b>ver. 0.154</b><br />
|
||||
- FIX - atrybuty produktów
|
||||
- FIX - atrybuty produktĂłw
|
||||
<hr>
|
||||
<b>ver. 0.153</b><br />
|
||||
- FIX - atrybuty produktów
|
||||
- FIX - atrybuty produktĂłw
|
||||
<hr>
|
||||
<b>ver. 0.152</b><br />
|
||||
- FIX - tematy maili
|
||||
@@ -695,7 +701,7 @@
|
||||
- FIX - tematy maili
|
||||
<hr>
|
||||
<b>ver. 0.150</b><br />
|
||||
- NEW - domyślna forma transportu
|
||||
- NEW - domyślna forma transportu
|
||||
<hr>
|
||||
<b>ver. 0.149</b><br />
|
||||
- NEW - tematy maili
|
||||
@@ -713,10 +719,10 @@
|
||||
- NEW - omnibus ready
|
||||
<hr>
|
||||
<b>ver. 0.144</b><br />
|
||||
- FIX - usunięcie adresu marianek.pl z kodu
|
||||
- FIX - usunięcie adresu marianek.pl z kodu
|
||||
<hr>
|
||||
<b>ver. 0.143</b><br />
|
||||
- FIX - poprawa generowania plików WEBP
|
||||
- FIX - poprawa generowania plikĂłw WEBP
|
||||
<hr>
|
||||
<b>ver. 0.142</b><br />
|
||||
- FIX - poprawa adresu strony głównej
|
||||
- FIX - poprawa adresu strony głównej
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?
|
||||
$current_ver = 300;
|
||||
<?
|
||||
$current_ver = 302;
|
||||
|
||||
for ($i = 1; $i <= $current_ver; $i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user