Jump to content

Disable the need of billing adress for customers?


Shirayukiie

Recommended Posts

Hi,
Im using Commerce only for virtual items so billing adressses are not necessary. Since IPB 4.4.X getting this error:

 

TypeError: Argument 1 passed to IPS\nexus\_Invoice::set_billaddress() must be an instance of IPS\GeoLocation, null given, called in /home/user/public_html/system/Patterns/ActiveRecord.php on line 372 (0)
#0 /home/user/public_html/system/Patterns/ActiveRecord.php(372): IPS\nexus\_Invoice->set_billaddress(NULL)
#1 /home/user/public_html/init.php(867) : eval()'d code(686): IPS\Patterns\_ActiveRecord->__set('billaddress', NULL)
#2 /home/user/public_html/applications/nexus/tasks/generateRenewalInvoices.php(106): IPS\Patterns\rules_hook_ipsPatternsActiveRecord->__set('billaddress', NULL)
#3 /home/user/public_html/system/Task/Task.php(255): IPS\nexus\tasks\_generateRenewalInvoices->execute()
#4 /home/user/public_html/applications/core/modules/admin/settings/advanced.php(709): IPS\_Task->run()
#5 /home/user/public_html/system/Dispatcher/Controller.php(85): IPS\core\modules\admin\settings\_advanced->runTask()
#6 /home/user/public_html/applications/core/modules/admin/settings/advanced.php(34): IPS\Dispatcher\_Controller->execute()
#7 /home/user/public_html/system/Dispatcher/Dispatcher.php(152): IPS\core\modules\admin\settings\_advanced->execute()
#8 /home/user/public_html/admin/index.php(14): IPS\_Dispatcher->run()
#9 {main}

Since most of my customers dont enter any adress and its returning a null value cause of that is there any way to bypass this easily?

Thanks a lot in advance

Link to comment
Share on other sites

there is an update for that if you check your updates in the acp maybe this would fix it

Dashboard.thumb.png.2ce6f494b7809fa96c6c1d09b7f0a84e.png

 

when I load your site, I was like a vampire, slept for thousands of years and just now is my first glimpse of light haha.

Link to comment
Share on other sites

On 7/14/2019 at 6:00 AM, mr-pimpen said:

there is an update for that if you check your updates in the acp maybe this would fix it

Dashboard.thumb.png.2ce6f494b7809fa96c6c1d09b7f0a84e.png

 

When i clicked Apply Patch i was redirected back to WebFlake 4.4.4 release and it does not contain the patch.

 

Anyway, resolved this myself by editing

.../applications/nexus/modules/admin/customers/purchases.php

 

Go to line 294 and comment out the entire try block until line 306.

/* Handle submissions */
		if ( $values = $form->values() )
		{
			/* Generate Invoice */
			$invoice = new \IPS\nexus\Invoice;
			$invoice->currency = $this->purchase->renewal_currency;
			$invoice->member = $this->purchase->member;
			/*try
			{
				$invoice->billaddress = $this->purchase->original_invoice->billaddress;
			}
			catch( \OutOfRangeException $e ) # original invoice doesn't exist
			{
				try
				{
					$invoice->billaddress = \IPS\GeoLocation::buildFromJson( \IPS\Db::i()->select( 'address', 'nexus_customer_addresses', array( "member=? AND primary_billing=?", $this->purchase->member->member_id, 1 ) )->first() );
				}
				catch( \UnderflowException $e ) {
				} # no billing primary address set
			}*/
			$invoice->addItem( \IPS\nexus\Invoice\Item\Renewal::create( $this->purchase, $values['renew_cycles'] ) );
			$invoice->save();
			$invoice->sendNotification();

Boom it works like a charm again!

(Obviously does not work for you who still needs to use billing adress tho)

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...