Magento yerel baz görüntüyü değiştirmek nasıl?

1 Cevap php

Ben magento arama görüntüyü değiştirmek istiyorum. Magento aramada görüntü adı btn_search.gif olduğunu. Şu anda cilt / frontend / default / default / görüntülerden görüntü almak. Ve dosya olarak bu etiketi söz / app / tasarım / frontend / default / default / template / CatalogSearch / form.mini.phtml olduğunu

<input id="search-button" type="image" src="<?php echo $this->getSkinUrl('images/btn_search.gif') ?>" alt="<?php echo $this->__('Search') ?>" />

Ben kodu kontrol ve ben biz bu _TYPE olarak yerel geçebilir bulundu

<input id="search-button" type="image" src="<?php echo $this->getSkinUrl('images/btn_search.gif', array('_type'=>'local')) ?>" alt="<?php echo $this->__('Search') ?>" />

I kodunu kontrol Ama bu sadece bu dosyayı bu yerel veya değil var olduğunu yerel dizinde kontrol edecektir. Bu o varsa cilt görüntü alacak. Ben yerel resmi yerine bu cilt resim kullanmak istiyorum.

I fransız mağaza tıkladıklarında Yani ben / app / tasarım / frontend / default / default / locale / fr_FR / images / btn_search.gif ayarlanır görüntü almak

I / app / kod / çekirdek / Büyücü / Çekirdek / Model / Tasarım / Package.php yılında getSkinUrl için kodunuzu kontrol edin. Ve ben o dosya için yerel kontrol ancak cilt url dönmek bulundu.

Yerel url dönmek herhangi bir yöntem var mı?

1 Cevap

Ben cevap var

Bu ben magenkarşı ticaret içindeki düğmeleri dili (yerel) bağımlı yapmış nasıl

Ben ana sayfasında mini arama formu ile başladı. Bu form için arama görüntü düğmesi tanımlanır

/ App / tasarım / frontend / / / şablon / CatalogSearch / form.mini.phtml

O dosyada ben aşağıdaki satırı değiştirdim

<input type="image" src="<?php echo $this->getSkinUrl('images/btn_mini_search.gif') ?>" alt="<?php echo $this->__('Search') ?>"/>

karşı

<input type="image" src="<?php echo $this->getSkinUrl('images/btn_mini_search_'.$this->__('_LOCALE_BUTTON_').'.gif') ?>" alt="<?php echo $this->__('Search') ?>"/>

Then I added the translation for _LOCALE_BUTTON_ karşı all the the locale translate.csv files: /app/design/frontend///locale//translate.csv:

I.e. Locale en_GB: _LOCALE_BUTTON_,en_GB Locale nl_NL: _LOCALE_BUTTON_,nl_NL

For each translation make sure you have the locale suffix butkarşın image files available in the /skin/frontend///images/ direckarşıry:

I.e. btn_mini_search_en_GB.gif btn_mini_search_nl_NL.gif

I think you can also make the translation for _LOCALE_BUTTON_ karşı represent a folder by changing the line mentioned above karşı:

<input type="image" src="<?php echo $this->getSkinUrl('images/locale/'.$this->__('_LOCALE_BUTTON_').'/btn_mini_search.gif') ?>" alt="<?php echo $this->__('Search') ?>"/>

but then you need karşı save the locale suffix butkarşın image files like this: /skin/frontend///images/ locale/en_GB/btn_mini_search.gif and /skin/frontend///images/ locale/nl_NL/btn_mini_search.gif

Ben son yöntem kendimi test değil, ama ben bu işe neden herhangi bir neden görmüyorum.

I’ve also been thinking about replacing the _LOCALE_BUTTON_ value with the regular ‘Search’ string (Not recommended!!) The advantage of this method is that you don’t need karşı add seperate translations karşı the translate.csv files but then you run the risk that certain translations can be similar for multiple locales (duplicate keys). Besides that it can lead karşı issues, when non-ascii/utf-8 characters are used in the translations, but that depends on the operating/file system you are using.