ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
/**
* @author Amasty Team
* @copyright Copyright (c) Amasty (https://www.amasty.com)
* @package Hide Price (Call for Price) for Magento 2
*/
namespace Amasty\HidePrice\Model;
use Amasty\HidePrice\Helper\Data;
use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Framework\Pricing\Render as PricingRender;
use Magento\Framework\Pricing\SaleableInterface;
class IsNeedRenderPrice
{
/**
* @var ConfigProvider
*/
private $configProvider;
/**
* @var Data
*/
private $helper;
public function __construct(
ConfigProvider $configProvider,
Data $helper
) {
$this->configProvider = $configProvider;
$this->helper = $helper;
}
public function execute(SaleableInterface $saleableItem, array $arguments): bool
{
// if Item not a product - show price
$isNotProduct = !($saleableItem instanceof ProductInterface);
// is current price block zone is not list, view or option
$isNoZone = (key_exists('zone', $arguments)
&& !in_array(
$arguments['zone'],
[PricingRender::ZONE_ITEM_LIST, PricingRender::ZONE_ITEM_VIEW, PricingRender::ZONE_ITEM_OPTION]
)
);
$isShowPrice = !$this->configProvider->isEnabled()
|| $isNotProduct
|| $isNoZone
|| !$this->helper->isNeedHideProduct($saleableItem);
return $isShowPrice;
}
}