magento操作汇总

怎么去修改语言

1、下载语言包(app > locale)替换
2、登陆admin后 台 > Manage stores ,创建一个新的store view【如果是一个网站多个语言则可以考虑】
3、到admin panel System > Configuration > general
然后选择 store view “Chinese” locale options > locale > Chinese【或者是其它的语言】

怎么移除首页以及商品链接中的index.php

In order to remove the index.php from the URL for the online Magento store you can follow the steps given below: 【同时要保证在apache下,.htaccess的文件配置】


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

如何去修改列表页的产品显示(每行显示多少个,是默认以列表显示还是以表格显示)

In your custom theme open up catalog.xml and find the following line on around line 100:

<action method="setDefaultGridPerPage"><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

解决办法:
将缓存 清空
同时将 数据换成  Allowed Currencies  等一系列的货币要要包含相应的货币类型

how to configuration multiple website

change the template layout  批量的修改商品布局视图

open  page.xml file.

<reference name="root">

            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>

去除默认的logo[并且进行替换]

1. Go to System | Configuraon | Advanced | Advanced. You should 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:

日志以及记录用户行为的数据占用了大量的数据库磁盘空间

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`;

使用数据库的方式来修改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(1,200000));
$product->setDescription('The Product Description');
$product->setShortDescription('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()); ?>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值