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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pcambra’s picture

Version: 7.x-1.0-beta7 » 7.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

The 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?

Majdi’s picture

Yes, 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

pcambra’s picture

Status: Postponed (maintainer needs more info) » Active

That'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.

Liam McDermott’s picture

Issue summary: View changes

I'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!

Liam McDermott’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Needs review
FileSize
3.15 KB

Attached 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.

dpolant’s picture

Category: Bug report » Feature request

Decoupling 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.

jcisio’s picture

Category: Feature request » Bug report

In this case it requires a line in .info file to add dependency on commerce_cart.

dpolant’s picture

Status: Needs review » Fixed

Good point - just committed.

  • dpolant committed dfec1a0 on 7.x-2.x
    whitespace + added commerce_cart as dependencies per #2017879
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.