32 replies [Last post]
cosmo83@drupal.org's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/08/2007
Juice: 236
Was this information Helpful?

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

Was it lost in the crash?

Regards
cosmo

aswalla's picture
Offline
Getting busy with the Ubercode.Spreading the word - Ubercart for president.
Joined: 08/17/2007
Juice: 105
Re: Coupon Functionality

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.zip 6.37 KB
cosmo83@drupal.org's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/08/2007
Juice: 236
Thanks aswalla... Found it

Thanks aswalla...

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

mathews.kyle's picture
Offline
Joined: 08/09/2007
Juice: 44
Re: Thanks aswalla... Found it

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

Miso's picture
Offline
Joined: 08/10/2007
Juice: 134
Re: Re: Thanks aswalla... Found it

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?

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: Re: Thanks aswalla... Found it

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

Miso's picture
Offline
Joined: 08/10/2007
Juice: 134
naturally...

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?

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: naturally...

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.

Miso's picture
Offline
Joined: 08/10/2007
Juice: 134
Re: Re: naturally...

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

aswalla's picture
Offline
Getting busy with the Ubercode.Spreading the word - Ubercart for president.
Joined: 08/17/2007
Juice: 105
Re: Re: Re: naturally...

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

Miso's picture
Offline
Joined: 08/10/2007
Juice: 134
hmm... I've got the bazaar

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

aswalla's picture
Offline
Getting busy with the Ubercode.Spreading the word - Ubercart for president.
Joined: 08/17/2007
Juice: 105
Re: hmm... I've got the bazaar

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

Miso's picture
Offline
Joined: 08/10/2007
Juice: 134
Re: Re: hmm... I've got the bazaar

please do!

mathews.kyle's picture
Offline
Joined: 08/09/2007
Juice: 44
uc_coupon on drupal.org

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

Miso's picture
Offline
Joined: 08/10/2007
Juice: 134
Re: uc_coupon on drupal.org

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!

TCS
TCS's picture
Offline
Getting busy with the Ubercode.
Joined: 09/12/2007
Juice: 55
uc_coupon with ubercart 7c

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

kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
Thanks for the info TCS I'm

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

Miso's picture
Offline
Joined: 08/10/2007
Juice: 134
Re: uc_coupon with ubercart 7c

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.

TCS
TCS's picture
Offline
Getting busy with the Ubercode.
Joined: 09/12/2007
Juice: 55
7c and php5

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;
}
}

jullio's picture
Offline
Joined: 09/27/2007
Juice: 11
It fixed it.

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?

TCS
TCS's picture
Offline
Getting busy with the Ubercode.
Joined: 09/12/2007
Juice: 55
jullio, Check that you chose

jullio,

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

Cheers

jullio's picture
Offline
Joined: 09/27/2007
Juice: 11
It fixed it.

Thanks it works now.

zmove's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 1192
Re: It fixed it.

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

<?php
user warning
: Table 'XXX.uc_coupons_orders' doesnt 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.
?>
zmove's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 1192
Re: Re: It fixed it.

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.

Guest (not verified)
Guest's picture
Can't get coupons to work either

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

TCS
TCS's picture
Offline
Getting busy with the Ubercode.
Joined: 09/12/2007
Juice: 55
paypal

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.

Miso's picture
Offline
Joined: 08/10/2007
Juice: 134
Re: paypal

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

TCS
TCS's picture
Offline
Getting busy with the Ubercode.
Joined: 09/12/2007
Juice: 55
Hi Miso, I'm not sure what

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,

Miso's picture
Offline
Joined: 08/10/2007
Juice: 134
Re: Hi Miso, I'm not sure what

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.

mintidea's picture
Offline
Joined: 09/01/2007
Juice: 30
Re: Coupon Functionality

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

TCS
TCS's picture
Offline
Getting busy with the Ubercode.
Joined: 09/12/2007
Juice: 55
Fatal error: Call to undefined function uc_cart_checkout_new_pan

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!

mintidea's picture
Offline
Joined: 09/01/2007
Juice: 30
Re: Fatal error: Call to undefined function uc_cart_checkout_new

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

TCS
TCS's picture
Offline
Getting busy with the Ubercode.
Joined: 09/12/2007
Juice: 55
Hi Adam, I missed this

Hi Adam,

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

AttachmentSize
uc_coupon.zip 13.35 KB