Jump to content



Photo
* * * - - 3 votes

[add-on] Discount Code (support)


  • Please log in to reply
146 replies to this topic

#61   yadetar

yadetar
  • Members
  • 24 posts
  • Real Name:Janina
  • Gender:Female

Posted 05 August 2011 - 21:41

Hello all,

Great contrib. but I have some problem with it:
(I have 2.3.1 and istalled Discount Code 2.6 for osCommerce 2.3.1)

In the installation manual it says that "Set the sort order for order total modules under Administration -> Modules -> Order Total."
My problem is that for some reason at the _modules -> order total_ I cannot change anything after the installation of this contrib. I can just add the discount code module, but after loading this module, the change option dissapears. How could I change the sort order OR how to have the change option back?

Could someone help me with this? I would appreciate it a lot!

BR,
yadetar

#62   Ausgirl

Ausgirl
  • Members
  • 936 posts
  • Real Name:Ruth
  • Gender:Female
  • Location:Brisbane, Australia

Posted 06 August 2011 - 08:12


There is a fix for PayPal Express on high-quality-php-coding website for PayPal to accept the discount code for 2.2

I was wondering if there was a fix for PayPal Express to accept the discount in OSC 2.3 as at the moment, it does
not recognize the discount & customers are charged full price and of course the code is different in 2.2 from 2.3
and I have no idea what to change in the payments/paypal_express.php

Help appreciated /smile.gif' class='bbc_emoticon' alt=':)' />







#63   yadetar

yadetar
  • Members
  • 24 posts
  • Real Name:Janina
  • Gender:Female

Posted 07 August 2011 - 18:44

Hello all,

Great contrib. but I have some problem with it:
(I have 2.3.1 and istalled Discount Code 2.6 for osCommerce 2.3.1)

In the installation manual it says that "Set the sort order for order total modules under Administration -> Modules -> Order Total."
My problem is that for some reason at the _modules -> order total_ I cannot change anything after the installation of this contrib. I can just add the discount code module, but after loading this module, the change option dissapears. How could I change the sort order OR how to have the change option back?

Could someone help me with this? I would appreciate it a lot!

BR,
yadetar


Nevermind about this. Problem solved. It was a typo in my files..

#64   digital_i

digital_i
  • Members
  • 1 posts
  • Real Name:James

Posted 17 August 2011 - 22:23

I'm getting an error on my checkout screen (checkout_payment.php) at the top. Any ideas as to the problem?

$(document).ready(function() { var a = 0; discount_code_process(); $('#discount_code').blur(function() { if (a == 0) discount_code_process(); a = 0 }); $("#discount_code").keypress(function(event) { if (event.which == 13) { event.preventDefault(); a = 1; discount_code_process() } }); function discount_code_process() { if ($("#discount_code").val() != "") { $("#discount_code").attr("readonly", "readonly"); $("#discount_code_status").empty().append(''); $.post("discount_code.php", { discount_code: $("#discount_code").val() }, function(data) { data == 1 ? $("#discount_code_status").empty().append('') : $("#discount_code_status").empty().append(''); $("#discount_code").removeAttr("readonly") }); } } });


#EDIT:
The error is below the main bar but right above payment information.

Edited by digital_i, 17 August 2011 - 22:25.


#65   Papa Bear

Papa Bear
  • Members
  • 1 posts
  • Real Name:Bear

Posted 22 August 2011 - 02:15

Thank you for posting your fix! Worked for me too. I was having the same problem getting a 1054 - Unknown column. The Discount Code 2.6 for osCommerce 2.3.1 (full install pkg) is missing this "customers_id" line in the SQL Query step 1.

So if you haven't installed add `customers_id` text, right after: `excluded_products_id` text, before running the query. Or just go to your myphpadmin and add a row in the table.



I must be missing something because I tried this and it still does not carry over..

#66   Ausgirl

Ausgirl
  • Members
  • 936 posts
  • Real Name:Ruth
  • Gender:Female
  • Location:Brisbane, Australia

Posted 18 September 2011 - 01:07

There is now an update for discount codes to be accepted via PayPal for 2.3

http://addons.oscommerce.com/info/7700

#67   eldridge

eldridge
  • Members
  • 16 posts
  • Real Name:Eldridge Ken
  • Gender:Male

Posted 06 October 2011 - 01:51

I installed the add-on however, when creating a coupon, this is the error:

Fatal error: Call to a member function format() on a non-object in /home/**/public_html/**/admin/includes/functions/general.php on line 223

Please help!

#68   nahi_sonu

nahi_sonu
  • Members
  • 104 posts
  • Real Name:Awais Tahir
  • Gender:Male

Posted 16 October 2011 - 17:21

Hi,
i had oscommerce 2.2rc1.. ive upgraded my store to v2.3.1 (manual upgrade)
ive installed the discount code addon and its working fine except 2 issues im having.

1. when i select (any number) in "

Discount coupon stops working after that.. if i leave it blank then it works just fine.

2. Discount in percentage not working.. when i use percentage as discount, it shows invalid coupon sign in ajax check.
please help me out on these issue.
thanks.
outside links are not allowed in signatures

#69   nahi_sonu

nahi_sonu
  • Members
  • 104 posts
  • Real Name:Awais Tahir
  • Gender:Male

Posted 20 October 2011 - 18:09

Hi,
i had oscommerce 2.2rc1.. ive upgraded my store to v2.3.1 (manual upgrade)
ive installed the discount code addon and its working fine except 2 issues im having.

1. when i select (any number) in "

Discount coupon stops working after that.. if i leave it blank then it works just fine.

2. Discount in percentage not working.. when i use percentage as discount, it shows invalid coupon sign in ajax check.
please help me out on these issue.
thanks.


bump
outside links are not allowed in signatures

#70   iffy

iffy
  • Members
  • 6 posts
  • Real Name:Iffy
  • Gender:Female
  • Location:United States - New Jersey

Posted 31 October 2011 - 03:02

Thanks for the great add-on. It's functionality is exactly what I needed without too many modifications. After testing the coupon codes, there are 2 problems I ran across, but not sure if there are more.

1) when you set a minimum order, it was calculating the minimum based on the order total, which included tax and shipping. I needed the minimum to be on the subtotal of all items purchased before shipping and tax.

2) the tax calculation is based on the subtotal before discount. I'd like the tax to be calculated after the discount. I've tried what others have posted before with no luck. The tax is still calculated incorrectly.

I was able to solve #1 with a minor change, which I have posted below if anyone needs it. If anyone has solved the tax problem, please post a solution. Thanks.

in ot_discount.php on line 40, change:

$check_query = tep_db_query("select dc.products_id, dc.categories_id, dc.manufacturers_id, dc.excluded_products_id, dc.customers_id, dc.orders_total, dc.order_info, dc.discount_values, dc.number_of_products from " . TABLE_DISCOUNT_CODES . " dc where dc.discount_codes = '" . tep_db_input($sess_discount_code) . "' and if(dc.expires_date = '0000-00-00', date_format(date_add(now(), interval 1 day), '%Y-%m-%d'), dc.expires_date) >= date_format(now(), '%Y-%m-%d') and dc.minimum_order_amount <= " . $order->info['total'] . " and dc.status = '1' limit 1");
to:

$check_query = tep_db_query("select dc.products_id, dc.categories_id, dc.manufacturers_id, dc.excluded_products_id, dc.customers_id, dc.orders_total, dc.order_info, dc.discount_values, dc.number_of_products from " . TABLE_DISCOUNT_CODES . " dc where dc.discount_codes = '" . tep_db_input($sess_discount_code) . "' and if(dc.expires_date = '0000-00-00', date_format(date_add(now(), interval 1 day), '%Y-%m-%d'), dc.expires_date) >= date_format(now(), '%Y-%m-%d') and dc.minimum_order_amount <= " . $order->info['subtotal'] . " and dc.status = '1' limit 1");
It's a simple one word change to check minimum order using order subtotal instead of order total.

BTW- I am using Discount Code version 2.9 on oscommerce 2.2 (newer add on with older shopping cart)

Best,
Iffy
www.cuddlebugfactory.com

#71   Tom14

Tom14
  • Members
  • 43 posts
  • Real Name:Thomas
  • Gender:Male
  • Location:Germany

