Getting site code giving error
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 44
- Joined: 05 Oct 2019, 06:42
Getting site code giving error
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
Re: Getting site code giving error
You are using the code from the master branch but your installed version is 2019.10.
The getSite() method in 2019.10 has been renamed to getSiteItem() in master.
The getSite() method in 2019.10 has been renamed to getSiteItem() in master.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star