Hallo zusammen,
Ich passe gerade ein Modul für PrestaShop 9.2 (PHP 8.2) an – Thema: Il contenuto del modulo Portafoglio Prepagato non appare nella pagina di selezione del pagamento. Il debugging mostra che il metodo hookDisplayPaymentTop restituisce una stringa vuota perché !Validate::isLoadedObject($cart) || !(int)$cart->id risulta vero, anche quando un cliente ha articoli nel carrello..
In der Datei prepaidpayment/prepaidpayment.php habe ich folgenden Code-Ausschnitt:
function hookDisplayPaymentTop($params)
{
if (!$this->active) {
return '';
}
$cart = isset($params['cart']) && $params['cart'] instanceof Cart
? $params['cart']
: $this->context->cart;
Wie passe ich diese Logik unter PrestaShop 9 am besten an, um Konflikte mit strikter Typisierung und dem Symfony-Event-Lifecycle zu vermeiden?