- 博客(48)
- 资源 (4)
- 收藏
- 关注
原创 Your account is not yet approved. If you have questions, please contact the seller.
Magento company admin 登录时提示:Your account is not yet approved. If you have questions, please contact the seller.解决办法是找到company admin 对应的company并修改状态为active。原因是company状态是pending approval。
2023-06-27 21:47:41
502
原创 关于api的响应时间(curl)
比如: curl --location --request GET "https://www.tmall.com" -s -w %{http_code}:%{time_total}:%{speed_download}:%{time_namelookup}:%{time_redirect}:%{time_pretransfer}:%{time_appconnect}:%{time_starttransfer}:%{size_download}上图这种网络耗时2.259s,这是真慢!
2022-11-25 00:05:30
795
1
原创 composer update抛出异常的处理
当本地运行composer update的时候提示Failed to update https://bitbucket.org/aaa/bbb.git package information from this repository may be outdated.
2022-10-21 23:49:39
995
原创 mysql 事务相关
mysql事务隔离1. 查询事物隔离级别select @@tx_isolation;2. 设置事务隔离级别set session transaction isolation level 隔离级别(如read uncommitted);3. 数据库的四个级别:1)read uncommitted : 读取尚未提交的数据 :哪个问题都不能解决2)read committed...
2019-11-16 16:02:26
147
原创 设计模式之命令模式php示例
《大话设计模式》是一本相当赞的介绍设计模式的书,易读性相当高。其中的示例都是.net的。下面的php文件是对应的23章命令模式的php示例。命令模式(Command),将一个请求封装为一个对象,从而使你可用不同的请求对客户进行参数化;对请求排队或记录请求日志,以及支持可撤销的操作。
2016-05-20 11:12:35
405
原创 magento自定义的payment method是否可用的判断
/app/code/core/Mage/Payment/Model/Method/Abstract.php isApplicableToQuote()[10:39:22] emily: 你的payment类会继承Mage_Payment_Model_Method_Abstract[10:39:31] emily: 这里有个isApplicableToQuote
2014-04-17 11:10:33
1073
原创 magento send email
protected function _sendEmailTemplate($template, $sender, $templateParams = array(), $storeId = null) { /** @var $mailer Mage_Core_Model_Email_Template_Mailer */ $mailer = Mage:
2014-04-10 18:13:06
1333
原创 magento变数组为object
在lib/Varien/Object.php中有个方法addData() /** * Add data to the object. * * Retains previous data in the object. * * @param array $arr * @return Varien_Object
2013-11-04 17:31:35
974
原创 为自定义页面加page
protected function _prepareLayout() { $pager = $this->getPagerBlock(); // called prepare sortable parameters $collection = $this->getImportedProducts(); //attention: $collecti
2013-10-09 14:53:33
690
原创 获得某个用户使用某个coupon的次数
$couponCode = 'WELCOME'; //coupon name $coupon = Mage::getModel('salesrule/coupon'); $coupon->load($couponCode, 'code'); $couponUsage = new Varien_Object(); $customerId
2013-09-04 18:20:12
860
转载 magento 后台xml配置
http://www.magentocommerce.com/wiki/5_-_modules_and_development/admin/xml_structure_for_admin_configurations#frontend_type_types
2013-06-21 14:22:28
642
转载 magento给order的incrementID加前缀
Sometimes the need arises where you must change the Magento order numbering. Perhaps it is necessary to avoid conflict with a separate Magento installation or other ecommerce platform. Or maybe you
2013-06-07 15:52:26
1703
原创 magento 常用方法
根据websiteId获取所有属于此website的产品collection: $_productCollection = Mage::getModel('catalog/product')->setWebsiteId( $websiteid)->getCollection();
2013-06-05 14:44:36
599
原创 magento 根据attribute code/id获取attribute对象 及options
$attributes = Mage::getModel('catalogsearch/advanced')->getAttributes();$attributeArray=array();foreach($attributes as $a){if($a->getAttributeCode() == 'desired_attribute_code'){foreach($a->getSou
2013-05-15 16:13:53
3372
翻译 magento更新scope为website的product attribute
有时候产品的属性为website,无法直接修改产品属性使其在不同的Website呈现不同的值.可以参考如下代码:首先需要设admin store, Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); 第二步,设置product的scope, $website = Mage::app()->getWebs
2013-05-14 17:59:12
984
翻译 magento Scope
Global means that the value of this attribute for a given product must be the same throughout your website. Global 表示这个产品属性在所有website里都是一样的.Website means that the value of this attribute for
2013-05-14 16:45:12
689
原创 magento各版本简称及翻译
Magento CE:Magento Community Edition [magento社区版]Mageto EE: Enterprise Edition [magento企业版]
2013-05-14 15:05:15
1364
原创 magento 买一送一设置
参考:http://www.magentocommerce.com/wiki/3_-_store_setup_and_management/shopping-cart-price-rule-recipes#buy_1_get_1
2013-03-25 11:59:17
1895
原创 windows下服务器配置sendmail发邮件
1> 在sendmail下载文件http://glob.com.au/sendmail/2> 按页面描述把解压后的文件放入相应文件夹.3> 参考http://flowingmotion.jojordan.org/2012/04/26/how-to-set-up-email-with-wamp/ 配置sendmail.ini和php.ini注:wampp使用的php.ini在C:\wam
2013-03-19 13:24:32
8686
原创 更新cart item的price
$quote = Mage::getModel('checkout/cart')->getQuote(); $_cartItems = $quote->getAllVisibleItems(); foreach ($_cartItems as $_cartItem) { $productId
2013-03-07 10:22:21
947
翻译 重置magento后台用户密码
进入相应数据库以后,运行select * from admin_user;查看所有后台用户信息.update admin_user set password=CONCAT(MD5('qXpassword),':qX') where username='admin'; //执行完这条语句即可用admin/password登录后台. 也可以把sql语句里的password换成你需要的密码
2013-02-28 14:29:01
4584
原创 magento addattributetoselect使用
$collection = Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect($collection = Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect('nam
2013-02-26 11:14:00
2036
转载 php delimiters 分隔符
http://php.net/manual/zh/regexp.reference.delimiters.php分隔符当使用 PCRE 函数的时候,模式需要由分隔符闭合包裹。分隔符可以使任意非字母数字、非反斜线、非空白字符。经常使用的分隔符是正斜线(/)、hash符号(#) 以及取反符号(~)。下面的例子都是使用合法分隔符的模式。/foo bar/
2013-02-19 17:35:34
627
转载 magento添加多域名网站
Tutorial: Multi-Site, Multi-Domain SetupCategory: Build Your Store Tomas G, Magento SupportOne of Magento’s greatest strengths is its capabilities for scaling to support mu
2013-02-07 16:55:12
1028
原创 magento 获取flat表记录
$statucCollection = Mage::getModel('localpartnerapi/partnerstatus')->getCollection();$statucCollection->addFieldToSelect('status_code')->getSelect()->distinct(true);$statusRows = $statucCollection->
2013-02-06 11:17:43
1013
原创 wamp配置ssl小记
配置ssl并不困难.如果输入openssl genrsa -des3 -out server.key 2048出现弹窗,内容是The ordinal xxx could not be located in the dynamic link library LIBEAY.dll.可以从http://slproweb.com/products/Win32OpenSSL.html下载openss
2013-02-04 16:15:56
2964
转载 How to setup HTTPS [SSL] on WAMP
How to setup HTTPS SSL on WAMPRecently I had to run a website with several https links under local server for testing and I had to configure the Open SSL server that comes with WAMP server. I'm sure
2013-02-04 16:07:50
2280
1
原创 magento 清空购物车
清空购物车 public function clearItems() { $cartHelper = Mage::helper('checkout/cart'); //Get all items from cart $items = $cartHelper->getCart()->getItems(); /
2013-01-22 17:31:33
1439
原创 magento添加产品[有quote/无quote]
有quote:<?phpclass Emily_Order_Model_orderCreate extends Mage_Core_Model_Abstract { private $_storeId = '1'; private $_groupId = '1'; private $_sendConfirmation = '0'; private $o
2013-01-18 18:14:21
2105
原创 magento 添加Creditmemo记录
当refund发生在线下,需要用程序加creditmemo时,如下代码可供参考1.可以调用sales/order_creditmemo_api的create()方法来生成creditmemo记录,function addCreditMemo($targetMagentoGoServiceId, $orderId, $commentText) { $product = Mag
2013-01-17 18:01:31
1591
原创 使用setTemplate设置页面结构
在Magento中新建一个插件的时候,如何控制我们前台页面的页面结构呢?一个方法是去修改我们的模板XML文件来实现。另一个办法就是在我们插件的Controller(控制器)中来设置Magento的页面结构。代码如下:$this->loadLayout();$this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
2013-01-08 12:00:24
2913
原创 magento 获取国家名字 get country name
echo Mage::app()->getLocale()->getCountryTranslation("CN"); //注意locale,根据本地语言获取国家名字 Mage::getSingleton('core/translate')->init('zh_CN', true); $country_name = Mage::getModel('directory
2012-12-27 16:58:10
2111
转载 Sublime Text 2 小记
常用快捷键Ctrl+Shift+P 超快速匹配搜索Shift+右键 方形区域选择Ctrl+左键 可选不连续代码文本操作Ctrl+K,U 改为大写Ctrl+K,L 改为小写Ctrl+/ 注释Ctrl+D 选中光标所在字符串 (按住继续选择下个相同字符串)Alt+F3 选中与光标处相同的全部词Ctrl+M 光标移动至括号前或后Ct
2012-12-21 16:50:12
391
原创 magento更新产品属性值 eg. visibility
$attributeData = array('Visibility'=>Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);$product = Mage::getModel('catalog/product')->load($productId); $storeIds = $pr
2012-12-21 15:26:33
806
转载 Magento: Join, filter, select and sort attributes, fields and tables
In my previous article (Magento: Very Useful Collection Functions), I had written about database interaction functions present in classVarien_Data_Collection_Db.Here, I am going to explain some
2012-12-20 12:18:22
1361
原创 magento 发邮件[不用template/使用template]
不使用template发邮件:$mail = Mage::getModel('core/email'); $mail->setToName('Your Name'); $mail->setToEmail('em@bluecomgroup.com'); // send email to this email address$mail->setBody('Mail Text / M
2012-12-10 14:43:59
660
原创 magento 获取路径
获取modules的路径 Mage::getUrl('checkout/cart');获取js路径:Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS)获取Css路径:$this->getSkinUrl('css/styles.css')
2012-12-07 16:00:06
606
Localown.zip
2020-02-06
alipay支付接口
2012-12-17
magento自定义后台配置 示例
2012-09-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人