Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Discount Coupon Codes


kgt

Recommended Posts

Thanks for a great mod kgt! I've got a heavily modded site but am only using DCC for coupons. I've got everything installed okay and was able to create a coupon with product exclusions only and 10% off. But then I go to test it and I'm getting an incorrect total - it always comes up $0.00:

 

2 x Respiratory Systems and Technologies eTraining Program $698.00

 

Discount Coupon 32UY5C applied: -$69.80

Sub-Total: $628.20

Total: $0.00

 

I've pm'd you my debug report from payment_confirmation.php - though this debug was outputted for only 1 item at only $349.00 so if the totals in the debug look different that's why.

 

Any insight into fixing this would be greatly appreciated - I've been pouring over the support thread for hours!

 

Thanks! - Val

Link to comment
Share on other sites

Hi,

 

Thanks for the reply. I sifted through the posts and did not see anything that looked obvious.

 

It appears the the Paypal version, which includes Express Checkout which can not be disabled, is where my problem is.

 

Here is what I see:

 

PayPal puts a checkout button on the shopping cart page, on the shipping page and the payment page.

( I manually disabled the former for testing)

 

If you select an express checkout button then I don't believe the coupon code gets seen.

 

If you use a credit card and check out normally every thing works fine.

 

If you partially check out using a credit card and go then go back and use express checkout then it appears the proper data gets sent to paypal. So it looks like there needs to be some way to capture the coupon code earlier for these contributions to like each other.

 

It looks like I'm running version 3.0 of your contribution based on the file headers.

I have SEO optimization installed

 

