摘要: 静态块主要是指在后台添加的可用静态块调用方法常见的有如下几种:(这边就不介绍使用widgets 调用的方法了,有兴趣的朋友可以自己在后台widgets中尝试设置)1、直接在HomePage中调用(只限首页):修改layout中的xml代码<reference name=”content”><block type=”cms/block” name=”blockname” before=”-”><action method=”setBlockId”><id>block_id</id></action></block> 阅读全文
posted @ 2012-08-30 17:37 hust_zk 阅读(4315) 评论(0) 推荐(0) 编辑
摘要: 在Magento目录的分类页面里,经常需要左侧导航获取到父分类和子分类,可以用以下方法:打开app/your_package/your_themes/template/catalog/navigation/left.phtml显示父分类的分类名$currentCat = Mage::registry('current_category');//如果是根目录,则显示当前目录if ( $currentCat-&gt;getParentId() == Mage::app()-&gt;getStore()-&gt;getRootCategoryId() )//显 阅读全文
posted @ 2012-08-27 17:53 hust_zk 阅读(588) 评论(0) 推荐(0) 编辑
摘要: By default, the quantity box on the product page is always blank and that is not very user friendly. It would be great if the box would be set to "1" by default .Now this can be done without any programming - only through configuration changes in the backend as follows:Go toAdmin Panel -&g 阅读全文
posted @ 2012-08-27 17:22 hust_zk 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 最开始尝试用.htaccess来解决问题 倒腾了好几回没招了 404 设置参数R=302重定向到动态的url还是正确的哥于是在群里面叫 可以就是没人答复 有回应的就是麦神 木子 都是要钱的主 自己动手 哥是山神后台也可以添加静态化页面 确实但是只是针对固定的url后来看Alan的资料才知道 xml里面也可以添加 他的文章不错 吐血推荐参考:http://alanstorm.com/magento_dispatch_rewrites_intro在search terms页面etc config.xml<global> <rewrite> <namespace_mod 阅读全文
posted @ 2012-08-20 20:45 hust_zk 阅读(2608) 评论(1) 推荐(0) 编辑
摘要: addAttributeToFilter是一个可以在Magento产品集合调用的函数。简言之,它添加到WHERE条件的MySQL查询的一部分用于从数据库中提取的产品集合。$_products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect(array('name', 'product_url', 'small_image'))->addAttributeToFilter('sku', array( 阅读全文
posted @ 2012-08-20 11:08 hust_zk 阅读(2245) 评论(0) 推荐(0) 编辑
摘要: 今天给magento新增了一个Popular Search Term页面,在添加面包屑的时候出现了问题Search Term页面对应的是一个1column.phtml结构 默认的情况下没有加入<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs" />这个块要加的位置也是要注意的 几经试探终于加好在controller的action里面加入 $this->loadLayout(); //这里也要注意放在前面 规则时必须遵守的 va 阅读全文
posted @ 2012-08-17 15:03 hust_zk 阅读(1087) 评论(0) 推荐(0) 编辑
摘要: Magento数据库表结构相当复杂,250多张表包含了非常多的表关联关系,让刚刚接触Magento的开发者来说真的非常头疼。往往是看到一个产品的各种属性分散在非常多的表中,找不到任何办法来取出它们的数据。实际上,国外有一个非常出色的Magento数据库表结构维护社区,从1.3.2.1时代就开始制作并更新Magento数据库表结构,目前已经随官方同步更新到了1.6.1版本。该社区维护的Magento数据库表结构相当出色,可以查看任意一张表的表结构,以及关联表,表外键及SQL代码!如下图所示,通过该工具,可以完全掌握Magento数据库表的关联方式,无论是分类,产品,订单,客户,任意表的关联都不在 阅读全文
posted @ 2012-08-13 16:02 hust_zk 阅读(5237) 评论(0) 推荐(0) 编辑
摘要: 如何修改magento后台密码 如何修改magento后台密码 在数据库执行如下SQL语句: UPDATE admin_user SET password=CONCAT(MD5('zdpassword'), ':zd') WHERE username=‘admin’; 其中,yourpassword 阅读全文
posted @ 2012-08-13 15:52 hust_zk 阅读(3001) 评论(0) 推荐(0) 编辑
摘要: catalog/product调用$product_model = Mage::getModel('catalog/product'); $product = $product_model->load($product_id); //可通过product_id 获取 product_name$product->getName(); $product_url = $product->getUrlModel()->getUrl($product, array('_ignore_category'=>true)); //单个产品的url 阅读全文
posted @ 2012-08-10 10:28 hust_zk 阅读(902) 评论(0) 推荐(0) 编辑
摘要: http://shuimu.js.cn 阅读全文
posted @ 2012-07-19 15:08 hust_zk 阅读(110) 评论(0) 推荐(0) 编辑