Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Discount Coupon Codes


kgt

Recommended Posts

I have had that happen to me before with a different module.. I just tried reinstalling this module, and it's still the same... Thanks for the tip :)

 

OMG! It's working!! I love this contrib!! I had to go into my SPPC Customer groups and enable the module to the groups order total module. I can choose which groups (wholesale, retail, vip) get to have the coupon codes...

 

Great stuff!!

 

Thanks PWS!

Link to comment
Share on other sites

OMG! It's working!! I love this contrib!! I had to go into my SPPC Customer groups and enable the module to the groups order total module. I can choose which groups (wholesale, retail, vip) get to have the coupon codes...

 

Great stuff!!

 

Thanks PWS!

 

well done. I have a different SPPC since i cannot chose OT for my groups, but only shipping and payment modules. Chek also if copons exclusions work with groups or you won't be able to separate coupons by group.

 

@rselonke

I do not trust very much in in_array function so first you have to check if the code fall into this condition. You can do it by inserting this 2 lines

print "yes, i'm falling here";
exit;

just after the

if (in_array('ot_discount_coupon', $order_total_array)) {

statement.

the position seems to be right, it's just what i meant.

let me know

 

Bye

 

i forgot to tell you that dumping the array can help you

print_r($order_total_array)

put this just before the return $ot_total_array

Edited by PWS
Link to comment
Share on other sites

Hi Forum folks,

 

I have a website with free shipping standard for all products. Now I want to offer a 20% discount coupon and add a $5.00 shipping fee if you use the coupon code. Is this possible?

 

BigJ

Link to comment
Share on other sites

i forgot to tell you that dumping the array can help you

print_r($order_total_array)

put this just before the return $ot_total_array

 

 

Hmm, now i'm really confused! i used print_r() as you suggested, and got the array. So i then used it both before AND after the unset() function.

 

	print_r($order_total_array);
if ($order_total_array[0] = 'ot_quantity_discount') {
echo "yes, i'm falling here ";
unset($order_total_array[2]);
echo ' |---| ';
}
print_r($order_total_array);

 

It does indeed remove the ot_quantity_discount from the array. however the calculations have all been done and are in the array as values which have been reduced by the ot_quantity_discount in the SECOND print_r() AFTER the unset ahs been called. How do i recalculate the values? Any ideas?

 

I was thinking maybe pre-empt the modules from doing ->output = array... or something else in the "function process() {" to prevent the calculations if the discount_coupon held data in the 'value' field.

 

thanks again, you're a great help to me.

 

rich

Edited by rselonke
Link to comment
Share on other sites

I've installed the module and see "Discount Coupons" under "Catalog" in the admin area, but when I click the "Discount Coupons" link, I get a "Page Not Found" error:

 

404 Not Found

 

The requested URL /bookstore/admin/FILENAME_DISCOUNT_COUPONS does not exist.

 

I've run the SQL you provided in the instructions, I've double checked to make sure I uploaded all the files into all the right directories. Any ideas about what's happening here?

Link to comment
Share on other sites

I have Oscommerce V2.2.RC2 with ot_discount_coupon_codes_3_34 installed and PayPal Website Payments Standard. Everything works fine until I go to confirm order.

With No discount code applied when I confirm order it goes straight through to PayPal, but with a discount code applied I get the following error.

'This invoice has already been paid. For more information, please contact the merchant'

Can anyone please help

Link to comment
Share on other sites

Hi There,

 

I've had this contribution running for about a year now but keep getting complaints from my users. Right now the coupon is entered after the credit card info. If the discount changes the shipping cost the screen resets back to the shipping page and the customer has to re-enter their CC info again. I've spent hours looking for an answer but have found none.

 

Anyone know if the entry can be moved before the shipping page and how to do it?

 

Thanks,

OX

Link to comment
Share on other sites

I've installed the module and see "Discount Coupons" under "Catalog" in the admin area, but when I click the "Discount Coupons" link, I get a "Page Not Found" error:

 

404 Not Found

 

The requested URL /bookstore/admin/FILENAME_DISCOUNT_COUPONS does not exist.

 

I've run the SQL you provided in the instructions, I've double checked to make sure I uploaded all the files into all the right directories. Any ideas about what's happening here?

 

Did you add to admin/includes/filenampes.php at the bottom of the page before the closing ?>

 

  //kgt - discount coupons
 define('FILENAME_DISCOUNT_COUPONS','coupons.php');
 define('FILENAME_DISCOUNT_COUPONS_MANUAL', 'coupons_manual.html');
 define('FILENAME_DISCOUNT_COUPONS_EXCLUSIONS', 'coupons_exclusions.php');
 //end kgt - discount coupons

Link to comment
Share on other sites

I had an SQL error...

 

#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1' at line 13

 

My SQL databse knowledge and operation is very little. Please can someone tell me what I should do.

 

Thanks

Link to comment
Share on other sites

Do a google search by pasting this into the search box (including the quotes):

 

site:www.oscommerce.com/forums "Warning: Cannot modify header information - headers already sent"

 

This should bring up a whole list of spots in the forums where people have come accross this error and how to fix it as it's a common one :)

 

anyone knows how to fix the following error caused by discount_coupon.php....

 

Warning: Illegal offset type in /homepages/13/d269723143/htdocs/store/includes/classes/discount_coupon.php on line 361

 

Warning: Illegal offset type in isset or empty in /homepages/13/d269723143/htdocs/store/includes/classes/discount_coupon.php on line 364

 

Warning: Illegal offset type in /homepages/13/d269723143/htdocs/store/includes/classes/discount_coupon.php on line 365

 

Warning: Cannot modify header information - headers already sent by (output started at /homepages/13/d269723143/htdocs/store/includes/classes/discount_coupon.php:361) in /homepages/13/d269723143/htdocs/store/includes/functions/general.php on line 33

~Tracy
 

Link to comment
Share on other sites

In your admin panel, go under modules, Order Total and under the discount coupons area there is a setting to exclude specials from the coupons :)

 

