Jump to content

Access to undeclared static property when add/edit package


Julia Osipova
 Share

Go to solution Solved by Stuart Silvester,

Recommended Posts

 

Hi!

I receive this error  when try to edit or add physical package item in invoice in ACP.

Edit or add comissions, and other items are ok. Error only when adding/editing package item.

Problem and in version 4.6.7, and in version 4.6.8.

Where can I look to solve this problem?

Thanks

Error: Access to undeclared static property: IPS\nexus\extensions\nexus\Item\ShippingCharge::$arent (0)
#0 /var/www/u1463182/data/www/fashionproduct.ru/test/applications/nexus/sources/Invoice/Item/Item.php(375): IPS\nexus\Invoice\_Item->__get('arent')
#1 /var/www/u1463182/data/www/fashionproduct.ru/test/applications/nexus/extensions/nexus/Item/Package.php(516): IPS\nexus\Invoice\_Item->isSameAsOtherItem(Object(IPS\nexus\extensions\nexus\Item\Package))
#2 /var/www/u1463182/data/www/fashionproduct.ru/test/applications/nexus/modules/admin/payments/invoices.php(1276): IPS\nexus\extensions\nexus\Item\_Package::createFromForm(Array, Object(IPS\nexus\Invoice))
#3 /var/www/u1463182/data/www/fashionproduct.ru/test/system/Helpers/Wizard/Wizard.php(181): IPS\nexus\modules\admin\payments\_invoices->IPS\nexus\modules\admin\payments\{closure}(Array)

 

Link to comment
Share on other sites

When I add this hook, problem is solved.

But groupping of products now not works.

For example, I have product1 in invoice, and I add another product1 in invoice.

Now I don't receive error, but I now have 2 copies of product1 in invoice.

Any ideas why this happened?

product1 is not a charge, it's physical product.

 

abstract class ecwid_hook_nexus_invoice_item extends _HOOK_CLASS_
{


	/**
	 * Is this item the same as another item in the cart?
	 * Used to decide when an item is added to the cart if we should just increase the quantity of this item instead  of creating a new item.
	 *
	 * @param	\IPS\nexus\Invoice\Item		$item	The other item
	 * @return	bool
	 */
	public function isSameAsOtherItem( $item )
	{
      
        if ( $this instanceof \IPS\nexus\extensions\nexus\Item\ShippingCharge ) {
            return FALSE;
        }       
        if ( $item instanceof \IPS\nexus\extensions\nexus\Item\ShippingCharge ) {
            return FALSE;
        }  
        if ( $this instanceof \IPS\nexus\extensions\nexus\Item\MiscellaneousCharge ) {
            return FALSE;
        }       
        if ( $item instanceof \IPS\nexus\extensions\nexus\Item\MiscellaneousCharge ) {
            return FALSE;
        }           
		return parent::isSameAsOtherItem( $item );
	}

 

Link to comment
Share on other sites

  • 2 weeks later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...