Skip to content

Commit

Permalink
6.4.11.0 Compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Le Thuong authored and Le Thuong committed Jul 4, 2022
1 parent af540a5 commit 6963ff8
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.2.0 - SW 6.4.11.0 Kompatibel
- Die neue Version funktioniert ab 6.4.11.0, wenn Sie 6.4.10.0 rückwärts verwenden, benutzen Sie bitte die Version 1.1.0

# 1.0.2 - SW 6.3.2 Compatible

# 1.0.1 - Fix HTTP Caching
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.2.0 - SW 6.4.11.0 Compatible
- New version work on 6.4.11.0 onward, if you're using 6.4.10.0 backward, please use the 1.1.0 version

# 1.0.2 - SW 6.3.2 Compatible

# 1.0.1 - Fix HTTP Caching
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

## Demo:

http://shopware.thuong.lv/

![](https://media.giphy.com/media/VInadwfREBVz8QfIAI/giphy.gif)

![](https://user-images.githubusercontent.com/22548423/93246997-d00fe580-f7b7-11ea-925b-18ee10dca0ee.png)
Expand All @@ -29,9 +27,10 @@ http://shopware.thuong.lv/

## Requirements

| Version | Requirements |
|--------- |---------------------------- |
| 1.0.1 | Shopware 6.3 >= |
| Version | Requirements |
|-------------|------------------------------|
| 1.0.1 | Shopware 6.3 >= 6.4.10.0 |
| 1.2.0 | Shopware 6.4.11.0 |

## License

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vienthuong/recently-viewed-products",
"description": "Recently viewed products plugin",
"type": "shopware-platform-plugin",
"version": "1.1.0",
"version": "1.2.0",
"license": "MIT",
"authors": [
{
Expand All @@ -16,8 +16,8 @@
}
},
"require": {
"shopware/core": "^6.3",
"shopware/storefront": "^6.3"
"shopware/core": "^6.4.10.1",
"shopware/storefront": "^6.4.10.1"
},
"extra": {
"shopware-plugin-class": "RecentlyViewedProduct\\RecentlyViewedProduct",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace RecentlyViewedProduct\Core\System\SalesChannel\Context;

use Doctrine\DBAL\Connection;
use Shopware\Core\Checkout\Cart\CartPersister;
use Shopware\Core\System\SalesChannel\Context\SalesChannelContextPersister;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
Expand All @@ -22,12 +23,14 @@ class SalesChannelContextPersisterDecorated extends SalesChannelContextPersister
public function __construct(
SalesChannelContextPersister $decorated,
Connection $connection,
EventDispatcherInterface $eventDispatcher
EventDispatcherInterface $eventDispatcher,
CartPersister $cartPersister,
?string $lifetimeInterval = 'P1D'
) {
$this->decorated = $decorated;
$this->connection = $connection;

parent::__construct($connection, $eventDispatcher);
parent::__construct($connection, $eventDispatcher, $cartPersister, $lifetimeInterval);
}

public function replace(string $oldToken, SalesChannelContext $context): string
Expand All @@ -47,9 +50,9 @@ public function replace(string $oldToken, SalesChannelContext $context): string
return $newToken;
}

public function delete(string $token): void
public function delete(string $token, ?string $salesChannelId = null, ?string $customerId = null): void
{
$this->decorated->delete($token);
$this->decorated->delete($token, $salesChannelId, $customerId);

$this->connection->executeUpdate(
'DELETE FROM recently_viewed_product WHERE token = :token',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
<argument type="service" id="RecentlyViewedProduct\Core\System\SalesChannel\Context\SalesChannelContextPersisterDecorated.inner"/>
<argument type="service" id="Doctrine\DBAL\Connection"/>
<argument type="service" id="event_dispatcher"/>
<argument type="service" id="Shopware\Core\Checkout\Cart\CartPersister"/>
<argument type="string">%shopware.api.store.context_lifetime%</argument>
</service>

</services>
Expand Down
Loading

0 comments on commit 6963ff8

Please sign in to comment.