Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Discount Coupon Codes


kgt

Recommended Posts

Hi,

 

What are you doing exactly?

 

I want the customer can yous once the coupon code.

I have PWA installed.

 

Please give me you solution to try in my site.

 

Thank you in advance,

 

Edmond

 

for my problems i think i fixed part of it. the problem was that a code that was only to be used once was not stopping.

 

on my discount reports page it showed i had -5 left. (not good)

also any order using that discount i was unable to set the status (shipped/canceled/processing) the page would cut off right at the discount (does not show tax/subtotal/total)

 

The fix for me was to delete all the discounts including the testing code that came with it.

 

i made a new one and this is what happend:

The coupon code you have entered is no longer valid. Our records show that you have used this coupon 1 time(s). You may not use this code more than 1 time(s).

 

so far so good. i will try to reproduce the error to see the difference. (i should have saved the SQL record to compare)

 

To use the discount coupon code multiple times, you have to set the number available in Catalog > Discount Coupons. this will enable a coupon that can be used multiple times.

 

About my problem:

 

When i complete the checkout_payment.php page process (payment details and discount coupon code), the page has been moved to checkout_confirmation.php page but there is no discount details appearing in billing information part. It shows only the sub-total, shipping cost and the total values.

 

Example:

Sub-Total: $11.00

Table Rate (Best Way): $7.90

Total: $18.90

 

When i refresh the page or navigate to other page and come back, it displays the billing information with discount information.

Example:

Sub-Total: $11.00

Discount Coupon FQRLY applied: -$1.10

Table Rate (Best Way): $7.90

Total: $17.80

 

If we confirm the order without refreshing the page, the billing details are properly stored in the admin's orders.php page with discount informations.

 

What will be the problem?

Vivekanandan

Link to comment
Share on other sites

:-)

 

I don't want to use the coupon multiple times.

I want to use it just once. Now, customer can use it multiple times.

In admin section, i set to use it once, withou succes.

I think is PWA problem, because they don't need to login, and the ID is always "0".

 

Anybody can fix that?

 

Discount coupon, use once with PWA installed.

 

 

To use the discount coupon code multiple times, you have to set the number available in Catalog > Discount Coupons. this will enable a coupon that can be used multiple times.

 

About my problem:

 

When i complete the checkout_payment.php page process (payment details and discount coupon code), the page has been moved to checkout_confirmation.php page but there is no discount details appearing in billing information part. It shows only the sub-total, shipping cost and the total values.

 

Example:

Sub-Total: $11.00

Table Rate (Best Way): $7.90

Total: $18.90

 

When i refresh the page or navigate to other page and come back, it displays the billing information with discount information.

Example:

Sub-Total: $11.00

Discount Coupon FQRLY applied: -$1.10

Table Rate (Best Way): $7.90

Total: $17.80

 

If we confirm the order without refreshing the page, the billing details are properly stored in the admin's orders.php page with discount informations.

 

What will be the problem?

Link to comment
Share on other sites

I am trying to get the discount coupon installed. I have oscommerce 2.2 rc2. I am trying to install the full 3.33 package from rajonbh.

 

I am trying to edi the order.php page. It says to:

 

FIND on line 244:

 

$shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];

$this->info['subtotal'] += $shown_price;

 

and then replace with certain code. I can't find the above anywhere in order.php. It seems totally different. and so I'm not sure where to put this or what to replace. Any help so I can finish this is appreciated.

Link to comment
Share on other sites

Hello Sir,

 

I'm scratching my head for more than a week to fix the following issue on your discount coupon 3.3 contribution.

 

I have installed your contribution perfectly in my website Psychegames http://ambersports.psychegames.com as given in the manual.html and also followed the instruction as provided in the README.html.

 

Everthing working fine, i have entered the cc details (for test use 4111111111111111) and the coupon code 'E3QAZG' in the checkout_payment.php page and clicked the button "Continue".

 

