Reputation: 127
On start:
I create custom module where i try to override class: Customer (located in root dir of prestashop in folder classes/Customer.php) So i created folder in my module ovveride/classes/ and put my code:
<?php
use PrestaShop\PrestaShop\Adapter\ServiceLocator;
use PrestaShop\PrestaShop\Adapter\CoreException;
/***
* Class CustomerCore
*/
class CustomerCore extends ObjectModel
{
public function customHook()
{
$isSuccess = $this->isLogged($withGuest = false);
if ($isSuccess == true) {
Hook::exec('actionCustomerLoginAfter', array('customer' => $this));
}
}
}
And that looks folder strucute:
When i install module, evrything looks good BUT
I try with:
Thx all for help :)
Upvotes: 1
Views: 1533
Reputation: 127
Ok problem solved :) In this case i creat ovveride when i try to redefine class CustomerCore with orginal extends. In ovveride we must create new class and extends to core class (in this case CustomerCore). So in this case new Customer class looks like
<?php
class Customer extends CustomerCore {
//your own code
}
Upvotes: 3