Needs review
Project:
Ubercart Discount Coupons
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Mar 2012 at 14:26 UTC
Updated:
9 Apr 2014 at 18:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
wodenx commentedComment #2
velpan commentedVery useful patch wodenx. Can you, please, give us a similar patch for the 6.x.-1.x-dev?
Comment #3
wodenx commentedAjax in D6 is a completely different animal. I'll backport if I have time or if someone wants to sponsor, but it's a nontrivial task.
Comment #4
Rafal LukawieckiI just tried applying this patch to current DEV branch of uc_coupon, but the patch does not seem to apply. The error I get is:
Checking patch uc_coupon.module...
error: while searching for:
if ($op == 'presave') {
// Apply any session coupons to the current cart order.
global $user;
if (isset($_SESSION['cart_order']) && $order->order_id == $_SESSION['cart_order']
&& uc_order_status_data($order->order_status, 'state') == 'in_checkout' && $user->uid == $order->uid) {
_uc_coupon_apply_to_order($order, uc_coupon_session_validate());
}
// Make sure any fake cart items don't get saved with the order if the checkout page is skipped
error: patch failed: uc_coupon.module:1276
error: uc_coupon.module: patch does not apply
Comment #5
Rafal LukawieckiShould I have used Alpha7 for this patch, by any chance? I am still very willing to test it. :)
Comment #6
wodenx commentedActually, I believe that in alphpa7, both the shipping pane and the payment pane are automatically updated whenever a coupon is applied -- no patch necessary. Please give it a try and report back if not the case.
Comment #7
Rafal LukawieckiGood news. I just tested without this patch, but with Alpha7 of uc_coupon and the two AJAX patches #1373236: Allow multiple modules to react on checkout Ajax events and #1518522: Update order_total when order saved on top of ubercart. I am happy to say, that at last, the payment methods, which in my case have a condition on the order balance, do react via AJAX as the coupons are applied. I will do a bit more testing and will put it into production.
Still, hoping the payment preview pane could update tax based on shipping country changes, via AJAX, but that is a matter for #34 in #1373236: Allow multiple modules to react on checkout Ajax events.
Comment #8
DanZ commented#1373236: Allow multiple modules to react on checkout Ajax events has been committed and is in Ubercart 7.x-3.3. Is this still an issue?
Comment #9
kirkofalltrades commentedI am using this method wodenx suggested to create a free shipping coupon:
https://drupal.org/comment/4931346#comment-4931346
So, it is imperative that the Shipping Options refresh automatically after a coupon is applied to the order. As it stands, this is not happening for me. In order to see the new shipping option made available by the conditions on the 'Free Shipping' shipping method, I have to refresh the cart page. The other panes are updating correctly (such as the Payment Method pane) when other coupons are being applied that have nothing to do with shipping methods.
I am using the following versions of modules:
Ubercart 7.x-3.6
Discount Coupons 7.x-2.1-alpha7
Ajax Driven Cart 7.x-2.x-dev
Flat Rate 7.x-3.6
Would appreciate any help.
Thanks!
Kirk