app/design/frontend/default/<yourtemplate>/template/checkout/cart/sidebar.phtml
2) Check div :
<code><div></code>
3) Add this php code right before that opening div tag:
$_cartQty1 = $this->getSummaryCount()
if ($_cartQty1 >0):
4) Add this php code to the bottom of the file:
endif
How to Display Currency Switcher Without Using XML File in Magento:
<?php
$currencyBlock = Mage::app()->getLayout()->createBlock('directory/currency');
if($currencyBlock->getCurrencyCount() > 1): ?>
<div>
<label for="custom-currency-selector"><?php echo $this->__('Your Currency:') ?> </label>
<select onchange="window.location.href=this.value" name="custom-currency-selector" id="custom-currency-selector">
<?php foreach ($currencyBlock->getCurrencies() as $_code => $_name): ?>
<option value="<?php echo $currencyBlock->getSwitchCurrencyUrl($_code)?>"
<?php if($_code == $currencyBlock->getCurrentCurrencyCode()): ?>
selected="SELECTED"
<?php endif; ?>>
<?php echo $_code ?>
</option>
<?php endforeach; ?>
</select>
</div>
<?php endif; ?>
And, if you don’t want to use currency code in header.phtml and use it in separate phtml file. Use below code in header.phtml:
<?php echo $this->getLayout()->createBlock('directory/currency')->setTemplate('directory/currency.phtml')->toHtml();?>
Note:
1) Find phtml file here:
app/design/frontend/[Current_Package]/[Current_Theme]/ template/directory/currency.phtml
2) If you still not able to find you can see currency.phtml in here :
app/design/frontend/base/default/template/directory/currency.phtml
How to Add a Contact Form to a Magento CMS Page
Go to your CMS-> Manage pages interface
Input HTML as you normally would on any other page
<!– CONTACT FORM –>
{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}
<!– END OF CONTACT FORM –>
How to Increase the Speed of Magento Website
<ifmodule mod_deflate.c>
# enable apache served files compression
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</ifmodule>
<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>
EXPIRES CACHING
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 1 year"
</IfModule>
EXPIRES CACHING
FileETag none
Header unset Cookie
Header unset Set-Cookie
<FilesMatch "!\.(gif|jpe?g|png)$">
php_value session.cookie_domain example.com
</FilesMatch>
How to Add a Language Pack as a Store View:
Download the language pack you need and then unpack it to your Magento install folder. It copies two folders: one goes toapp\design\frontend\default\default\locale and the other one to app\locale.
Go to System-> Configuration in your admin. On the left top corner in Current Configuration Scope dropdown box, you can see Default Config, and Main Store in English store view.
Add the French store view. Under the dropdown box, there’s Manage Stores link or you can directly go to System -> Manage Stores. Click theCreate Store View link on top right, and type these in store view information form: Store: Main Store
1) Name: French
Code: french
Status: Enabled
Sort order: 0
2) Save, go back to System -> Configuration. In Current Configuration Scope dropdown box, you now see there’s French store view. Click that link.
On Locale options tab on the left, uncheck the “use website” checkbox then change the locale to French (France). Save.
Now you can have your website in French.
We hope, it will help you & contact us if you have any query related to Magento. As well, you can also share your programming tips & tricks here.
Post A Comment