Skip to content

Commit

Permalink
Merge pull request PrestaShop#37533 from tswfi/37532_hide_add_to_cart…
Browse files Browse the repository at this point in the history
…_from_listing_if_no_prices

If price is not shown hide add to cart too. Fixes PrestaShop#37532
  • Loading branch information
nicosomb authored Dec 13, 2024
2 parents d310eba + fc45a33 commit e8cbac5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Adapter/Presenter/Product/ProductLazyArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,11 @@ protected function shouldEnableAddToCartButton(array $product, ProductPresentati
return false;
}

// Do not enable add to cart button if prices are hidden
if (!$this->shouldShowPrice($settings, $product)) {
return false;
}

if (($product['customizable'] == 2 || !empty($product['customization_required']))) {
$shouldEnable = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public function providerDeliveryInformationCases(): iterable
'allow_oosp' => OutOfStockType::OUT_OF_STOCK_AVAILABLE,
]
),
self::PRODUCT_DELIVERY_TIME_OOSBOA,
null,
];
}

Expand Down

0 comments on commit e8cbac5

Please sign in to comment.