magento问题集

magento产品页面价格出现2遍

In app\design\frontend\default\default\template\catalog\product\view\type\Simple.phtml
Just change…

<block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml" />

TO

<!-- <block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml" /> -->

注释掉就可以了.

Magento Homepage

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}
<reference name="left">
<block type=" amshopby/catalog_layer_view " name="amshopby.navleft" after="currency" template="catalog/layer/view.phtml"/>
</reference>
{{block type="catalog/product_list" column_count="4" category_id="7" template="catalog/product/list.phtml"}}

The homepage is set from the admin side.
but if you want to add content yo your homepage from the layout files just edit the content of the <cms_index_index>tag in the cms.xml file.

Adding CMS Layout Templates

Demystifying Magento’s Layout XML – Part 1

Magento. Display new products on the home page (XML)
http://www.templatemonster.com/help/magento-display-new-products-on-the-home-page-xml.html

<reference  name="content">
<block  type="catalog/product_new" name="product_new"  template="catalog/product/list.phtml">
<action  method="setColumnCount"><column_count>6</column_count></action>
<action  method="setProductsCount"><count>0</count></action>
</block>
</reference>

如何修改magento默认的产品图片的大小尺寸

第一个地方,产品列表页的产品图片

文件位置:app\design\frontend\default\helloblank\template\catalog\product\list.phtml
在此文件中搜 “resize”,发现有两处,因为列表页有 List 和 Grid 两种显示方式,第一个resize一般是List列表显示中的产品图片,第二个resize一般是 Grid 列表显示中的产品图片。
截取代码片段:

$this->helper(‘catalog/image’)->init($_product, ‘small_image’)->resize(135, 135); ?>” width=”135″ height=”135″

代码分析:
resize(135, 135),就是设置产品图片 尺寸的函数,以像素为单位的。width=”135″ height=”135″就是css的设置。例如,想改成 150像素宽,200像素高。那么代码就改成

$this->helper(‘catalog/image’)->init($_product, ‘small_image’)->resize(150, 200); ?>” width=”150″ height=”200″

第二个地方,产品详细页产品图片

文件位置:app\design\frontend\default\helloblank\template\catalog\product\view\media.phtml
在此文件中搜“resize”。我们会找到两处,第一处是产品大图的,第二个是大图下面小图的。
代码片段截取:

resize(265)
resize(48, 48); ?>” width=”48″ height=”48″

代码分析:
当resize里面只有一个参数的时候就是设置宽和高是一样的。resize(265) 等于resize(265,256)。
这页有大量css的修饰代码,请务必用firebug等工具检查下,最大可以修改到多大
第三个地方,相关产品图片,upsell产品图片,crosssell产品图片

相关产品图片修改文件位置:app\design\frontend\default\helloblank\template\catalog\product\list\related.phtml
upsell产品图片修改文件位置:app\design\frontend\default\helloblank\template\catalog \product\list\upsell.phtml
crosssell产品图片修改文件位置:app\design\frontend\default\helloblank\template\checkout\cart\upsell.phtml
设置图尺寸的函数还是resize()函数,也基本和前面说的是一样的。
第四个地方,页面边栏购物车里产品图片

文件位置:app\design\frontend\default\helloblank\template\checkout\cart\item\default.phtml
基本就这些了,还有别的地方要改的,开启下magento模板路径看下,在哪里,改的方法也一样。最重要的是,要和你的css修饰代码配合好。

Magento如何删除Add to Compare和Add to Wishlist

app/design/frontend/default/yourtheme/template/catalog/product / List.phtml
移除

                    <ul class="add-to-links">
                        <?php if ($this->helper('wishlist')->isAllow()) : ?>
                            <li><a rel="nofollow" href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
                        <?php endif; ?>
                        <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
                            <li><span class="separator">|</span> <a rel="nofollow" href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
                        <?php endif; ?>
                    </ul>

如仅仅需要移除 add to compare.则

<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
                            <li><span class="separator">|</span> <a rel="nofollow" href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
                        <?php endif; ?>

如果你想要清除者两个模块以实现节省那么一点点资源的目的那么可以参照magento官方相关介绍
http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/how_to_remove_add_to_compare

innodb-fix.sql

alter table admin_assert                                engine=innodb;
alter table admin_role                                  engine=innodb; alter table admin_rule engine=innodb;

alter table admin_user engine=innodb; alter table adminnotification_inbox engine=innodb; alter table catalog_category_entity engine=innodb; alter table catalog_category_entity_datetime engine=innodb; alter table catalog_category_entity_decimal engine=innodb; alter table catalog_category_entity_int engine=innodb; alter table catalog_category_entity_text engine=innodb; alter table catalog_category_entity_varchar engine=innodb; alter table catalog_category_product engine=innodb; alter table catalog_category_product_index engine=innodb; alter table catalog_compare_item engine=innodb; alter table catalog_product_bundle_option engine=innodb; alter table catalog_product_bundle_option_link engine=innodb; alter table catalog_product_bundle_option_value engine=innodb; alter table catalog_product_bundle_selection engine=innodb; alter table catalog_product_enabled_index engine=innodb; alter table catalog_product_entity engine=innodb; alter table catalog_product_entity_datetime engine=innodb; alter table catalog_product_entity_decimal engine=innodb; alter table catalog_product_entity_gallery engine=innodb; alter table catalog_product_entity_int engine=innodb; alter table catalog_product_entity_media_gallery engine=innodb; alter table catalog_product_entity_media_gallery_value engine=innodb; alter table catalog_product_entity_text engine=innodb; alter table catalog_product_entity_tier_price engine=innodb; alter table catalog_product_entity_varchar engine=innodb; alter table catalog_product_link engine=innodb; alter table catalog_product_link_attribute engine=innodb; alter table catalog_product_link_attribute_decimal engine=innodb; alter table catalog_product_link_attribute_int engine=innodb; alter table catalog_product_link_attribute_varchar engine=innodb; alter table catalog_product_link_type engine=innodb; alter table catalog_product_option engine=innodb; alter table catalog_product_option_price engine=innodb; alter table catalog_product_option_title engine=innodb; alter table catalog_product_option_type_price engine=innodb; alter table catalog_product_option_type_title engine=innodb; alter table catalog_product_option_type_value engine=innodb; alter table catalog_product_super_attribute engine=innodb; alter table catalog_product_super_attribute_label engine=innodb; alter table catalog_product_super_attribute_pricing engine=innodb; alter table catalog_product_super_link engine=innodb; alter table catalog_product_website engine=innodb; alter table catalogindex_eav engine=innodb; alter table catalogindex_minimal_price engine=innodb; alter table catalogindex_price engine=innodb; alter table cataloginventory_stock engine=innodb; alter table cataloginventory_stock_item engine=innodb; alter table catalogrule engine=innodb; alter table catalogrule_product engine=innodb; alter table catalogrule_product_price engine=innodb; alter table catalogsearch_query engine=innodb; alter table checkout_agreement engine=innodb; alter table checkout_agreement_store engine=innodb; alter table cms_block engine=innodb; alter table cms_block_store engine=innodb; alter table cms_page engine=innodb; alter table cms_page_store engine=innodb; alter table core_config_data engine=

转载于:https://www.cnblogs.com/focai/p/4484792.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值