本文介绍了在cron作业中获取storeId的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
许多搜索根本没有帮助:(.我正在尝试在cron作业中执行的功能中获取商店ID ...我已经读到可以在cron计划中添加参数,但这不是我想要的.我真的需要动态获取它.
Many searches didn't help at all :(.I'm trying to get the store id in a function executed in a cron job...I've read that I could add a parameter in my cron schedule, but this is not what I want. I really need to get it dynamically.
任何帮助将不胜感激!
在此功能中,我处理一些产品.他们的getStoreId()总是给我0 ...我可以更改它吗?
Edit : in this function, I handle some products. Their getStoreId() always gives me 0... could I change that ?
推荐答案
尝试使用类似以下代码的代码:
Try to use some like this code:
$defStoreId = Mage::app()->getDefaultStoreView()->getStoreId();
希望这会有所帮助.
这篇关于在cron作业中获取storeId的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!