Getting site code giving error
Posted: 11 Jan 2020, 10:29
Hi I have extended the getSession and setSession methods from the Base.php. I have created my own php file named Ebdaa.php
my Ebdaa.php looks like
Now I am facing an error-:
my Ebdaa.php looks like
Code: Select all
<?php
namespace Aimeos\MShop\Order\Manager\Base;
class Ebdaa extends Standard
{
public function getSession($type = 'default')
{
$context = $this->getContext();
$session = $context->getSession();
$locale = $context->getLocale();
$currency = $locale->getCurrencyId();
$language = $locale->getLanguageId();
$sitecode = $locale->getSiteItem()->getCode();
$key = 'aimeos/basket/lock-' . $sitecode . '-' . $language . '-' . $currency . '-' . strval( $type );
if( ( $value = $session->get( $key ) ) !== null ) {
return (int) $value;
}
return \Aimeos\MShop\Order\Manager\Base\Base::LOCK_DISABLE;
}
/**
* Saves the current shopping basket of the customer.
*
* @param \Aimeos\MShop\Order\Item\Base\Iface $order Shopping basket
* @param string $type Order type if a customer can have more than one order at once
* @return \Aimeos\MShop\Order\Manager\Base\Iface Manager object for chaining method calls
*/
public function setSession( \Aimeos\MShop\Order\Item\Base\Iface $order, $type = 'default')
{
dd('in set session');
}
}
Please assist.Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Aimeos\MShop\Locale\Item\Standard::getSiteItem() in file /Users/adityabanerjee/code/ebdaa-ecommerce-beta/ext/ebdaa/lib/custom/src/MShop/Order/Manager/Base/Ebdaa.php on line 14