Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Apr 2011
    Posts
    9
    Plugin Contributions
    0

    Default Can't control wording for sub-total in admin

    I have a really tricky problem (I think):

    I want to change the wording for the sub-total from "Total" to "Total (incl VAT)" to make it clearer. And I already found how to do that for the cart and checkout (in ot_subtotal.php, the line with MODULE_ORDER_TOTAL_SUBTOTAL_TITLE).

    But this does not affect what is seen inside the admin part (orders)! And this wouldn't be a problem if only I saw it, but when I create invoices, it is the same.

    Normally these kinds of changes are rather easy in zc: Just search for the word "Total" in all php files, and change it at the right place. But I did that search, and I could not find it.

    I should mention that I in general try to keep two languages working (English and Swedish), even though I don't really use English (yet), and for the admin parts I have often been lazy and created a file in the Swedish dept. by just copying the English one and let it be in English.

    The weirdest thing is that some texts in the order total (and thus also in the invoice) are always in Swedish (right click to see it bigger; "Summa" means "Total" in Swedish):

    Name:  Invoice_Swe_eng_mix.jpg
Views: 749
Size:  16.8 KB

    This is a snapshot of an English image, and it shows that the words for Sub-total, Shipping, VAT and total (below the products table) and the payment method (above the table) are in Swedish. This is in itself no problem as long as I just send Swedish invoices, but it reveals that I have no control over the words used in these 5 places in the invoice.

    How can this be?! It seems to be all things related to the modules ordertotal and shipping (i e basically everything that is controlled from the "modules" dropdown menu in the admin panel).

    I assume the code for this must be in /zcadmin, and most likely in the orders.php (or maybe in order.php, which I think is called by orders.php and invoice.php etc)? I have looked over these and can't make it work.

    /zcadmin/includes/languages/swedish/orders.php is an example of a file where the Swedish "translation" is just a copy of the English one (i e the files are identical and in English, but both exist, and are basically the original English zc v1.3.9h files with some small edits).

    And a final weirdity is that the mentioned orders.php has entries for all the things you see when you pres the "edit" button for an order, and if I e g change the text for TABLE_HEADING_PRICE_EXCLUDING_TAX, I can change the words used in that heading, as one would expect, but what is written for e g ENTRY_SUB_TOTAL and ENTRY_TOTAL (which I would suspect should change the words used for sub-total) is ignored.

    And the word "Totalsumma" (the Swedish word for "Total" that you can see in the image and that insists on being used no matter what) is found only in one file: ot_total.php (which has no effect on the invoice etc, and this file also isn't in the zcadmin part, which I would expect if it were the file I'm after).

    The phrase ENTRY_SUB_TOTAL exists only in the "php files with text definitions" (orders.php, invoice.php and some backup file), not in any php file with code in it. This to me indicates something is wrong with the code, and my best guess the code of orders.php (or order.php), that some lines are missing there?


  2. #2
    Join Date
    Apr 2011
    Posts
    9
    Plugin Contributions
    0

    Default Re: Can't control wording for sub-total in admin

    No one?

    I have now at least identified which part of the code that generates that small table of 4 rows (From "Summa" to "Totalsumma"), found in orders.php but it is (more or less) identical in invoice.php:

    Code:
        for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
          echo '              <tr>' . "\n" .
               '                <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Text">' . $order->totals[$i]['title'] . '</td>' . "\n" .
               '                <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" .
               '              </tr>' . "\n";
        }
    I understand it gets the info from a 2x4 matrix called "order" or "totals" but I don't know enough php code to easily find out where the info is put into this matrix. I don't know what the symbol "->" means but I'm guessing it fetches the "totals" part of a structure called "order" perhaps. Anyway, searching through all php files for the phrases "totals" or "$order" gives too many hits. I could need some help..

  3. #3
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Can't control wording for sub-total in admin

    In /includes/languages/english.php
    the text total is defined and you probably have a swedish.php
    Code:
    define('TABLE_HEADING_TOTAL', 'Total');
    Use dev took kit

    https://www.zen-cart.com/tutorials/index.php?article=38
    https://www.zen-cart.com/tutorials/index.php?article=39
    Zen-Venom Get Bitten

 

 

Similar Threads

  1. v139h Can't Find Sub-Total Display
    By voltar in forum General Questions
    Replies: 2
    Last Post: 6 Jul 2012, 01:18 PM
  2. Can I Add shipping to sub Total BEFORE adding Tax?
    By iantopanto in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 1
    Last Post: 3 May 2008, 12:12 PM
  3. How can sub-total include shipping??
    By Kitiarachan in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 4
    Last Post: 6 Nov 2007, 03:48 PM
  4. Changing the sub-total wording depending on tax
    By Ryk in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 24 Aug 2007, 12:46 PM
  5. Translating Sub-Total for emails
    By ellivir in forum Addon Language Packs
    Replies: 3
    Last Post: 6 Nov 2006, 09:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg