- Nach den hier markierten Zeilen den folgenden Code anfügen:
if (!array_key_exists(‚allow_shipping‘, $countryTranslations[$countryId])) {
return $allowedByDefault;
}
Hallo, Patrick!
Ich habe die o.g. Code hinzugefügt. Das hat aber leider nicht geholfen. Soll ich folgende Code auch hinzufügen? Wenn ja, wohin?
private function isShippingAllowed(int $countryId): bool
{
$queryBuilder = $this->get('dbal_connection')->createQueryBuilder();
$allowedByDefault = (bool) $queryBuilder->select('allow_shipping')
->from('s_core_countries', 'countries')
->where('countries.id = :countryId')
->setParameter(':countryId', $countryId)
->execute()
->fetchColumn();
$countryTranslations = $this->get('modules')->sAdmin()->sGetCountryTranslation();
if (!$countryTranslations) {
return $allowedByDefault;
}
if (!array_key_exists($countryId, $countryTranslations)) {
return $allowedByDefault;
}
if (!array_key_exists('allow_shipping', $countryTranslations[$countryId])) {
return $allowedByDefault;
}
return $countryTranslations[$countryId]['allow_shipping'];
}