Skip to content

Commit

Permalink
fix retail mode - catalog web price
Browse files Browse the repository at this point in the history
  • Loading branch information
livca-smile committed Jul 16, 2024
1 parent ac9da3a commit 5c1df95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions Plugin/ContextPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ public function aroundDispatch(
RequestInterface $request
): mixed {

// show product offer price if shop has been selected, even in Retail mode
if ($this->settingsHelper->isDriveMode() || $this->currentStore->getRetailer()) {
if ($this->settingsHelper->isDriveMode()) {
// Set a default value to have common vary for all customers without any chosen retailer.
$retailerId = 'default';

Expand Down
12 changes: 4 additions & 8 deletions Plugin/ProductPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public function aroundIsAvailable(Product $product, Closure $proceed): bool
{
$isAvailable = $proceed();

// show product availability if shop has been selected, even in Retail mode
if ($this->settingsHelper->useStoreOffers() || $this->getRetailer()) {
if ($this->settingsHelper->useStoreOffers()) {
$isAvailable = false;
$offer = $this->offerHelper->getCurrentOffer($product);

Expand All @@ -67,8 +66,7 @@ public function aroundGetPrice(Product $product, Closure $proceed): mixed
{
$price = $proceed();

// show product offer price if shop has been selected, even in Retail mode
if ($this->settingsHelper->useStoreOffers() || $this->getRetailer()) {
if ($this->settingsHelper->useStoreOffers()) {
$offer = $this->offerHelper->getCurrentOffer($product);

if ($offer && $offer->getPrice()) {
Expand All @@ -88,8 +86,7 @@ public function aroundGetSpecialPrice(Product $product, Closure $proceed): mixed
{
$price = $proceed();

// show product offer price if shop has been selected, even in Retail mode
if ($this->settingsHelper->useStoreOffers() || $this->getRetailer()) {
if ($this->settingsHelper->useStoreOffers()) {
$offer = $this->offerHelper->getCurrentOffer($product);

if ($offer && $offer->getSpecialPrice()) {
Expand All @@ -107,8 +104,7 @@ public function aroundGetFinalPrice(Product $product, Closure $proceed, mixed $q
{
$price = $proceed($qty);

// show product offer price if shop has been selected, even in Retail mode
if ($this->settingsHelper->useStoreOffers() || $this->getRetailer()) {
if ($this->settingsHelper->useStoreOffers()) {
$offer = $this->offerHelper->getCurrentOffer($product);

if ($offer) {
Expand Down

0 comments on commit 5c1df95

Please sign in to comment.