Current Version of Codefight CMS Available for Download:

            « Version 1.5.0 »

            NOTE: The code available is same as the code used for this site at the time of release.

            Codefight CMS is based on Codeigniter PHP Framework which is very easy to learn.

            It would be nice to hear back some feedback. Also you can contribute with code and helping translating language files in your language.

            You can use this CMS in anyway you want. You can modify as you like and use commercially for free.

 

 

Select Language.[TESTING For Next Release.]

English | नेपाली | French | German | Korean

Login | Select Language | Thu, 29 Jul 10 17:07:25 -0600

Magento e-Commerce Few Tips, Tricks, Codes and Options

2009-09-26 17:40:39Damodar Bashyal

 

These are the few things i had been documenting while doing projects on Magento E-Commerce Solution. So posted here to find faster when needed. These are just small snippets. Not detailed, easy to understand though (hopefully).

How to insert Url in the CMS pages?

{{store url=''}} will give base|store url

<div class="shop-by-category-top-image"><img src="{{store url=''}}media/shop_by_category.gif" alt="Shop By Category" width="698" height="208" /></div>

How to get item/product counts in cart?

<?php
$_cart = Mage::getModel('checkout/cart'); echo "getItemsQty-" . ($_cart->getItemsQty()); echo "getItemsCount-" . ($_cart->getItemsCount()); echo "getSummaryQty-" . ($_cart->getSummaryQty());
?>

How to load newly created admin theme as it can't be done through admin so far?

Goto: app/code/core/Mage/Adminhtml/Controller/Action.php

//change:
->setTheme((string)Mage::getConfig()->getNode('stores/admin/design/theme/default'));
//to:
->setTheme((string)Mage::getConfig()->getNode('stores/admin/design/theme/NEWLY-CREATED-THEME-NAME'));

How to turn on Developer Path Hints?

Goto Configuration in admin -> Click on advance/developer -> select Template Path Hints 'yes' under debug.

[You need to select store website from dropdown to see this option.]

How to offer more than one currency to customers?

Goto: system -> config -> system -> currency

Make sure default config is selected. To make currency dropdown visible there should be more than one currency and all set with value.

How to add a static block to a CMS page?

First, create your static block.

You will use the identifier to call it on the cms page. Let's say, for this example, we call the identifier 'home_page_text'.

Once your static block is created, edit whatever cms page you would like this block to appear on, and simply put this code in right where you want it to show up:

//NOTE: block_id is static block identifier
{{block type="cms/block" block_id="home_page_text"}}

This is how i use it in one of the site's homepage.

<div class="homepage-top-div">
<div class="content">{{block type="cms/block" block_id="home_page_text"}}
</div>
</div>

And that's all.

How to add WYSIWYG editor to product/category description?

Download files from http://tinymce.moxiecode.com/download.php.
Copy folder "tinymce/jscripts/tiny_mce/" from downloaded and upload to the directory "/js/tiny_mce/".

Product:
Copy "app/design/adminhtml/defaut/default/template/catalog/product/edit.phtml" to your theme "app/design/adminhtml/defaut/YOUR_THEME/template/catalog/product/edit.phtml".

Category:
Copy "app/design/adminhtml/defaut/default/template/catalog/category/edit.phtml" to your theme "app/design/adminhtml/defaut/YOUR_THEME/template/catalog/category/edit.phtml".
And,
Copy "app/design/adminhtml/defaut/default/template/catalog/category/edit/form.phtml" to your theme "app/design/adminhtml/defaut/YOUR_THEME/template/catalog/category/edit/form.phtml".

Insert code somewhere in above pages:

<script language="javascript" type="text/javascript" src="getJsUrl('tiny_mce/tiny_mce.js') ?>"></script>
tinyMCE.init({
//General options
mode : "exact",
theme : "advanced",
elements : "description",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount",
//Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect,|,cite,nonbreaking",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,ltr,rtl,|,fullscreen",
//theme_advanced_buttons4 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin });

To be continued...


Bookmark and Share
 

 





Javascript must be enabled to post comments!