I am testing/trying to use CiviEvent 'shopping cart' (needs to be enabled using CiviEvent Component Settings under Administer/CiviEvent) mode of registering for events and while I am on an older version of Civi I looked at 4.6 code and it looks about the same re: Cart functionality. I have modified Cart code to allow for using CiviDiscount, if an event is configured to allow discounts - is anyone else interested in this? I will submit a patch if so. (there are other features that seem lacking in Cart, I will include a README to document)

  • hi Lesley, I really thought that CiviDiscount and CiviEvent's shopping cart were compatible, but after testing I have found some issues.
    – Jon-man
    Jun 12, 2015 at 16:02
  • Should there be a new answer to this saying "yes this is possible now"?
    – petednz - fuzion
    Oct 20, 2016 at 16:07

2 Answers 2


This might an important feature for folks using Event Cart functionality. It would be great if you can submit a PR against CiviDiscount repository at


  • Because the Cart modules (ParticipantsandPrices, Payment.php) are not modeled on regular Event/Registration modules, I couldn't simply add Cart form names to _cividiscount - I called in _cividiscount methods in Cart. I understand that no one supports Cart code as part of core CiviCRM, yet it isn't an extension? Should I rewrite Cart to 'fit' CiviDiscount in the way Event/Reg is done? Apr 22, 2015 at 15:19
  • OK, I submitted a PR for this in CiviDiscount and it will be added- it needs a PR in Event/Cart/Form/Checkout too, which I also submitted Apr 24, 2015 at 2:35
  • If you think Cart code changes will be an improvement, then go for it. Alternatively you can also submit the PR against CiviDiscount repo. Apr 25, 2015 at 4:05
  • Lesley or Kurund - I just looked through PR requests to see if i could see an outcome from this work but failed. Can anyone update this thread?
    – petednz - fuzion
    Nov 17, 2016 at 5:10

Thanks very much for this. It would definitely be a useful feature, so please submit a PR.

I think the best way to share desired features is via the issue queue for the extension at https://github.com/dlobo/org.civicrm.module.cividiscount/issues. Perhaps separate each suggestion into a different issue. That will make it easier to manage the suggestion, and to cite the issue when submitting a PR implementing a new feature.

  • As I commented to Kurund Jalmi, the problem is more with the Cart code- if it were modeled on the Event Registration code I could fairly easily add the correct form name to CiviDiscount to add the input textbox for the code, and enable it for applicable events/pricesets, but it is Cart code that needs re-writing. I added calls to cividiscount* to implement discounting in Cart/Form/Checkout modules Apr 22, 2015 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.