*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
) {
$productDAO = new CRM_Contribute_DAO_Product();
$productDAO->id = $params['product_name'][0];
+ $productOptionID = $params['product_name'][1];
$productDAO->find(TRUE);
$params['product_name'] = $productDAO->name;
$params['product_sku'] = $productDAO->sku;
- if (empty($params['product_option']) && !empty($form->_options[$params['product_name'][0]])) {
- $params['product_option'] = $form->_options[$params['product_name'][0]][$params['product_name'][1]];
+ if (empty($params['product_option']) && !empty($form->_options[$productDAO->id])) {
+ $params['product_option'] = $form->_options[$productDAO->id][$productOptionID];
}
}
'receipt_date_time' => '',
'cancel_date' => '',
'cancel_date_time' => '',
+ 'hidden_Premium' => 1,
);
if (!empty($params['id'])) {
$existingContribution = civicrm_api3('contribution', 'getsingle', array(
CRM_Contribute_Form_AdditionalInfo::buildPremium($this);
$this->submit(array_merge($defaults, $params), $action, CRM_Utils_Array::value('pledge_payment_id', $params));
+
}
/**
*/
public function testPremiumUpdate() {
$form = new CRM_Contribute_Form_Contribution();
+ $mut = new CiviMailUtils($this, TRUE);
$form->testSubmit(array(
'total_amount' => 50,
'financial_type_id' => 1,
'contribution_status_id' => 1,
'product_name' => array($this->products[0]['id'], 1),
'fulfilled_date' => '',
+ 'is_email_receipt' => TRUE,
+ 'from_email_address' => 'test@test.com',
), CRM_Core_Action::ADD);
$contributionProduct = $this->callAPISuccess('contribution_product', 'getsingle', array());
$this->assertEquals('clumsy smurf', $contributionProduct['product_option']);
+ $mut->checkMailLog(array(
+ 'Premium Information',
+ 'Smurf',
+ 'clumsy smurf',
+ ));
+ $mut->stop();
}
}