The contribution works!!!

One question though: how do I add CATEGORY SPECIALS to exclusion list? I am thinking that those are on sale anyway and would like to exclude those products from further discount.

 

Thanks alot for the contribution!!!

~Tracy
 

Link to comment
Share on other sites

Hi,

the Coupon is working fine for me, except one little thing:

I set the min. order amount at 20Euro and give a discount over 10Euro.

If your cart has an amount from 1-9Euro, you`ll get an error message!

From 10-xxxEuro, you`ll get the discount. But you shouldn`t!

Only for 20Euro and up... Why is there a 10Euro "discount hole"?

If I set the amount to 30Euro, it works fine!!!

The only thing is, under 20Euro cart worth, the error message says:

"Min. amount is 30Euro!" Not right but working this way.

Where`s the hook?

 

Is it in includes/classes/discount_coupon.php?

Maybe here somewhere:

 function check_coupons_min_order() {
  switch( $this->coupon['coupons_min_order_type'] ) {
	//minimum number of products:
	case 'quantity':
	  global $cart;
	  $total = $this->cart_info['valid_products']['count'];
	  if( $this->coupon['coupons_min_order'] > $total ) { //make sure there are enough products in the cart
		$this->message( sprintf( ENTRY_DISCOUNT_COUPON_MIN_QUANTITY_ERROR, $this->coupon['coupons_min_order'] ) );
		if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DEBUG == 'true' ) $this->message( 'INFO: Failed to pass check_coupons_min_order(): $total='.$total, 'debug' );
		return false;
	  }
	  break;
	//minimum price:
	case 'price':
	default:
	  global $order, $currencies;
	  $total = $this->cart_info['valid_products']['total'];
	  //if we display the subtotal without the discount applied, then just compare the subtotal to the minimum order
	  if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_SUBTOTAL == 'false' && $this->coupon['coupons_min_order'] > $total ) {
		$this->message( sprintf( ENTRY_DISCOUNT_COUPON_MIN_PRICE_ERROR, $currencies->format( $this->coupon['coupons_min_order'], true, $order->info['currency'], $order->info['currency_value'] ) ).'.' );
		if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DEBUG == 'true' ) $this->message( 'INFO: Failed to pass check_coupons_min_order(): $total='.$total, 'debug' );
		return false;
	  //if we display the subtotal with the discount applied, then we need to compare the subtotal with the discount added back in to the minimum order
	  } else if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_SUBTOTAL == 'true' ) {
		$subtotal = $total;
		foreach( $this->applied_discount as $discount ) {
		  $subtotal += $discount;
		}
		if( $this->coupon['coupons_min_order'] > $subtotal ) {
		  $this->message( sprintf( ENTRY_DISCOUNT_COUPON_MIN_PRICE_ERROR, $currencies->format( $this->coupon['coupons_min_order'], true, $order->info['currency'], $order->info['currency_value'] ) ).'.' );
		  if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DEBUG == 'true' ) $this->message( 'INFO: Failed to pass check_coupons_min_order(): $subtotal='.$subtotal, 'debug' );
		  return false;
		}
	  }
	  break;
  }
  return true;
}

