Jump to content

[request] custom code fix (v7)


Recommended Posts

Hi,

 

I am looking for a person/company able to fix a few small issues I got after upgrading to whmcs 7 and 7.0.1:

 

Here is a description of the first and most urgent issue I have so if you are able to fix it please PM me with your price (please do not ask me to register on some site for a personal quote, I will do that afterwards after we agree on a price). Ive got other pieces of code of the same kind to address so if you can do that you may get more from me if interested:

 

 

 

I am basically using a hook to get the currencies values (prefix/suffix/rate etc) and display pricing on my pages.

 

here is the hook:

 

```

<?php

 

use Illuminate\Database\Capsule\Manager as Capsule;

 

function currencies_hook($vars)

{

$currencies = Capsule::table('tblcurrencies')

->get();

 

$encodedata = json_encode($currencies);

$decodedata = json_decode($encodedata, true);

 

return array("currencies" => $decodedata);

}

add_hook("ClientAreaPage", 1, "currencies_hook");

?>

```

 

And here is the code contained in my tempalte pages:

 

```

{if isset($smarty.get.cid)}

{assign cid $smarty.get.cid}

{elseif isset($smarty.session.currency)}

{assign cid $smarty.session.currency}

{else}

{assign cid '1'}

{/if}

 

{foreach $currencies as $cartcurrency}

<li><a href="{$smarty.server.PHP_SELF}?cid={$cartcurrency.id}"><img src="{$BASE_PATH_IMG}/flags/{$cartcurrency.code|substr:0:2|strtolower}.png" alt="" /> {$cartcurrency.code}</a></li>

{if $cartcurrency.id eq $cid}

{assign conversionrate $cartcurrency.rate}

{assign currencyprefix $cartcurrency.prefix}

{assign currencysuffix $cartcurrency.suffix}

{/if}

```

 

However $conversionrate , $currencyprefix and $currencysuffis do not seem to get assigned any value anymore. Note that the above code used to work just fine so it is about upgrading it for 7.0.1 compatibility.

 

 

 

Thank you

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