I have a custom module that exports data to our fulfillment system when the user checks out. Before export I need to run the address through a verification service. Since we are charged for this service, I need to configure the user name and password for the service per store. I have added the attributes I need, however I cannot figure out how to load them per store. How can I tell my resource model to load based off the store?
1条回答 默认 最新
- duandang6352 2010-02-08 18:44关注
How have you added them? It strikes me that they'd be perfect candidates for config values, and Magento wraps the whole per-store-setting thing there really well - take a look in a system.xml file for one of the built-in modules (or a downloaded one...they tend to be simpler) and how it builds the fields up and specifies at what 'scope' (global, store, store-view) settings can be applied.
Then you can access the values from your code with
Mage::getStoreConfigValue('your/config/key')
and it will give you the correct value for the scope you're in, or the default if you haven't set one for a particular store.本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥50 安卓adb backup备份子用户应用数据失败
- ¥20 有人能用聚类分析帮我分析一下文本内容嘛
- ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
- ¥30 python代码,帮调试
- ¥15 #MATLAB仿真#车辆换道路径规划
- ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
- ¥15 数据可视化Python
- ¥15 要给毕业设计添加扫码登录的功能!!有偿
- ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
- ¥15 微信公众号自制会员卡没有收款渠道啊