cluster Posted January 26, 2021 Share Posted January 26, 2021 I show all prices including VAT (company country) ... how can I get it work in the TPL files domainregister.tpl, domaintransfer.tpl to show the gross price instead of the net price? 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted January 27, 2021 Author Share Posted January 27, 2021 that worked in my old domainregister.tpl <span class="pricing">{math equation="netprice + netprice * percentage / 100" netprice=$tldpricing.{$tld->tld}.register|replace:' EUR':'' percentage=17 format="%.2f"}</span> it seems variable for $tldpricing is no longer compatible w/ 8.1 any idea what variable works in v 8 standard-card? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 27, 2021 Share Posted January 27, 2021 you shouldn't need to use math equation in Smarty3 - once you make it a number, you should be able to perform calculations on it directly... e.g in the pricing table... {(((current($price.register)|replace:',':'.')*1.17)|number_format:2)} .... would take the registration price for a TLD, multiply it by 1.17 (add 17%) and set it to 2 decimal places... I supposed you might then need to add the currency prefix/suffix vack to the output. 1 Quote Link to comment Share on other sites More sharing options...
cluster Posted January 27, 2021 Author Share Posted January 27, 2021 (edited) thank you brian! it seems $price.register variable are ignored in .tpl file {((current($price.register)))} no output, I use own pricing - not connected to an external provider Edited January 27, 2021 by cluster 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 27, 2021 Share Posted January 27, 2021 2 hours ago, cluster said: it seems $price.register variable are ignored in .tpl file it was taken from the v8.1 version of standard_cart/domainregister.tpl, so it definitely works if you're inside the pricing table loop. 2 hours ago, cluster said: no output, I use own pricing - not connected to an external provider you mean pricing within WHMCS? so does the above page... the problem I had was I didn't recognise where <span class="pricing"> is used (because it's not in v8.1 - or 8 or v7.10 I think - so I wasn't sure how far you were going back or whether you were talking about the pricing table, or when it returns a price after a search? just checked and $tldpricing doesn't exist... perhaps open a {debug} in the template to see what's available. 1 Quote Link to comment Share on other sites More sharing options...
cluster Posted January 28, 2021 Author Share Posted January 28, 2021 ok, if I replace the <span class="price"> part with: {(((current($price.register)|replace:',':'.')*1.17)|number_format:2)} it shows the price as 0.00 could this be caused when two currencies are activated? I use EUR as main currency & suffix second currency is $ but only used in whmcs backend for marketplace, in my frontend only EUR is shown. 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted January 28, 2021 Author Share Posted January 28, 2021 in debug the variable is displayed as: $pricing $pricing currency => Array (6) id => 1 code => "EUR" prefix => "" suffix => " EUR" so at least the net price should be displayed with following, but it doesn't {((current($pricing.register)))} 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 28, 2021 Share Posted January 28, 2021 are we in the pricing table? 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted January 28, 2021 Author Share Posted January 28, 2021 11 minutes ago, brian! said: are we in the pricing table? both, in search result part & suggestions part <div id="DomainSearchResults" class="w-hidden"> ... <p class="domain-price"> <span class="price">{((current($pricing.register)))}</span> <button class="btn btn-primary btn-add-to-cart" data-whois="0" data-domain=""> <span class="to-add">{$LANG.addtocart}</span> <span class="loading"> ### <div id="domainSuggestions" class="domain-lookup-result list-group w-hidden"> ... <span class="price">{(((current($pricing.register)|replace:',':'.')*1.17)|number_format:2)}</span> <button type="button" class="btn btn-add-to-cart" data-whois="1" data-domain=""> <span class="to-add">{$LANG.addtocart}</span> <span class="loading"> <i class="fas fa-spinner fa-spin"></i> {lang key='loading'} </span> 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted January 28, 2021 Author Share Posted January 28, 2021 can it be added into the jQuery part from scripts.js? // primary lookup handler lookup.done(function (data) { jQuery.each(data.result, function(index, domain) { var pricing = null, result = jQuery('#primaryLookupResult'), available = result.find('.domain-available'), availablePrice = result.find('.domain-price'), unavailable = result.find('.domain-unavailable'), invalid= result.find('.domain-invalid'), contactSupport = result.find('.domain-contact-support'), resultDomain = jQuery('#resultDomain'), resultDomainPricing = jQuery('#resultDomainPricingTerm'), error = result.find('.domain-error'); result.show(); jQuery('.domain-lookup-primary-loader').hide(); if (typeof domain !== 'string' && !domain.error && domain.isValidDomain) { error.hide(); pricing = domain.pricing; if (domain.isAvailable && typeof pricing !== 'string') { if (domain.domainName !== domain.idnDomainName && idnLanguage.not(':visible')) { idnLanguage.slideDown(); } if (domain.preferredTLDNotAvailable) { unavailable.show().find('strong').html(domain.originalUnavailableDomain); } 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.