VbzCart/docs/v1/class/vcCartDataManager/CaptureShippingPage

From Woozle Writes Code
Jump to navigation Jump to search

Template:Page/code/class/method

Call Chains

Code

public function CaptureShippingPage(array $arStat) {
	//echo 'GOT TO CaptureShippingPage()<br>';
	//$oCDMgr = $this->FieldsManager();
	$oCDMgr = $this;
	$oCDMgr->FetchBlob();
	
	$oCD_Buyer = $oCDMgr->GetBuyerObject();
	$oCD_Recip = $oCDMgr->GetRecipObject();
	
	//$arStat = $this->GetFormObject()->Receive($_POST);
	$oFormStat = $this->GetFormObject()->Receive($_POST);

	// 2019-04-13 TODO these probably need to pass $oFormStat instead
	$oCD_Buyer->CaptureContact($arStat);	// email/phone
	$oCD_Recip->CaptureShipping($arStat);	// shipping address / instructions

	$this->AddMissing($oCD_Buyer->GetMissingArray());
	$this->AddMissing($oCD_Recip->GetMissingArray());
	
	// calculate resulting blob
	//echo 'BLOB AFTER FETCH: '.$oCDMgr->RenderBlob();
	//echo 'UPDATING BUYER -> BLOB<br>';
	$oCDMgr->UpdateBlob($oCD_Buyer);
	//echo 'UPDATING RECIP -> BLOB<br>';
	$oCDMgr->UpdateBlob($oCD_Recip);
	//echo 'STORING BLOB<br>';
	$oCDMgr->StoreBlob();
	//echo 'SHIPPING VALUES:'.fcArray::Render($this->Values());
	//echo 'SHIPPING UPDATE ARRAY:'.fcArray::Render($this->UpdateArray());
	
	$rcCart = $this->GetCartRecord();
	$rcCart->Save();
	//echo 'SHIPPING SAVE SQL: ['.$this->sqlExec.']<br>';
	//die();
}