Jump to content

Help in Affilate Referalllink write in other TPL file


maxmoto

Recommended Posts

Hello

i am not a coder and want show the REFERRAL link from affialtes.tpl  under the SEARCH Box on clienthome.tpl

The only i am able to do is the Code copy  on that place. It shows me the Translattion from language  but not the Refferal Link

can someone help me or explain me what i made wrong. I used that

</form>
/// here ends Search BOX

{if $inactive}

    {include file="$template/includes/alert.tpl" type="danger" msg=$LANG.affiliatesdisabled textcenter=true}

{else}

    <div class="affiliate-referral-link text-center">

        <h4>{$LANG.affiliatesreferallink}</h4>
        <span>{$referrallink}</span>

    </div>
    {/if}
	
/// here starts details
{foreach from=$addons_html item=addon_html}

Thx a LOT if possible

Link to comment
Share on other sites

On 06/03/2019 at 11:04, maxmoto said:

i am not a coder and want show the REFERRAL link from affiliates.tpl  under the SEARCH Box on clienthome.tpl

The only i am able to do is the Code copy  on that place. It shows me the Translation from language  but not the Referral Link

sadly, you can't just copy template code from one template, paste it in another and expect it to work if the variables that it wants to use don't exist on the new page - and in this case, referrallink doesn't exist on the homepage and there is no way to generate it from available Smarty variables in the template.

there are a few ways to do this - one would be to do it *entirely* using an action hook with no need to edit the template...

but as you're a new user, let's keep things simple for now and do it in two parts - first you need an action hook to create the $referrallink variable - so upload the attached .php file in /includes/hooks/

... and then in your clientareahome.tpl template, you can use...

{if $referrallink}
	<div class="affiliate-referral-link text-center">
		<h4>{$LANG.affiliatesreferallink}</h4>
		<span>{$referrallink}</span>
	</div>
{/if}

.. to output your referral link - it will only appear for those clients who are affiliates.

affiliatehome.php

Link to comment
Share on other sites

  • 5 years later...
On 3/8/2019 at 7:58 PM, brian! said:

sadly, you can't just copy template code from one template, paste it in another and expect it to work if the variables that it wants to use don't exist on the new page - and in this case, referrallink doesn't exist on the homepage and there is no way to generate it from available Smarty variables in the template.

there are a few ways to do this - one would be to do it *entirely* using an action hook with no need to edit the template...

but as you're a new user, let's keep things simple for now and do it in two parts - first you need an action hook to create the $referrallink variable - so upload the attached .php file in /includes/hooks/

... and then in your clientareahome.tpl template, you can use...

{if $referrallink}
	<div class="affiliate-referral-link text-center">
		<h4>{$LANG.affiliatesreferallink}</h4>
		<span>{$referrallink}</span>
	</div>
{/if}
 

.. to output your referral link - it will only appear for those clients who are affiliates.

affiliatehome.php

Please can you drop this file again, its cant be viewed anymore (

Link to comment
Share on other sites

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