Remitur Posted September 6, 2018 Share Posted September 6, 2018 Issue: in standard cart (but in other carts too...), when you came to the selection of registrant contact, you can choose one yet existing profile, That's good, but to select it, the only info showed is name and surname ... that's confusing, because often happens that a customer has many contact profiles with same name and surname, and different company name... So, it would be nice if, instead of only name + surname, would be exposed name + surname + company name... I guess this can be done editing checkout.tpl, in these lines: <p class="small text-muted">{$LANG.orderForm.domainAlternativeContact}</p> <div class="row margin-bottom"> <div class="col-sm-6 col-sm-offset-3"> <select name="contact" id="inputDomainContact" class="field"> <option value="">{$LANG.usedefaultcontact}</option> {foreach $domaincontacts as $domcontact} <option value="{$domcontact.id}"{if $contact == $domcontact.id} selected{/if}> {$domcontact.name} </option> {/foreach} <option value="addingnew"{if $contact == "addingnew"} selected{/if}> {$LANG.clientareanavaddcontact}... </option> </select> </div> </div> ... but I can't understand how ... 😞 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 6, 2018 Share Posted September 6, 2018 16 hours ago, Remitur said: I guess this can be done editing checkout.tpl, in these lines: sadly, the name and surname is all you've got to work with. if you want more, it's going to take a hook to get the company name for each contact. -1 Quote Link to comment Share on other sites More sharing options...
Remitur Posted September 7, 2018 Author Share Posted September 7, 2018 What a pity!!! 😞 The only way to make it little easier it's so: <select name="contact" id="inputDomainContact" class="field"> <option value="">{$LANG.usedefaultcontact}</option> {foreach $domaincontacts as $domcontact} <option value="{$domcontact.id}"{if $contact == $domcontact.id} selected{/if}> {$domcontact.id}-{$domcontact.name} </option> {/foreach} <option value="addingnew"{if $contact == "addingnew"} selected{/if}> {$LANG.clientareanavaddcontact}... </option> </select> So contact id is near the name of the contact (and if you know the contact id, it's ok) Not the best fix, but better than a sandwich of broken glass... 😉 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 7, 2018 Share Posted September 7, 2018 it's not a difficult hook to write, so with a spare 5 minutes during the tea break in the cricket... 🏏 <?php # Cart Domain Contacts Add Company Name Hook # Written by brian! use Illuminate\Database\Capsule\Manager as Capsule; function hook_cart_domaincontacts($vars) { $client = Menu::context('client'); if ($client && $vars['templatefile'] == 'viewcart') { $contacts = $vars['domaincontacts']; foreach($contacts as $key => $domaincontact) { $companyname = Capsule::table('tblcontacts')->where('userid', $client->id)->where('id', $domaincontact['id'])->value('companyname'); if ($companyname) { $contacts[$key]['name'] = $domaincontact['name'].' ('.$companyname.')'; } } return array("domaincontacts" => $contacts); } } add_hook('ClientAreaPageCart', 1, 'hook_cart_domaincontacts'); ?> 1 Quote Link to comment Share on other sites More sharing options...
Remitur Posted September 7, 2018 Author Share Posted September 7, 2018 @brian!, the whmcs community should erect a virtual bronze monument dedicated to you ... 😮 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 7, 2018 Share Posted September 7, 2018 1 minute ago, Remitur said: @brian!, the whmcs community should erect a virtual bronze monument dedicated to you ... 😮 virtual ? 🙂 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.