2013-08-01 52 views
0

我有一个模板重写它显示产品(与一些jquery)。我有一个自定义的sendmail.php,它正确地发送选择的值。但不是产品自定义字段的价值。我无法联系到他们。 在sendmail.php此可用:Joomla 2.5和Virtuemart 2自定义字段值通过电子邮件发送

$userContact->shipname 
$product->quantity 
$product->product_parent_id ... 

我可以列出在sendmail.php所有与此有关的自定义字段值:

foreach ($product->customfieldsCart as $field) { 
echo $field->custom_value; 
} 

但我只想要选择的值。在正常的订购过程中,invoice_items.php运作良好(线57-51):

if (!empty($item->product_attribute)){ 
if(!class_exists 'VirtueMartModelCustomfields')) 
require JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'customfields.php'); 
$product_attribute = 
VirtueMartModelCustomfields::CustomsFieldOrderDisplay($item,'FE'); 
echo $product_attribute;} 

请帮助我,非常感谢

回答

0

有没有办法让自定义字段的选定值超出产品视图中的产品数据。 如您所说,您可以获取自定义字段的所有选项的值,但产品数据数组不会存储,选择了哪些值/选项。此数据只能来自购物车或发票数组。

在你的情况下,我认为你需要用javascript获取选定的值,将它们发送到你的sendmail.php(ajax,json)并用这些数据构建你的电子邮件。