I've read a lot about countrycodes in Magento, but now my question is; where can I find country numbers in Magento? Does this exist? I'm no programmer so I can not edit some code.
We recieved an order from Austria, but somehow Magento sends the number "00" (Holland) to our server where this must be "14" (Austria) as shipping code.
The package was returned to us because this address did not (of course) exist in Holland.
Magento returns standard country codes. You can find the list here;
http://dev.maxmind.com/geoip/legacy/codes/iso3166/
In any of your template files you can echo the current stores country code with this;
$countryCode = Mage::getStoreConfig('general/country/default');
echo $countryCode;
I'd like to be able to set a discount code which is only applied to full price items - eg not special prices items. Is this possible? Or is there an extension that does this?
Found this answer on the Magento forum:
In Promotions > Shopping cart price rules > Actions
Make the condition
If ALL of these conditions are TRUE :
to
If ALL of these conditions are FALSE :
Then
Special Price equals or greater than 0
http://www.magentocommerce.com/boards/viewthread/20641/
The only problem now, is that the cart error message is confusing - the default message is Coupon code “%s” is not valid. (%s replaces the coupon code).
In order to change this, edit the Mage_Checkout.csv language file (app/local/{lang_ISO}) and change the translation to this message to whatever you want.
http://www.magentocommerce.com/boards/viewthread/290271/
I need to change Magento's default decimal format. I mean, when I save '1' to a decimal field, it becomes '10000.0000' with this '.0000' in the end.
I need to change it to another format, which uses ',' instead of '.' to separate decimal (and currency) numbers.
This is the Brazilian standard and it's not being used even after changing the store language. This change should be reflected mainly in the admin side.
Thanks a lot!
==Edited==
I haven't solved the problem yet. I'm using PT-BR (Brazilian Portuguese) as default language and it still using the wrong decimal character.
It seems Magento have some not-localized price formatting (I mean, hard-coded) in a few points of code. For example: magento\js\prototype\validation.js at line 426 have:
|| (!isNaN(parseNumber(v)) && /^\s*-?\d*(\,\d*)?\s*$/.test(v));
but instead it needs to be
|| (!isNaN(parseNumber(v)) && /^\s*-?\d*(\,\d*)?\s*$/.test(v));
to fit into PT-BR format (or other locales to).
Am I right? Does anybody could fix this issue?
if you want to check in admin area for this change
you go to in admin left bottom drop down
and select
Português (Portugal) / português (Portugal)
it will show you currency as you want. Also if you doesn't install you package go to
http://www.magentocommerce.com/translations/list/19
download your package and add it to your
locale folder and select from configuration for front end also
hope this will sure help you.
I've applied the following change to the file magento\js\prototype\validation.js (line 426):
|| (!isNaN(parseNumber(v)) && /^\s*-?\d*(\,\d*)?\s*$/.test(v));
and also, changed the file lib/Varien/Data/Form/Element/Abstract.php by adding the first if statement:
public function getEscapedValue($index=null)
{
$value = $this->getValue($index);
if(is_numeric($value)){
$value= number_format($value, 3, ",", ".");
}
...
this changes have solved the problem so far. Do you see any side-effect?
Comments are welcome! Thanks!
Newer versions of Magento are based on Zend Framework currency locale format so the best way to do this is to change the language.xml from the Zend directory, more information is on this great article.
We have a special couponcode 10% off, 3 monhts valid.
Now the 10% goes to charity. And we use the couponcode to identify that it is in fact for charity BUT alas someone has thought up that everybody can decide for themselves which chairt it is. So ....
We need a couponcode that works (check!)
But when entered somewhere there should be an extra box asking for the "charity name"
Options I can think off is directly at coupon input, or add addressfiled (but only when coupon)
Anyone know how to do this easily? or with sme code?
Just create a coupon code for each charity and replace the coupon entrance input with a select box that lists your codes or make a additional select-box that pre-fills the coupon field with right code ?
In the Magento default theme's cart page we see the following totals box towards the right mid of the screen:
I want to modify the labels of the 5 fields in the above box, and I have been able to change the Grand Totals, by overriding the following design file:
/html/app/design/frontend/default/mine/template/tax/checkout/grandtotal.phtml
So, now it looks like this:
My Problem is to:
Change the labels for other 3 fields in the box, and the label of a discount box that appears there if a discount applies. I have spent some time grepping through other design files, but couldn't find any. It might be some classes to override, but I haven't been able to locate them either.
I am using Magento 1.4.1.1
UPDATE 1: After turning on template path hints, following are template paths for
Cart
Subtotal:
app/design/frontend//tax/checkout/subtotal.phtml
Total:
app/design/frontend//checkout/total/default.phtml
GrandTotal:
app/design/frontend//tax/checkout/grandtotal.phtml
Tax:
app/design/frontend//tax/checkout/tax.phtml
Checkout
Same as for cart and the following additional one for
Shipping: app/design/frontend//tax/checkout/shipping.phtml
But when one goes into these template files, no labels are found except in grandtotal.phtml.
I found the solution to the problem, which I have mentioned in my own answer.
This question originally asked for help on two separate problems. I posted the other one later as another question.
Why don't you change the labels with inline translator or in locale files?
grep 'Grand Total' app/locale/ -rsn
app/locale/en_US/Mage_Tax.csv:55:"Grand Total (Excl. Tax)","Grand Total (Excl. Tax)"
app/locale/en_US/Mage_Tax.csv:56:"Grand Total (Excl.Tax)","Grand Total (Excl.Tax)"
app/locale/en_US/Mage_Tax.csv:57:"Grand Total (Incl. Tax)","Grand Total (Incl. Tax)"
app/locale/en_US/Mage_Tax.csv:58:"Grand Total (Incl.Tax)","Grand Total (Incl.Tax)"
app/locale/en_US/Mage_Tax.csv:59:"Grand Total Excl. Tax","Grand Total Excl. Tax"
app/locale/en_US/Mage_Tax.csv:60:"Grand Total Incl. Tax","Grand Total Incl. Tax"
app/locale/en_US/Mage_Tax.csv:66:"Include Tax In Grand Total","Include Tax In Grand Total"
app/locale/en_US/Mage_Rss.csv:22:"Grand Total","Grand Total"
app/locale/en_US/Mage_Adminhtml.csv:366:"Grand Total","Grand Total"
app/locale/en_US/Mage_Customer.csv:146:"Grand Total","Grand Total"
app/locale/en_US/Mage_Sales.csv:216:"Grand Total","Grand Total"
app/locale/en_US/Mage_Sales.csv:217:"Grand Total to be Charged","Grand Total to be Charged"
app/locale/en_US/Mage_Sales.csv:373:"Order Grand Total","Order Grand Total"
app/locale/en_US/Mage_Checkout.csv:104:"Grand Total:","Grand Total:"
or get the templates where this string is used:
grep "__('Grand Total" app/design/ -rsn
Answer to Problem 1:
The solution is to override the
function:
fetch(Mage_Sales_Model_Quote_Address $address)
in: code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php
Similarly the files Tax and Subtotal in the same folder should be edited for desired results.
The solution is a modification of a solution on the Magento community forum
I know this thread is a little old but i recently had to solve this problem my self. The easiest solution for my needs was to rewrite the Mage_Checkout_Block_Cart_Totals class and override the renderTotals function. It ended up looking something like this:
public function renderTotals($area = null, $colspan = 1)
{
return $this->_replaceLabels(parent::renderTotals($area, $colspan));
}
protected function _replaceLabels($html){
$labelMap = array();
$labelMap['Subtotal'] = "Product Total";
$labelMap['Grand Total'] = "Order Total";
$labelMap["Shipping & Handling"] = "Shipping";
foreach($labelMap as $key => $value){
$html = str_replace($key, $value,$html) ;
}
return $html;
}
There might be cleaner ways to do this, but this was the fastest for me.
I'd start by flipping on template path hints. That will give you a starting point as to which template is rendering which sections of the final HTML. From there you can view the template, and see where the phtml template (or its parent block) is pulling the text from.
Surely the quickest and safest way must be to use inline translation.
If your requirement is to only change the labels than you can change it from "locale". If your store locale is "United States" for example than go to "app/locale/en_US/Mage_Tax.csv", search for the text you want to change. For example: If you want to change the label "Tax" to "VAT", then search for Tax and then replace it with "VAT". IN this way you can easily change your labels. If you have your store setup for Australia,in the locale folder create a folder named "en_AU", copy Mage_Tax.csv to that folder and make the change mentioned above. This will solve your problem.