Page 1 of 1

Translation 'cost fee'

PostPosted: Wed May 30, 2018 12:45 pm
by inkoop@.....nl
Behind the shipping and payment method on the OPC page, there is a description and an amount for the cost/fee. Some version before (don't know which extension) this 'cost fee' label was translated correctly. Now it is also translated (in Dutch), but I want to display another text. Some how I can't find the correct .ini file where the translation should be. It looks like it using a other variable now, because my old translation for this label still excist.

I don't know if this is the OPC extension what causes this, or another extension, but maybe you can help me out with this?

Re: Translation 'cost fee'

PostPosted: Thu May 31, 2018 1:42 pm
by loppan
Sounds like a regular Joomla language override, no?

Go to joomla admin / extensions / languages / over rides.

Do you see your own translation in there?

Re: Translation 'cost fee'

PostPosted: Fri Jun 01, 2018 7:03 pm
by inkoop@.....nl
Yes, it was no override, but in de standaard language folder, using variable COM_VIRTUEMART_PLUGIN_COST_DISPLAY.
I thought it was used for something else, because it translated both words 'discount / costs'. It seems to be that only one word of this variable is displayed.

Re: Translation 'cost fee'

PostPosted: Tue Jun 05, 2018 7:49 pm
by admin
hello, maybe you mean this part of VM core file that handles the discount/fee part of the payment/shipping methods:

Code: Select all
if ($pluginSalesPrice) {
         $costDisplay = $currency->priceDisplay( $pluginSalesPrice );
         $t = vmText::_( 'COM_VIRTUEMART_PLUGIN_COST_DISPLAY' );
         if(strpos($t,'/')!==FALSE){
            list($discount, $fee) = explode( '/', vmText::_( 'COM_VIRTUEMART_PLUGIN_COST_DISPLAY' ) );
            if($pluginSalesPrice>=0) {
               $costDisplay = '<span class="'.$this->_type.'_cost fee"> ('.$fee.' '.$costDisplay.")</span>";
            } else if($pluginSalesPrice<0) {
               $costDisplay = trim(strip_tags($costDisplay),'-');
               $costDisplay = '<span class="'.$this->_type.'_cost discount"> ('.$discount.' '.$costDisplay.")</span>";
            }
         } else {
            $costDisplay = '<span class="'.$this->_type.'_cost fee"> ('.$t.' '.$costDisplay.")</span>";
         }
      }



as defined in:
administrator\components\com_virtuemart\plugins\vmpsplugin.php

so per the definition above:
1. if the language string COM_VIRTUEMART_PLUGIN_COST_DISPLAY includes "/" first part will be used as discount text and second part as fee text
2. if there is no "/" it considers it to be just the costs/fee
3. you cannot really get rid of the parenthesis since it's within the VM core file

best regards, stan