Topmagento.com|Magento技术交流站

栏目:magento疑难解答      723 views

上次发现一个插件不支持多店,很郁闷,现在解决了~哈哈开心! 本来在magento网店中装了个产品页估算运费的插件,这个插件是免费的,官方安装地址是 http://www.magentocommerce.com/magento-connect/EcomDev/extension/3860/ecomdev_productpageshipping 开发插件作者早在去年就停止更新了,上次在多店面里面使用该插件结果报下面错误: ?View Code PHP1 Fatal error: require_once() [function.require]: Failed opening required ‘app/code/core/Mage/Catalog/controllers/ProductController.php’ (include_path=’/home/wines2bu/public_html/app/code/local:/home/wines2bu/public_html/app/code/community:/home/wines2bu/public_html/app/code/core:/home/wines2bu/public_html/lib:.:/usr/lib/php’) in /home/wines2bu/public_html/app/code/community/EcomDev/ProductPageShipping/controllers/EstimateController.php on line 59 解决此错误的方法是: 1.打开app/code/community/EcomDev/ProductPageShipping/controllers/EstimateController.php 2.找到 ?View Code PHP1 require_once ‘app/code/core/Mage/Catalog/controllers/ProductController.php’; 修改成 ?View Code PHP1 require_once BP . DS . ‘app/code/core/Mage/Catalog/controllers/ProductController.php’; 3.刷新缓存OK.

栏目:magento疑难解答      1,093 views

magento店面基本都已经完工了,最近有客户问我们说他们在登录账户后,里面看不到他们的订单,起初以为是paypal接口的问题,因为问这些问题的客户大多数是通过paypal付款的,用信用卡付款的客户前台账户里面都可以看到。 于是用自己帐号测试,结果发现跳转到paypal网站进行付款的时候,订单状态为”Pending Payment”,若点击取消付款,订单状态就变成了”cancel”,若paypal IPN 即时信息通知没有填写正确,即便客户付款成功,返回的订单状态仍然是”Pending Payment”,只有填写了正确的IPN地址,订单状态才能自动切换成”Processing”。 下面问题来了,订单状态为”Processing”和”cancel” 的订单在客户账户”My orders”链接里面都可以看到,唯有订单状态为”Pending Payment” 的订单看不到,于是我猜想:是不是在magento里面默认不显示订单状态为”Pending Payment”的订单呢? 结果找到app/code/core/Mage/Sales/etc/config.xml 该文件,打开第564行找到Pending Payment,在结束标签前加上<visible_on_front />,如下: ?View Code XML1 2 3 4 5 6 7 <pending_payment translate="label"> <label>Pending Payment</label> <statuses> <pending_payment default="1"/> </statuses> <visible_on_front /> </pending_payment> 保存后上传,在后台刷新缓存,结果再去测试一个订单,意料之中的事发生了,事实证明了我上面的猜想。呵呵…收工!

栏目:magento疑难解答      1,709 views

magento默认标签地址是http://yourdomai.com/tag/list/ ,显示所有标签的集合,点击任意标签出现标签的搜索结果:/tag/product/list/tagId/xx/”,页面标题为“Products tagged with ‘xxxxx’ “ ,这个搜索页面在magento里默认是三栏布局,如何修改成自己想要的布局呢?下面以两栏带左侧栏为例: 1.打开tag.xml文件编辑,位置为app/design/frontend/base/default/layout/tag.xml 2.搜索“tag_product_list” ,在次块里面加入下面代码: ?View Code XML1 2 3 <reference name="root"> <action method="setTemplate"><template>page/2columns-left.phtml</template></action> </reference> 类似这样: ?View Code XML1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <tag_product_list translate="label"> <label>Tagged Products List</label> <reference name="root"> <action method="setTemplate"><template>page/2columns-left.phtml</template></action> </reference> <!– Mage_Tag –> <reference name="content"> <block type="tag/product_result" [...]

栏目:magento疑难解答      1,800 views

在magento里面相关产品(Related Products),推荐销售产品(Up-sells Products),交叉销售产品(Cross-sells Products)都是在后台手动设置的,这篇文章教大家如何随即显示magento Up-sells 产品,修改后的结果是magento的推荐产品里面随即显示当前目录下产品,这样节省了一大笔时间。当然,修改相关产品和推荐产品的方法也是一样。 1.首先找到对应模板下的upsell.phtml文件,app/design/frontend/default/yourthemes/template/catalog/product/list/upsell.phtml 2.打开编辑,用下面代码替换掉原来的内容: ?View Code PHP1 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 [...]

栏目:magento模板美工 , magento疑难解答      1,445 views

