Skip to content

Instantly share code, notes, and snippets.

@mlutfy
Created October 8, 2017 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlutfy/e0a85bee47478866ec17b23f98efc8fd to your computer and use it in GitHub Desktop.
Save mlutfy/e0a85bee47478866ec17b23f98efc8fd to your computer and use it in GitHub Desktop.
protected function setPriceSetParameters($formValues) {
$this->_priceSetId = self::getPriceSetID($formValues);
$priceSetDetails = self::getPriceSetDetails($formValues);
$this->_priceSet = $priceSetDetails[$this->_priceSetId];
// Call the buildAmount hook again to support extensions such as
// cdntaxcalculator, otherwise we cannot customize tax calculations.
// Setting the priceSetId this way is required by some extensions
// such as CiviDiscount.
$this->set('priceSetId', $this->_priceSetId);
CRM_Utils_Hook::buildAmount('membership', $this, $this->_priceSet['fields']);
// process price set and get total amount and line items.
$this->ensurePriceParamsAreSet($formValues);
return $formValues;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment