Skip to main content

userid dans cart.php

More
14 years 6 months ago - 14 years 6 months ago #45373 by erickb
userid dans cart.php was created by erickb
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: 14 years 6 months ago by erickb.

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

More
14 years 6 months ago #45425 by nicolas
Replied by nicolas on topic Re: userid dans cart.php
avec
$user = hikashop_loadUser(true);

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

More
14 years 6 months ago #45435 by erickb
Replied by erickb on topic Re: userid dans cart.php
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.

More
14 years 6 months ago #45436 by nicolas
Replied by nicolas on topic Re: userid dans cart.php
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.

More
14 years 6 months ago - 14 years 6 months ago #45438 by erickb
Replied by erickb on topic Re: userid dans cart.php
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: 14 years 6 months ago by erickb.

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

More
14 years 6 months ago - 14 years 6 months ago #45440 by erickb
Replied by erickb on topic Re: userid dans cart.php
$userid = hikashop_loadUser(); marche sans le true
merci
Last edit: 14 years 6 months ago by erickb.

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

More
14 years 6 months ago #45557 by nicolas
Replied by nicolas on topic Re: userid dans cart.php
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.

More
14 years 5 months ago #45813 by erickb
Replied by erickb on topic Re: userid dans cart.php
tres pratique
merci

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

Time to create page: 0.247 seconds
Powered by Kunena Forum