Récemment
-
Images produit qui disparaissent
Bugs & Améliorations il y a environ 2 jours15 -
Urls bizarres dans la console search
PhenixSuite il y a environ 5 jours12 -
Erreurs 410 dans BO
PhenixSuite il y a environ 5 jours3 -
la classe search
Bugs & Améliorations il y a environ 7 jours2 -
Probleme depuis MAJ phenix 1.6.2.36
PhenixSuite il y a environ 7 jours8 -
[resolu] Le module mondial relay 3.4.5
Bugs & Améliorations il y a environ 10 jours1 -
controlleur fournisseurs.
Bugs & Améliorations il y a environ 12 jours11 -
J'en profite (la fougue de la jeunesse) (ah ah ah)
Bugs & Améliorations il y a environ 13 jours5 -
Bon dernier du jour mais cela me turlupine classe search
Bugs & Améliorations il y a environ 13 jours4 -
se connecter comme un client idntifié
Bugs & Améliorations il y a environ 13 jours1 -
la bonne blague
Discussion générale il y a environ 15 jours2 -
Passage de la 16.1.9 a la PhenixSuite 1.6.2.36
Bugs & Améliorations il y a environ 19 jours8 -
Echec de l'installation de Creative Elements
Bugs & Améliorations il y a environ 26 jours3 -
[Résolu] Modification données client dans l'admin
PhenixSuite il y a environ 26 jours10 -
googletagmanager
PhenixSuite il y a environ 27 jours2 -
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)
-
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 !
-
Hooks visibles :
displayHeader, displayProductFooterHooks invisibles :
actionOrderStatusPostUpdate, displayShoppingCartFooter!$this->registerHook('productFooter') ||
!$this->registerHook('header') ||
!$this->registerHook('shoppingCart') ||
!$this->registerHook('actionOrderStatusPostUpdate')