Posted 01 November 2011 - 21:06

Hello.

In the admin overview the orders are doesn't count, isn' it? I tried several adjustments with orders but der counter shows zero.

Can anybody confirm that?

Thanks

Regards

#72   'GaryLack-Jones'

'GaryLack-Jones'
  • Members
  • 2 posts

Posted 16 November 2011 - 13:58

Hi first time posting here, hoping someone can help or redirect me to the relevent topic.

I installed this:

[img]http://addons.oscommerce.com/images/icon_minus.gif[/img] Discount Code update 2.9 for osCommerce 2.2 high-quality-php-coding 21 Feb 2011 [img]http://addons.oscommerce.com/images/16x16_report.png[/img]

Changes:
- Added discount code editing

Screenshots are available at
http://high-quality-...oscommerce.html

Discount Code for osCommerce Online Merchant v2.3.1 can be downloaded at
http://addons.oscommerce.com/info/7700




Everything admin side works fine, however in testing eg making a dummy order i am getting an error on the checkout page. http://silverbirchcr...ut_shipping.php




The error is Warning: Cannot modify header information - headers already sent by (output started at /home/sites/silverbirchcrafts.co.uk/public_html/includes/application_top.php:523) in /home/sites/silverbirchcrafts.co.uk/public_html/includes/functions/general.php on line 33




Ive double checked all the code ive changed as per the readme and everything seems to be in order, hoping someone can help.




Rgds.




Gary


#73   'GaryLack-Jones'

'GaryLack-Jones'
  • Members
  • 2 posts

Posted 16 November 2011 - 14:22

Ive replaced the file application_top.php to the original file temporarily so users can still order normally until i find a resolution to the issue.

Rgds.

Gary

#74   Crazypilot

Crazypilot
  • Members
  • 60 posts
  • Real Name:Hans Wiren
  • Gender:Male

Posted 20 November 2011 - 20:44

Hi All,

I am having the same problem that many other are complaining about.
When discount is set as a percentage, like 10%, then the NET price is discounted by 10% = all correct.

Sample: original price 100€ will be discounted with 10% and show as subtotal 90€.

But, when the TAX /VAT is added to the NET price, then the TAX/VAT is calculated on the price BEFORE the discount.
It should off course be based and calculated on the price AFTER discount, right?

Example on how it should be with 15% TAX/VAT:

NET price before discount: 100€
Discount 10% ==> NET Price after discount = 90€
TAX/VAT 15% ==> 0,15 x 90€ = 13,5€
Total Price= 90 + 13,50 = 103,50€ including TAX

Now Example on how it is wrongly working:


NET price before discount: 100€
Discount 10% ==> NET Price after discount = 90€

TAX/VAT 15% ==> 0,15 x ( Wrongly based on original price) 100€ = 15,00€
Total Price= 90 + 15,00 = 105,00€ including TAX which is giving a false TAX figure

As seen, the latter example is wrong and is giving me faulty invoices/Receipts and can not be used for fiscal declarations.

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.


Maybe someone smarter than I can help me figure out where and how to use this information to get the contribution to show correct TAX?

It is a super good contribution, BUT as long as it shows wrong TAX, it can not really be used right?

Best regards

CrazyP

#75   S.James

S.James
  • Members
  • 3 posts
  • Real Name:Steve

Posted 22 November 2011 - 13:39

Like this add am using to offer free shipping when the code is entered. Customer selects shipping option then goes to payment page selects how to pay and then enters the code click continue and we get this error message (Your calculated shipping charges have changed) then it goes back to choose shipping options. Any help on correct this

#76   sedemik

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

Posted 23 November 2011 - 16:57

Using this "fix", tax are ok

catalog/includes/modules/order_total/ot_discount.php

Find:

