Magento: 单产品(product)或者当前类别(category)最大和最小价格 Min/Max Product Price in a Category

1. 当前类别最大最小价格: $minPrice = Mage::getModel('catalog/product')->getCollection() ->addStoreFilter() ->addAttributeToSelect('price') ->addAttributeToSort('price', 'ASC')->getFirstItem()->getMinimalPrice()*1; $maxPrice = Mage::getModel('catalog/product')->getCollection() ->addStoreFilter() -&g… Read More

Magento: 无法登录后台 Can’t login to admin panel

This tutorial shows how to resolve the Magento admin panel login issue. It’s a common issue: you are trying to login to the Magento admin panel, typed your username and password, clicked Login button and nothing happens. The page refreshes and that’s all. No error or any other messages. This is caused by the cookies issue. In

Magento: Mage::getResourceModel, Mage::getModel 和 Mage::getSingleton() 的区别 when to use Mage::getResourceModel, Mage::getModel and Mage::getSingleton()

Perfect differece with example for getsingleton and getmodel. Mage::getSingleton() Mage::getSingleton() will first check if the same class instance exists or not in the memory. If the instance exists then it will return the same object from the memory. So Mage::getSingleton() is faster than Mage::getModel(). Example $product1 = Mage::getSingleto… Read More

Magento: 获取客户信息 Get Customer’s Full Name, First Name, Last Name and Email Address

1.  获取已登录客户信息 // Check if any customer is logged in or not if (Mage::getSingleton('customer/session')->isLoggedIn()) { // Load the customer's data $customer = Mage::getSingleton('customer/session')->getCustomer(); $customer->getPrefix(); $customer->getName(); // Full Name $customer->getFirstname(); // First Name $cu… Read More

Magento: 获取商店名称及邮件地址 Get Store Email Addresses

General Contact /* Sender Name */ Mage::getStoreConfig('trans_email/ident_general/name'); /* Sender Email */ Mage::getStoreConfig('trans_email/ident_general/email'); Sales Representative /* Sender Name */ Mage::getStoreConfig('trans_email/ident_sales/name'); /* Sender Email */ Mage::getStoreConfig('trans_email/ident_sales… Read More

Magento: 客户登陆验证 How magento store password and validate password

Magento uses MD5 and salt algorithems to store password for customer as well admin user. How magento create encrypted password Magento create encrypted password with, Mage::getModel('core/encryption')->decrypt($password); Here is the logic of decrypt($password) function, $password = "12345678"; $salt = "at"; $encyPasswod = md5($salt.$pa… Read More

Magento搬家、换域名、重新安装教程

范例:从http://www.youdomain.com 迁移到http://www.newsite.com。 将原来网站文件中的var文件中的cache和session文件删除,将media中的缓存文件删除。然后将所有文件制作成一个压缩包,以减少文件体积,方便转移。 将压缩包转移到新的服务器域名指向的文件夹,解压。 一、首先要通过phpMyAdmin备份整个magento的数据库。备份数据并且存为.SQL. 二、接着打开你的备份文件(.SQL),查找并且替换所有的 “www.youdomain.com” 到“www.newsite.com”. 必须在导入数据之前完成,不然新的MAGENTO将会全部瘫痪。 三、… Read More

Magento 1.8+/1.9+ 无法更新购物车产品数量 Quantity in checkout shopping cart doesn’t work properly

In your theme directory In your /app/design/frontend/yourthemepackage/default/template/checkout/cart.phtml file OR /app/design/frontend/default/yourtheme/template/checkout/cart.phtml file <form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post"> <?php echo $this->getBlo… Read More

亚马逊云服务安装magento How To Install Magento On Amazon EC2

Magento is an open source content management system for ecommerce based web applications. It is a popular ecommerce open source web application. There is also an enterprise edition for magento. So, the open source can be used for small scale ecommerce websites and you can modify the application based on your necessities. Enterprise edition on

Magento 创建唯一优惠券 Create unique coupon code in Magento

Toni from ICG wrote a post how to create simple A/B split testing for offline promotions for online store. Now we will show you how to manage coupon codes trough Magento and prepare for your next “offline” campaign. Under Magento administration, first go to System -> Configuration -> Customer -> Promotions and create initial settings which wil…

Magento批量生成优惠券

使用Magento后台手动生成优惠券,效率太低了。如果生成1万个号码不一样的优惠券,还是要靠代码。 我来分享一段从互联网获得的批量生成优惠券的代码,如下: 此代码在Magento外部运行,所有使用了require_once(‘app/Mage.php’); 此代码只是一个生成优惠券的演示,如果要实现具体的功能,还需要修改,但是有了这个demo就容易多了。 示例1: <?php require_once('app/Mage.php'); Mage::app('default'); function generateUniqueId($length = null) { $rndId = crypt(uniqid(rand… Read More

移除magento投票栏 How to remove magento poll block

Magento is nowadays the most known CMS if we are talking about eCommerce. We all know that a magento store have at its base blocks. Category blocks, Subcategories blocks, polls block, manufacturers blocks and more. Todays question for Stanley is: How to remove a default magento block like: Mangento poll block? In a Magento webstore you

Magento 添加评论 How to add Magento Product Reviews form anywhere on product page

Product reviews helps in boosting customer’s confidence in your product. No points for guessing why they are one of the primary driving force behind conversion. Amazon is a great example of product reviews where a majority of the products are sold due to efficient reviews posted by their consumers. To show the review form and product