我在 Prestashop 论坛上问过这个问题,但目前还没有回复。
我需要能够将 sagepay 代码添加到 mailalert 模块中使用的新订单电子邮件。
我所拥有的是;
// Filling-in vars for email
$template = 'new_order';
$subject = $this->l('New order');
$spvtxc = Db::getInstance()->ExecuteS("SELECT vendortxcode FROM `"._DB_PREFIX_."sagepay_transactions` WHERE id_cart = '$order->id_cart'");
...
$templateVars = array(
'{firstname}' => $customer->firstname,
'{lastname}' => $customer->lastname,
...
'{sagepay_no}' => $spvtxc,
...
);
每次我测试交易时,$spvtxc 都会返回“ARRAY”。我努力了;
$spvtxc = '5';
正如预期的那样,这将返回 5 作为 sagepay 编号,因此我确信正在调用变量并将其添加到电子邮件中。我试过了;
$spvtxc = Db::getInstance()->ExecuteS("SELECT vendortxcode FROM `"._DB_PREFIX_."sagepay_transactions` WHERE id_cart = '2'");
所以这应该将 $spvtxc 设置为肯定存在的值(我手动将它添加到数据库中),但这仍然返回'ARRAY'。
如果有人能指出我错过了什么,那将不胜感激。