随笔 - 56,  文章 - 267,  评论 - 21,  阅读 - 67万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

 

怎么去修改语言

 

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()); ?>

posted on   myjavawork  阅读(2238)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
点击右上角即可分享
微信分享提示