Jump to content

bss42

Member
  • Posts

    3
  • Joined

  • Last visited

Everything posted by bss42

  1. Hello, it's because the $products array is not enable in clienareahome.tpl , you must retrieve it with a hook
  2. Hello, Is it possible to get some variable avalaible from all template , for example is it possible to retrieve list of services in the clientareahome template, when i try to add this code , the list is empty, so how could i get the $services variable Thanks Code in clientareahome.tpl that doesn't work : {foreach key=num item=service from=$services} <tr class="clientareatable{$service.class}"> <td>{if $service.product eq 'Licence 1 ClickBackup + 5 Go'}<img src="images/1cb.png" /> {elseif $service.product eq 'Licence InfoBackup Manager + 5 Go'}<img src="images/im.png" /> {elseif $service.product eq 'Produit Test'}Produit Test{/if}</td> <td>{$service.amount}</td> <td>{$service.billingcycle}</td> <td>{$service.nextduedate}</td> <td><form method="post" action="{$smarty.server.PHP_SELF}?action=productdetails"> <input type="hidden" name="id" value="{$service.id}" /> <input type="image" src="images/details_open.png" alt="{$LANG.clientareaviewdetails}" /> </form></td> </tr> {foreachelse} <tr> <td colspan="6">{$LANG.norecordsfound}</td> </tr> {/foreach}
  3. Hello, First sorry for my poor english ( i'm french) Here is my request : I wan't to add the contact customer list in my order form ( contact from the customer account ) so that when my customer order a product he had to choose a contact ( from a value list ) how can i retrieve the contact list in the viewcart.tpl ? i try to add a php file with include and assign the variable but this do not work : My php files : <?php $bdd = new PDO('mysql:host=localhost;dbname=portal', 'xxx', 'xxx'); $query = $bdd->prepare("SELECT * FROM tblcontacts where userid =".(int)$_SESSION['uid']); $query->execute(); $contacts = array(); $contacts[0]['firstname'] = " Choisissez votre client"; $i = 1; while($data = $query->fetch()){ $contacts[$i]['id'] = $data['id']; $contacts[$i]['firstname'] = $data['firstname']; $contacts[$i]['lastname'] = $data['lastname']; $contacts[$i]['companyname'] = $data['companyname']; $contacts[$i]['email'] = $data['email']; $i++; } $smartyvalues["contacts"] = $contacts; ?> and in my viewcart.tpl {foreach from=$contacts item=contact} <option value="{$contact.id}"{if $contact.id eq $contacid} selected="selected"{/if}>{$contact.companyname}-{$contact.firstname} {$contact.lastname}</option> {/foreach} But my list is empty just as the php files is not read, is there a way to pass variables from one template to another ( eg : contacts array from clientareacontacts.tpl to viewcart.tpl ) Thanks
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated