Jump to content
kgt

[Contribution] Discount Coupon Codes

Recommended Posts

i have replaced the code as suggested and again i have no admin panel content except for the top left corner box.

 

my phpmyadmin states i am running mysql 3.23.58 not version 5.

 

hope this helps.

 

my full server setup is a webfusion VPS running plesk 8.1.1 with virtuozzo panel

 

thx again 4 your help

Share this post


Link to post
Share on other sites
i have replaced the code as suggested and again i have no admin panel content except for the top left corner box.

 

my phpmyadmin states i am running mysql 3.23.58 not version 5.

 

hope this helps.

 

my full server setup is a webfusion VPS running plesk 8.1.1 with virtuozzo panel

 

thx again 4 your help

 

 

You're getting a different error than the database error, probably the same problem others have been reporting that is a result of the install instructions missing some code.

 

admin/includes/boxes/catalog.php needs to be:

								   //kgt - discount coupons
							   '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>' .
							   '<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );
							   /***************
							   '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );
							   ***************/
							   //end kgt - discount coupons

and admin/includes/boxes/reports.php needs to be:

								   //kgt - discount coupons report
							   '<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>' .
							   '<a href="' . tep_href_link(FILENAME_STATS_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_DISCOUNT_COUPONS . '</a>');
							   /*************
							   '<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a>');
							   *************/
							   //end kgt - discount coupons report


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
You're getting a different error than the database error, probably the same problem others have been reporting that is a result of the install instructions missing some code.

 

admin/includes/boxes/catalog.php needs to be:

								   //kgt - discount coupons
							   '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>' .
							   '<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );
							   /***************
							   '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );
							   ***************/
							   //end kgt - discount coupons

and admin/includes/boxes/reports.php needs to be:

								   //kgt - discount coupons report
							   '<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>' .
							   '<a href="' . tep_href_link(FILENAME_STATS_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_DISCOUNT_COUPONS . '</a>');
							   /*************
							   '<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a>');
							   *************/
							   //end kgt - discount coupons report

 

 

Thx - i replaced the code as you suggested but still i have no other content in my admin panel other than the selections

on the top left.

 

i can still select them etc... they just don't show anything in the main window.

 

i know it's something to do with the admin files because if i revert just the changed admin files everything goes back to normal (only without the discount code functionality).

 

could i maybe post specific files for you to check over ?

Share this post


Link to post
Share on other sites
You're getting a different error than the database error, probably the same problem others have been reporting that is a result of the install instructions missing some code.

 

admin/includes/boxes/catalog.php needs to be:

								   //kgt - discount coupons
							   '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>' .
							   '<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );
							   /***************
							   '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );
							   ***************/
							   //end kgt - discount coupons

//snipped

 

Just added this contrib and just thought I'd comment how easy an clear the instructions were. Out of all the contributions I've installed this had the most detailed instructions and easy to follow format.

 

THANK YOU!!!

 

I had the problem above to, but everything else went in like a dream.

Your a real credit to the community, thank you so very much!

Share this post


Link to post
Share on other sites

Help! I am fairly new to osCommerce and just installed the Discount Coupon Codes contribution. I had not modified any of the files listed in the new files, so loaded them one by one onto my site. I now have two fatal errors:

 

#1 ORDER TOTAL MODULES

Fatal error: Cannot redeclare class ot_discount_coupon in D:\inetpub\vhosts\katecompany.com\httpdocs\oscommerce\includes\modules\order_total\ot_discount_coupon.php on line 13

I compared this file to the original and cannot find any difference on line 13, but this error did not occur until I loaded this module - none of the modules display

 

#2 - SHIPPING MODULES

Fatal error: Cannot redeclare class table in D:\inetpub\vhosts\katecompany.com\httpdocs\oscommerce\includes\modules\shipping\table.php on line 13

 

In this module, I can only see Pickup Up Rate (which is the only other contribution I have installed & was working fine), flat rate & per item - nothing else displays.

 

Appreciate your help!

Edited by la_sunshine

Share this post


Link to post
Share on other sites

I installed this contribution and it installed fine, but when I get to the checkout confirmation page the coupon doesn't subtract from the order total. I am using it to offer free shipping and it lists on the confirmation page but doesn't factor into the order total. Here's what it lists...

 

Sub-Total: $39.95

Table Rate (Best Way): $6.05

Discount Coupon MYSPACE applied: -$6.05

Total: $46.00

 

 

See it lists the shipping discount but the total doesn't reflect the discount. It should be $39.95. Why does it do this? The shipping I am using is a flat table rate method. Any ideas?

Share this post


Link to post
Share on other sites

I have installed this mod for other people before, and I have to say that it's great! I went ahead and installed it on my own store this morning and I am getting the following SQL error on checkout_payment.php:

 

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 'or z2g.zone_id = 0 or z2g.zone_id IS NULL ) ' at line 5

SELECT dc2z.geo_zone_id FROM discount_coupons_to_zones dc2z LEFT JOIN zones_to_geo_zones z2g USING( geo_zone_id ) WHERE ( z2g.zone_id= or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="w8663m"

 

Any thoughts? Thanks.

Share this post


Link to post
Share on other sites

P.S.- I just noticed that I only get the above error when checking out with downloadable items (all of the items in my store are downloadable). If I use a product that is not downloadable, everything with this mod works fine.

 

Any thoughts as to why this error is happening when attempting to checkout with downloadable items?

 

 

Thank you!

Share this post


Link to post
Share on other sites
"Transaction refused because of an invalid argument. See additional error messages for details. Item total is invalid. (Error code10426)"

KG, I wanted to let you know that the suggestion you made in PM solved the above problem for me. I'll reproduce it here so other people can benefit from it as well.

 

Note to other forum members: These changes are for the Website Payments Pro contribution when used in tandem with Discount Coupon Codes 3.3. The changes listed below need to be made in the /catalog/includes/modules/payment/paypal_wpp.php file.

 

At about lines 985-989, change the following lines from:

	  $order_info['PAYPAL_ITEM_TOTAL'] = $order->info['subtotal'];
  //The shipping total must be under $10,000.  I've removed the check that would
  //set the shipping total at $10,000 if it was over, but that didn't make any sense
  //as the totals would be off, causing other errors.  Just don't ship anything that'll cost more than $10k
  $order_info['PAYPAL_SHIPPING_TOTAL'] = $order->info['shipping_cost'];

to:

	  $order_info['PAYPAL_ITEM_TOTAL'] = round($order->info['subtotal'], 2);
  //The shipping total must be under $10,000.  I've removed the check that would
  //set the shipping total at $10,000 if it was over, but that didn't make any sense
  //as the totals would be off, causing other errors.  Just don't ship anything that'll cost more than $10k
  $order_info['PAYPAL_SHIPPING_TOTAL'] = round($order->info['shipping_cost'], 2);

 

I'm guessing that the PAYPAL_SHIPPING_TOTAL line did not actually need to be changed to accommodate the Discount Coupon Codes contrib, but it certainly doesn't hurt anything and could help someone who has a discount shipping contribution installed.

 

Thanks, KG, for your dedication and assistance. You rock! :thumbsup:

 

Stace


The soul is greater than the hum of its parts. -- Douglas R. Hofstadter in Gödel, Escher, Bach

Share this post


Link to post
Share on other sites
P.S.- I just noticed that I only get the above error when checking out with downloadable items (all of the items in my store are downloadable). If I use a product that is not downloadable, everything with this mod works fine.

 

Any thoughts as to why this error is happening when attempting to checkout with downloadable items?

Thank you!

 

UPDATE:

 

I found a temporary solution to the problem. In includes/classes/discount_coupon.php, I commented out all the lines dealing with zone exclusions:

 

		//shipping zone exclusions
//		$check_user_query = tep_db_query($sql = 'SELECT dc2z.geo_zone_id
//												  FROM '.TABLE_DISCOUNT_COUPONS_TO_ZONES.' dc2z
//												  LEFT JOIN '.TABLE_ZONES_TO_GEO_ZONES.' z2g
//													USING( geo_zone_id )
//												  WHERE ( z2g.zone_id='.$delivery['zone_id'].' or z2g.zone_id = 0 or z2g.zone_id IS NULL )
//													AND ( z2g.zone_country_id='.$delivery['country_id'].' or z2g.zone_country_id = 0 )
//													AND dc2z.coupons_id="'.tep_db_input( $code ).'"' );
//
//		  if (tep_db_num_rows( $check_user_query ) > 0 ) {
//			$this->message( ENTRY_DISCOUNT_COUPON_ERROR ); //display the error message
	  //use this to debug exclusions:
		//$this->message( 'Shipping Zones exclusion check failed' );
//		  }
	  //end shipping zone exclusions

 

Now the discount coupon mod works with my digital items, only I will have to remember that I can no longer make coupons with zone exclusions :)

 

