Skip to content

Commit

Permalink
fix retail mode - catalog web price - code style
Browse files Browse the repository at this point in the history
  • Loading branch information
livca-smile committed Jul 16, 2024
1 parent 5c1df95 commit 709851e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
6 changes: 4 additions & 2 deletions Plugin/ContextPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ public function aroundDispatch(
// Set a default value to have common vary for all customers without any chosen retailer.
$retailerId = 'default';

if ($this->currentStore->getRetailer()
&& $this->currentStore->getRetailer()->getId()) {
if (
$this->currentStore->getRetailer()
&& $this->currentStore->getRetailer()->getId()
) {
$retailerId = $this->currentStore->getRetailer()->getId();
}

Expand Down
16 changes: 0 additions & 16 deletions Plugin/ProductPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Closure;
use Magento\Catalog\Model\Product;
use Smile\Retailer\Api\Data\RetailerInterface;
use Smile\RetailerOffer\Helper\Offer;
use Smile\RetailerOffer\Helper\Settings;
use Smile\StoreLocator\CustomerData\CurrentStore;
Expand All @@ -16,28 +15,13 @@
*/
class ProductPlugin
{

public function __construct(
private Offer $offerHelper,
private Settings $settingsHelper,
protected CurrentStore $currentStore
) {
}

/**
* Retrieve current retailer.
*/
private function getRetailer(): ?RetailerInterface
{
$retailer = null;
if ($this->currentStore->getRetailer() && $this->currentStore->getRetailer()->getId()) {
/** @var RetailerInterface $retailer */
$retailer = $this->currentStore->getRetailer();
}

return $retailer;
}

/**
* Return offer availability (if any) instead of the product one.
*
Expand Down

0 comments on commit 709851e

Please sign in to comment.