Jump to content

add new column in client area products


AladdinJ
Go to solution Solved by Vike,

Recommended Posts

Hello 
is there any way to add new column  in clientareaproducts 

I need to add Registration Date in the column so user can sort the services just by clicking on  Registration Date column

Untitle22d.thumb.png.32334812a456f6018973617e2fa17240.png

I would appreciate any type of help 

Edited by AladdinJ
Link to comment
Share on other sites

  • Solution

Hi AladdinJ, so the variable for the Registration Date is regdate - below is the code for template clientareaproducts.tpl file, comments above sections of code added to default file:

{include file="$template/includes/tablelist.tpl" tableName="ServicesList" filterColumn="4" noSortColumns="0"}

<script>
    jQuery(document).ready(function() {
        var table = jQuery('#tableServicesList').show().DataTable();

        {if $orderby == 'product'}
            table.order([1, '{$sort}'], [4, 'asc']);
        {elseif $orderby == 'amount' || $orderby == 'billingcycle'}
            table.order(2, '{$sort}');
        {elseif $orderby == 'nextduedate'}
            table.order(3, '{$sort}');
        {elseif $orderby == 'domainstatus'}
            table.order(4, '{$sort}');
        //ADD ABILITY TO SORT VIA REGISTER DATE
        {elseif $orderby == 'regdate'}
            table.order(5, '{$sort}');
        {/if}
        table.draw();
        jQuery('#tableLoading').hide();
    });
</script>

<div class="table-container clearfix">
    <table id="tableServicesList" class="table table-list w-hidden">
        <thead>
            <tr>
                <th></th>
                <th>{lang key='orderproduct'}</th>
                <th>{lang key='clientareaaddonpricing'}</th>
                <th>{lang key='clientareahostingnextduedate'}</th>
                <th>{lang key='clientareastatus'}</th>
                <!-- ADD TABLE HEADER FOR REGISTERED DATE -->
                <th>{lang key='clientareahostingregdate'}</th>
            </tr>
        </thead>
        <tbody>
            {foreach $services as $service}
                <tr onclick="clickableSafeRedirect(event, 'clientarea.php?action=productdetails&amp;id={$service.id}', false)">
                    <td class="py-0 text-center{if $service.sslStatus} ssl-info{/if}" data-element-id="{$service.id}" data-type="service"{if $service.domain} data-domain="{$service.domain}"{/if}>
                        {if $service.sslStatus}
                            <img src="{$service.sslStatus->getImagePath()}" data-toggle="tooltip" title="{$service.sslStatus->getTooltipContent()}" class="{$service.sslStatus->getClass()}" width="25">
                        {elseif !$service.isActive}
                            <img src="{$BASE_PATH_IMG}/ssl/ssl-inactive-domain.png" data-toggle="tooltip" title="{lang key='sslState.sslInactiveService'}" width="25">
                        {/if}
                    </td>
                    <td><strong>{$service.product}</strong>{if $service.domain}<br /><a href="http://{$service.domain}" target="_blank">{$service.domain}</a>{else}<br />-{/if}</td>
                    <td class="text-center" data-order="{$service.amountnum}">{$service.amount} <small class="text-muted">{$service.billingcycle}</small></td>
                    <td class="text-center"><span class="w-hidden">{$service.normalisedNextDueDate}</span>{$service.nextduedate}</td>
                    <td class="text-center"><span class="label status status-{$service.status|strtolower}">{$service.statustext}</span></td>
                    <!-- ADD TABLE CONTENT FOR REGISTERED DATE -->
                    <td class="text-center"><span class="w-hidden">{$service.normalisedRegDate}</span>{$service.regdate}</td>
                </tr>
            {/foreach}
        </tbody>
    </table>
    <div class="text-center" id="tableLoading">
        <p><i class="fas fa-spinner fa-spin"></i> {lang key='loading'}</p>
    </div>
</div>

 

Link to comment
Share on other sites

  • 2 weeks later...
On 10/30/2021 at 2:53 PM, AladdinJ said:

Hello @Vike

 

after installing it the sidebar for filtering no longer work 
image.png.40f353740697138d3d81c58eb72ca158.png

 

I mean when click on Active or completed or cancelled its return nothing in the table

do you know to we may fix this ?


Thanks in advance 
 

@AladdinJ did you add the column after Status or somewhere before ? You need to set the correct filterColumn (line 1) on the code @Vike provided, if you change columns position. Count starts from 0

{include file="$template/includes/tablelist.tpl" tableName="ServicesList" filterColumn="4" noSortColumns="0"}
Edited by pRieStaKos
Link to comment
Share on other sites

On 11/1/2021 at 11:18 AM, pRieStaKos said:

@AladdinJ did you add the column after Status or somewhere before ? You need to set the correct filterColumn (line 1) on the code @Vike provided, if you change columns position. Count starts from 0


{include file="$template/includes/tablelist.tpl" tableName="ServicesList" filterColumn="4" noSortColumns="0"}

you where right that fixed the problem thanks 

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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