magento模板升级其实很简单,网上有很多种方法,这里就不多说了,上次把magento1.4模板升级到1.5.0.1版本,结果在订单购买结账页面的最后一步找不到”Place Order”按钮了,因此无法完成订单,找了下gg,解决方法如下: 1.打开主题下的checkout.xml文件,具体路径 /app/design/frontend/default/yourtheme/layout/checkout.xml 2.搜索”One page checkout order review block”,大概370行处,把下列代码加入到此block中: ?View Code XML1 <block type="core/template" name="checkout.onepage.review.button" as="button" template="checkout/onepage/review/button.phtml"/> 类似这样: ?View Code XML1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 <!– One page checkout order review block –>   <checkout_onepage_review> <!– Mage_Checkout –> <remove name="right"/> <remove [...]

栏目:magento新手问题 , magento疑难解答      1,462 views

Magento的布局文件一般在用的就4个,1column.phtml,2columns-left.phtml,2columns- right.phtml,3columns.phtml.今天magento互助群里有人问是不是可以弄4列的。那样就需要自己增加布局文件了。里面具体怎么布,就看你的需求了。我这里讲下如何增加magento布局文件 一、在目录app/design/frontend/default/yourtheme/template/page/ 下新建一个布局文件cmscolumn.phtml。 二、在app/design/frontend/default/yourtheme/template/layout/page.xml 中”Custom page layout handles”标签里加以下代码,其中有其他布局文件的写法,可以仿照。 ?View Code XML1 2 3 4 5 6 7 8 <page_cms_columns translate="label"> <label>All cms-Column Layout Pages</label> <reference name="root"> <action method="setTemplate"><template>page/cmscolumn.phtml</template></action> <!– Mark root page block that template is applied –> <action method="setIsHandle"><applied>1</applied></action> </reference> </page_cms_columns> 三、在app/code/core/Mage/Page/etc/config.xml中47行”layouts”标签里加入以下代码,同样有其他布局文件的写法,可参考 ?View Code XML1 2 3 4 5 <cms_columns module="page" translate="label"> <label>cms [...]

栏目:Magento 教程 , magento疑难解答      1,108 views

在magento里面我们定义多种运费方式,必须使用magento的”table rate”运费方式,在运费表里面”Country”必须填写各个国家代号,但这里并不完全是国家名称的缩写,下面先列出magneto里面”Specific Countries” 国家的两个字母的代号: AF – Afghanistan AL – Albania DZ – Algeria AS – American Samoa AD – Andorra AO – Angola AI – Anguilla AQ – Antarctica AG – Antigua and Barbuda AR – Argentina AM – Armenia AW – Aruba AU – Australia AT – Austria AZ – Azerbaijan BS – Bahamas [...]

栏目:magento新手问题 , magento疑难解答      1,830 views

在magento里面,magento产品评论默认是需后台审核才能在前台显示的,下面教你把它改成自动显示。首先找到app/code/core/Mage/Review/controllers/ProductController.php 打开编辑171行,把”STATUS_PENDING”替换成”STATUS_APPROVED”: ?View Code PHP1 2 3 4 5 6 7 $review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE)) ->setEntityPkValue($product->getId()) ->setStatusId(Mage_Review_Model_Review::STATUS_APPROVED) ->setCustomerId(Mage::getSingleton(’customer/session’)->getCustomerId()) ->setStoreId(Mage::app()->getStore()->getId()) ->setStores(array(Mage::app()->getStore()->getId())) ->save();

栏目:magento疑难解答      1,330 views

大家都知道magento里面头部的My Account,Log In,My Wishlist几个链接都是通过xml布局文件进行调用的,为了SEO分配权重必须为它们加上”nofollow”属性,但它的链接标签并不是普通的标签,所以想加nofollow属性就有点难度了。下面是我的方法: 首先找到对应模板下的customer.xml 文件,默认位置是app/design/frontend/base/default/layout/customer.xml 打开编辑,例如要给”My Account”链接加”nofollow”属性, 搜索”My Account” ,然后把”rel=”nofollow”” 放在结束标签后面就解决了。完整代码如下: ?View Code PHP1 2 3 <reference name="top.links"> <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare /><urlparams /><position>100</position><null /><aparams>rel="nofollow"</aparams></action> </reference>

栏目:magento新手问题 , magento疑难解答      1,337 views

默认magento模板头部都会有My Account,Log In,My Wishlist 这几个链接,下面是去掉这几个链接的方法: 1.首先找到对应模板下的customer.xml 文件,默认位置是app/design/frontend/base/default/layout/customer.xml 打开编辑,搜索”My Account” ,去掉那行代码或者用注释符号来注释掉,代码如下: ?View Code PHP1 2 3 <reference name="top.links"> <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare /><urlparams /><position>100</position></action> </reference> 2.去掉”Log In” 链接的方法和去掉”My Account” 链接的方法一模一样,这里不多说了。 3.去掉”My Wishlist”链接你必须先找到相同目录下的wishlist.xml 文件并打开编辑,同样找到My Wishlist 所在的那段代码去掉它或者把它注释掉,代码如下: ?View Code PHP1 2 3 4 5 <reference name="top.links"> <block type="wishlist/links" name="wishlist_link"> <action method="addWishlistLink"></action> </block> </reference>