Document directory
-
- How to modify language
- How to remove index. php from the home page and product links
-
- Add ad for left slider
- How to add special category content [you can put it in home page or other pages]
- Use the database method to modify the model
How to modify language
1. Download the Language Pack (app> locale) and replace it
2. log on to the admin Console> Manage stores to create a new store view. [if it is a website with multiple languages, consider]
3. Go to admin panel System> Configuration> general
Then select store view "Chinese" locale options> locale> Chinese [or other languages]
How to remove index. php from the home page and product links
In order to remove the index. php from the URL for the online Magento store you can follow the steps given below: [at the same time, ensure that the. htaccess file configuration under apache]
First Login to Magento backend and navigate to menu System-> Configuration-> Web-> Search Engine Optimization
Set Use Web Server Rewrites to 'yes'
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
How to modify the block position
How to modify the product display on the list page (whether to display in list or in table by default)
In your custom theme open up catalog. xml and find the following line on around line 100:
<Action method = "setdefagrigridperpage"> <limit> 3 </limit> </action>
<Action method = "addPagerLimit"> <mode> grid </mode> <limit> 15 </limit> </action>
<Action method = "addPagerLimit" translate = "label"> <mode> grid </mode> <limit> all </limit> <label> All </label>
</Action>
Add ad for left slider
The callouts are hardcoded in the default layout xml to be files on your server. I think you can change them to be static blocks instead, so you can manipulate them in the admin instead of in the layout files.
Update:
I got my head wrapped around how to do this now.
In the default theme, the catalog. xml file has this for the left callout:
<Reference name = "left">
<Block type = "core/template" name = "left. permanent. callout" template = "callouts/left_col.phtml">
<Action method = "setImgSrc"> <src> images/media/col_left_callout.jpg </src> </action>
<Action method = "setImgAlt" translate = "alt" module = "catalog"> <alt> Our customer service is available 24/7. call us at (800) DEMO-NUMBER. </alt> </action>
<Action method = "setLinkUrl"> <url> checkout/cart </url> </action>
</Block>
</Reference>
I changed it to this: (just use custom block to replace default block)
<Reference name = "left">
<Block type = "cms/block" name = "left. permanent. callout">
<Action method = "setBlockId"> <block_id> left_column_block </block_id> </action>
</Block>
</Reference>
And added a CMS Static Block with an ID of left_column_block. I can put whatever I want in there from the backend (including empty) and it will show in the left column. I did the same thing with the right column, and can add more in strategic places for future editing by the client in the backend. this worked even when I hadn't created the static block yet
Change default currency setting
Selected default display currency is not available in allowed currencies
Solution:
Clear Cache
At the same time, replace the data with Allowed Currencies and other Currencies to include the corresponding currency type.
How to configure multiple website
Change the template layout
Open page. xml file.
<Reference name = "root">
<Action method = "setTemplate"> <template> page/2columns-left.phtml </template> </action>
</Reference>
Remove the default logo [and replace]
1. Go to System | upgrade Aon | Advanced. You shocould see the Disable
Modules output page.
2. Locate the module labeled Mage_Newsleer and/or Mage_Poll, and select Disable.
3. Click on the Save Config button.
How to add special category content [you can put it in home page or other pages]
<Reference name = "content">
<Block type = "catalog/product_list" name = "featured" template = "catalog/product/list. phtml">
<Action method = "setCategoryId"> <category_id> [category id here] </category_id> </action>
</Block>
</Reference>
Development Reference
Database:
Logs and user behavior data occupy a large amount of database disk space.
TRUNCATE table 'Log _ url_info ';
TRUNCATE table 'Log _ url ';
TRUNCATE table 'report _ event ';
TRUNCATE table 'Log _ visitor_info ';
TRUNCATE table 'Log _ visitor ';
TRUNCATE table 'index _ event ';
TRUNCATE table 'report _ viewed_product_index ';
TRUNCATE table 'dataflow _ batch_export ';
TRUNCATE table 'index _ process_event ';
TRUNCATE table 'dataflow _ batch_import ';
Use the database method to modify the model
<? Php
Require_once 'app/Mage. php ';
Mage: app ();
// Instatiate Product
$ Product = Mage: getModel ('catalog/product ');
$ Product-> setWebsiteIds (array (1 ));
$ Product-> setSku ('rand-sku-'. rand ());
$ Product-> setPrice (rand (100,2000 ));
$ Product-> setAttributeSetId (4 );
$ Product-> setCategoryIds (array (3 ));
$ Product-> setType ('simple product ');
$ Product-> setName ('product name'. rand ));
$ Product-> setDescription ('the Product description ');
$ Product-> setincludescription ('Brief description ');
$ Product-> setStatus (1 );
$ Product-> setTaxClassId ('2 ');
$ Product-> setWeight (0 );
$ Product-> setCreatedAt (strtotime ('now '));
/* ADDITIONAL OPTIONS
$ Product-> setCost ();
$ Product-> setInDepth ();
$ Product-> setKeywords ();
*/
$ Product-> save ();
// "Stock Item" still required regardless of whether inventory
// Control is used, or stock item error given at checkout!
$ StockItem = Mage: getModel ('cataloginventory/stock_item ');
$ StockItem-> loadByProduct ($ product-> getId ());
$ StockItem-> setData ('is _ in_stock ', 1 );
$ StockItem-> save ();
Header ("Location:/checkout/cart/add/product/". $ product-> getId ()."/);
?>
Reference: http://blog.chapagain.com.np/magento-how-to-select-insert-update-and-delete-data/
The code reference for Magento
Get the Total Price of items currently in the Cart:
<? Php echo $ this-> helper ('checkout')-> formatPrice (Mage: getSingleton ('checkout/cart')-> getQuote () -> getGrandTotal ();?>