There the problem started, in the checkout_confirmation page, i cant view the Discount Coupon value at first when the page gets loaded after the checkout_payment.php. I have to Refresh the page or press F5 to view that Discount Coupon applied text along with the subtotal discount value.

 

I have checked for the solution in all the oscommerce websites and in forums, but it havent got any proper answer for that.

 

Please tell me how to fix this bug so that i cant able to view the discount coupon applied value in the checkout_confirmation page without refreshing the page again.

 

Awaiting for your prompt response.

 

 

 

You should be able to install the latest version without installing the previous ones first.
Link to comment
Share on other sites

Dear all,

 

I install this contrib couple of month ago, and everything is going fine expet if I'm trying to use the shipping discount, it not applied.

 

exemple:

Products (Edit)

1 x Mosquito OilSpray --------------------- 9 €

Discount Coupon test applied: ------------- -7 €

Sub-Total: ------------------------------------ 9 €

Regular deliver :-------------------------------7 €

Total: -----------------------------------------16 €

<!-- Discount Coupons DEBUG
order Object
(
[info] => Array
	(
		[order_status] => 1
		[currency] => EUR
		[currency_value] => 1.00000000
		[payment_method] => Klik & Pay - Credit card payment module
		[cc_type] => 
		[cc_owner] => 
		[cc_number] => 
		[cc_expires] => 
		[shipping_method] => Regular deliver
		[shipping_cost] => 6.5
		[giftwrap_method] => 
		[giftwrap_cost] => 
		[subtotal] => 9
		[tax] => 0
		[tax_groups] => Array
			(
				[Unknown tax rate] => 0
			)

		[comments] => 
		[total] => 15.5
	)

[totals] => Array
	(
	)

[products] => Array
	(
		[0] => Array
			(
				[qty] => 1
				[name] => Mosquito OilSpray
				[model] => 
				[tax] => 0
				[tax_description] => Unknown tax rate
				[price] => 9.0000
				[final_price] => 9
				[weight] => 0.12
				[id] => 356
			)

	)

[customer] => Array
	(
		[firstname] => sacha3
		[lastname] => sacha3
		[company] => 
		[street_address] => 33rue
		[suburb] => 
		[city] => QSDSQ
		[postcode] => 123213
		[state] => 
		[zone_id] => 0
		[country] => Array
			(
				[id] => 73
				[title] => France
				[iso_code_2] => FR
				[iso_code_3] => FRA
			)

		[format_id] => 1
		[telephone] => 123213213
		[email_address] => [email protected]
	)

[delivery] => Array
	(
		[firstname] => sacha3
		[lastname] => sacha3
		[company] => 
		[street_address] => 33rue
		[suburb] => 
		[city] => QSDSQ
		[postcode] => 123213
		[state] => 
		[zone_id] => 0
		[country] => Array
			(
				[id] => 73
				[title] => France
				[iso_code_2] => FR
				[iso_code_3] => FRA
			)

		[country_id] => 73
		[format_id] => 1
	)

[content_type] => physical
[billing] => Array
	(
		[firstname] => sacha3
		[lastname] => sacha3
		[company] => 
		[street_address] => 33rue
		[suburb] => 
		[city] => QSDSQ
		[postcode] => 123213
		[state] => 
		[zone_id] => 0
		[country] => Array
			(
				[id] => 73
				[title] => France
				[iso_code_2] => FR
				[iso_code_3] => FRA
			)

		[country_id] => 73
		[format_id] => 1
	)

[coupon] => discount_coupon Object
	(
		[messages] => Array
			(
				[debug] => Array
					(
						[0] => INFO: DISPLAY_PRICE_WITH_TAX = false
						[1] => INFO: MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING = false
						[2] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS = true
						[3] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_SORT_ORDER = 0
						[4] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_TYPE = true
						[5] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_SUBTOTAL = true
						[6] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_TAX = None
						[7] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_EXCLUDE_SPECIALS = true
						[8] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_RANDOM_CODE_LENGTH = 6
						[9] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_LINES = false
						[10] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_ALLOW_NEGATIVE = false
						[11] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_USE_LANGUAGE_FILE = false
						[12] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_CONFIG = Discount Coupon [code] applied
						[13] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DEBUG = true
						[14] => INFO: Product 356 passed exclusion check.  Discount 0 applied. (shipping)
						[15] => INFO: Discount of 0 applied to product 356 ($9).
						[16] => INFO: Calculating tax on 9.  Displayed price 9.
						[17] => INFO: Shipping Discount of 6.5 applied.
					)

			)

		[coupon] => Array
			(
				[coupons_id] => t
				[coupons_description] => 
				[coupons_discount_amount] => 1.000000000000
				[coupons_discount_type] => shipping
				[coupons_date_start] => 
				[coupons_date_end] => 
				[coupons_max_use] => 0
				[coupons_min_order] => 0.0000
				[coupons_min_order_type] => 
				[coupons_number_available] => 0
			)

		[applied_discount] => Array
			(
				[Unknown tax rate] => 0
				[shipping] => 6.5
			)

		[cart_info] => Array
			(
				[valid_products] => Array
					(
						[count] => 1
						[line_items] => 1
						[total] => 9
					)

				[total_products] => Array
					(
						[count] => 1
						[line_items] => 1
						[total] => 9
					)

				[exclusions] => Array
					(
						[categories] => Array
							(
							)

						[products] => Array
							(
							)

						[manufacturers] => Array
							(
							)

					)

			)

		[discount_tax] => Array
			(
				[Unknown tax rate] => 0
			)

	)

)

End Discount Coupons DEBUG-->

 

 

 

If someone could help me is would be great.

Link to comment
Share on other sites

Hello,

 

I have installed this discount coupon contribution 3.32 and I am not sure what verions I am running?

 

After installing this contribution nothing in my admin panel works? I have gone over everything 3 times and can not see any mistakes?

 

Does one have any ideas??????

 

Thanks,

 

Rakan

Link to comment
Share on other sites

Hi

just some questions.

 

If I use my store in English, and I try to use a wrong CCC number I got the error message OK.

The problem is that if I try to use DCC on an excluded product or category, I dont get the message at all. The DCC is not applied to the amount, but it doesnt give any indication why the amount is not reduced. If I try to use DCC with minimum amount set, then I see the error message for that. So some error messages dont appear.

 

The other problem is like the first, with that difference that if I use my store in Bulgarian the above messages that appeared in English dont appear in Bulgarian, I just see a red area, and no text or in case of set min amount, just the amount number e.g 100

 

Help please.

OSC beginner

Link to comment
Share on other sites

Hi,

 

I downloaded and installed version 3.3 FULL (without the autoinstaller) and now the links in Admin (Mindsparx admin mod) do not work at all. I check the configure.php and that seems to be okay. I can log into admin and I can see all the links but none of them work. Just a blank when I click on any links!!

 

I've checked and re-checked many times but I can't seem to solve the problem. Anybody with any ideas?

 

Thanks. :o

Link to comment
Share on other sites

Okay found the problem and managed to sort it out. The problem is in the mindsparx mod where the /includes/boxes/reports is modified.

 

To prevent the same problem, you need to keep the mindsparx admin mod for the reports.php and place the Discount Coupon mod addition below it.

 

Cheers.

Link to comment
Share on other sites

I've got the mod installed using AutoInstaller 2.14 for Discount Coupon Codes 3.32. I thought everything was working but now it appears that the discounts are being doubled. I enter a .10 % discount and 20% is taken off. I've gone through and doubled checked the code, which appears correct. My quick fix was to knock the discount down to .05 but I'd like to find the real source of the problem. Has anyone else ran into this issue?

Link to comment
Share on other sites

I've got the mod installed using AutoInstaller 2.14 for Discount Coupon Codes 3.32. I thought everything was working but now it appears that the discounts are being doubled. I enter a .10 % discount and 20% is taken off. I've gone through and doubled checked the code, which appears correct. My quick fix was to knock the discount down to .05 but I'd like to find the real source of the problem. Has anyone else ran into this issue?

 

Problem solved! Somehow I had duplicate code within includes/classes/order.php. Removed the code and all is well.

Link to comment
Share on other sites

I am having a bugger of a time and for the life of me I can't seem to find the reason why - LOL

 

I have two table rate shipping modules - the original one (table.php) for retail customers, and then a second one (wtable.php) for wholesale customers. For some reason - the function recalc_shipping is working fine on the retail side, but it isn't functioning at all on the wholesale side.

 

My includes/classes/discount_coupon.php file contains the following code for the recalc_shipping function:

	function is_recalc_shipping() {
  global $order, $language;

  //calculate the order total:
  $order_total = $order->info['total'] - $order->info['shipping_cost'];
  if( DISPLAY_PRICE_WITH_TAX != 'true' ) $order_total -= $order->info['tax'];

  //check if there is free shipping
  if( strtolower(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING) == 'true' ) {
	include( DIR_WS_LANGUAGES.$language.'/modules/order_total/ot_shipping.php' );
	//if free shipping is enabled, make sure the discount does not bring the order total below free shipping limit
	if( $order->info['shipping_method'] == FREE_SHIPPING_TITLE ) { //if free shipping is the selected shipping method
	  if( $order_total < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER ) { //if the discount lowers the total below the free shipping limit
		return true;
	  }
	}
  }

	//check if table rate shipping has changed			
	if( strtolower(MODULE_SHIPPING_TABLE_STATUS) == 'True' ) {
	include( DIR_WS_LANGUAGES.$language.'/modules/shipping/table.php' );
	if( substr($order->info['shipping_method'], 0, strlen(MODULE_SHIPPING_TABLE_TEXT_TITLE)) == MODULE_SHIPPING_TABLE_TEXT_TITLE && MODULE_SHIPPING_TABLE_MODE == 'price' ) {
	  $table_cost = split( "[:,]", MODULE_SHIPPING_TABLE_COST );
	  for( $i = 0; $i < count( $table_cost ); $i += 2 ) {
		if( $order_total <= $table_cost[$i] ) {
		  $shipping = $table_cost[$i+1];
		  break;
		} // end if( $order-total <= $table_cost[$i])
	  }// end for( $i = 0; $i < count( $table_cost ); $i += 2 )
	  if( $order->info['shipping_cost'] != $shipping ) { //if the discount lowers the total below the table rate
		return true;
	  } // end if( $order->info['shipping_cost'] != $shipping)
	} // end if( substr($order->info['shipping_method'], 0, strlen(MODULE_SHIPPING_TABLE_TEXT_TITLE)) == MODULE_SHIPPING_TABLE_TEXT_TITLE && MODULE_SHIPPING_TABLE_MODE == 'price' )
  } // end if( strtolower(MODULE_SHIPPING_TABLE_STATUS) == 'True' )
  else if( strtolower(MODULE_SHIPPING_WTABLE_STATUS) == 'True') {
	  include( DIR_WS_LANGUAGES.$language.'/modules/shipping/wtable.php' );
	if( substr($order->info['shipping_method'], 0, strlen(MODULE_SHIPPING_WTABLE_TEXT_TITLE)) == MODULE_SHIPPING_WTABLE_TEXT_TITLE && MODULE_SHIPPING_WTABLE_MODE == 'price' ) {
		$wtable_cost = split( "[:,]", MODULE_SHIPPING_WTABLE_COST );
		for( $i = 0; $i < count( $wtable_cost ); $i += 2 ) {
		  if( $order_total <= $wtable_cost[$i] ) {
			$wshipping = $wtable_cost[$i+1];
			break;
		  } // end if( $order_total <= $wtable_cost[$i] )
		 } // end for( $i = 0; $i < count( $wtable_cost ); $i += 2 )
		 if( $order->info['shipping_cost'] != $wshipping ) { //if the discount lowers the total below the table rate
		   return true;
		 } // end if( $order->info['shipping_cost'] != $wshipping )
	  } // end if( substr($order->info['shipping_method'], 0, strlen(MODULE_SHIPPING_WTABLE_TEXT_TITLE)) == MODULE_SHIPPING_WTABLE_TEXT_TITLE && MODULE_SHIPPING_WTABLE_MODE == 'price' )
	} // end else if( strtolower(MODULE_SHIPPING_WTABLE_STATUS) == 'True')
  return false;
} // end  function is_recalc_shipping() {

 

My includes/modules/shipping/wtable.php looks like this:

<?php
/*
 $Id: wtable.php,v 1.27 2003/02/05 22:41:52 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class wtable {
var $code, $title, $description, $icon, $enabled;

// class constructor
function wtable() {
  global $order, $customer;
  if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') {
  $this->cg_id = $_SESSION['sppc_customer_group_id'];
  } else {
 $this->cg_id = '0';
 }

  $this->code = 'wtable';
  $this->title = MODULE_SHIPPING_WTABLE_TEXT_TITLE;
  $this->description = MODULE_SHIPPING_WTABLE_TEXT_DESCRIPTION;
  $this->sort_order = MODULE_SHIPPING_WTABLE_SORT_ORDER;
  $this->icon = '';
  $this->tax_class = MODULE_SHIPPING_WTABLE_TAX_CLASS;
  $this->enabled = ((MODULE_SHIPPING_WTABLE_STATUS == 'True') ? true : false);

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

	if ($this->cg_id != '1' OR $check_flag == false) {
	  $this->enabled = false;
	}
  }
}

// class methods
function quote($method = '') {
  global $order, $cart, $shipping_weight, $shipping_num_boxes;

  if (MODULE_SHIPPING_WTABLE_MODE == 'price') {
	//kgt - discount coupons
	$order_total = $order->info['subtotal'];
	/**************
	$order_total = $cart->show_total();
	**************/
	//end kgt - discount coupons
  } else {
	$order_total = $shipping_weight;
  }

  $table_cost = split("[:,]" , MODULE_SHIPPING_WTABLE_COST);
  $size = sizeof($table_cost);
  for ($i=0, $n=$size; $i<$n; $i+=2) {
	if ($order_total <= $table_cost[$i]) {
	  $shipping = $table_cost[$i+1];
	  break;
	}
  }

  if (MODULE_SHIPPING_WTABLE_MODE == 'weight') {
	$shipping = $shipping * $shipping_num_boxes;
  }

  $this->quotes = array('id' => $this->code,
						'module' => MODULE_SHIPPING_WTABLE_TEXT_TITLE,
						'methods' => array(array('id' => $this->code,
												 'title' => MODULE_SHIPPING_WTABLE_TEXT_WAY,
												 'cost' => $shipping + MODULE_SHIPPING_WTABLE_HANDLING)));

  if ($this->tax_class > 0) {
	$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
  }

  if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

  return $this->quotes;
}

