PHP IF then redirect for OSCommerce

  • mossman65
  • Born
  • Born
  • No Avatar
  • Joined: May 20, 2011
  • Posts: 3
  • Status: Offline

Post May 20th, 2011, 1:48 pm

Hello and thank you,

I am new to PHP and have successfully installed a version of osCommerce for my company.

We use Skipjack as our processor and the have limited options with the services. Our front desk uses their virtual point of sale to enter cards from phone orders. We are also using the account for our new online cart.

The issue:
If i change the response pages at the processors site to redirect to the OSC processing page to complete my web order, it breaks the Secretaries page so that she can see the transaction receipt or print it. If i use the processors default response page it charges the card but never completes the order in OSC because the variables aren't being passed through their page to update the admin section in OSC.

The Idea:
A IF statement at the top of my process.php page that looks for a "user defined" variable from the processor, or visa versa one from OSC's cart. Not sure which will work best.

if variable == user_defined_field then
got to OSC_process_page.pgp
else
got to processors_page
end if

Any help would be great!
Aaron
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 20th, 2011, 1:48 pm

  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8211
  • Loc: USA
  • Status: Offline

Post May 20th, 2011, 2:57 pm

PHP Code: [ Select ]
<?php
if($variable == $_POST['user_defined_field'])
{
     header("LOCATION: OSC_process_page.php");
}
else
{
     header("LOCATION: processors_page.php");
}
  1. <?php
  2. if($variable == $_POST['user_defined_field'])
  3. {
  4.      header("LOCATION: OSC_process_page.php");
  5. }
  6. else
  7. {
  8.      header("LOCATION: processors_page.php");
  9. }
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • mossman65
  • Born
  • Born
  • No Avatar
  • Joined: May 20, 2011
  • Posts: 3
  • Status: Offline

Post May 23rd, 2011, 6:27 am

Thank you for your reply!

I insert the following:

///// REDIRECT ON CHECKOUT /////

if($variable == $_POST['transactionamount'])
{
header("LOCATION:buy_online/catalog/checkout_process.php");
}
else
{
header("LOCATION: VPOSWebResponse.asp");
}

//// END REDIRECT ////

It results into to many redirects and errors out.

I placed it at the top of my checkout page, should i set/param "transactionamount" to null?

Thanks!
Aaron
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8211
  • Loc: USA
  • Status: Offline

Post May 23rd, 2011, 12:19 pm

What does the $variable hold?
"Bring forth therefore fruits meet for repentance:" Matthew 3:8

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 175 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.