osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Free Shipping Coupon and LinkPoint

This is a discussion on Free Shipping Coupon and LinkPoint within the osCMax v2 Features Discussion forums, part of the osCMax v2.0 Forums category; I'm trying to use a free shipping coupon in my store. I'm usin the linkpoint gateway, which required that the ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Features Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 01-07-2006, 09:13 PM
Member
 
Join Date: Jun 2005
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
driwashsolutions
Default Free Shipping Coupon and LinkPoint

I'm trying to use a free shipping coupon in my store. I'm usin the linkpoint gateway, which required that the subtotal, shipping and total match. So, if any discounts are applied (such as a free shipping coupon) these don't add up as far as linkpoint is concerned.

So, I though I would take the free shipping off before the order is subtotaled, then everything would jive. I've done this through the order total module sort order.

Well, the subtotal is not removing the free shipping amount, so the values still don't jive.

What can I do to get this to work?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 01-12-2006, 04:15 AM
Member
 
Join Date: Jun 2005
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
driwashsolutions
Default RE: Free Shipping Coupon and LinkPoint

OK figured out the problem for us Linkpoint users.

First, there is a piece of code missing from the catalog/includes/modules/order_total/ot_coupon.php file. Find the this section of code:
Code:
function process() {
global $PHP_SELF, $order, $currencies;


	$order_total=$this->get_order_total();
	$od_amount = $this->calculate_credit($order_total);
	$tod_amount = 0.0; //Fred
	$this->deduction = $od_amount;
	if ($this->calculate_tax != 'None') { //Fred - changed from 'none' to 'None'!
		$tod_amount = $this->calculate_tax_deduction($order_total, $this->deduction, $this->calculate_tax);
	}

	if ($od_amount > 0) {
		$order->info['total'] = $order->info['total'] - $od_amount;
Then, add this just below it:

Code:
$_SESSION['od_amount'] = $od_amount;
This will then allow this piece of code which already exists in the catalog/includes/modules/order_total/ot_subtotal.php file to work correctly:

Code:
    function process() {
      global $order, $currencies;

// BOF: LINES ADDED
      $od_amount = $_SESSION['od_amount'];
      $subtotal = $order->info['subtotal'] - $od_amount;
      $order->info['subtotal'] = $order->info['subtotal'] - $od_amount;
// EOF: LINES ADDED
Finally, change the sort order of the order total modules to put the Discount Coupons BEFORE the subtotal module, and everything will then work out. Here's how it looks in my store:



Now, I'm not a proficient PHP programmer, but there are sections of code that have the $_SESSION line commented out with a statement that says to use the global variable rather than the $_SESSION statement. So if there's a better, more preferred method of getting the $od_amount into the ot_subtotal routine, I would certainly welcome the tip.

John
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 05-24-2006, 08:48 PM
red_fraggle's Avatar
Active Member
 
Join Date: Feb 2004
Location: wilmington, NC
Posts: 319
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
red_fraggle
Default RE: Free Shipping Coupon and LinkPoint

actually you didnt figure this out, lol, its in the installation instructions i wrote and included with the module and which micheal has included in the module directory for you in the /includes/linkpoint directory.

this is plainly documented, it is required ONLY if you use this module or the credit class gift voucher modification.

linkpoint was originally written for stock oscommerce which did not come with these modules and therefore the code had to be changed IF and only IF you actually added these modules to your store. Since these modules come with oscmax, it needs to be done.
__________________
Clifton Murphy CEO/CTO
Hyperactive Inc.
osCommerce hosting, OSCMAX hosting, osCommerce modification, and OSCMAX modification specialists!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 12-16-2006, 07:40 PM
New Member
 
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
BadDog is on a distinguished road
Default Re: Free Shipping Coupon and LinkPoint

Quote:
Originally Posted by driwashsolutions View Post
OK figured out the problem for us Linkpoint users.

Finally, change the sort order of the order total modules to put the Discount Coupons BEFORE the subtotal module, and everything will then work out.
John
Can you be more specific about what files are changed and how in order to change the sort order of the order total modules? I don't want to screw it up.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 12-18-2006, 05:04 AM
New Member
 
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
BadDog is on a distinguished road
Default Re: Free Shipping Coupon and LinkPoint

Quote:
Originally Posted by red_fraggle View Post
actually you didnt figure this out, lol, its in the installation instructions i wrote and included with the module and which micheal has included in the module directory for you in the /includes/linkpoint directory.

this is plainly documented, it is required ONLY if you use this module or the credit class gift voucher modification.

linkpoint was originally written for stock oscommerce which did not come with these modules and therefore the code had to be changed IF and only IF you actually added these modules to your store. Since these modules come with oscmax, it needs to be done.
I cannot find the file credit_voucher_gift_card_hack.txt mentioned in the install instructions. Can anyone poiint me in the right direction? I'm trying to make a mod called ccgv(trad) for osCommerce work with Linkpoint. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #6  
Old 12-18-2006, 06:56 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,973
Thanks: 80
Thanked 345 Times in 324 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Free Shipping Coupon and LinkPoint

Quote:
Originally Posted by driwashsolutions View Post
OK figured out the problem for us Linkpoint users.

First, there is a piece of code missing from the catalog/includes/modules/order_total/ot_coupon.php file. Find the this section of code:
Code:
function process() {
global $PHP_SELF, $order, $currencies;


    $order_total=$this->get_order_total();
    $od_amount = $this->calculate_credit($order_total);
    $tod_amount = 0.0; //Fred
    $this->deduction = $od_amount;
    if ($this->calculate_tax != 'None') { //Fred - changed from 'none' to 'None'!
        $tod_amount = $this->calculate_tax_deduction($order_total, $this->deduction, $this->calculate_tax);
    }

    if ($od_amount > 0) {
        $order->info['total'] = $order->info['total'] - $od_amount;
Then, add this just below it:

Code:
$_SESSION['od_amount'] = $od_amount;
This will then allow this piece of code which already exists in the catalog/includes/modules/order_total/ot_subtotal.php file to work correctly:

Code:
    function process() {
      global $order, $currencies;

// BOF: LINES ADDED
      $od_amount = $_SESSION['od_amount'];
      $subtotal = $order->info['subtotal'] - $od_amount;
      $order->info['subtotal'] = $order->info['subtotal'] - $od_amount;
// EOF: LINES ADDED
Finally, change the sort order of the order total modules to put the Discount Coupons BEFORE the subtotal module, and everything will then work out. Here's how it looks in my store:



Now, I'm not a proficient PHP programmer, but there are sections of code that have the $_SESSION line commented out with a statement that says to use the global variable rather than the $_SESSION statement. So if there's a better, more preferred method of getting the $od_amount into the ot_subtotal routine, I would certainly welcome the tip.

John

Just follow these instructions...already there for you, no need to look elsewhere.
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #7  
Old 12-18-2006, 08:19 AM
New Member
 
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
BadDog is on a distinguished road
Default Re: Free Shipping Coupon and LinkPoint

Quote:
Originally Posted by michael_s View Post
Just follow these instructions...already there for you, no need to look elsewhere.
Well, that seems to work for discount coupons, but it does not work for gift certificates (at least not with ccgv(trad)), so I'm still looking for a solution for that piece.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #8  
Old 12-18-2006, 09:08 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,973
Thanks: 80
Thanked 345 Times in 324 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Free Shipping Coupon and LinkPoint

Maybe I am asking too much, but if it works in ot_coupon.php... why not make the logical connection that it should also work in ot_gv.php?

Here is the text file from the linkpoint mod:
Quote:
Simple really, just had to figure out the "PHP" way to do it. Just a couple of edits so I won't include full files.

In /catalog/includes/modules/ot_coupon.php:

Find lines:

if ($od_amount > 0) {
$order->info['total'] = $order->info['total'] - $od_amount;

Add this line right after:

$_SESSION['od_amount'] = $od_amount;

In /catalog/includes/modules/ot_subtotal.php:

Find lines:

function process() {
global $order, $currencies;

Add right after:

$od_amount = $_SESSION['od_amount'];
$subtotal = $order->info['subtotal'] - $od_amount;
$order->info['subtotal'] = $order->info['subtotal'] - $od_amount;

Then, make sure the sort order of the payment lines (via OSCommerce admin
site) puts discount before subtotal.

Essentially, I just used the global PHP session to make the discount amount available in the standard subtotal routine. There may be more correct ways to do it but it works.
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #9  
Old 12-18-2006, 10:00 AM
New Member
 
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
BadDog is on a distinguished road
Default Re: Free Shipping Coupon and LinkPoint

Quote:
Originally Posted by michael_s View Post
Maybe I am asking too much, but if it works in ot_coupon.php... why not make the logical connection that it should also work in ot_gv.php?

Here is the text file from the linkpoint mod:
I added the line from ot_coupon.php to ot_gv.php but it did not work. Maybe there is a conflict between discount coupons and gift certificates? Maybe you can only use one or the other but not both? Hopefully someone who knows more about these than I do can shed some light on this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #10  
Old 12-18-2006, 11:36 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,973
Thanks: 80
Thanked 345 Times in 324 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Free Shipping Coupon and LinkPoint

Did you put the gift voucher ot mod before the subtotal?
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Free Shipping Mod. mrocket osCommerce 2.2 Modification Help 0 10-25-2004 01:44 PM
free shipping over $99.00 lil-raskals osCommerce 2.2 Modification Help 0 10-05-2004 08:49 AM
Free Shipping GamerGoat osCMax v1.7 General Mods Discussion 8 04-14-2004 12:22 PM
Free shipping?? ChanBe osCMax v1.7 Discussion 3 09-17-2003 02:18 PM
Free Shipping/flat rate shipping in zone cvc505 osCommerce 2.2 Installation Help 2 07-21-2003 10:29 AM


All times are GMT -8. The time now is 07:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax