Sub tota coming zero
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your 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
Sub tota coming zero
Hi Aimeos,
We see that when the delivery status is 2 then our subtotal $basket->getPrice()->getValue() is coming zero for us.
Please assist.
We see that when the delivery status is 2 then our subtotal $basket->getPrice()->getValue() is coming zero for us.
Please assist.
Re: Sub tota coming zero
This isn't the default behaviour.
-
- Posts: 44
- Joined: 05 Oct 2019, 06:42
Re: Sub tota coming zero
Please assist. What could be the reason?
Re: Sub tota coming zero
Please post your custom code, probable there's somewhere a problem.
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
-
- Posts: 44
- Joined: 05 Oct 2019, 06:42
Re: Sub tota coming zero
<?php
/**
* @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
* @copyright Metaways Infosystems GmbH, 2011
* @copyright Aimeos (aimeos.org), 2015-2021
* @package MShop
* @subpackage Order
*/
namespace Aimeos\MShop\Order\Item\Base;
/**
* Default implementation of the shopping basket.
*
* @package MShop
* @subpackage Order
*/
class EbdaaOrderItemBase extends Standard
{
/**
* 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() : \Aimeos\MShop\Price\Item\Iface
{
if( $this->recalc )
{
$price = $this->price->clear();
foreach( $this->getServices() as $list )
{
foreach( $list as $service ) {
$price = $price->addItem( $service->getPrice() );
}
}
foreach( $this->getProducts() as $product ) {
// 0=deleted, 1=cancelled
if( !in_array( $product->getStatus(), [0, 1] ) ) {
$price = $price->addItem( $product->getPrice(),
$product->getQuantity() );
}
}
$this->price = $price;
$this->recalc = false;
}
return $this->price;
}
}
Is this has to do something with it?
/**
* @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
* @copyright Metaways Infosystems GmbH, 2011
* @copyright Aimeos (aimeos.org), 2015-2021
* @package MShop
* @subpackage Order
*/
namespace Aimeos\MShop\Order\Item\Base;
/**
* Default implementation of the shopping basket.
*
* @package MShop
* @subpackage Order
*/
class EbdaaOrderItemBase extends Standard
{
/**
* 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() : \Aimeos\MShop\Price\Item\Iface
{
if( $this->recalc )
{
$price = $this->price->clear();
foreach( $this->getServices() as $list )
{
foreach( $list as $service ) {
$price = $price->addItem( $service->getPrice() );
}
}
foreach( $this->getProducts() as $product ) {
// 0=deleted, 1=cancelled
if( !in_array( $product->getStatus(), [0, 1] ) ) {
$price = $price->addItem( $product->getPrice(),
$product->getQuantity() );
}
}
$this->price = $price;
$this->recalc = false;
}
return $this->price;
}
}
Is this has to do something with it?
Re: Sub tota coming zero
Does it work if you remove your "if( !in_array( $product->getStatus(), [0, 1] ) )" again?
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
-
- Posts: 44
- Joined: 05 Oct 2019, 06:42
Re: Sub tota coming zero
No, I think the issue still persist.
Re: Sub tota coming zero
Remove other custom code until it works again as this behavior is not standard.
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