Coupon Functionality

Posts: 110
Joined: 08/08/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik

I remember there was a module for such a functionality and also some livesites using.

Was it lost in the crash?

Regards
cosmo

Posts: 50
Joined: 08/17/2007
Getting busy with the Ubercode.Spreading the word - Ubercart for president.

It hasn't been posted yet to the forum, but its currently on the author's site for version Ubercart 6a. I have not tried it yet on 7B. Here's the link:

http://boldsource.com/ubercart-coupon-module-rev-2

I will let the author post it to the contributions since this is not my module.

AttachmentSize
uc_coupon_a6_ver_2_1.zip6.37 KB
Posts: 110
Joined: 08/08/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik

Thanks aswalla...

Found it just before u poste.. Next time i shd google before doing anything Laughing out loud

Posts: 17
Joined: 08/09/2007

BTW, I've been using the coupon module with Ubercart alpha 7b and I haven't had any problems with it.

Posts: 67
Joined: 08/10/2007

I just installed it in "uc_coupon" subfolder and I can't find the functionality for the coupons anywhere in the Store Administration... where should I be looking into?

Or am I not supposed to install the files in a folder of their own?

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

Did you enable the module in /admin/build/modules?

Posts: 67
Joined: 08/10/2007

naturally...

but I still can't find it anywhere in the Store Config menu.

if you have it enabled, where would you find it?

and am I missing something as far as installation goes, files/folder upload?

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

Oh yeah, I remembered it's in a kind of weird place: Store administration > Customers > Coupons. Not the most intuitive place, if I may say so.

Posts: 67
Joined: 08/10/2007

aaahhhh, that's where the bugger is!