I`m not sure...

 

Thank you for your time!

ChilliNr1

Link to comment
Share on other sites

Step 3 of the instructions tells you that you need to run two statements via phpMyAdmin (generally available via your host's control panel). You need to select your OSC database, then click the SQL tab along the top. Copy and paste the following two statements into the text area provided and click Go.

 

Is it possible for someone to fill me in the other steps that are involved in this process. I installed this code as it says in the instructions but when I go to my admin>catalog, I do not see the discount coupon config to install it. What am I missing?

 

I am not knowledgeable at all in this and a step by step scenario would really help me to figure out how to install this.

 

Thank you everyone for your time.

Link to comment
Share on other sites

Discount Coupon value gets added to the sub total rather then deduct from subtotal

anyone knows how to fix this?

I also have the exact same problem.

I have Oscommerce V2.2.RC2 with ot_discount_coupon_codes_3_34 installed.

I do not see anywhere where its answered directly. I have checked my installation and all seems well.

Any answers?

Link to comment
Share on other sites

I think I have a contribution confict here. When I go to click on the admin link it tried to take me to

 

FILENAME_COUPON_ADMIN?selected_box=gv_admin

 

and I get nothing, could this be because of the Ultimate SEO contrib or the Header Tags SEO?

 

or is this somthing that has been encountered before and i need to go back and read up

The Site can be viewed at www.performanceautopartsonline.com

 

The site is live (despite these minor glitches) please respect that and do not sign up etc...

 

maybe a contribution one day when I get this site the way I want it.

 

I don't make spelling mistakes! I have dyslecsic fingers.

Link to comment
Share on other sites

Ok I got it working.

 

Do we have any programmers following this thread?

 

This is not as sophisticated as the CCGV contribution and I was wondering if a couple of those files could be modified to work with this contribution.

 

Namely:

being able to limit the products or categories that the discount coupon can be applied to

 

you could give someone a discount on an expensive item say $100 off and if they apply that to a cheaper item that only cost $125 you end up giving it away (if you honor it)

The Site can be viewed at www.performanceautopartsonline.com

 

The site is live (despite these minor glitches) please respect that and do not sign up etc...

 

maybe a contribution one day when I get this site the way I want it.

 

I don't make spelling mistakes! I have dyslecsic fingers.

Link to comment
Share on other sites

again my bad I just noticed that it is applied after the coupon is created, disregard. Doh

 

Excellent contribution.

The Site can be viewed at www.performanceautopartsonline.com

 

The site is live (despite these minor glitches) please respect that and do not sign up etc...

 

maybe a contribution one day when I get this site the way I want it.

 

I don't make spelling mistakes! I have dyslecsic fingers.

Link to comment
Share on other sites

Major Problem!

 

So as I am going though all of the testing i now find that the amount for the total after the payment information is entered is being doubled and i cannot seem to find out why.

The Site can be viewed at www.performanceautopartsonline.com

 

The site is live (despite these minor glitches) please respect that and do not sign up etc...

 

maybe a contribution one day when I get this site the way I want it.

 

I don't make spelling mistakes! I have dyslecsic fingers.

Link to comment
Share on other sites

I installed this contrib on yesterday and all seemed to go well until the end. When I login to the admin panel and go to modules -> order total, I can see the coupon module (good). When I highlight it and click the install button on the right, nothing happens (bad). Is there a file I missed or some common issue before I try to uninstall and start over? Thanks in advance.

Link to comment
Share on other sites

Everything is working great until I want to edit or delete existing coupon. When I try to edit it, I get this error and I cann:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home1/xxxxxx/public_html/trgovina/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home1/xxxxxxx/public_html/trgovina/admin/includes/classes/object_info.php on line 18

 

And when I confirm the delete of existing coupon, it just reloads and nothing happens. Coupon is still there.

 

What could be the problem?

 

Recently I migrated my store to another server (hosting) and I had some PHP5 or MySQL5 upgrade errors, which I have already solved.

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