Definition at line 12 of file PriceModifier.php.
◆ __construct()
- Parameters
-
\Magento\Catalog\Api\ProductRepositoryInterface | $productRepository | |
Definition at line 22 of file PriceModifier.php.
◆ removeTierPrice()
- Parameters
-
\Magento\Catalog\Model\Product | $product | |
int | string | $customerGroupId | |
int | $qty | |
int | $websiteId | |
- Exceptions
-
Definition at line 38 of file PriceModifier.php.
43 throw new NoSuchEntityException(
__(
'Tier price is unavailable for this product.'));
45 $tierPricesQty = count(
$prices);
47 foreach (
$prices as $key => $tierPrice) {
48 if ($customerGroupId ==
'all' && $tierPrice[
'price_qty'] == $qty
49 && $tierPrice[
'all_groups'] == 1 && intval($tierPrice[
'website_id']) === intval(
$websiteId)
52 }
elseif ($tierPrice[
'price_qty'] == $qty && $tierPrice[
'cust_group'] == $customerGroupId
53 && intval($tierPrice[
'website_id']) === intval(
$websiteId)
59 if ($tierPricesQty == count(
$prices)) {
60 throw new NoSuchEntityException(
62 'Product hasn\'t group price with such data: customerGroupId = \'%1\'' 63 .
', website = %2, qty = %3',
70 $this->productRepository->save(
$product);
71 }
catch (\Exception $exception) {
72 throw new CouldNotSaveException(
__(
'The tier_price data is invalid. Verify the data and try again.'));
elseif(isset( $params[ 'redirect_parent']))
◆ $productRepository
The documentation for this class was generated from the following file: