$countryID = (int)($user['additional']['countryShipping']['id'] ?? 0); $subShopID = (int)$this->contextService->getShopContext()->getShop()->getId(); if(empty($countryID)){ $countryID = $this->db->fetchOne( 'SELECT id FROM s_core_countries ORDER BY position ASC LIMIT 1' );
if(!$affectedRows || !$orderID){ thrownewEnlight_Exception(sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']), 0); }
/**
* Checks if the vouchers on the current basket have already been used.
* Return true if the current cart doesn't have a voucher or if the voucher is valid
* Returns false if the current voucher has already been used.
*
* @param string $sessionId
* @param int $userId
*
* @return bool
*/
// Save payment method details to db
if($checkData['sPaymentObject'] instanceof BasePaymentMethod){ $checkData['sPaymentObject']->savePaymentData(Shopware()->Session()->get('sUserId'), $this->Request()); }
// Save the payment info
$customerData = Shopware()->Modules()->Admin()->sGetUserData(); if(!\is_array($customerData)){ thrownewRuntimeException('Could not get customer data'); } $previousPayment = $customerData['additional']['user']['paymentID'];