Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
When I add coupon to order and click add , I get this Ajax response
Fatal error: Call to undefined function commerce_cart_order_refresh() in modules/commerce_coupon/includes/commerce_coupon.checkout_pane.inc on line76
Thanks
Comment | File | Size | Author |
---|---|---|---|
#5 | commerce_coupon-cart-dependency-2017879-5.patch | 3.15 KB | Liam McDermott |
Comments
Comment #1
pcambraThe function does exist in Drupal commerce.
http://drupalcode.org/project/commerce.git/blob?f=modules/cart/commerce_...
Do you have the cart module installed and enabled?
Comment #2
Majdi CreditAttribution: Majdi commentedYes, you right
No the cart module is not enabled , I'm working on booking site and basically I don't need the cart at all
I really don't want to enable the cart module since I don't need it in the whole process
Also the module don't show any dependencies on chart module
dependencies[] = number
dependencies[] = commerce
dependencies[] = commerce_checkout
dependencies[] = commerce_price
dependencies[] = commerce_line_item
dependencies[] = commerce_order
dependencies[] = entityreference
Comment #3
pcambraThat's an interesting use case... I'd be in favor of adding some kind of checking or decoupling of that dependency at checkout step.
Patches are welcome.
Comment #4
Liam McDermott CreditAttribution: Liam McDermott commentedI'm having a look at this for the next few hours (not sure if I'll come up with something usable, but will try), pcambra, if you have any pointers/advice on how you'd generally like this done, please let me know!
Comment #5
Liam McDermott CreditAttribution: Liam McDermott commentedAttached is a patch. It's pretty straight-forward, where there were calls to commerce_cart_order_refresh(), commerce coupon and commerce discount's hook_cart_order_refresh() functions are called directly (when the cart module is disabled), which add/remove coupons and discounts from the order as you'd expect.
Comment #6
dpolant CreditAttribution: dpolant commentedDecoupling from commerce_cart is a feature request. This would require a lot of work b/c so much of coupon/discount logic happens on the cart refresh cycle.
Comment #7
jcisio CreditAttribution: jcisio commentedIn this case it requires a line in .info file to add dependency on commerce_cart.
Comment #8
dpolant CreditAttribution: dpolant commentedGood point - just committed.