The site was working with a different wpp contribution. (It's difficult to sift though some of the paypal stuff but that another subject.) But we encountered a situation where a customer could avoid paying shipping so it seemed logical to update to a paypal supported module. Perhaps that was my mistake.

 

I manually compared each existing file and moved your code to the paypal files.

 

I do not think there is a problem with the contribution, I believe the architecture of the paypal version of WPP is just different, hence my question has any one been able to run with their version. I guess a good question would be should I be using a different payment pro module?

 

I'm not dismissing the obvious possibility that I've missed something so if some has been successful I know where to point the finger. I downloaded the paypal contribution form the paypal developer site.

 

Thanks,

jtc

 

 

So it sounds like everything works fine EXCEPT for the express checkout? I'm not familiar with how the express checkout actually works, so I'd be making a guess as to what's the problem. Did express checkout work with coupons before you switched?

 

Send me an email or PM with the contents of includes/modules/payment/your_paypal_module.php.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

hi kgt. ok thanks for the offer to help! just to clear up before hand, in the version 3.3 clean install, do i still need to run any SQL? coz if yes, i did not run any.

 

There's no SQL to manually run - it's run automatically when you install the module.

 

I don't see a problem here. Do you have a testing site? I am afraid the only thing to do is go through and see if we can figure out why those entries aren't going into the discount_coupons_to_orders table. I'll need you to add some output statements to that file.

 

Does the rest of the order procedure with a coupon work fine? IE, the discount is applied and you can see the discount on the order in the admin section?

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Sorry if this has been touched on already, but I searched this topic and could not find anything pertaining to this.

 

I have the newest version of your contribution installed- 3.3. Everything is working flawlessly. When the customer gets to checkout_confirmation.php, their shopping cart total is displayed with the coupon discount. In the upper right hand corner I have boxes/shopping_cart.php, and the total shows there without the coupon discount.

 

This has been confusing to some of my customers. What updates do I have to do to boxes/shopping_cart.php in order for it to display the discounted price? Thank you!

 

BTW- I have never seen anybody support their mod/contribution like KG does- for ANY script I have used in the past. GREAT SUPPORT!

 

 

This might work:

 

boxes/shopping_cart.php replace this:

  $info_box_contents = array();
 $info_box_contents[] = array('text' => $cart_contents_string);

 if ($cart->count_contents() > 0) {
$info_box_contents[] = array('text' => tep_draw_separator());
$info_box_contents[] = array('align' => 'right',
							 'text' => $currencies->format($cart->show_total()));
 }

 new infoBox($info_box_contents);

 

with this:

  $info_box_contents = array();
 $info_box_contents[] = array('text' => $cart_contents_string);

 $discount = 0;
 if(tep_session_is_registered('coupon') && is_object($order->coupon)) $discount = array_sum($order->coupon->applied_discount);

 if ($cart->count_contents() > 0) {
$info_box_contents[] = array('text' => tep_draw_separator());
$info_box_contents[] = array('align' => 'right',
							 'text' => $currencies->format(($cart->show_total() - $discount)));
 }

 new infoBox($info_box_contents);

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Hi all,

 

I've been trying to install the latest version of the contribution but am receiving the following error when I go to admin>catalog>discount coupons:

I've tried to search for a solution but have come up with only ideas. The prevailing one is that I've installed old SQL tables.

 

 

You are correct. You can get the SQL to update your tables from version 3.0 of the DCC contributions page. Since you have version 2.* installed, the upgrade instructions for version 3.3 will not be correct for you. You will need to install 3.3 from the new installation instructions.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

So it sounds like everything works fine EXCEPT for the express checkout? I'm not familiar with how the express checkout actually works, so I'd be making a guess as to what's the problem. Did express checkout work with coupons before you switched?

 

Send me an email or PM with the contents of includes/modules/payment/your_paypal_module.php.

 

Hi KGT,

I must say your support is excellent.

 

I believe everything in your contribution was working prior to my switching the PayPal maintained Website Payment Pro contribution.

 

I have removed the PayPal version and replaced it with Brian Burton's (dynamoeffects) contribution and everybody seems to be playing together nicely.

http://www.oscommerce.com/community/contributions,3647

 

Thank you for your help.

 

john

Link to comment
Share on other sites

Changing the SQL fixed that problem, but I've run into another. I can create a new discount coupon, but it doesn't show up. This I assume is because the step of the installation where you go into admin>modules>order total and install, I don't see the Discount Coupon option.

 

There's no error or anything of that sort and when I try to go through a purchase of an item with a created coupon, no dice there either.

 

Any ideas? Thanks.

Link to comment
Share on other sites

I am acutally having the same problem as Matt in regards to the coupons. I have the module working just fine, but I cannot get the code to accept. when you type in the code, the page returns with no errors. However, when you don't put in a code, the page processes successfully to the final payment screen. I could use some insight. I browsed through the topics, but the only time I saw this was before this version was released.

 

Your help on this product is SO greatly appreciate. Thank you! My client is going to be thrilled once it's actually fucntioning properly.

Link to comment
Share on other sites

See the README for help with common problems like this one. Likely causes are a non-unique sort order, you missed the changes to includes/classes/order.php, or you missed the changes to checkout_confirmation.php.

 

KGT,

Are you saying that even thought I installed the latest version [3.3] of the program I still need to manually edit the includes/classes/order.php? Please clarify. The instructions were not clear on that, but after reading all the posts, it looks as though this may be my answer.

 

Thank you again!

Link to comment
Share on other sites

KGT,

Are you saying that even thought I installed the latest version [3.3] of the program I still need to manually edit the includes/classes/order.php? Please clarify. The instructions were not clear on that, but after reading all the posts, it looks as though this may be my answer.

 

Thank you again!

 

 

The version doesn't matter. Since version 1.0 you've had to make changes to the order.php file. You can avoid making manual changes if you have no other contributions installed and you just uploaded all the files found in the install zip.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Changing the SQL fixed that problem, but I've run into another. I can create a new discount coupon, but it doesn't show up. This I assume is because the step of the installation where you go into admin>modules>order total and install, I don't see the Discount Coupon option.

 

There's no error or anything of that sort and when I try to go through a purchase of an item with a created coupon, no dice there either.

 

Any ideas? Thanks.

 

 

Quite frankly, I don't know exactly what will happen (what symptoms you'll get) if you don't install the module in Modules > Order Total in the admin section, but I am certain DCC will never work without doing that step.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

