QUESTION:
Exception #0 (Exception): Warning: Declaration of Bss\CatalogRulePerStoreView\Model\ResourceModel\RuleFrontend::getRulePrices(DateTimeInterface $date, $websiteId, $customerGroupId, $productIds) should be compatible with Magento\CatalogRule\Model\ResourceModel\Rule::getRulePrices(DateTime $date, $websiteId, $customerGroupId, $productIds) in /var/www/html/app/code/Bss/CatalogRulePerStoreView/Model/ResourceModel/RuleFrontend.php on line 0
ANSWER:
This exception/die site due to the module is not compatible with M2.1.2, the core function declaration is now different from this old version which leads to incompatibility of extend class with module Magento 2 Catalog Price Rule Per Store View.
Solution:
Please edit the two files as below to fix the issue:
File: Model/ResourceModel/RuleAdmin.php
Line 159
From
public function getRulePrices(\DateTimeInterface $date, $websiteId, $customerGroupId, $productIds, $storeId = null)
To
public function getRulePrices(\DateTime $date, $websiteId, $customerGroupId, $productIds, $storeId = null)
File: Model/ResourceModel/RuleFrontend.php
Line 49
From
public function getRulePrices(\DateTimeInterface $date, $websiteId, $customerGroupId, $productIds)
To
public function getRulePrices(\DateTime $date, $websiteId, $customerGroupId, $productIds)
If you need further assistant, please feel free to contact us via https://bsscommerce.com/contact. We'd be happy to support.
Explore more powerful extensions:
- Magento 2 B2B Extension by BSS Commerce delivers a complete solution for scalable and efficient wholesale management.
- Magento 2 SEO Extension by BSS Commerce empowers your store to rank higher and grow organic traffic faster.
To get to know us, here are some information:
BSS Commerce is a full-service ecommerce agency with 14+ years of experience, supporting 75,000+ customers worldwide. As an Adobe Commerce Solution Bronze Partner and Select Magento Extensions Builder, we deliver trusted end-to-end solutions.
Our core strength is Magento, with 150+ extensions designed to enhance store performance and drive growth. With deep expertise from years of working on Magento websites, we deliver scalable, high-impact solutions backed by strong client trust.
Discover our extensions: https://bsscommerce.com/magento-2-extensions.html
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article