Récemment
-
Images produit qui disparaissent
Bugs & Améliorations il y a environ 24 jours15 -
Urls bizarres dans la console search
PhenixSuite il y a environ 27 jours12 -
Erreurs 410 dans BO
PhenixSuite il y a environ 27 jours3 -
la classe search
Bugs & Améliorations il y a environ 29 jours2 -
Probleme depuis MAJ phenix 1.6.2.36
PhenixSuite il y a environ 30 jours8 -
[resolu] Le module mondial relay 3.4.5
Bugs & Améliorations 13 juil. 2025, 11:051 -
controlleur fournisseurs.
Bugs & Améliorations 11 juil. 2025, 15:2111 -
J'en profite (la fougue de la jeunesse) (ah ah ah)
Bugs & Améliorations 10 juil. 2025, 17:355 -
Bon dernier du jour mais cela me turlupine classe search
Bugs & Améliorations 10 juil. 2025, 15:444 -
se connecter comme un client idntifié
Bugs & Améliorations 10 juil. 2025, 15:151 -
la bonne blague
Discussion générale 8 juil. 2025, 17:492 -
Passage de la 16.1.9 a la PhenixSuite 1.6.2.36
Bugs & Améliorations 4 juil. 2025, 12:548 -
Echec de l'installation de Creative Elements
Bugs & Améliorations 27 juin 2025, 15:123 -
[Résolu] Modification données client dans l'admin
PhenixSuite 27 juin 2025, 07:3410 -
googletagmanager
PhenixSuite 26 juin 2025, 15:052 -
2 téléphones obligatoires
PhenixSuite 21 juin 2025, 21:5411 -
Liens qui disparaissent
PhenixSuite 21 juin 2025, 17:545 -
Smart cache JS et Iphone
PhenixSuite 20 juin 2025, 23:121 -
Hack ancien PS 1.6 avant mise à jour Phenix
PhenixSuite 16 juin 2025, 07:423 -
[RESOLU]Souci Revolut et Hipay
Modules 14 juin 2025, 18:5511
Error logs (null object)
-
Mon override de productcontroller :
(j'ai nettoyé, c'est pas de moi, mais y'avait tout le productcontroller là-dedans)<?php class ProductController extends ProductControllerCore { /* * module: alinkoverrideproductcontroller * date: 2023-12-02 10:00:22 * version: 0.1 */ public function initContent() { parent::initContent(); $tab = explode("<h3>", strip_tags($this->product->description, '<p><a><img><span><h3><div><li><ul><br><strong><b><iframe>')) ; foreach ($tab as $value) { if(strpos($value,'</h3>')>0) $tab_w[] = substr($value, strpos($value,'</h3>') + 5); } if(!empty($tab_w)) $this->context->smarty->assign('ONGLETS_CONTENT', $tab_w); preg_match_all("/<h3>(.*)<\/h3>/",$this->product->description,$out,PREG_PATTERN_ORDER); $this->context->smarty->assign('ONGLETS', $out[0]); $ONGLETS = $out[0]; } }
C'est pour mettre en forme d'onglets :
Mais j'avoue que ton module pour les onglets me fait de l'oeil...
-
Il est bien hooké dans displayFooterProduct et displayHeader, j'ai réinitialisé le module, placé en première position sur ces 2 hooks, mais toujours pareil.
-
la requête a un argument vide :
SELECT o.id_order
FROM rm_orders o
LEFT JOIN rm_order_detail od ON (od.id_order = o.id_order)
WHERE o.valid = 1 AND od.product_id IN ()Notice: Undefined index: product in /var/www/clients/client1/web4/web/modules/crossselling/crossselling.php on line 253
Notice: Trying to get property 'id' of non-object in /var/www/clients/client1/web4/web/modules/crossselling/crossselling.php on line 253
Notice: Undefined index: product in /var/www/clients/client1/web4/web/modules/crossselling/crossselling.php on line 256
Notice: Trying to get property 'id' of non-object in /var/www/clients/client1/web4/web/modules/crossselling/crossselling.php on line 256pourtant d(array($params['product']->id)) me retourne bien :
Array
(
[0] => 6748
)
-
Si je remplace :
$cache_id = 'crossselling|productfooter|'.(int)$params['product']->id;
par
$cache_id = 'crossselling|productfooter|ID du produit';
ça fonctionne, alors que d((int)$params['product']->id) me retourne bien l'ID du produit aussi...
-
A ajouter.
Je ne sais pas pourquoi chez toi cette variable n'est pas systématiquement remplie.
On peut aussi récupérer l'ID produit comme ça:
$id_product = (int)Tools::getValue('id_product');
-
Le problème c'est qu'elle l'est. d((int)$params['product']->id) avant ou après $cache_id me retourne bien l'ID produit.
Vu qu'il ne trouve pas l'index product, ne devrais-je pas faire un array_key_exists ?Cannot use isset() on the result of an expression (you can use "null !== expression" instead)
-
parce que tu fais un d() qui est un die et arrête le script mais s'il est appelé plusieurs fois tu ne vois pas les autres (ou alors faire un p())
-
du coup :
if(array_key_exists('product',$params)){
$cache_id = 'crossselling|productfooter|'.(int)$params['product']->id;
}
else{
$cache_id = 'crossselling|productfooter|'.(int)Tools::getValue('id_product');
}
-
Bon en fait, si je clique sur un produit du crossselling, même erreur (ligne 256). Donc :
$id_product = (int)Tools::getValue('id_product');
$cache_id = 'crossselling|productfooter|'.$id_product;if (!$this->isCached('crossselling.tpl', $this->getCacheId($cache_id))) { $final_products_list = $this->getOrderProducts(array($id_product));
-
@eolia p(((int)$params['product']->id)) donne bien l'ID puis Notice: Undefined index: product in /var/www/clients/client1/web4/web/modules/crossselling/crossselling.php on line 253
Notice: Trying to get property 'id' of non-object in /var/www/clients/client1/web4/web/modules/crossselling/crossselling.php on line 253
puis 0
-
donc tu mets le if(isset(... comme je t'ai dit ;)
-
@eolia Cannot use isset() on the result of an expression (you can use "null !== expression" instead)
NB: c'est un peu pénible cette contrainte de temps pour poster une réponse.if(null==((int)$params['product']->id)){
return;
} ben toujours le problème mais n'affiche plus les produits crossselling
-
@Olivier75009 a dit dans Error logs (null object) :
Bon en fait, si je clique sur un produit du crossselling, même erreur (ligne 256). Donc :
$id_product = (int)Tools::getValue('id_product');
$cache_id = 'crossselling|productfooter|'.$id_product;if (!$this->isCached('crossselling.tpl', $this->getCacheId($cache_id))) { $final_products_list = $this->getOrderProducts(array($id_product));
ça fait le job.
-
Tu es à quel endroit là, sur quelle page ?
-
Sur la page produit (hookProductFooter de toute façon)
Grrrr:
En tant que nouvel utilisateur, vous ne pouvez poster que toutes les 120 seconde(s) jusqu'à ce que vous obteniez une réputation de 3 - patientez avant de publier de nouveau.
-
Ton pb est ailleurs, pas normal que le module soit appelé 2 fois (et à mon avis, c'est un ajax qui l'appelle la seconde fois et forcément il n'y a pas d'id_product).
Mois si je fais un p($params['product']->id); je n'ai qu'une ligne avec le bon id.
-
Disons que j'ai une valeur (l'ID) et après la notice un 0.
<xmp style="text-align: left;">5992</xmp>
...
<b>Notice</b>: Undefined index: product in <b>/var/www/clients/client1/web4/web/modules/crossselling/crossselling.php</b> on line <b>269</b><br> <br> <b>Notice</b>: Trying to get property 'id' of non-object in <b>/var/www/clients/client1/web4/web/modules/crossselling/crossselling.php</b> on line <b>269</b><br>
<xmp style="text-align: left;">0</xmp>Je suppose que le second est $final_products_list = $this->getOrderProducts(array($params['product']->id
-
le second te parle de la ligne 269
-
la ligne 269 c'est justement : p(((int)$params['product']->id));
-
Donc oui, ton hook est appelé 2 fois et ce n'est pas normal !