if (!empty($order->products[$i]['tax'])){
And replace with:
if ((!empty($order->products[$i]['tax'])) && (strpos($check['discount_values'], '%') == true)){

Find:
if (!empty($discount)) {
		$order->info['total'] -= array_sum($tax_discount);
		$order->info['total'] -= $discount;
Add after:
if (strpos($check['discount_values'], '%') == true) {
		$discount = $discount + array_sum($tax_discount);			
		}

Save the file and upload [img]http://forums.oscommerce.com/public/style_emoticons/default/wink.gif[/img]

Regards!!


I have problems with taxes too. I change code as above but it doesn't fix my problem.

Products price is with tax and discount should be show with tax. I asked advice for my problem from http://high-quality-php-coding.com/ but they only said that i have to adjust $order->info['total']. I didn't know what I have to do but now I am almost solved this problem. I fix ot_tax.php file:

Find:
if ($value > 0) {
Add below:
  $step1 = $order->info['subtotal'] - $value;
  $step2 = $order->info['subtotal'] / $step1;
  $step3 = $order->info['total'] - ($order->info['total'] / $step2);


Find:
$this->output[] = array('title' => $key . ':',
								  'text' => $currencies->format($value, true, $order->info['currency'], $order->info['currency_value']),
								  'value' => $value);


Replace with:

		  $this->output[] = array('title' => $key . ':',
								 // 'text' => $currencies->format($value, true, $order->info['currency'], $order->info['currency_value']),
								 // 'value' => $value);
								  'text' => $currencies->format($step3, true, $order->info['currency'], $order->info['currency_value']),
								  'value' => $step3);


Everything works fine if total is over free shipping limit. If total is under then comes shipping fee. Fee includes tax also and now problem is that this tax got discount too.

How I can exlude tax of shipping from this?

#77   MindyAdams

MindyAdams
  • Members
  • 2 posts

Posted 23 November 2011 - 20:47

Thought I had it fixed but get errors when I go into the admin section.... Any suggestions? I am at a loss.

define('FILENAME_DISCOUNT_CODES', 'discount_codes.php'); // Discount Code 2.6 // 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 cookie - headers already sent by (output started at /home/hugsnsti/public_html/store/admin/includes/filenames.php:57) in /home/hugsnsti/public_html/store/admin/includes/functions/sessions.php on line 102

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/hugsnsti/public_html/store/admin/includes/filenames.php:57) in /home/hugsnsti/public_html/store/admin/includes/functions/sessions.php on line 102

Warning: Cannot modify header information - headers already sent by (output started at /home/hugsnsti/public_html/store/admin/includes/filenames.php:57) in /home/hugsnsti/public_html/store/admin/includes/functions/general.php on line 34

#78   llz925

llz925
  • Members
  • 76 posts
  • Real Name:Liz

Posted 24 November 2011 - 03:09

Hi -
I just installed this module and the most recent update for it on my store. It is working fine in the admin side, but when I just went to checkout and order to test it I get a white, blank screen when you get to the "payment information"( or checkout_payment.php) page.

Does anyone have any idea of what would be causing this to happen?

Thanks
Liz

#79   paccman

paccman
  • Members
  • 7 posts
  • Real Name:emile

Posted 24 November 2011 - 23:09

I was happy to find that the Discount code was upgraded to work on Paypal so I went from my v2.6 step by step till I reached 3.1.1

The problem I now have is that my default currency is GBP, checkout is great, discount is applied and then... when you get to Paypal payment, paypal charges the same amount in US$

i.e. Total purchase is GBP 10 ---> Paypal charges the customer US$ 10
Now even when I disable the discount code module, I still have the same problem!!

Even when selecting US$ currency, when you go to checkout PayPal will charge the GBP value but in US$

i.e. Total Purchase is US$ 150 ---> Paypal charges US$ 100 (Which is what it would have been in GBP)

Hope I make sense
Thanks for any help as my site is now useless

Emile

#80   sedemik

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

Posted 25 November 2011 - 08:16

This add-on is great but there is missing one important attribute, customer groups. It is so much easier to handle groups than individual persons. I tried yesterday to code customer group for Discount Code and get it almost work.

Now I can:
- Add customer groups via admin
- Add customers to groups
- Adjust discount codes to groups

Problem is what I should to change to ot_discount.php file?

If some one wants to continue this project or give some advice I appreciate that help a lot. [img]http://forums.oscommerce.com//public/style_emoticons/default/thumbsup.gif[/img]

I attached files and instructions for what I have done.