I am currently looking into migrating a number of custom modules and features from existing 4.* X-Cart installs into 5.2.
Using the Wholesale pricing module as an example, it has the following method defined:
./classes/XLite/Module/CDev/Wholesale/Model/Product.php
Code:
public function getWholesalePrice($membership)
{
return \XLite\Core\Database::getRepo('XLite\Module\CDev\Wholesale\Model\WholesalePrice')->getPrice(
$this,
$this->getWholesaleQuantity() > $this->getMinQuantity($membership) ? $this->getWholesaleQuantity() : $this->getMinQuantity($membership),
$membership
);
}
I have created a second test module and within it defined the same method:
./classes/XLite/Module/MyDev/MyModule/Model/Product.php
Code:
public function getWholesalePrice($membership)
{
return 987654321;
}
After redeploying the store the result from my getWholesalePrice() method from my test module is what is being called on the front end.
How does X-Cart decide which class override should be used? Is there any way to control the precedence?
Cheers,
Ron
PS: my initial post seemed to go off into the ether (silent moderation?)