Hi - first great to see this picked up and available here, I had the old version basically working - but you've really cleaned this up a lot from what was posted on Ubercart.org

Just wondering why you had added a note to make adding shipping/tax charges configurable - wouldn't you always want your gift certificate to be able to cover the entire order - your user has already paid cash to get the certificate?

Anyway, I just changed it on my site to calculate this way - could post a patch if you want it - but pretty much just used uc_order_get_total() instead of iterating through the cart/line items.

Thanks!

Jere

Comments

torgospizza’s picture

Sure, post a patch and I can take a look. I've been speaking with the Uberdudes about better ways to get the $order object and calculate the total.. the tests I had done showed that line items in D5 were not being updated when they should've. (Hopefully Lyle will be able to backport his D6 patch that addresses this issue).

Thanks!

cccox’s picture

Is there a patch for this? I would really appreciate someone posting one.

Thanks!

Openlogic’s picture

Hi

I'm encountering the same situation where an issued GC is sufficient to cover the cost of tax and shipping, but is applied only to the order totals of items in the cart.

Theoretically, a GC would work like any other form of payment and apply to the final total including line items such as:
- shipping
- tax
- gift wrap
that get added in the checkout screen.

It appears that this remains an open issue through the 6.x versions and was wondering if someone had a solution.

If not, I'm prepared to develop, test and submit a patch if someone can offer a starting point.

Thanks

Faisal Siddiqi

torgospizza’s picture

I would love a patch! I don't have a lot of time to track this down, but a patch would be hugely appreciated.

Openlogic’s picture

torgosPizza -

I'd be glad to develop a patch.

According to the initial message in this thread, jeremdow mentioned using uc_order_get_total() to sidestep getting item totals. This would require having the an order number available. However, when I try to get an order number using this logic:
$order = uc_order_load($_SESSION['cart_order']);
The the cart_order session value and therefore the $order object appears to be empty.

Can you help me understand how to get the order number from within the uc_gift_certificate_validate() function?

Thanks

Faisal