function check() {
  if (!isset($this->_check)) {
	$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_WTABLE_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 Table Method', 'MODULE_SHIPPING_WTABLE_STATUS', 'True', 'Do you want to offer Wholesale table rate shipping?', '6', '0', '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 ('Shipping Table', 'MODULE_SHIPPING_WTABLE_COST', '25:8.50,50:5.50,10000:0.00', 'The Wholesale shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', '6', '0', now())");
  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 ('Table Method', 'MODULE_SHIPPING_WTABLE_MODE', 'weight', 'The Wholesale shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'weight\', \'price\'), ', now())");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_WTABLE_HANDLING', '0', 'Handling fee for this Wholesale shipping method.', '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 ('Tax Class', 'MODULE_SHIPPING_WTABLE_TAX_CLASS', '0', 'Use the following tax class on the Wholesale shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', 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 ('Shipping Zone', 'MODULE_SHIPPING_WTABLE_ZONE', '0', 'If a zone is selected, only enable this Wholesale shipping method for that zone.', '6', '0', '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, date_added) values ('Sort Order', 'MODULE_SHIPPING_WTABLE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
}

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

function keys() {
  return array('MODULE_SHIPPING_WTABLE_STATUS', 'MODULE_SHIPPING_WTABLE_COST', 'MODULE_SHIPPING_WTABLE_MODE', 'MODULE_SHIPPING_WTABLE_HANDLING', 'MODULE_SHIPPING_WTABLE_TAX_CLASS', 'MODULE_SHIPPING_WTABLE_ZONE', 'MODULE_SHIPPING_WTABLE_SORT_ORDER');
}
 }
?>

 

Does anyone here see any reason this should not work? Am I missing the forest while looking at the trees? :blush:

~Tracy
 

Link to comment
Share on other sites

I am using Discount Coupon, at times, to allow certain customers to get a product for free (an NFR - not for resale - purchase). So the amount ends up being $0.00. Not all my coupons discount to $0.00, but some do (or may).

 

How do I set up oscCommerce to skip the payment pages (the ones after checkout_payment.php) and go directly to checkout_process.php, but only if the price is $0.00?

 

I know it must be a modifiction to checkout_confirmation.php, in this sort of area:

 

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

$form_action_url = $$payment->form_action_url;

} else {

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

}

 

If I could only see at that point of time if the total price was $0.00, I could set $form_action_url to FILENAME_CHECKOUT_PROCESS and skip the payment pages. But how? I'm not sure how to calculate the total price at that time.

Edited by chickeneps
Link to comment
Share on other sites

I installed a contribution: Free of Charge. It changes the payment method to "Free of Charge" so they aren't asked for a credit card. Maybe this will work for you?

 

I am using Discount Coupon, at times, to allow certain customers to get a product for free (an NFR - not for resale - purchase). So the amount ends up being $0.00. Not all my coupons discount to $0.00, but some do (or may).

 

How do I set up oscCommerce to skip the payment pages (the ones after checkout_payment.php) and go directly to checkout_process.php, but only if the price is $0.00?

 

I know it must be a modifiction to checkout_confirmation.php, in this sort of area:

 

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

$form_action_url = $$payment->form_action_url;

} else {

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

}

 

If I could only see at that point of time if the total price was $0.00, I could set $form_action_url to FILENAME_CHECKOUT_PROCESS and skip the payment pages. But how? I'm not sure how to calculate the total price at that time.

~Tracy
 

Link to comment
Share on other sites

Has anyone come up with a way to do both a product discount and a shipping discount on the same coupon code?

 

The majority of the discounts that our marketing department creates are along the lines of 10% off your order and 50% off shipping. Right now we end up manually editing every order that comes in with a discount code that applies to both and then emailing the customer with the true total that was charged to their card. Getting to be a pain as the online store gets busier.

~Tracy
 

Link to comment
Share on other sites

Hi guys im totally new to this, so i need some help, reading the previous replies to this thread confused me further.

 

Please help.

Basically how do i put this contribution that it works on my site. What program do i use? can someone give me a step by step detailed guide? PLEASE!

 

THanks :lol:

Link to comment
Share on other sites

I installed a contribution: Free of Charge. It changes the payment method to "Free of Charge" so they aren't asked for a credit card. Maybe this will work for you?

 

Thank you.

 

Well, I tried it. Your contrib has no docs really, but it seemed simple to install.

 

-I uploaded the two files, they are correctly inserted

-Going into Admin-Modules, I installed the module

-I set the Sort Order to something other then 0

-I set COD to false, and set the default Order setting to "Processing"

 

Hoping that it would work:

 

-I signed on

