dotnetrix Posted February 4, 2017 Share Posted February 4, 2017 Hi, I am trying to update a value for a template variable. The {debug} on the domainrenewals.tpl states: $renewals Origin: "Smarty object" Value Array (3) 0 => Array (12) id => "21" domain => "mydomain.com" tld => ".com" status => "Expired" expirydate => "06/09/2016" daysuntilexpiry => -151 beforerenewlimit => false beforerenewlimitdays => 0 ingraceperiod => false pastgraceperiod => true graceperioddays => "30" renewaloptions => Array (1) 0 => Array (2) period => 1 price => WHMCS\View\Formatter\Price Object (0) So, via a hook on ClientAreaPageCart I am trying to update the price value, but cannot get this right: I've tried: $template->assign('price', '285.00'); and also: $return['renewals']['renewaloptions']['price'] = "285.00"; The last one above actually overrides the entire array, but I just want to update the price. Now, the .tpl file itself shows the variable as {$renewaloption.price} Any help appreciated. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 4, 2017 Share Posted February 4, 2017 if it helps, the documentation for the Price Formatter class is available below... http://docs.whmcs.com/classes/7.1/WHMCS/View/Formatter/Price.html 0 Quote Link to comment Share on other sites More sharing options...
dotnetrix Posted February 4, 2017 Author Share Posted February 4, 2017 Thank you for that! I am however looking to only temporarily change the price, if the domain expired more than 30 days ago. Sort of a Redemption Fee hook. The Price Formatter class appears to allow for permanent updating of the price field of the domain/s. 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.