共计 1412 个字符,预计需要花费 4 分钟才能阅读完成。
如果使用MAGENTO默认后台生成的订单号,客户一看你做了多单一目了然,你肯定不 能让客户知道你做了多少单吧.这个插件可以帮你把日期+流水号做为订单号,再也不用为泄露商业机密发愁了吧.
[php]
<!–?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage * @package Mage_Eav * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Enter description here… * * Properties: * – prefix * – pad_length * – pad_char * – last_id */ class Mage_Eav_Model_Entity_Increment_Numeric extends Mage_Eav_Model_Entity_Increment_Abstract { public function getNextId() { $last = $this—>getLastId();
if(!$last){$last=10000000;}
return $showtime=date("YmdHis");
if (strpos($last, $showtime) === 0) {
$next = (int)substr($last,strlen($showtime),strlen($last));
$next=(int)$next+1;
return (String)$showtime.(String)$next;
} else {
$next =(int)$last+1;
return (String)$showtime.(String)$next;
}
}
}
[/php]
[url]下载地址[/url]
喜欢就赶紧下载吧。
应该挺不错的