-Ordered something

-Put in the coupon that set the "Total" (that is the Grand Total) to $0.00, in checkout_confirmation

-I clicked Continue, hoping that it would simply skip the payment pages and go to checkout_process

 

It didn't work, the payment page came up anyway.

 

So - your contribution simply looks at the total coming out of checkout_confirmation, the ONE TOTAL (grand total) that goes to the payment pages - whatever they might be - and if it's zero, it goes to checkout_process, NOT the payment pages? That would be great...

 

But it doesn't seem to work.

 

Perhaps the problem is that your contrib doesn't look "late enough" - it looks for $0.00 earlier then checkout_confirmation, where the Coupons are applied. COuld that be?

 

 

Any suggestions?

Edited by chickeneps
Link to comment
Share on other sites

Maybe try contacting the person who created the module. I didn't create it - I simply was able to use it for $0.00 orders on our site. In our case, the product itself has a $0.00 amount, which triggers the table rate shipping to be $0.00 so the entire order has no charge. I haven't tried it with a coupon to change the order total.

 

Thank you.

 

Well, I tried it. Your contrib has no docs really, but it seemed simple to install.

 

-I uploaded the two files, they are correctly inserted

-Going into Admin-Modules, I installed the module

-I set the Sort Order to something other then 0

-I set COD to false, and set the default Order setting to "Processing"

 

Hoping that it would work:

 

-I signed on

-Ordered something

-Put in the coupon that set the "Total" (that is the Grand Total) to $0.00, in checkout_confirmation

-I clicked Continue, hoping that it would simply skip the payment pages and go to checkout_process

 

It didn't work, the payment page came up anyway.

 

So - your contribution simply looks at the total coming out of checkout_confirmation, the ONE TOTAL (grand total) that goes to the payment pages - whatever they might be - and if it's zero, it goes to checkout_process, NOT the payment pages? That would be great...

 

But it doesn't seem to work.

 

Perhaps the problem is that your contrib doesn't look "late enough" - it looks for $0.00 earlier then checkout_confirmation, where the Coupons are applied. COuld that be?

 

 

Any suggestions?

~Tracy
 

Link to comment
Share on other sites

I've not used paypal with our store - but I know that on the contribution download page there is a paypal module that you need to install if you are using this contribution with paypal. Did you install that module?

 

any one get this contribution works via Paypal? On checkout comfirmation page, I can see the discount code does works, however, when transfer to Paypal page, the total back to normal without discount applied...

~Tracy
 

Link to comment
Share on other sites

If you download the contribution it includes instructions on how to install manually for an already modified osCommerce site, or how to install if you are on a stock osCommerce site. What program you use depends on your preference - could be notepad, could be Dreamweaver -etc...

 

Hi guys im totally new to this, so i need some help, reading the previous replies to this thread confused me further.

 

Please help.

Basically how do i put this contribution that it works on my site. What program do i use? can someone give me a step by step detailed guide? PLEASE!

 

THanks :lol:

~Tracy
 

Link to comment
Share on other sites

Maybe try contacting the person who created the module. I didn't create it - I simply was able to use it for $0.00 orders on our site. In our case, the product itself has a $0.00 amount, which triggers the table rate shipping to be $0.00 so the entire order has no charge. I haven't tried it with a coupon to change the order total.

 

Thanks - sorry, I misread your post.

 

I coded my desire myself - in checkout_confirmation.php, after line approx. 151 I just put this:

 

if ($order->info['total'] == 0) {
  $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
}

 

I know enough PHP to make me dangerous, but you know, OSC seems to be well-written enough to where modifying it doesn't seem to be such a task.

 

Thanks a lot for taking time out to help, though.

 

Is there any place in the Community here that provides a "code overview" in "programmer language" on how OSC is set up? It would be nice to know esssentially how OSC basically works, so in modifying OSC it would be an easier task, instead of dumbly working off contributions and wimply complaining when they "don't work".

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