Its strange that I only had that error when using digital products. There must be an error in the syntax of the above code somewhere...

Share this post


Link to post
Share on other sites
UPDATE:

 

I found a temporary solution to the problem. In includes/classes/discount_coupon.php, I commented out all the lines dealing with zone exclusions:

 

Now the discount coupon mod works with my digital items, only I will have to remember that I can no longer make coupons with zone exclusions :)

 

Its strange that I only had that error when using digital products. There must be an error in the syntax of the above code somewhere...

 

 

Changing that section to this:

 

		//shipping zone exclusions
	$check_user_query = tep_db_query($sql = 'SELECT dc2z.geo_zone_id
											  FROM '.TABLE_DISCOUNT_COUPONS_TO_ZONES.' dc2z
											  LEFT JOIN '.TABLE_ZONES_TO_GEO_ZONES.' z2g
												USING( geo_zone_id )
											  WHERE ( z2g.zone_id='.(int)$delivery['zone_id'].' or z2g.zone_id = 0 or z2g.zone_id IS NULL )
												AND ( z2g.zone_country_id='.(int)$delivery['country_id'].' or z2g.zone_country_id = 0 )
												AND dc2z.coupons_id="'.tep_db_input( $code ).'"' );

	if (tep_db_num_rows( $check_user_query ) > 0 ) {
	  $this->message( ENTRY_DISCOUNT_COUPON_ERROR ); //display the error message
	//use this to debug exclusions:
	  //$this->message( 'Shipping Zones exclusion check failed' );
	}
	//end shipping zone exclusions

 

Should fix the problem and allow you to still use zone exclusions. The reason it fails when you have only digital problem is because there's no shipping address needed - thus there's no zone to check against.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
I installed this contribution and it installed fine, but when I get to the checkout confirmation page the coupon doesn't subtract from the order total. I am using it to offer free shipping and it lists on the confirmation page but doesn't factor into the order total. Here's what it lists...

 

Sub-Total: $39.95

Table Rate (Best Way): $6.05

Discount Coupon MYSPACE applied: -$6.05

Total: $46.00

See it lists the shipping discount but the total doesn't reflect the discount. It should be $39.95. Why does it do this? The shipping I am using is a flat table rate method. Any ideas?

 

 

Can you PM or email me a debug output? Please see the README for help with capturing debug output.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
Help! I am fairly new to osCommerce and just installed the Discount Coupon Codes contribution. I had not modified any of the files listed in the new files, so loaded them one by one onto my site. I now have two fatal errors:

 

#1 ORDER TOTAL MODULES

Fatal error: Cannot redeclare class ot_discount_coupon in D:\inetpub\vhosts\katecompany.com\httpdocs\oscommerce\includes\modules\order_total\ot_discount_coupon.php on line 13

I compared this file to the original and cannot find any difference on line 13, but this error did not occur until I loaded this module - none of the modules display

 

#2 - SHIPPING MODULES

Fatal error: Cannot redeclare class table in D:\inetpub\vhosts\katecompany.com\httpdocs\oscommerce\includes\modules\shipping\table.php on line 13

 

In this module, I can only see Pickup Up Rate (which is the only other contribution I have installed & was working fine), flat rate & per item - nothing else displays.

 

Appreciate your help!

 

You've uploaded files to the wrong place. Note that there is a difference between includes/modules/order_total/ot_discount_coupon.php and includes/languages/english/modules/order_total/ot_discount_coupon.php. There are two DIFFERENT files with the same name that must go in two different places. Getting them mixed up causes this error.

 

Re-upload the files, specifically the languages files found in the install zip.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
Thx - i replaced the code as you suggested but still i have no other content in my admin panel other than the selections

on the top left.

 

i can still select them etc... they just don't show anything in the main window.

 

i know it's something to do with the admin files because if i revert just the changed admin files everything goes back to normal (only without the discount code functionality).

 

could i maybe post specific files for you to check over ?

 

 

What is happening is that you are getting a fatal error that is halting script execution. Add this to the top of admin/includes/application_top.php:

 

ini_set('display_errors', 1);

error_reporting(E_ALL);

 

You should now see an error message when you try to access your admin section.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

Has any one successfully used this contribution with PayPal's Website Payment Pro (US) payment module.

 

This is a great contribution that I had working prior to switching to this version of WPP. I switched to eliminate a PayPal shipping issue (i.e 'Free' Shipping).

 

Any suggestions would be helpful.

 

 

thx

Share this post


Link to post
Share on other sites
You've uploaded files to the wrong place. Note that there is a difference between includes/modules/order_total/ot_discount_coupon.php and includes/languages/english/modules/order_total/ot_discount_coupon.php. There are two DIFFERENT files with the same name that must go in two different places. Getting them mixed up causes this error.

 

Re-upload the files, specifically the languages files found in the install zip.

 

THANK YOU! Obviously I did mix up a file. I did what you said and this did fix the problem with the order module and now I can see my promotion discounts - but I still have the error on shipping, in spite of reloading all the files. I'm not sure what I've missed - Thanks!

Share this post


Link to post
Share on other sites
THANK YOU! Obviously I did mix up a file. I did what you said and this did fix the problem with the order module and now I can see my promotion discounts - but I still have the error on shipping, in spite of reloading all the files. I'm not sure what I've missed - Thanks!

 

Thank you again! I did finally figure out what I did wrong - I missed one file that I loaded in the wrong place. Corrected it and voila! It's working like a charm. Now to set up the promotion codes. :thumbsup:

Share this post


Link to post
Share on other sites
Make sure you've made the changes to checkout_process.php. Also see the README for help with fixing Paypal IPN if you use that as a payment module. Some payment modules may alter the way checkout_process.php operates or bypass it completely. It all depends on what else you have installed.

 

hi kgt. thank you for answering my query.

 

i have ensured the changes are made for checkout_process.php file, because it was a clean install. there are no other problem in creation of the coupon. but apparently the same coupon can used again and again. i used the Internet Transfer payment method (from Internet Transfer / Direct Bank Deposit contribute). and it seems the coupon was not restricted after the max number of use.

 

do i have to make modification in that payment mode too? if so, is it the same logic as the one use for Paypal IPN?

 

please pardon me, i know nuts about scripting....

 

thank you again for your help.

Share this post


Link to post
Share on other sites

if i may ask for your help to edit the transfer.php file for me (from the Internet Transfer / Direct Bank Deposit contribute)

where should i make the amendment so that the coupon will not be reused?

 

<?php
/*
 $Id: TRANSFER.php,v 1.10 2003/01/29 19:57:14 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 class transfer{
   var $code, $title, $description, $enabled;

// class constructor
   function transfer() {
     global $order;

     $this->code = 'transfer';
     $this->title = MODULE_PAYMENT_TRANSFER_TEXT_TITLE;
     $this->description = MODULE_PAYMENT_TRANSFER_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_PAYMENT_TRANSFER_SORT_ORDER;
     $this->enabled = ((MODULE_PAYMENT_TRANSFER_STATUS == 'True') ? true : false);

     if ((int)MODULE_PAYMENT_TRANSFER_ORDER_STATUS_ID > 0) {
       $this->order_status = MODULE_PAYMENT_TRANSFER_ORDER_STATUS_ID;
     }

     if (is_object($order)) $this->update_status();

     $this->email_footer = MODULE_PAYMENT_TRANSFER_TEXT_EMAIL_FOOTER;
   }

// class methods
   function update_status() {
     global $order;

     if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_TRANSFER_ZONE > 0) ) {
       $check_flag = false;
       $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_TRANSFER_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
       while ($check = tep_db_fetch_array($check_query)) {
         if ($check['zone_id'] < 1) {
           $check_flag = true;
           break;
         } elseif ($check['zone_id'] == $order->billing['zone_id']) {
           $check_flag = true;
           break;
         }
       }

       if ($check_flag == false) {
         $this->enabled = false;
       }
     }
   }

   function javascript_validation() {
     return false;
   }

   function selection() {
     return array('id' => $this->code,
                  'module' => $this->title);
   }

   function pre_confirmation_check() {
     return false;
   }

   function confirmation() {
     return array('title' => MODULE_PAYMENT_TRANSFER_TEXT_DESCRIPTION);
   }

   function process_button() {
     return false;
   }

   function before_process() {
     return false;
   }

   function after_process() {
     return false;
   }

   function get_error() {
     return false;
   }

   function check() {
     if (!isset($this->_check)) {
       $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_TRANSFER_STATUS'");
       $this->_check = tep_db_num_rows($check_query);
     }
     return $this->_check;
   }

   function install() {
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Bank Transfer Module', 'MODULE_PAYMENT_TRANSFER_STATUS', 'True', 'Do you want to accept Bank Transfer or Deposits?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Account Holder:', 'MODULE_PAYMENT_TRANSFER_PAYTO', '', 'Who is the bank account owner?', '6', '1', now());");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Account Number:', 'MODULE_PAYMENT_TRANSFER_ACCOUNT', '', 'What is the account number to deposit to?', '6', '1', now());");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Bank:', 'MODULE_PAYMENT_TRANSFER_BANK', '', 'Name of the bank', '6', '1', now());");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Branch Name:', 'MODULE_PAYMENT_TRANSFER_BRANCH_NAME', '', 'Branch name', '6', '1', now());");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Account Type:', 'MODULE_PAYMENT_TRANSFER_ACCOUNT_TYPE', '', 'Account Type', '6', '1', now());");
 	  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Branch Code:', 'MODULE_PAYMENT_TRANSFER_BRANCH', '', 'Branch code', '6', '1', now());");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_TRANSFER_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_TRANSFER_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_TRANSFER_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
   }

   function remove() {
     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
   }

   function keys() {
     return array('MODULE_PAYMENT_TRANSFER_PAYTO', 'MODULE_PAYMENT_TRANSFER_ACCOUNT', 'MODULE_PAYMENT_TRANSFER_BANK', 'MODULE_PAYMENT_TRANSFER_BRANCH_NAME', 'MODULE_PAYMENT_TRANSFER_ACCOUNT_TYPE','MODULE_PAYMENT_TRANSFER_BRANCH', 'MODULE_PAYMENT_TRANSFER_STATUS', 'MODULE_PAYMENT_TRANSFER_ZONE', 'MODULE_PAYMENT_TRANSFER_ORDER_STATUS_ID', 'MODULE_PAYMENT_TRANSFER_SORT_ORDER');
   }
 }
?>

 

thank you again for your help.

Share this post


Link to post
Share on other sites
hi kgt. thank you for answering my query.

 

i have ensured the changes are made for checkout_process.php file, because it was a clean install. there are no other problem in creation of the coupon. but apparently the same coupon can used again and again. i used the Internet Transfer payment method (from Internet Transfer / Direct Bank Deposit contribute). and it seems the coupon was not restricted after the max number of use.

 

do i have to make modification in that payment mode too? if so, is it the same logic as the one use for Paypal IPN?

 

please pardon me, i know nuts about scripting....

 

thank you again for your help.

 

 

You don't need to edit your payment module - it's only if it takes over the processing from checkout_process.php does it need to be edited.

 

The coupon and order id must be inserted into the discount_coupons_to_orders table for orders to be registered as having used a coupon. That normally happens in checkout_process.php. You may post that file for me to look at if you need.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
Has any one successfully used this contribution with PayPal's Website Payment Pro (US) payment module.

 

This is a great contribution that I had working prior to switching to this version of WPP. I switched to eliminate a PayPal shipping issue (i.e 'Free' Shipping).

 

Any suggestions would be helpful.

thx

 

 

There were posts about this on the same day you posted. If they didn't work for you, then you'll need to give a better explanation of what's not working.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
There were posts about this on the same day you posted. If they didn't work for you, then you'll need to give a better explanation of what's not working.

 

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

Share this post


Link to post
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!

Share this post


Link to post
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:

 

1054 - Unknown column 'cd.coupons_date_end' in 'order clause'

 

select * from discount_coupons cd order by cd.coupons_date_end, coupons_date_start limit 0, 20

 

[TEP STOP]

 

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. I installed the following:

 

CREATE TABLE discount_coupons(
coupons_id varchar( 32 ) NOT NULL default '',
coupons_description varchar( 64 ) NOT NULL default '',
coupons_discount_percent decimal( 7, 4 ) default NULL ,
date_start datetime default NULL ,
date_end datetime default NULL ,
max_use int( 3 ) NOT NULL default 0,
min_order decimal( 15, 4 ) NOT NULL default '0.0000',
PRIMARY KEY ( coupons_id )
);# MySQL returned an empty result set (i.e. zero rows).
CREATE TABLE discount_coupons_to_orders(
discount_coupons_to_orders_id int( 11 ) NOT NULL AUTO_INCREMENT ,
coupons_id varchar( 32 ) default NULL ,
orders_id int( 11 ) default '0',
PRIMARY KEY ( discount_coupons_to_orders_id ) ,
KEY coupons_id( coupons_id )
);# MySQL returned an empty result set (i.e. zero rows).

 

Any help would be appreciated. Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×