関数
RedirectRouteGuards::addressCheck()
addressError in $_SESSION if address is not valid戻り値 戻り値
ファイル: src/Routing/RedirectRouteGuards.php
public function addressCheck() {
return function () {
$_SESSION['amazonCheckoutSession']['addressError'] = '';
$addressCheck = $this->restRouteGuards->addressCheck();
$res = $addressCheck();
if ($res instanceof GenericError) {
if ($res->errorcode === GenericErrorStore::USCES_DELIVERY_PREF_INVALID) {
$_SESSION['amazonCheckoutSession']['addressError'] = __('The prefecture is not valid.', 'wcexaap');
}
if ($res->errorcode === GenericErrorStore::USCES_COUNTRY_NOT_TARGET_MARGET) {
$_SESSION['amazonCheckoutSession']['addressError'] = __(
'International shipping is unavailable for the country you selected.',
'wcexaap'
);
}
}
};
}