我已经在网络上和本网站上搜索解决方案,但找不到任何。 我想获取与Magento中的优惠券代码关联的客户名称。我发现了使用优惠券代码的时间的一些代码,但我无法获得客户名称。在Magento中获取优惠券代码的客户名称
我尝试下面的代码:
<?php
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
umask(0);
Mage::app('admin');
$coupon = Mage::getModel('salesrule/coupon/usage');
$coupon->load('dd_38WX9N', 'code');
if($coupon->getId()) {
$timesUsed = $coupon->getTimesUsed();
$customer = $coupon->getCustomerId();
echo $timesUsed;
echo $customer;
}
?>
可能有人请帮助我与和我指向正确的方向。
非常感谢您的帮助。 丹尼尔
非常感谢Diglin的帮助。这就像一个魅力。你刚刚救了我的一天:-) –
不要犹豫投票:-) –
我试图做到这一点,但我的名声不允许我投票:-(我会回来,尽快做到这一点声望让我投票。 –