Extend Order and add a new Field to JQadm
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: Extend Order and add a new Field to JQadm
i understand....
...all this method are needed in the own Itemclass that the basket works....
(all methods who something do with the private property $locale or $price)
hope you can maybe specially make an documentaion for this kind of Managers/Items so we can again be friends.
May its something special if the property is from type \Aimeos\MShop\*\Item\Iface
just one thing: how can i actiavete my new property as checked by default in the backend modules filter?
...all this method are needed in the own Itemclass that the basket works....
(all methods who something do with the private property $locale or $price)
Code: Select all
/**
* Clones internal objects of the order base item.
*/
public function __clone()
{
$this->price = clone $this->price;
$this->locale = clone $this->locale;
}
/**
* Returns the locales for the basic order item.
*
* @return \Aimeos\MShop\Locale\Item\Iface Object containing information
* about site, language, country and currency
*/
public function getLocale()
{
return $this->locale;
}
/**
* Returns a price item with amounts calculated for the products, costs, etc.
*
* @return \Aimeos\MShop\Price\Item\Iface Price item with price, costs and rebate the customer has to pay
*/
public function getPrice(){
if( $this->price->getValue() === '0.00' ){
$this->price->clear();
$currencyId = $this->price->getCurrencyId();
foreach( $this->getServices() as $service ) {
$this->price->addItem( $service->getPrice()->setCurrencyId( $currencyId ) );
}
foreach( $this->getProducts() as $product ) {
$this->price->addItem( $product->getPrice()->setCurrencyId( $currencyId ), $product->getQuantity() );
}
}
return $this->price;
}
/**
* Checks if the price uses the same currency as the price in the basket.
*
* @param \Aimeos\MShop\Price\Item\Iface $item Price item
*/
protected function checkPrice( \Aimeos\MShop\Price\Item\Iface $item )
{
$price = clone $this->price;
$price->addItem( $item );
}
/**
* Tests if the order object was modified.
*
* @return bool True if modified, false if not
*/
public function isModified(){
return ( parent::isModified() === false ? $this->modified : true );
}
/**
* Sets the modified flag of the object.
*/
public function setModified()
{
$this->modified = true;
$this->price->clear();
}
May its something special if the property is from type \Aimeos\MShop\*\Item\Iface
just one thing: how can i actiavete my new property as checked by default in the backend modules filter?
Re: Extend Order and add a new Field to JQadm
I think the problem is that you've stored $price and $locale in your own class again with the same name as the base class. Maybe the PHP interpreter has a problem with that because the error you mentioned before (site object not found) makes no sense if the interpreter would work correctly. Can remove both properties and all your methods incl. __clone()? The locale and price items are available nevertheless using getLocale() and getPrice() from the parent class as long as you call parent::__construct() with them as parameter.
Can you explain a bit more or post a screenshot of what you mean by activating the new property in the backend module filter by default?
Can you explain a bit more or post a screenshot of what you mean by activating the new property in the backend module filter by default?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Extend Order and add a new Field to JQadm
I try this after i check that all methods who something do with the local properties must have the methods implemented but it dosen't work. same error. so i let it like it is.aimeos wrote:I think the problem is that you've stored $price and $locale in your own class again with the same name as the base class. Maybe the PHP interpreter has a problem with that because the error you mentioned before (site object not found) makes no sense if the interpreter would work correctly. Can remove both properties and all your methods incl. __clone()? The locale and price items are available nevertheless using getLocale() and getPrice() from the parent class as long as you call parent::__construct() with them as parameter.
very wired is that when i debug the $locale in the file: typo3conf/ext/aimeos/Resources/Private/Extensions/ai-controller-frontend/controller/frontend/src/Controller/Frontend/Basket/Base.php->checkLocale()
if i \Typo3\CMS\Extbase\Utility\DebuggerUtility::var_dump ($this->get) then i hav ethe whole object inclusiv the locale with the truth locale subobject (i make an A-B Testing with my own Manager and without) BUT
\Typo3\CMS\Extbase\Utility\DebuggerUtility::var_dump ($locale->get->getLocale()) then i got Null.
and just to know i also rename the properties name in myLoclae, myPrice etc. this dosen't help too.
Code: Select all
Can you explain a bit more or post a screenshot of what you mean by activating the new property in the backend module filter by default?

Re: Extend Order and add a new Field to JQadm
Strange. We will do some tests on our own if we can reproduce that.mantik wrote: I try this after i check that all methods who something do with the local properties must have the methods implemented but it dosen't work. same error. so i let it like it is.
Is the complete locale object available in __construct() of your own order base item when you store it?mantik wrote: very wired is that when i debug the $locale in the file: typo3conf/ext/aimeos/Resources/Private/Extensions/ai-controller-frontend/controller/frontend/src/Controller/Frontend/Basket/Base.php->checkLocale()
if i \Typo3\CMS\Extbase\Utility\DebuggerUtility::var_dump ($this->get) then i hav ethe whole object inclusiv the locale with the truth locale subobject (i make an A-B Testing with my own Manager and without) BUT
\Typo3\CMS\Extbase\Utility\DebuggerUtility::var_dump ($locale->get->getLocale()) then i got Null.
You can do this by configuration:mantik wrote:i mean the filter on the rioght side. how can i say to any field that i wan it see it by default (exmpla my field)
- https://aimeos.org/docs/Configuration/C ... der/fields
- https://github.com/aimeos/ai-admin-jqad ... rd.php#L97
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
