Jump to content



Photo
* * * - - 3 votes

[add-on] Discount Code (support)


  • Please log in to reply
143 replies to this topic

#81   sedemik

sedemik
  • Members
  • 32 posts
  • Real Name:Mikko
  • Gender:Male

Posted 25 November 2011 - 08:36

Sorry, I forgotted to attach the file.

Attached File  user_group_for_discount_code.zip   32.58KB   9 downloads

#82   Whittie

Whittie
  • Members
  • 7 posts
  • Real Name:Alex Whitfield

Posted 02 December 2011 - 11:23

Hi guys, great addon - Thanks.

I have two issues however, which are probably very simple to fix, but just can't get my head around.

1 - The discount code section should be in its own box, this however isn't showing.

[img]http://img33.imageshack.us/img33/9867/helpcs.jpg[/img]

2 - Paypal - The PayPal isn't working on "Discount Code 2.9 for osCommerce 2.2" version. I've applied the paypal fix but to no joy.

Wanting to get a mailshot sent out asap, so would really appreciate an answer.

Many Thanks

Alex

Edited by Whittie, 02 December 2011 - 11:24.


#83   Whittie

Whittie
  • Members
  • 7 posts
  • Real Name:Alex Whitfield

Posted 05 December 2011 - 09:28

Guessing the problem hasn't been resolved then??

#84   jordana

jordana
  • Members
  • 1 posts
  • Real Name:Jorana

Posted 13 December 2011 - 01:20

Hi, I just installed this, got to step 14: Install the module under Administration -> Modules -> Order Total -> Discount Code.
When I go to this page Discount Code is listed, but when I click on it, nothing happens. There's no "install" button. Any ideas of where the problem could be?

Thank you.

I installed Discount Code 2.9 for osCommerce 2.2

Edited by jordana, 13 December 2011 - 01:22.


#85   nammm

nammm
  • Members
  • 2 posts
  • Real Name:Henderson
  • Gender:Male

Posted 14 December 2011 - 23:24

Hi,

I installed Discount Code 2.9 for osCommerce 2.2 on V2.2 RC2. Everythings working fine until checkout_confirmation.php where i cant see the discount field or its being applied to the Sub-total.

Attached a Screencap of how it looks.

Appriciate any help on this.

http://i.imgur.com/ZDAkz.png

thanks

Edited by nammm, 14 December 2011 - 23:25.


#86   nammm

nammm
  • Members
  • 2 posts
  • Real Name:Henderson
  • Gender:Male

Posted 15 December 2011 - 18:12

Anyone /sad.png' class='bbc_emoticon' alt=':(' />

#87   paccman

paccman
  • Members
  • 7 posts
  • Real Name:emile

Posted 29 December 2011 - 19:59

The contributor has updated his package and you can now download the latest full package from his site. This was on 26/12/2011

http://high-quality-...erce_2.3.1.html

Edited by paccman, 29 December 2011 - 19:59.


#88   saupe31

saupe31
  • Members
  • 54 posts
  • Real Name:carl

Posted 31 December 2011 - 13:06

ok install this and the paypal standard fix but it only seems to send the right amount to pay to paypal when you do apply to order sub total if you apply to total it ignores the discount

#89   kevinb456

kevinb456
  • Members
  • 23 posts
  • Real Name:Kevin

Posted 11 January 2012 - 01:21

Hi Kevin, thanks for your solution but I would like to set Paypal IPN module set to 'per item' mode. Do you know what modification is required in order to make it work with 'per item'? Thanks!


I've got this to work with 'per item' mode (whoop!), it seems the following are important;
  • discount should be in the 'discount_amount_cart' parameter
  • there should be NO tax_1, tax_2, etc parameters declared.
  • declare the full tax in the 'tax_cart' parameter instead
The second point is crucial, if these variables are declared, then paypal ignores the discount amount.


So to fix;

Step 1 - Comment out the following line:

$parameters['tax_' . $item] = number_format($tax_value * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));

Step 2 - Change the discount code added from my previous post (quoted at the bottom), to instead be;