I am acutally having the same problem as Matt in regards to the coupons. I have the module working just fine, but I cannot get the code to accept. when you type in the code, the page returns with no errors. However, when you don't put in a code, the page processes successfully to the final payment screen. I could use some insight. I browsed through the topics, but the only time I saw this was before this version was released.

 

Your help on this product is SO greatly appreciate. Thank you! My client is going to be thrilled once it's actually fucntioning properly.

 

 

This is a little different than what I thought you had first reported. When you enter a coupon, do you get to the confirmation page or just stay on the payment page? If you stay on the payment page, then that is another type of error.

 

If you stay on the payment page, see if there's an error message in the URL in your browser. See the REDAME for help with that problem.

 

If you get to the confirmation page when entering a code, then the problem is likely within the code in includes/classes/order.php or checkout_confirmation.php or you do not have a unique sort order for the module in Modules > Order Total in your admin section.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

.....If you stay on the payment page, see if there's an error message in the URL in your browser. See the REDAME for help with that problem.

 

KGT,

Thank you! I was able to see the error. I read the manual, but did not see the "error" at the top of the page. The problem was with the way my client had formatted the date - minor indeed.

Link to comment
Share on other sites

It depends on the paypal module. It would be a simple change. All you would need to do is edit the payment module. I can give generic instructions for doing so. I haven't tested this, so please make these changes on a test site.

 

includes/modules/payment/paypal_whatever.php (whatever the name of your paypal module is)

 

find:

function before_process() {

 

if it doesn't look like this:

	function before_process() {
  return false;
}

Then add this code right after the "function before_process() {" part:

function before_process() {
global $order;
if($order->info['total'] != 0) {

 

and before the closing } for that function, add another }.

 

Do the same to after_process if it's not empty. So your function(s) might look like this:

 

	function before_process() {
  global $order;
  if($order->info['total'] != 0) {
	//existing paypal code in this function
  }
}

function after_process() {
  global $order;
  if($order->info['total'] != 0) {
	//existing paypal code in this function
  }
}

 

Hallo Kgt

 

I use paypal_ipn and have tried your suggetion but the code never goes in this functons. and i am forwarded to paypal page again.

I think this has no relation with the paypal-ipn module. instead we should make some checks in the checout_confirmation page and if the $order->info['total'] == 0 then the next page should be chekout_success page.

 

maybe something in this place in checkout_confirmation.php

 

if (isset($$payment->form_action_url)) {

$form_action_url = $$payment->form_action_url;

} else {

$form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');

}

 

echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');

 

if (is_array($payment_modules->modules)) {

echo $payment_modules->process_button();

}

 

echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n";

 

hier we can make a check whether the total is 0 or not and if it is then we set the $form_action_url as our new page which does the rest of the job (I don't know exactly what this new file should do!! for example insert the order to the table or something like this)

 

could you maybe help me ?

 

thanks a lot

Link to comment
Share on other sites

There's no SQL to manually run - it's run automatically when you install the module.

 

I don't see a problem here. Do you have a testing site? I am afraid the only thing to do is go through and see if we can figure out why those entries aren't going into the discount_coupons_to_orders table. I'll need you to add some output statements to that file.

 

Does the rest of the order procedure with a coupon work fine? IE, the discount is applied and you can see the discount on the order in the admin section?

 

hi,

 

everything else works fine, i guess. by everything i meant:

- i can create discount coupon in my admin

- i can assign coupon to my customers

- when they put in the coupon during checkout, the discounts are being done correctly

 

but after the confirmation of payment (using Internet Transfer contribute), the coupon can be reused for the next purchase. even after limiting its usage.

 

i also discover a problem when i give a 100% discount (i.e. free purchase)... if the customer selected PayPal and use the 100% discount coupon, they are still redirected to PayPal and given the error because it's $0 payment. if possible you have a fix for this as well? i am not sure how... it's the same problem as the Points and Rewards contribute.

 

unfortunately i do not have a test site, its a live shop. but do let me know what file i need to pull out for you to inspect if need be. will it help if you visit my live shop and register? i can probably create a dummy account for you and a coupon for you to try.

 

thank you so much for you help!!

Link to comment
Share on other sites

Hello-

 

Is there a way to limit free shipping to one option..ie exclude express shipping as free? (Express shipping is usually 25 dollars :blink: )

 

Thanks! :rolleyes:

I am a Jedi, like my father before me!

Link to comment
Share on other sites

Hello All,

 

I've looked through the forums and haven't found an answer. I am getting this error, and so far I haven't found a cure for it:

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/geekfitt/public_html/admin/includes/boxes/catalog.php on line 31

 

I get this error when I log in to admin then click on configuration.

 

Any suggestions? Thank you in advance.

 

Best,

 

Chris

Link to comment
Share on other sites

Hello All,

 

I've looked through the forums and haven't found an answer. I am getting this error, and so far I haven't found a cure for it:

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/geekfitt/public_html/admin/includes/boxes/catalog.php on line 31

 

I get this error when I log in to admin then click on configuration.

 

Any suggestions? Thank you in advan

 

Best,

 

Chris

 

Make sure you have a . after <br>

 

for example - '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>' .

 

I noticed this was missing on mine (admin/includes/boxes/catalog.php)..also you might check the following change and make sure its not there too.

Edited by pinklep

I am a Jedi, like my father before me!

Link to comment
Share on other sites

I think this issue has been brought up before and there was a simple resoultion. But once I updated to the latest version the update was wiped out and I just realized it.

 

In my case the discount is being applied AFTER the tax calculation. This means my clients are paying tax on the higher, pre-discount amount. I'd like the discount to be applied BEFORE the tax, therefore taxes are calculated on the lower, discounted price. What changes do I have to make so this is the case?

 

Anthony

Link to comment
Share on other sites

Here's an interesting update. It seems that the CHECKOUT does the calculations correctly but when reviewing the order in the order editor it shows the calculations done differently.

 

Anthony

Link to comment
Share on other sites

Sorry still be N00b here again I have downlod discount coupons 3.3 and with conjuction with some other contribions such Qt pro and Proudct image directory everything tostar with seems to be ok but i whenever i try to end the discount code in the

 

Do you have a promotional code or discount coupon?

 

Coupon Code:

 

 

Just moves to comfrimation screen without any discounts the stranges thing is there no error messages

 

i hav cras all through 68 pages but it seems that anything i do it do seems to be playing ball any help ??

Link to comment
Share on other sites

Make sure you have a . after <br>

 

for example - '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>' .

 

I noticed this was missing on mine (admin/includes/boxes/catalog.php)..also you might check the following change and make sure its not there too.

 

It worked! Thank you! And note to the next person who updates this, please include the period.

Link to comment
Share on other sites

Sorry still be N00b here again I have downlod discount coupons 3.3 and with conjuction with some other contribions such Qt pro and Proudct image directory everything tostar with seems to be ok but i whenever i try to end the discount code in the

 

Do you have a promotional code or discount coupon?

 

Coupon Code:

 

 

Just moves to comfrimation screen without any discounts the stranges thing is there no error messages

 

i hav cras all through 68 pages but it seems that anything i do it do seems to be playing ball any help ??

 

Hi guys I am still trying to figure out where I have gone wrong with this contribution The adim of the coupon seem to be working fines as in no errors at all, but the actual enter the code to get the discount doesn't work. Is theresuch a thing like and comfrimation button to add/ comfrim the code into the " Do you have a promotional code or discount coupon? Coupon Code: " box when I press return the it goes straight to the Order Confirmation page without discount taken off all any discount showing any ideas ??

Link to comment
Share on other sites

Hi guys I am still trying to figure out where I have gone wrong with this contribution The adim of the coupon seem to be working fines as in no errors at all, but the actual enter the code to get the discount doesn't work. Is theresuch a thing like and comfrimation button to add/ comfrim the code into the " Do you have a promotional code or discount coupon? Coupon Code: " box when I press return the it goes straight to the Order Confirmation page without discount taken off all any discount showing any ideas ??

 

 

Hooray i solved it was an issues between QT pro version and Discount Coupon checkout_payment.php all works now fine :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...