WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Final Checkout TXT_BUY showing Country Code
  • Print
Pages: [1]   Go Down

Author Topic: Final Checkout TXT_BUY showing Country Code  (Read 3922 times)

Offline sky writer

  • Posts: 926
Final Checkout TXT_BUY showing Country Code
« on: September 24, 2015, 04:29:32 AM »
When you reach the final checkout page, the button for TXT_BUY does not show what is in the EN.PHP language file "Buy", it shows - "Buy CAD 544.50"
I've searched around the files and I believe this is being populated by/jquery/calc_price.js

My question is, how can I remove the "CAD" country code from this button.  I would like it to just show "Buy 544.50", or even "Buy Now".

Code: [Select]
(function($) {
    $.fn.calcPrice = function() {

        // Get basic price and keep it stored in global var
        if (typeof basic_price === 'undefined') {
            basic_price = container.text().replace(/\D/g, '');
            basic_price = parseFloat(basic_price / 100);
        }
        var price = basic_price;

        // Loop through selected options
        $.each(this, function(key, value) {
            var sel_option = $(value);
            // Split the selected option into attribute / currency / sign / price
            arr = sel_option.text().match(/(.*)([A-Z]{3}) ([+,-]?)(.*)/);

            if (arr) {
                var sign      = arr[3];
                var opt_price = parseFloat(arr[4]);
                // Calculate new price
                if (sign == '+') {
                    price = price + opt_price;
                } else if (sign == '-') {
                    price = price - opt_price;
                } else {
                    price = opt_price;
                }
            }
        });

        // Money number format
        // Adapted from: http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript
        var n = price,
        c = 2,
        d = decimal_sep,
        t = thousands_sep,
        sign = (n < 0) ? '-' : '',
        i = parseInt(n = Math.abs(n).toFixed(c)) + '',
        j = ((j = i.length) > 3) ? j % 3 : 0;

        new_price = sign + (j ? i.substr(0, j) + t : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : '');

        // Refresh item price on page
        container.html(currency + ' ' + new_price);

    };
})(jQuery);
Logged

Offline sky writer

  • Posts: 926
Re: Final Checkout TXT_BUY showing Country Code
« Reply #1 on: September 24, 2015, 04:57:30 AM »
I found it in "/view_summary.php"

Line 850
Code: [Select]
'TXT_BUY'                    =>    $MOD_BAKERY['TXT_BUY'].' '.$setting_shop_currency.' '.$f_order_total
Maybe this will help others.
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Final Checkout TXT_BUY showing Country Code
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2