插件说明:安装插件后,会自动导入中国的省,支持中英文。
安装说明见插件内说明文件。
大家好我是钥匙,欢迎大家来到我的博客学习magento的使用与开发。
推荐:http://www.mage-world.com/magento-store-credit-extension.html
账户余额,账户充值,类似的Magento插件google下”magento credit”可以找到好几个,大家可以试下哪一个适合自己。
这类插件的基本功能是,可以给账户充值,可以使用充值后的金额购买商品(如上图,在购物车结算的时候使用),可以送一定的金额给客户,可以查看账户充值的金额,消费历史记录等等。
插件地址:http://www.magentocommerce.com/magento-connect/order-delivery-date-7864.html
此插件可以让顾客自己设置快递配送时间,方便客户安排人收货。
这个插件对于那些用不靠谱快递公司的人来说,没有什么用,因为快递哪一天到,快递公司自己都不知道。但是对于一些同城的服务,这个插件还是有用的,比如卖花,顾客定了,肯定是要选个送花的日期的,这样的情况是很有用的。此插件还有订单留言,方便客户针对订单留言,比如礼物卡片些什么等等做些备注。
Magento结账流程对于很多人来说,无法接受,因为步骤太多了。一页结账这个插件市面上有很多,现在更多了,每个都不同。现在推荐这个免费的,大家可以在自己的测试站上试下,地址:http://www.magentocommerce.com/magento-connect/iwd-free-one-page-one-step-checkout.html,有demo。
如果满意就可以用下,不满意直接google “magento onepage checkout”看下其它的。
插件有两种,一种是可以解决你问题的,一种是不能帮你解决问题的。
最近使用了magento的商品品牌插件,需要在此插件的数据库表中添加几个字段。
首先需要修改插件的版本号,以便magento发现插件版本升级了,运行升级脚本。
版本号在插件的ect/config.xml文件中,sql脚本示例mysql4-upgrade-0.1.0-0.1.1.php如下
<?php $installer = $this; $installer->startSetup(); $installer->getConnection()->addColumn( $installer->getTable('brand'), 'country', "varchar(255) NULL" ); $installer->getConnection()->addColumn( $installer->getTable('brand'), 'role', "varchar(255) NULL" ); $installer->endSetup();
最新写个magento获取评价的插件,获取全部评价的代码分享下。
如下代码片段如下,仅供参考:
Block中的代码如下
class Hellokeykey_Allreviews_Block_Allreviews extends Mage_Core_Block_Template { protected $_collection; protected function _construct() { $this->_collection = Mage::getModel('review/review')->getProductCollection(); $this->_collection ->addStoreFilter(Mage::app()->getStore()->getId()) //->addCustomerFilter(Mage::getSingleton('customer/session')->getCustomerId()) ->addStatusFilter(1) //const STATUS_APPROVED = 1; ->setDateOrder(); } // add by lee public function getReviewsSummaryHtml(Mage_Catalog_Model_Product $product, $templateType = false, $displayIfNoReviews = false) { return $this->getLayout()->createBlock('rating/entity_detailed') ->setEntityId($this->getProduct()->getId()) ->toHtml() . $this->getLayout()->getBlock('product_review_list.count') ->assign('count', $this->getReviewsCollection()->getSize()) ->toHtml() ; } /** * Gets collection items count * * @return int */ public function count() { return $this->_collection->getSize(); } /** * Get html code for toolbar * * @return string */ public function getToolbarHtml() { return $this->getChildHtml('toolbar'); } /** * Initializes toolbar * * @return Mage_Core_Block_Abstract */ protected function _prepareLayout() { $toolbar = $this->getLayout()->createBlock('page/html_pager', 'customer_review_list.toolbar') ->setCollection($this->getCollection()); $this->setChild('toolbar', $toolbar); return parent::_prepareLayout(); } /** * Get collection * * @return Mage_Review_Model_Resource_Review_Product_Collection */ protected function _getCollection() { return $this->_collection; } /** * Get collection * * @return Mage_Review_Model_Resource_Review_Product_Collection */ public function getCollection() { return $this->_getCollection(); } /** * Get product link * * @return string */ public function getProductReviewLink() { return Mage::getUrl('review/product/list/id/'); } /** * Format date in short format * * @param $date * @return string */ public function dateFormat($date) { return $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM); } protected function _beforeToHtml() { $this->_getCollection() ->load() ->addReviewSummary(); return parent::_beforeToHtml(); } }
上面代码来自核心代码的修改,注意的地方就是去掉用户筛选出状态是通过的评价
maegnto模板文件中输出,模板文件中的代码如下
<?php if( $this->getCollection() && $this->count()): ?> <?php echo $this->getToolbarHtml() ?> <table class="data-table" id="my-reviews-table"> <col width="1" /> <col width="210" /> <col width="1" /> <col /> <tbody> <?php foreach ($this->getCollection() as $_review): ?> <?php $_product = Mage::getModel('catalog/product')->load($_review->getEntityPkValue()); $storeId = Mage::app()->getStore()->getId(); //$reviewsCount = Mage::getModel('review/review')->getTotalReviews($_review->getEntityPkValue(), true , $storeId); ?> <tr> <td> <P><strong><?php echo $_review->getNickname(); ?></strong></P> <span class="nobr"><?php echo $this->dateFormat($_review->getReviewCreatedAt()); ?></span> </td> <td> <a href="<?php echo $_product->getProductUrl(); ?>" target="_blank"><?php echo $this->htmlEscape($_review->getName()) ?></a> <img src="<?php echo $_product->getImageUrl() ?>" /> </td> <td> <?php if($_review->getSum()): ?> <div class="rating-box"> <div class="rating" style="width:<?php echo ( $_review->getSum() / $_review->getCount() ) ?>%;"></div> </div> <a href="<?php echo $this->getProductReviewLink() ?>id/<?php echo $_review->getEntityPkValue() ?>" target="_blank"><?php echo $_review->getCount() ?> <?php echo $this->__('reviews') ?></a> <?php endif; ?> </td> <td><?php echo $this->helper('review')->getDetailHtml($_review->getDetail()) ?></td> </tr> <?php endforeach; ?> </tbody> </table> <script type="text/javascript">decorateTable('my-reviews-table')</script> <?php echo $this->getToolbarHtml() ?> <?php else: ?> <p><?php echo $this->__('You have submitted no reviews.') ?></p> <?php endif; ?>
此为magento 1.7.2.0测试代码,不建议用于生产环境。大家根据自己magento版本和经验适当修改。
Magento自动关联商品插件:将一个分类的商品自动关联多个分类的商品,随机显示。
插件购买地址:http://www.hellokey.com/cn/magento-related-products
继续阅读“Magento自动关联商品插件”
我的插件店上线了,这是我和朋友推出的第一个插件,大家看视频和demo来了解这个插件的作用吧。
demo地址:http://demo.hellokey.com/
购买地址:http://www.hellokey.com/cn/magento-a-z-extension (支持paypal付款或网银支付宝付款)
视频介绍如下:插件如果有更新,视频中可能并未介绍,请以demo为准。
google shopping需要将商品导出为指定的XML格式,用 Data Feed Manager 这个工具就非常的方便来组织数据。官网网址 http://wyomind.com/ ,他们的说明文档很清楚,基本可以熟悉如何定制自己的数据。
如果你只想向google shopping提交商品数据,那么你使用其它免费的Magento插件即可,如果你的数据需要按照其它规则进行定制,那么这个插件也许就是你想要的。
插件中你可以设置属于你自己的过滤规则,比如将某些商品屏蔽掉。你可以按照商品的各个属性来过滤商品,可以按照分类来过滤商品。
如果过滤插件内置的输出内容不能满足你的要求,你甚至可以直接插入 PHP 代码来获得你想输出的内容,如果插入php见插件的说明文档。
简单介绍下两款插件:
Simple Google Shopping: 30欧元,看名字就知道是只可以生成适用google shopping格式的商品数据。适合一般店家使用。
Data Feed Manager: 80欧元,可以生成XML CSV等格式的商品数据。适合对magento比较熟,功能需求多的用户。
插件卸载对于很多新手来说并不清楚,今天来介绍下如何禁用或者卸载Magento插件。如下的方法都需要刷新magento的缓存,或者操作前禁用magento的缓存。操作完成后,请退出后台,重新登录后台。最重要的一点,在测试网站上练习,不要在自己运行的网站上实验。
1.禁用magento插件
我们在magent后台,最讨厌的就是那个信息的弹窗,就是下图这个东东。
这个消息提示的名字是Notification,也算是magento的一个插件,我们来看下如何关闭他,关闭其它的插件也是这样的一个过程。
我们在后台进入 system -> configuration->advanced,如下图,找到这个插件,选择disable,保存即可。
这是magento后台提供的禁用插件的方式,但是有的时候我们装完插件,网站挂了,连后台都进不去了,这个时候怎么办呢?下面说说人工手动来对插件进行操作。
2.我们可以手动删除magento的插件配置文件,以此来禁用插件。
一般插件的配置文件所在位置为,magento文件根目录/app/etc/modules 文件夹中,寻找有你插件名字的xml文件将其删除,或者查看文件更新日期来帮你判断哪个文件是刚才安装的插件。以此来禁用插件。操作结束后勿忘记手动刷新缓存文件。
3.关于删除插件
当我们禁用了插件后,心中自然不爽,不用的东西留着做些什么,所以想删掉,如上面所说的删除缓存文件外,还需要删除模板的其它文件,这些文件的位置一般在 /app/code 文件中的community文件夹或者local文件夹中,这俩文件夹中的是插件的核心文件,如果插件有模板文件,你还需要进入你的模板文件中,一般是default模板中查找,将其删除掉。
关于删除插件,需要一定的magento插件常识,比如mgento插件的文件结构常识,查看配置文件寻找文件的常识。如果是ftp安装的插件,可以按照原插件文件结构来寻找,如果是magento connect安装的插件就需要自己根据经验来找了。
文件我们可以找到,但是同时我们不要忘了还可能有数据库的表,可能需要同时删除,进入插件的数据库脚本文件中,看下插件是否增加了数据库的表,以此来进行删除。
4.关于重新安装插件,有的时候为了调试插件的目的,需要重新安装插件。重新安装插件,一个是更新文件信息,删除数据库,还有一点就是去删除core_resource中的插件安装记录。这才是毫无痕迹的将一个插件手动删除掉。