if (isset($order_total['ot_discount'])) {	
$parameters['discount_amount_cart'] = number_format(($order_total['ot_discount']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
if (MOVE_TAX_TO_TOTAL_AMOUNT != 'True') $parameters['tax_cart'] = $tax_total;
}

The method will apply generally to other setups, just you will have to figure out where to code the parameters. (my original post quoted below is the code I added for my setup)

I've found the solution to making this mod work with Paypal IPN 2.3.4.6 [img]http://forums.oscommerce.com//public/style_emoticons/default/thumbsup.gif[/img]
This may also work with other paypal mods and other discount mods, but you need to check the variable names to be certain.
This is only for use with the Paypal IPN module set to 'aggregate' mode, not 'per item' (although it would work with a bit of modification).


Open \catalog\includes\modules\payment\paypal_ipn.php

Find the code:

		if(MOVE_TAX_TO_TOTAL_AMOUNT == 'True') {
		  $parameters['amount'] = number_format(($subtotal + $order->info['tax']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
		} else {
		  // default
		  $parameters['amount'] = number_format($subtotal * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
		  $parameters['tax'] = number_format($order->info['tax'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
		}

(make sure this is correct, there's another 'IF' block that looks very similar in a different loop)
Add the following code directly after:

if (isset($order_total['ot_discount'])) {	
	$parameters['discount_amount'] = number_format(($order_total['ot_discount']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
}


Done!

The discount will now be included in the paypal payment page, and its event under a special 'discount' heading so your customer can see how much they're saving!


EDIT: I guess you could also set the variable 'discount_amount_cart' instead of 'discount_amount' (see https://cms.paypal.c...d_htmlvariables), but this seems to work so I haven't played around too much. 'discount_amount_cart' is infact for the whole cart so this may work better for aggregate mode.



#90   StonerArms

StonerArms
  • Members
  • 21 posts
  • Real Name:Matt

Posted 13 January 2012 - 06:56

Yep.....completely lost. I set my site up but I can't, for the life of me, figure out how to get the discount code to work.

#91   StonerArms

StonerArms
  • Members
  • 21 posts
  • Real Name:Matt

Posted 13 January 2012 - 07:15

So....since I'm not figuring this out....where do I need to install the Discount Code file. I have made it through getting the site up and running and set up but I am having a HUGE brain fart right now.

#92   Trentide

Trentide
  • Members
  • 475 posts
  • Real Name:Jason Maier
  • Gender:Male

Posted 10 March 2012 - 01:40

What a great add-on!! Everything works great except.......has anyone come up with a solution for the tax problem? I've tried all the solutions mentioned in this post, with no luck. None of those work properly either. It looks as though the taxes are being calculated before the discount takes place. In other words, on the original price, Any and all information will be well received by many.

Peace,

Jason

#93   Trentide

Trentide
  • Members
  • 475 posts
  • Real Name:Jason Maier
  • Gender:Male

Posted 12 March 2012 - 19:50

I contacted high-quality-php-coding.com that created this handy ADD-ON and explained the problem and got following reply:


Hello,

Thank you for your interest in our product.

To get correct order total info, you should adjust the following
variables:

$order->info['tax']
$order->info['tax_groups'][<your tax>]
$order->info['total']

Sincerely,
The High Quality PHP Coding Team.


This was posted by someone previously regarding fixing the tax problem with this contribution. Does anyone know how to adjust this so we can get this invaluable contribution to work properly with taxes?

Thanks so much!

Jason

#94   matrism

matrism
  • Members
  • 7 posts
  • Real Name:shahrul iman

Posted 27 March 2012 - 09:53

Hi all,

Anyone able to make it work with One Page checkout? right now I am able to include the discount field and also the ajax validation. it works. Can someone point me or help how to trigger the java to load the discount into the Order total. please.

#95   parasit55

parasit55
  • Members
  • 14 posts
  • Real Name:Simon
  • Gender:Male
  • Location:Slovenia

Posted 01 April 2012 - 12:56

Hello

I could use help in changing the code for a discount.

The default should always be that items are not included in the campaign. Currently, so that all items immediately in action with the code for the discount. I could use the inverse operation to choose which items are included.

Can anyone help me?

#96   Mike Owings

Mike Owings
  • Members
  • 2 posts

Posted 06 April 2012 - 22:11

Gang,

Total newb here and I'm pretty sure my backup is corrupt so whatever assistance you can provide is greatly appreciated.

I tried installing the 3.1.1 full but ran into some trouble. I can't recall exactly what the issue was but we reverted to backup. All was well.

Now that the store is up and running, discount codes were requested again. Instead of going from 3.1.1 again, opted to go from 2.6 and upgrade so I could not any errors.

Well boy did I get one. The following appears at the top of every page in the site except checkout:

// Discount Code 2.6 - start define('TABLE_CUSTOMERS_TO_DISCOUNT_CODES', 'customers_to_discount_codes'); define('TABLE_DISCOUNT_CODES', 'discount_codes'); // Discount Code 2.6 - end
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ab20256/public_html/shop/includes/database_tables.php:67) in /home/ab20256/public_html/shop/includes/functions/sessions.php on line 102
// Discount Code 2.6 - start define('TEXT_DISCOUNT', 'Discount'); define('TEXT_DISCOUNT_CODE', 'Discount Code'); // Discount Code 2.6 - end // Discount Code 2.6 - start if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true') { if (!tep_session_is_registered('sess_discount_code')) tep_session_register('sess_discount_code'); if (!empty($HTTP_GET_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_GET_VARS['discount_code']); if (!empty($HTTP_POST_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_POST_VARS['discount_code']); } // Discount Code 2.6 - end


Checkout brings the following error:

// Discount Code 2.6 - start define('TABLE_CUSTOMERS_TO_DISCOUNT_CODES', 'customers_to_discount_codes'); define('TABLE_DISCOUNT_CODES', 'discount_codes'); // Discount Code 2.6 - end
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ab20256/public_html/shop/includes/database_tables.php:67) in /home/ab20256/public_html/shop/includes/functions/sessions.php on line 102
// Discount Code 2.6 - start define('TEXT_DISCOUNT', 'Discount'); define('TEXT_DISCOUNT_CODE', 'Discount Code'); // Discount Code 2.6 - end // Discount Code 2.6 - start if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true') { if (!tep_session_is_registered('sess_discount_code')) tep_session_register('sess_discount_code'); if (!empty($HTTP_GET_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_GET_VARS['discount_code']); if (!empty($HTTP_POST_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_POST_VARS['discount_code']); } // Discount Code 2.6 - end
Warning: Cannot modify header information - headers already sent by (output started at /home/ab20256/public_html/shop/includes/database_tables.php:67) in /home/ab20256/public_html/shop/includes/functions/general.php on line 45



Any advice? Really need this fixed as soon as possible but I'm at a complete loss.

Thanks!

Edited by Mike Owings, 06 April 2012 - 22:17.


#97   leathernecksswflcom

leathernecksswflcom
  • Members
  • 52 posts
  • Real Name:Ray Walters

Posted 07 April 2012 - 01:42

I thought this would be a great way to give our club members a discount so I downloaded the add-on and read the readme.txt till I was blue in the face. I installed just the way it said and when I go to install the module I get all of this:

Order Total [img]http://www.leathernecks-swfl.com/store/admin/images/pixel_trans.gif[/img] Back
Warning: include(/hermes/bosweb26d/b447/ipw.leathernecksswflcom/public_html/leathernecks/store/includes/languages/english/modules/order_total/ot_discount.php) [function.include]: failed to open stream: No such file or directory in/hermes/bosweb26d/b447/ipw.leathernecksswflcom/public_html/leathernecks/store/admin/modules.php on line 129

Warning: include() [function.include]: Failed opening '/hermes/bosweb26d/b447/ipw.leathernecksswflcom/public_html/leathernecks/store/includes/languages/english/modules/order_total/ot_discount.php' for inclusion (include_path='.:/usr/local/lib/php-5.2.17/lib/php') in/hermes/bosweb26d/b447/ipw.leathernecksswflcom/public_html/leathernecks/store/admin/modules.php on line 129

Warning: include(/hermes/bosweb26d/b447/ipw.leathernecksswflcom/public_html/leathernecks/store/includes/languages/english/modules/order_total/ot_shipping.php.php) [function.include]: failed to open stream: No such file or directory in/hermes/bosweb26d/b447/ipw.leathernecksswflcom/public_html/leathernecks/store/admin/modules.php on line 129

Warning: include() [function.include]: Failed opening '/hermes/bosweb26d/b447/ipw.leathernecksswflcom/public_html/leathernecks/store/includes/languages/english/modules/order_total/ot_shipping.php.php' for inclusion (include_path='.:/usr/local/lib/php-5.2.17/lib/php') in/hermes/bosweb26d/b447/ipw.leathernecksswflcom/public_html/leathernecks/store/admin/modules.php on line 129
Modules Sort Order Action MODULE_ORDER_TOTAL_DISCOUNT_TITLE [img]http://www.leathernecks-swfl.com/store/admin/images/icon_arrow_right.gif[/img] Low Order Fee [img]http://www.leathernecks-swfl.com/store/admin/images/icon_info.gif[/img] Module Directory: /hermes/bosweb26d/b447/ipw.leathernecksswflcom/public_html/leathernecks/store/includes/modules/order_total/ MODULE_ORDER_TOTAL_DISCOUNT_TITLE Install Module
MODULE_ORDER_TOTAL_DISCOUNT_DESCRIPTION

Can someone give me some help on this, and please keep in mind I am fairly new to all of this.

#98   leathernecksswflcom

leathernecksswflcom
  • Members
  • 52 posts
  • Real Name:Ray Walters

Posted 07 April 2012 - 01:46

I forgot to mention this is discount code update 3.2 for osCommerce 2.3.1

#99   Mike Owings

Mike Owings
  • Members
  • 2 posts

Posted 09 April 2012 - 22:48

Gang,

Total newb here and I'm pretty sure my backup is corrupt so whatever assistance you can provide is greatly appreciated.

I tried installing the 3.1.1 full but ran into some trouble. I can't recall exactly what the issue was but we reverted to backup. All was well.

Now that the store is up and running, discount codes were requested again. Instead of going from 3.1.1 again, opted to go from 2.6 and upgrade so I could not any errors.

Well boy did I get one. The following appears at the top of every page in the site except checkout:

// Discount Code 2.6 - start define('TABLE_CUSTOMERS_TO_DISCOUNT_CODES', 'customers_to_discount_codes'); define('TABLE_DISCOUNT_CODES', 'discount_codes'); // Discount Code 2.6 - end
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ab20256/public_html/shop/includes/database_tables.php:67) in /home/ab20256/public_html/shop/includes/functions/sessions.php on line 102
// Discount Code 2.6 - start define('TEXT_DISCOUNT', 'Discount'); define('TEXT_DISCOUNT_CODE', 'Discount Code'); // Discount Code 2.6 - end // Discount Code 2.6 - start if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true') { if (!tep_session_is_registered('sess_discount_code')) tep_session_register('sess_discount_code'); if (!empty($HTTP_GET_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_GET_VARS['discount_code']); if (!empty($HTTP_POST_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_POST_VARS['discount_code']); } // Discount Code 2.6 - end


Checkout brings the following error:

// Discount Code 2.6 - start define('TABLE_CUSTOMERS_TO_DISCOUNT_CODES', 'customers_to_discount_codes'); define('TABLE_DISCOUNT_CODES', 'discount_codes'); // Discount Code 2.6 - end
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ab20256/public_html/shop/includes/database_tables.php:67) in /home/ab20256/public_html/shop/includes/functions/sessions.php on line 102
// Discount Code 2.6 - start define('TEXT_DISCOUNT', 'Discount'); define('TEXT_DISCOUNT_CODE', 'Discount Code'); // Discount Code 2.6 - end // Discount Code 2.6 - start if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true') { if (!tep_session_is_registered('sess_discount_code')) tep_session_register('sess_discount_code'); if (!empty($HTTP_GET_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_GET_VARS['discount_code']); if (!empty($HTTP_POST_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_POST_VARS['discount_code']); } // Discount Code 2.6 - end
Warning: Cannot modify header information - headers already sent by (output started at /home/ab20256/public_html/shop/includes/database_tables.php:67) in /home/ab20256/public_html/shop/includes/functions/general.php on line 45



Any advice? Really need this fixed as soon as possible but I'm at a complete loss.

Thanks!



I'm a doofus - i tracked down the trailing spaces and improper insertion of changed code.

I tell you, when you take the time to double-check instead of going into blue-assed panic mode, this add-on really is a joy to work with.

Sorry for the temporary idiocy.

#100   polepositions

polepositions
  • Members
  • 37 posts
  • Real Name:Carlene Spiteri

Posted 19 April 2012 - 09:48

I have installed the Discount Code as per instructions, but it don't seem to be working.
When you go through the checkout process, it does not deduct the discount percentage from the total..

Can anyone help me with this..