Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,17 @@ jobs:
run: composer analyse

phpcs:
name: Code Style (PHP ${{ matrix.php-version }})
name: Code Style
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
php-version: '8.2'
extensions: bcmath, ctype, curl, dom, gd, hash, iconv, intl, mbstring, openssl, pdo_mysql, simplexml, soap, xsl, zip
coverage: none

Expand All @@ -76,8 +71,8 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php${{ matrix.php-version }}-composer-
key: ${{ runner.os }}-php-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
Expand Down
2 changes: 2 additions & 0 deletions Helper/Import/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
class Product extends BaseProduct
{
/**
* Overwritten to set values for store view 0 when attributes are scopable/localizable and required
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the comment in commit bb98adc.

*
* @param array<string, mixed> $result
* @param array<int, string> $keys
* @return array<string, mixed>
Expand Down
2 changes: 1 addition & 1 deletion Job/RunSlackMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function getLogs(): Log\Collection

return $this->logCollection
->addFieldToFilter('created_at', ['gteq' => date('Y-m-d')])
->addFieldToFilter('created_at', ['lt' => date('Y-m-d', $tomorrow !== false ? $tomorrow : time() + 86400)]);
->addFieldToFilter('created_at', ['lt' => date('Y-m-d', $tomorrow !== false ? $tomorrow : strtotime('tomorrow'))]);
}

protected function getLogsByStatus(int $status): Log\Collection
Expand Down
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<a href="https://github.com/justbetter/magento2-akeneo-bundle" title="JustBetter Magento 2 Akeneo Bundle">
<img src="./.github/assets/banner.svg" alt="JustBetter Magento 2 Akeneo Bundle - Essential features the Akeneo Connector is missing">
</a>
<h1>JustBeter - Magento 2 Akeneo Bundle</h1>
<h1>JustBetter - Magento 2 Akeneo Bundle</h1>
<a id="readme-top"></a>

[![Latest Version on Packagist][packagist-version-shield]][packagist-version-url]
Expand All @@ -18,7 +18,7 @@
<img src="https://raw.githubusercontent.com/justbetter/art/master/justbetter-logo.png" alt="JustBetter Logo" width="200">
</a>

<h3 align="center">JustBeter - Magento 2 Akeneo Bundle</h3>
<h3 align="center">JustBetter - Magento 2 Akeneo Bundle</h3>

<p align="center">
Extends the official <a href="https://github.com/akeneo/magento2-connector-community">Akeneo Connector</a> with several features and optimizations.
Expand Down Expand Up @@ -75,7 +75,6 @@ Thanks to all the people who have contributed to this project:
<img src="https://contrib.rocks/image?repo=justbetter/magento2-akeneo-bundle" alt="Contributors" />
</a>

<p align="right">(<a href="#readme-top">back to top</a>)</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove all the back-to-top links? I'd like to keep this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored the "back to top" links in commit bb98adc. The README now keeps all navigation links while fixing the typos.


## Getting Started

Expand All @@ -96,7 +95,6 @@ Thanks to all the people who have contributed to this project:
bin/magento setup:upgrade && bin/magento cache:flush
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Features

Expand Down Expand Up @@ -126,7 +124,6 @@ For configuration instructions and best practices, see **[Configuration Guide](F
| **<a href="FEATURES.md#notification-features">Notifications</a>** | <a href="FEATURES.md#slack-notifications">Slack Notifications</a> | JustBetter Akeneo > Slack |
| **<a href="FEATURES.md#event-system">Events</a>** | <a href="FEATURES.md#import-finished-events">Import Finished Events</a> | - |

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Configuration

Expand All @@ -136,23 +133,20 @@ All features are configured in the Magento Admin Panel:

For detailed configuration instructions, grid mappings, and best practices, see **[FEATURES.md - Configuration Guide](FEATURES.md#configuration-guide)**.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Usage

The bundle extends the Akeneo Connector with additional features that can be configured in the Magento Admin Panel. Some features also provide CLI commands for manual execution.

For detailed usage instructions and CLI commands, see **[FEATURES.md](FEATURES.md)**.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Events

The bundle dispatches custom events after import completion to enable custom post-processing.

For available events, implementation examples and use cases, see **[FEATURES.md - Event System](FEATURES.md#event-system)**.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Contributing
Please read our [Contributing Guide](.github/CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
Expand All @@ -174,26 +168,22 @@ composer grumphp

For security vulnerabilities, please see our [Security Policy](.github/SECURITY.md).

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## License

Distributed under the GPL-3.0 License. See `LICENSE` for more information. Please see [License File](LICENSE) for more information.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Contact

[JustBetter B.V.](https://justbetter.nl/contact)

<p align="right">(<a href="#readme-top">back to top</a>)</p>


<a href="https://justbetter.nl" title="JustBetter - Innovative Magento Development Agency">
<img src="./.github/assets/footer.svg" alt="JustBetter - We're an innovative development agency from The Netherlands building better Magento solutions">
</a>

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- MARKDOWN LINKS & IMAGES -->
[packagist-version-shield]: https://img.shields.io/packagist/v/justbetter/magento2-akeneo-bundle.svg?style=for-the-badge
Expand Down
14 changes: 6 additions & 8 deletions Service/SetTaxClassId.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,15 @@ public function execute(string $code): void
$connection = $this->entitiesHelper->getConnection();

foreach ($taxColumns as $taxIdColumn) {
try {
$taxQuery = $this->createQuery($taxIdColumn, $tmpTable);
$connection->query($taxQuery);
} catch (Exception $e) {
throw $e;
}
$taxQuery = $this->createQuery($taxIdColumn, $tmpTable);
$connection->query($taxQuery);
}
}

protected function createQuery(string $taxIdColumn, string $tableName): string
{
$query = "UPDATE `" . $tableName . "` SET `" . $taxIdColumn . "` = ";
$connection = $this->entitiesHelper->getConnection();
$query = "UPDATE " . $connection->quoteIdentifier($tableName) . " SET " . $connection->quoteIdentifier($taxIdColumn) . " = ";

return $this->addCase($query, $taxIdColumn);
}
Expand All @@ -93,13 +90,14 @@ protected function addCase(string $query, string $taxIdColumn): string
return $query;
}

$connection = $this->entitiesHelper->getConnection();
$query .= "CASE ";

foreach ($unserializedMappings as $mapping) {
if (!is_array($mapping)) {
continue;
}
$query .= "WHEN `" . $taxIdColumn . "` = '" . $mapping['akeneo'] . "' then '" . $mapping['magento'] . "' ";
$query .= "WHEN " . $connection->quoteIdentifier($taxIdColumn) . " = " . $connection->quote($mapping['akeneo']) . " THEN " . $connection->quote($mapping['magento']) . " ";
}

$query .= 'END';
Expand Down
Loading