now that I have the coupons figured out, enabled and whatnot, they don't actually apply at the checkout... I notice the field that asks which users can use the coupons. If I don't select anything (there's an empty user field), they don't apply. If I select an existing user and log in/try to checkout with that user, coupons still don't apply.

Ok, next step - did anyone get the coupon module to work? If so, how?

When you enter the coupon, does it discount the price on the Order Total preview screen, or does it do that on the Review Order page? Because I can't see it in either one...

Posts: 50
Joined: 08/17/2007
Getting busy with the Ubercode.Spreading the word - Ubercart for president.

coupon is working good for me. The discount will only show on the "Review Order" page. Look under payment method it should have the following listed (for example, a 10% off coupon):

Subtotal: $51.97
Coupon Discount: 'MYCOUPONCODE': -$5.20
Total: $46.77

You should also have the capability of adding in a coupon code to an existing order in your order list.

Now about whether its working or not...do you have:
1. A coupon code listed that is working with a set value and a valid date under your Coupons admin page (admin/store/customers/coupon)

2. which ubercart version are you running? 7b or bazaar? I have 7b that it is working on right now.

3. What coupon values do you have? Here's mine: I have put in 10.00 and chose "Percentage" as the Discount Value Type. Coupon is set to Active, with expiration date of 12/30/2007, 0.00 for minimum order amount and 0 for maximum number of redemptions. Both wholesale and retail are allowed to use coupon and I have not selected any specific user under "Allowed Users" so anyone should be able to use it.

let me know if you make some progress.
-Aaron

Posts: 67
Joined: 08/10/2007

hmm...

I've got the bazaar version (due to a few glitches I had with 7b), and that might be the problem... because I've got all the other options you listed pretty much the same or similar to yours, and I don't have that "Coupon Discount" field on the Review Order page.

wondering what/where could the problem be...

Posts: 50
Joined: 08/17/2007
Getting busy with the Ubercode.Spreading the word - Ubercart for president.

I'll be upgrading some time in the next few days - will let you know if the coupon module still works after the upgrade.

Posts: 67
Joined: 08/10/2007

please do!

Posts: 17
Joined: 08/09/2007

btw,
uc_coupon has been updated and released on drupal.org here:
http://drupal.org/project/uc_coupon

Posts: 67
Joined: 08/10/2007

just tried that new version 1.2 with ubercart from bazaar and still nada... hmm. if anyone else gets it to work with the bazaar version, let me know!

Posts: 42
Joined: 09/12/2007
Getting busy with the Ubercode.

For uc_coupon version 1.2 with ubercart alpha7c

We had to make the following modifications:

in the file uc_coupon.module, for the function uc_checkout_pane_coupon, we changed the case 'view' from:

-----------------old code-----------

$pane = uc_cart_checkout_new_pane('coupon');
$pane->fields['pane']['coupon'] = uc_textfield(t('Coupon Code'), $arg1->couponCode, FALSE, FALSE, 14);
$pane->fields['pane']['next'] = uc_cart_checkout_next_button($pane->id, $pane->next);
return $pane;
-----------------old code-----------

to:
------------------new code---------------
$contents['coupon'] = array(
'#type' => 'textfield',
'#title' => t('Coupon code'),
'#description' => t('Fill in the coupon code.'),
'#default_value' => '',
);
return array( 'contents' => $contents);

-----------------end of new code-----------

------------

as well for php 4 we changed:

uc_checkout_pane_coupon($op, $arg1, $arg2)

to:

uc_checkout_pane_coupon($op, &$arg1, $arg2)

we are new to ubercart, so maybe someone can say if these changes look right. It seems to work for me. Hope this helps someone else!!

Cheers

Posts: 144
Joined: 08/14/2007
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer

Thanks for the info TCS Smiling I'm going to try this one next week.

______________
Best regards,
Thomas Kulvik
Ny Media AS
www.nymedia.no

Posts: 67
Joined: 08/10/2007

I'll test this on 7c and php5 shortly as well...

EDIT: Nope, still doesn't work with either 7b or 7c, changes or no changes.

No coupon discounts are being applied either on checkout page or on the review order page.

Posts: 42
Joined: 09/12/2007
Getting busy with the Ubercode.

We tested with 7c on both php4 and php5 . on php4, it was necessary to change
uc_checkout_pane_coupon($op, $arg1, $arg2) to
uc_checkout_pane_coupon($op, &$arg1, $arg2)

The discounts are showing up where thay should be for us (checkout page ..).

Here is the entire function with the code changes

function uc_checkout_pane_coupon($op, &$arg1, $arg2) {
switch ($op) {
case 'view':
$contents['coupon'] = array(
'#type' => 'textfield',
'#title' => t('Coupon code'),
'#description' => t('Fill in the coupon code.'),
'#default_value' => '',
);
return array( 'contents' => $contents);
case 'process':
$arg1->coupon = check_plain($arg2['coupon']);
return true;
}
}

Posts: 42
Joined: 09/12/2007
Getting busy with the Ubercode.

I just noticed that the coupon discount is not being sent to paypal.The module seems to work fine everywhere else with the code changes we made. It just doesn't carry through to paypal (both php4 and php5). Anybody else having this problem? Any ideas what code I should look to modify to fix this?

Thanks

EDIT: This was not a bug in the coupon module after all. I had the "PayPal cart submission method" set incorrectly.

Posts: 67
Joined: 08/10/2007

Ok, the discount is showing... I can get to that point in 7c and php5.

But does it apply to the total? Either on Checkout Page or Review Order page, that is...

Posts: 42
Joined: 09/12/2007
Getting busy with the Ubercode.

Hi Miso,

I'm not sure what your question is. The coupon discounts are showing up where they should for us, and the discount is being applied correctly. What does not still seem working for you?

Cheers,

Posts: 67
Joined: 08/10/2007

well, the discount is not being applied at all... that's the problem.

I enter the discount, click Review Order and there's no mention of the discount on the review order page at all.

Guest (not verified)

I'm having the same problem. I installed, enabled, and set up a discount code that allowed access from everyone, created a test order and the discount doesn't show up anywhere, not even on the order review page. Any other suggestions? Puzzled

Posts: 14
Joined: 09/01/2007

I added the coupon module to the site and once I get to the checkout page

I get the following message

Fatal error: Call to undefined function uc_cart_checkout_new_pane() in /home/pandapou/public_html/modules/ubercart/contrib/uc_coupon/uc_coupon.module on line 470

Any ideas why?

Cheers

Posts: 42
Joined: 09/12/2007
Getting busy with the Ubercode.

mintidea,

This was exactly the error we were getting. I said how we fixed it on my post above at (Fri, 09/21/2007 - 01:43). This should work if you are using the same versions we mentioned above.

ps. I PM'd you about your moneris gateway project.

Cheers!

Posts: 14
Joined: 09/01/2007

I am not sure out to do the changes to the coupon module like u said in your post on 09/21/2007

Could you attach the updated module file?

on and Cosmos did a module for me re: moneris gateway its on the contrib page.

Check it out.

Cheers
Adam

Posts: 42
Joined: 09/12/2007
Getting busy with the Ubercode.

Hi Adam,

I missed this request for the module file. Here it is if you still need it.

AttachmentSize
uc_coupon.zip13.35 KB
Posts: 5
Joined: 09/27/2007

I applied this to my site and it worked great. I tested a coupon. I typed in the coupon code and it went to the review page. The coupon showed up on the review page. It was deducted from the total. When I click on submit it sends me to Paypal Payments Standard Site with the order. The total amount is different than the review order total amount. The coupon discount is not showing up on paypal. Is there anything that can be done to fix this. Why isn't it submitting to paypal?

Posts: 42
Joined: 09/12/2007
Getting busy with the Ubercode.

jullio,

Check that you chose "Submit the whole order as a single line item" in your ubercart paypal settings.

Cheers

Posts: 5
Joined: 09/27/2007

Thanks it works now.

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

It seems to work too on alpha 8 but the report get an SQL error :

<?php
user warning
: Table 'XXX.uc_coupons_orders' doesn't exist query: uc_coupon_reports SELECT co.cid, co.oid, co.value, co.code, o.order_total, o.created FROM uc_coupons_orders AS co LEFT JOIN uc_orders AS o ON (co.oid = o.order_id) WHERE o.order_status >= 0 AND o.created > 1195686000 AND o.created < 1195686000 ORDER BY co.cid, o.created ASC in /includes/database.mysqli.inc on line 151.
?>

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Ok I rework a lot of things in the coupon module, I made a standalone contribution. Let's try.

It's still in bug testing, give me feedback.