userid dans cart.php

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 7 months ago #45373

bonjour

comment je peux recuperer l'id de l'utilisateur dans cart.php ? l'id de celui qui a le cart et passe commande

autrement qu'avec
$user =& JFactory::getUser();
$userid = $user->get('id');

merci

Last edit: 12 years 7 months ago by erickb.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 7 months ago #45425

avec
$user = hikashop_loadUser(true);

Please Log in or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 7 months ago #45435

non ça plante
il faut sans doute importer une class mais tel quel ça marche pas

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 7 months ago #45436

Cette fonction est dans le helper de base d'hikashop qui est chargé avant n'importe quelle vue d'hikashop.
Il n'y a pas de raison quelle ne soit pas définie.

Please Log in or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 7 months ago #45438

php_error.log

[31-Mar-2012 14:06:46] PHP Catchable fatal error: Object of class stdClass could not be converted to string in /www/sacapuce.biz/templates/shoes/html/com_hikashop/checkout/cart.php on line 16


$userid = hikashop_loadUser(true);

plante completement la page

Last edit: 12 years 7 months ago by erickb.

Please Log in or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 7 months ago #45440

$userid = hikashop_loadUser(); marche sans le true
merci

Last edit: 12 years 7 months ago by erickb.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 7 months ago #45557

Ah oui c'est normal que ça plantait :)
Avec le true cela renvoi toutes les infos de l'utilisateur. Il suffisait de faire un $user->user_id ensuite. sinon, sans le true cela retourne l'id directement.

Please Log in or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 7 months ago #45813

tres pratique
merci

Please Log in or Create an account to join the conversation.

Time to create page: 0.067 seconds
Powered by Kunena Forum