Current Version of Codefight CMS Available for Download:

            « Version 1.1.4 »

            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 | Wed, 10 Mar 10 12:18:57 -0700

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?

CODE:

1-
2-{{store url=''}} will give base|store url
3-</p>
4-<!-- pagebreak -->
5-<div class=“shop-by-category-top-image“>
6- <img src=“{{store url=''}}media/shop_by_category.gif“ mce_src=“{{store url=''}}media/shop_by_category.gif“ alt=“Shop By Category“ height=“208“ width=“698“></div>
7- <div class=“shop-by-category-categories“></div><p>
8-

How to get item/product counts in cart?

CODE:

1-
2-$_cart = Mage::getModel('checkout/cart');
3-
4-echo“getItemsQty-“ . ($_cart->getItemsQty());
5-echo“getItemsCount-“ . ($_cart->getItemsCount());
6-echo“getSummaryQty-“ . ($_cart->getSummaryQty());
7-

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

And change:

CODE:

1-
2-->setTheme((string)Mage::getConfig()->getNode('stores/admin/design/theme/default'));
3-TO:
4-->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:

CODE:

1-
2-//NOTE: block_id is static block identifier
3-{{block type=“cms/block“ block_id=“home_page_text“}}

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

CODE:

1-</p><div class=“homepage-top-div“>
2-<div class=“mermaid“></div>
3-<div class=“content“>
4-{{block type=“cms/block“ block_id=“home_page_text“}}
5-</div>
6-</div><p>
7-

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:

CODE:

1-
2-
3-< script language=“javascript“ type=“text/javascript“ src=“getJsUrl('tiny_mce/tiny_mce.js') ?>“>< /script>
4-tinyMCE.init({
5-// General options
6- mode : “exact“,
7- theme : “advanced“,
8- elements : “description“,
9-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“,
10-// Theme options
11- theme_advanced_buttons1 : “bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect,|,cite,nonbreaking“,
12- 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“,
13- theme_advanced_buttons3 : “tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,ltr,rtl,|,fullscreen“,
14-//theme_advanced_buttons4 : ““,
15- theme_advanced_toolbar_location : “top“,
16- theme_advanced_toolbar_align : “left“,
17- theme_advanced_statusbar_location : “bottom“,
18- theme_advanced_resizing : true,
19-// Example content CSS (should be your site CSS)

20- content_css : “css/content.css“,
21-// Drop lists for link/image/media/template dialogs
22- template_external_list_url : “lists/template_list.js“,
23- external_link_list_url : “lists/link_list.js“,
24- external_image_list_url : “lists/image_list.js“,
25- media_external_list_url : “lists/media_list.js“,
26-// Replace values for the template plugin
27-});
28-

To be continued...


Bookmark and Share
 

 





Javascript must be enabled to post comments!