Jump to content
Sign in to follow this  
bmcewan

Purchase Without Account Updated & Admin Functionality

Recommended Posts

Stew,

 

Thanks for the quick reply. Please do post if you find my change turns out to cause an unforseen problem. Everything else is great. I did find a couple of other small issues and will post those later this afternoon to help out. I am going for an upload of PWA .90 to my production (under construction) site now. I'll post the link afterwards so you can check it out, I am not in production quite yet.

 

Joe

Share this post


Link to post
Share on other sites
Stew,

 

Thanks for the quick reply. Please do post if you find my change turns out to cause an unforseen problem. Everything else is great. I did find a couple of other small issues and will post those later this afternoon to help out. I am going for an upload of PWA .90 to my production (under construction) site now. I'll post the link afterwards so you can check it out, I am not in production quite yet.

 

Joe

 

 

Joe-

 

Let me know what these other problems are. I'm putting together a new release, v0.910, that will include your fix, expanded instructions for integrating PWA with WPP, and maybe some other stuff. I'll wait on releasing it until I hear from you.

 

Thanks,

Stew

 

 

==========================================================

 

Ray-

 

Add this to your catalog/includes/languages/english/create_account.php:

 

// PWA
define('PWA_FAIL_ACCOUNT_EXISTS', 'An account already exists for the email address {EMAIL_ADDRESS}.  You must login here with the password for that account before proceeding to checkout.');
//End PWA

 

Plus any other languages you're using.

 

Stew


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

Hey Stew,

 

Here are some minor cosmetic problems I found /catalog/order_info.php and how I fixed them. My fixes are off the cuff as I am not a programmer so be sure to look them over before incorporating into your contribution:

 

Problem #1: In the Checkout "My Billing Information" page, the "* Required Field" asterisks next to "State/Provence" and "Country" fields are black in color and not the same color as set by /catalog/stylesheet.css for the other required fields on the page.

 

I changed this code in /catalog/order_info.php from to add the "inputRequirement" Style from:

 

echo tep_draw_input_field('state', tep_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state'])) . ' ' . ENTRY_STATE_TEXT;

 

and

 

echo tep_get_country_list('country', $account['entry_country_id']) . ' ' . ENTRY_COUNTRY_TEXT;

 

To this:

 

echo tep_get_country_list('country', $account['entry_country_id']) . ' ' . '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>';

 

echo tep_draw_input_field('state', tep_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state'])) . ' ' . '<span class="inputRequirement">' . ENTRY_STATE_TEXT . '</span>';

 

------------------------------

 

Problem #2: In the Checkout "My Billing Information" page, the "Country" drop down field was shifted to the right and did not align with the other fields on the page.

 

I changed this code in /catalog/order_info.php:

 

<td class="main"><?php echo ENTRY_COUNTRY; ?></td>

<td class="main"> 

<?php

 

To this (removed  ):

 

<td class="main"><?php echo ENTRY_COUNTRY; ?></td>

<td class="main">

<?php

 

------------------------------

 

Problem #3: On the Checkout Page where the three choices are provided:

Proceed Directly to Checkout

New Customer

Returning Customer

The field was using only 70% of the page. If a site owner has info boxes on the right and left columns (as by a default osCommerce install it leave a lot of white space on the right side of the screen. Also, the table border was not matching the rest of the site. There was no thin line around the table.

 

In /catalog/login.php I changed this:

 

<td><table border="0" width="70%" cellspacing="0" cellpadding="2">

 

To this:

 

<td><table border="0" width="100%" height="100%" cellspacing="1" cellpadding="0" class="infoBox">

 

------------------------------

 

There is one more issue Stew. I am working on it now and will post it soon.

 

Joe

Share this post


Link to post
Share on other sites

Stew, here is the last issue I have:

 

 

Problem: When using the PWA Checkout "My Billing Information" screen and when entering an e-mail address that already exists, an error field is correctly displayed to tell the customer that an account already exists. The error message is not displayed as it should, the Tag name "PWA_FAIL_ACCOUNT_EXISTS" is displayed instead of the error message text.

 

I confirmed that this define entry is correctly set in /catalog/includes/languages/english/login.php:

 

define('PWA_FAIL_ACCOUNT_EXISTS', 'An account already exists for the email address {EMAIL_ADDRESS}. You must login here with the password for that account before proceeding to checkout.');

 

I implemented a work around temporarily but need help to figure why PWA_FAIL_ACCOUNT_EXISTS is not being pulled into /catalog/order_info.php:

 

From /catalog/order_info.php, this line is not working:

 

tep_redirect(tep_href_link(FILENAME_LOGIN,'login=fail&reason=' . urlencode(str_replace('{EMAIL_ADDRESS}',$check_customer['customers_email_address'],PWA_FAIL_ACCOUNT_EXISTS)), 'SSL'));

 

I commented the above line and hacked in the text directly as a work around until this issue can be resolved:

 

tep_redirect(tep_href_link(FILENAME_LOGIN,'login=fail&reason=' . urlencode(str_replace('{EMAIL_ADDRESS}',$check_customer['customers_email_address'],"An account already exists for the email address {EMAIL_ADDRESS}. You must login here with the password for that account before proceeding to checkout.")), 'SSL'));

 

I am stuck on this one Stew...

 

Joe

Share this post


Link to post
Share on other sites

Stew,

 

I was thinking that as an enhancement this would be a change I think would be beneficial to this contribution. From what you had posted earlier, I think this may have been a part of your initial intent.

 

Suggested enhancement to this great PWA contribution:

 

Scenario: A customer already has an Account and Password in the osCommerce site and has returned to make another purchase several months later for example. However, the customer may not remember his password and just doesn't want to deal with it. So the customer just clicks PWA Checkout to make a quick purchase. However, PWA recognizes that the customer e-mail address is already registered and forces the user to remember or reset his password to make the deal. This could cause a customer to jump ship because it is a hassle.

 

Recommended change: The PWA Checkout "My Billing Information" screen could gently indicate to the customer that the e-mail address is recognized as a previous account and provide the user the ability to change his password or redirect back to the login screen. However, PWA should allow the customer the choice to just go ahead and make the deal by filling out the "My Billing Information" screen anyway. This change could seal the deal for some returning customers.

 

PWA as usual could destory the current customer information at Checkout. However, the original Customer registration information should still be kept just in case the customer returns and wants to reset the password.

 

Just a suggestion Stew...

 

Joe

Share this post


Link to post
Share on other sites

Joe-

 

Add this to your catalog/includes/languages/english/create_account.php:

 

// PWA
define('PWA_FAIL_ACCOUNT_EXISTS', 'An account already exists for the email address {EMAIL_ADDRESS}. You must login here with the password for that account before proceeding to checkout.');
//End PWA

 

Plus any other languages you're using.

 

This should take care of the PWA_FAIL_ACCOUNT_EXISTS thing.

 

Stew


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

That did the trick. I also removed if from catalog/includes/languages/english/login.php thinking it was no longer needed there.

 

Thanks!

 

Joe

Share this post


Link to post
Share on other sites
Problem #3: On the Checkout Page where the three choices are provided:

Proceed Directly to Checkout

New Customer

Returning Customer

The field was using only 70% of the page. If a site owner has info boxes on the right and left columns (as by a default osCommerce install it leave a lot of white space on the right side of the screen. Also, the table border was not matching the rest of the site. There was no thin line around the table.

 

In /catalog/login.php I changed this:

 

<td><table border="0" width="70%" cellspacing="0" cellpadding="2">

 

To this:

 

<td><table border="0" width="100%" height="100%" cellspacing="1" cellpadding="0" class="infoBox">

 

------------------------------

 

There is one more issue Stew. I am working on it now and will post it soon.

 

Joe

 

 

Weird- that 70% is in a line of code that should not have been modified from stock osC, lest my eyes deceive me (it's right above the line that says "<!-- this is where PWA mods begin -->", right?). It wasn't in my test site, but that's where I got the files from. Cue theme from The Twilight Zone....

 

Thanks for that and the other fixes, I've integrated them and will post an update soon.

 

Stew


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

Ok-

 

I feel like I'm forgetting something, but oh well, here goes:

 

v0.910 (by djmonkey1)

 

-Thanks to primadude- modified order_info.php so that if the user email already exists as an active non-PWA account in the database then the email error will be returned. Previously it would look for a match of first name, last name, and email address. This fixes a bug that could result in users with accounts not being able to update their account info if their email address was used with an abandoned PWA checkout.

-Included a new line in catalog/includes/languages/english/create_account.php to cover PWA_FAIL_ACCOUNT_EXISTS

-Thanks to primadude- cleaned up various cosmetic issues in catalog/order_info.php and catalog/login.php

-Included expanded instructions for integrating with Brian Burton's PayPal WPP in the extras/wpp/ folder.


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

does anyone know how to keep some sort of record of the customers order and receive e-mail of the order when they choose proceed to checkout - after they pay via HSBC bank module?

 

Without having to keep checking the sql database?

 

my customer just purchased the way above and if it wasn't for her phoning us, we would never had known she had purchased as her order and her details were erased from admin the minute she completed checkout.

 

Also i cannot have anything that lets me know of an order when someone leaves the checkout successfully because they still may not complete the HSBC payment part.

 

thank you


Hope it helps...

PC Planet

Share this post


Link to post
Share on other sites

Hi! I am getting some errors now after installing PWA 0.91. It may be something simple but I am at a loss. The first error I noticed is after adding an item to the cart and then proceeding to checkout without an account I get the following error:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/www/sommartimemarketplace/includes/header.php:136) in /home/www/sommartimemarketplace/includes/boxes/categories.php on line 13

 

Here is the line in includes/header.php (line 136)

function tep_show_category($counter) {

 

Here is the line in includes/boxes/categories.php (line 13)

function tep_show_category($counter) {

 

I notice that both are the same...is this a problem and if so how do I resolve it.

 

Now...if instead I chose to "create an account", then I get the following error:

 

Parse error: parse error, unexpected $ in /home/www/sommartimemarketplace/create_account.php on line 547

 

Here is the code in catalog/create_account.php:

?php
/*
 $Id: create_account.php,v 1.65 2003/06/09 23:03:54 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

// needs to be included earlier to set the success message in the messageStack
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT);

 $process = false;
 if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
$process = true;

if (ACCOUNT_GENDER == 'true') {
  if (isset($HTTP_POST_VARS['gender'])) {
	$gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
  } else {
	$gender = false;
  }
}
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
$street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
$postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
$city = tep_db_prepare_input($HTTP_POST_VARS['city']);
if (ACCOUNT_STATE == 'true') {
  $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
  if (isset($HTTP_POST_VARS['zone_id'])) {
	$zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
  } else {
	$zone_id = false;
  }
}
$country = tep_db_prepare_input($HTTP_POST_VARS['country']);
$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
$fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
if (isset($HTTP_POST_VARS['newsletter'])) {
  $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);
} else {
  $newsletter = false;
}
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);
$confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);

$error = false;

if (ACCOUNT_GENDER == 'true') {
  if ( ($gender != 'm') && ($gender != 'f') ) {
	$error = true;

	$messageStack->add('create_account', ENTRY_GENDER_ERROR);
  }
}

if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
}

if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_LAST_NAME_ERROR);
}

if (ACCOUNT_DOB == 'true') {
  if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) {
	$error = true;

	$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
  }
}

if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);
} elseif (tep_validate_email($email_address) == false) {
  $error = true;

  $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
} else {
  $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
  $check_email = tep_db_fetch_array($check_email_query);
  if ($check_email['total'] > 0)
{  //PWA delete account
	$get_customer_info = tep_db_query("select customers_id, customers_email_address, purchased_without_account from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
	$customer_info = tep_db_fetch_array($get_customer_info);
	$customer_id = $customer_info['customers_id'];
	$customer_email_address = $customer_info['customers_email_address'];
	$customer_pwa = $customer_info['purchased_without_account'];
	if ($customer_pwa !='1')
	{
	$error = true;
	$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
	} else {
		tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");
		tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
		tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customer_id . "'");
		tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "'");
		tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "'");
		tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . $customer_id . "'");
	}
  }
// END

if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_STREET_ADDRESS_ERROR);
}

if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_POST_CODE_ERROR);
}

if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_CITY_ERROR);
}

if (is_numeric($country) == false) {
  $error = true;

  $messageStack->add('create_account', ENTRY_COUNTRY_ERROR);
}

if (ACCOUNT_STATE == 'true') {
  $zone_id = 0;
  $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
  $check = tep_db_fetch_array($check_query);
  $entry_state_has_zones = ($check['total'] > 0);
  if ($entry_state_has_zones == true) {
	$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
	if (tep_db_num_rows($zone_query) == 1) {
	  $zone = tep_db_fetch_array($zone_query);
	  $zone_id = $zone['zone_id'];
	} else {
	  $error = true;

	  $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);
	}
  } else {
	if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
	  $error = true;

	  $messageStack->add('create_account', ENTRY_STATE_ERROR);
	}
  }
}

if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
}


if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_PASSWORD_ERROR);
} elseif ($password != $confirmation) {
  $error = true;

  $messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING);
}

if ($error == false) {
  $sql_data_array = array('customers_firstname' => $firstname,
						  'customers_lastname' => $lastname,
						  'customers_email_address' => $email_address,
						  'customers_telephone' => $telephone,
						  'customers_fax' => $fax,
						  'customers_newsletter' => $newsletter,
						  'customers_password' => tep_encrypt_password($password));

  if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
  if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);

  tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);

  $customer_id = tep_db_insert_id();

  $sql_data_array = array('customers_id' => $customer_id,
						  'entry_firstname' => $firstname,
						  'entry_lastname' => $lastname,
						  'entry_street_address' => $street_address,
						  'entry_postcode' => $postcode,
						  'entry_city' => $city,
						  'entry_country_id' => $country);

  if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
  if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
  if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
  if (ACCOUNT_STATE == 'true') {
	if ($zone_id > 0) {
	  $sql_data_array['entry_zone_id'] = $zone_id;
	  $sql_data_array['entry_state'] = '';
	} else {
	  $sql_data_array['entry_zone_id'] = '0';
	  $sql_data_array['entry_state'] = $state;
	}
  }

  tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

  $address_id = tep_db_insert_id();

  tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");

  tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())");

  if (SESSION_RECREATE == 'True') {
	tep_session_recreate();
  }

  $customer_first_name = $firstname;
  $customer_default_address_id = $address_id;
  $customer_country_id = $country;
  $customer_zone_id = $zone_id;
  tep_session_register('customer_id');
  tep_session_register('customer_first_name');
  tep_session_register('customer_default_address_id');
  tep_session_register('customer_country_id');
  tep_session_register('customer_zone_id');

// restore cart contents
  $cart->restore_contents();

// build the message content
  $name = $firstname . ' ' . $lastname;

  if (ACCOUNT_GENDER == 'true') {
	 if ($gender == 'm') {
	   $email_text = sprintf(EMAIL_GREET_MR, $lastname);
	 } else {
	   $email_text = sprintf(EMAIL_GREET_MS, $lastname);
	 }
  } else {
	$email_text = sprintf(EMAIL_GREET_NONE, $firstname);
  }

  $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
  tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

  tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
}
 }

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<?php require('includes/form_check.js.php'); ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('create_account', tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onSubmit="return check_form(create_account);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="smallText"><br><?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL')); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 if ($messageStack->size('create_account') > 0) {
?>
  <tr>
	<td><?php echo $messageStack->output('create_account'); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo CATEGORY_PERSONAL; ?></b></td>
	   <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
<?php
 if (ACCOUNT_GENDER == 'true') {
?>
		  <tr>
			<td class="main"><?php echo ENTRY_GENDER; ?></td>
			<td class="main"><?php echo tep_draw_radio_field('gender', 'm') . '  ' . MALE . '  ' . tep_draw_radio_field('gender', 'f') . '  ' . FEMALE . ' ' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }
?>
		  <tr>
			<td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
			<td class="main"><?php echo tep_draw_input_field('firstname') . ' ' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
			<td class="main"><?php echo tep_draw_input_field('lastname') . ' ' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 if (ACCOUNT_DOB == 'true') {
?>
		  <tr>
			<td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
			<td class="main"><?php echo tep_draw_input_field('dob') . ' ' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }
?>
		  <tr>
			<td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
			<td class="main"><?php echo tep_draw_input_field('email_address') . ' ' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
 if (ACCOUNT_COMPANY == 'true') {
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_COMPANY; ?></b></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_COMPANY; ?></td>
			<td class="main"><?php echo tep_draw_input_field('company') . ' ' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
 }
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_ADDRESS; ?></b></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
			<td class="main"><?php echo tep_draw_input_field('street_address') . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 if (ACCOUNT_SUBURB == 'true') {
?>
		  <tr>
			<td class="main"><?php echo ENTRY_SUBURB; ?></td>
			<td class="main"><?php echo tep_draw_input_field('suburb') . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }
?>
		  <tr>
			<td class="main"><?php echo ENTRY_POST_CODE; ?></td>
			<td class="main"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_CITY; ?></td>
			<td class="main"><?php echo tep_draw_input_field('city') . ' ' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 if (ACCOUNT_STATE == 'true') {
?>
		  <tr>
			<td class="main"><?php echo ENTRY_STATE; ?></td>
			<td class="main">
<?php
if ($process == true) {
  if ($entry_state_has_zones == true) {
	$zones_array = array();
	$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
	while ($zones_values = tep_db_fetch_array($zones_query)) {
	  $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
	}
	echo tep_draw_pull_down_menu('state', $zones_array);
  } else {
	echo tep_draw_input_field('state');
  }
} else {
  echo tep_draw_input_field('state');
}

if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
?>
			</td>
		  </tr>
<?php
 }
?>
		  <tr>
			<td class="main"><?php echo ENTRY_COUNTRY; ?></td>
			<td class="main"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_CONTACT; ?></b></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
			<td class="main"><?php echo tep_draw_input_field('telephone') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
			<td class="main"><?php echo tep_draw_input_field('fax') . ' ' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_OPTIONS; ?></b></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>
			<td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_PASSWORD; ?></b></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_PASSWORD; ?></td>
			<td class="main"><?php echo tep_draw_password_field('password') . ' ' . (tep_not_null(ENTRY_PASSWORD_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_TEXT . '</span>': ''); ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
			<td class="main"><?php echo tep_draw_password_field('confirmation') . ' ' . (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
</table></form></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php include(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

The last line I show in this code is line 546...but the error indicates that the problem is on line 547???

 

Thanks in advance for any help that anyone may have!

Share this post


Link to post
Share on other sites

OK...it appears that I have resolved the issue with the create_account.php code. I am no longer getting the parse error. But now when I choose to "create an account" I get the same error on my page as when I try to checkout without an account. Again...here it is:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/www/sommartimemarketplace/includes/header.php:136) in /home/www/sommartimemarketplace/includes/boxes/categories.php on line 13

 

My assumption is that this is pretty simple to fix...but I am no programmer! :blush: Any help would be greatly appreciated. Thanks in advance!

 

Sommar

Share this post


Link to post
Share on other sites

Well...I thought I might get some help as it appears that others do here. Anyways, I have one more piece of information to add in the chance that somebody responds to my questions. In the install instructions, it says:

OPEN AND MAKE CHANGES IN THIS FILE: /catalog/includes/header.php

 

at or around line 64 change this:

 

<td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>

 

to this:

 <td align="right" class="headerNavigation">   

  <?php if ((tep_session_is_registered('customer_id')) && (!tep_session_is_registered('noaccount'))) // DDB - PWA - 040622 - no display of logoff for PWA customers
  { ?>
	  <a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?> 
  </a>  |  
  <?php } ?>

  <?php if (!tep_session_is_registered('noaccount')) // DDB - PWA - 040622 - no display of account for PWA customers
  { ?>
	  <a href="<?php echo tep_href_link(FILENAME_ACCOUNT, 'my_account_f=1', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?>						</a>  |  
  <?php } ?>

	<a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> 
   |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>  </td>

 

The problem is that I do not have the code in my header.php file which it says to change. So I didn't do so. I don't know if that will cause a problem or not. Here is my header.php file again so that people can see what I am talking about:

<?php
/*
 $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// check if the 'install' directory exists, and warn of its existence
 if (WARN_INSTALL_EXISTENCE == 'true') {
if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
  $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
}
 }

// check if the configure.php file is writeable
 if (WARN_CONFIG_WRITEABLE == 'true') {
if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
  $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
}
 }

// check if the session folder is writeable
 if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
if (STORE_SESSIONS == '') {
  if (!is_dir(tep_session_save_path())) {
	$messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
  } elseif (!is_writeable(tep_session_save_path())) {
	$messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
  }
}
 }

// check session.auto_start is disabled
 if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
if (ini_get('session.auto_start') == '1') {
  $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
}
 }

 if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
if (!is_dir(DIR_FS_DOWNLOAD)) {
  $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
}
 }

 if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
 }
?>


 <table cellspacing=0 cellpadding=0 width=674 align=center>
  <tr><td>
	<table cellspacing=0 cellpadding=0>
	 <tr><td><a href=<?=tep_href_link('index.php')?>><img src=images/new_banner.jpg width=468 height=80 border=0></a></td>
		 <td width=60></td>

		 <td width=118>
		  <table cellspacing=0 cellpadding=0>
		   <tr><td height=25 colspan=2></td></tr>
		   <tr><td colspan=2>

<? // LANGUAGES

 if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language;
 }

 $languages_string = '';
 reset($lng->catalog_languages);
 while (list($key, $value) = each($lng->catalog_languages)) {
$languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
 }

 echo $languages_string;

?>						   

		   </td></tr>
		   <tr><td height=13 colspan=2></td></tr>
		   <tr><td colspan=2><img src=images/sm_line.gif width=103 height=1></td></tr>
		   <tr><td height=13 colspan=2></td></tr>
		   <tr><td rowspan=2><a href=<?=tep_href_link('shopping_cart.php')?>><img src=images/red_cart.gif width=22 height=22 border=0></a></td><td> <b>Shopping bag</b></td></tr>
		   <tr><td colspan=2> <b><a href=<?=tep_href_link('shopping_cart.php')?> class=ml><?=$cart->count_contents()?> items</a></b></td></tr>			   
		  </table>
		 </td>
		 <td><img src=images/vert_line.gif width=1 height=85></td>
		 <td width=122>
		  <table cellspacing=0 cellpadding=0 width=96 align=center>
		   <tr><td height=16></td></tr>
		   <tr><td><img src=images/sm_nipple.gif width=10 height=10 align=absmiddle>   <a href=<?=tep_href_link('specials.php')?> class=ml1>Specials</a><br><br class=px2></td></tr>
		   <tr><td><img src=images/sm_nipple.gif width=10 height=10 align=absmiddle>   <a href=<?=tep_href_link('advanced_search.php')?> class=ml1>Search</a><br><br class=px2></td></tr>
		   <tr><td><img src=images/sm_nipple.gif width=10 height=10 align=absmiddle>   <a href=<?=tep_href_link('contact_us.php')?> class=ml1>Contact Us</a><br><br class=px2></td></tr>
		   <tr><td><img src=images/sm_nipple.gif width=10 height=10 align=absmiddle>   <a href=<?=tep_href_link('create_account.php')?> class=ml1>Create account</a><br><br class=px2></td></tr>
		   <tr><td><img src=images/sm_nipple.gif width=10 height=10 align=absmiddle>   <a href=<?=tep_href_link('login.php')?> class=ml1>Customer Login</a><br><br></td></tr>
		  </table>
	  </td></tr>
	</table>
	<table cellspacing=0 cellpadding=0>
	 <tr><td><img src=images/divider.jpg width=675 height=5></td></tr>
	</table>
	<table cellspacing=0 cellpadding=0>
	 <tr><td width=206 valign=top>
		  <table cellspacing=0 cellpadding=0>
		   <tr><td height=7></td></tr>
		   <tr><td><a href=<?=tep_href_link('index.php')?>><img src=images/side_nav.gif width=206 height=27 border=0></a></td></tr>
		   <tr><td><a href=<?=tep_href_link('account.php')?>><img src=images/s_nav_account.gif width=206 height=28 border=0></a></td></tr>
		   <tr><td><a href=<?=tep_href_link('products_new.php')?>><img src=images/side_nav_new.gif width=206 height=27 border=0></a></td></tr>
		   <tr><td><a href=<?=tep_href_link('shopping_cart.php')?>><img src=images/s_nav_cart.gif width=206 height=27 border=0></a></td></tr>
		   <tr><td><a href=<?=tep_href_link('checkout_shipping.php')?>><img src=images/s_nav_checkout.gif width=206 height=27 border=0></a></td></tr>
		   <tr><td height=4></td></tr>
		  </table>
		 </td>
		 <td width=25></td>
		 <td width=444><a href=<?=tep_href_link('products_new.php')?>><img src=images/vibe_between.jpg width=203 height=147 border=0><img src=images/flesh_light.jpg width=241 height=147 border=0></a></td></tr>
	 <tr><td colspan=3 height=1></td></tr>
	 <tr><td colspan=3 height=4 bgcolor=#000000 width=674></td></tr>
	 <tr><td colspan=3 height=6></td></tr>
	</table>
	<table cellspacing=0 cellpadding=0>
	 <tr><td width=229 valign=top>
		  <table cellspacing=0 cellpadding=0>
		   <tr><td background=images/cat_head.gif width=229 height=36 class=bc>         <b>Browse by Categories:</b></td></tr>
		   <tr><td class=bg>
				<table cellspacing=0 cellpadding=0 width=195 align=center>
				 <tr><td height=17></td></tr>

<?   // ---- CATEGORIES

 function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;

  if(!$tree[$counter]['level']){
$categories_string .= $categories_string ? '<tr><td colspan=2><img src=images/sm_line.gif width=195 height=1><br><br class=px3></td></tr>' : '';

$categories_string .= '<tr><td width=39 align=center><img src=images/sm_nipple.gif width=10 height=10></td><td width=156><a class=ml href=';

if ($tree[$counter]['parent'] == 0) {
  $cPath_new = 'cPath=' . $counter;
} else {
  $cPath_new = 'cPath=' . $tree[$counter]['path'];
}
$categories_string .= tep_href_link('index.php', $cPath_new) . '>';
// display category name
$categories_string .= $tree[$counter]['name'];
$categories_string .= '</a><br><br class=px3></td></tr>';
  }else{
$categories_string .= '<tr><td width=39 align=center></td><td width=156>';

for($i=0;$i<$tree[$counter]['level'];$i++)
 $categories_string .= ' ';

$categories_string .= '- <a class=ml href=';   
if ($tree[$counter]['parent'] == 0) {
  $cPath_new = 'cPath=' . $counter;
} else {
  $cPath_new = 'cPath=' . $tree[$counter]['path'];
}
$categories_string .= tep_href_link('index.php', $cPath_new) . '>';
// display category name
$categories_string .= $tree[$counter]['name'];
$categories_string .= '</a><br><br class=px3></td></tr>';
  }  

if ($tree[$counter]['next_id'] != false) {
  tep_show_category($tree[$counter]['next_id']);
}  
 }



 define(TABLE_CATEGORIES, "categories");
 define(TABLE_CATEGORIES_DESCRIPTION, "categories_description");
 $categories_string = '';
 $tree = array();

 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
 while ($categories = tep_db_fetch_array($categories_query))  {
$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
											'parent' => $categories['parent_id'],
											'level' => 0,
											'path' => $categories['categories_id'],
											'next_id' => false);

if (isset($parent_id)) {
  $tree[$parent_id]['next_id'] = $categories['categories_id'];
}

$parent_id = $categories['categories_id'];

if (!isset($first_element)) {
  $first_element = $categories['categories_id'];
}
 }

 //------------------------
 if ($cPath) {
$new_path = '';
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {
  unset($parent_id);
  unset($first_id);
  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
  if (tep_db_num_rows($categories_query)) {
	$new_path .= $value;
	while ($row = tep_db_fetch_array($categories_query)) {
	  $tree[$row['categories_id']] = array('name' => $row['categories_name'],
										   'parent' => $row['parent_id'],
										   'level' => $key+1,
										   'path' => $new_path . '_' . $row['categories_id'],
										   'next_id' => false);

	  if (isset($parent_id)) {
		$tree[$parent_id]['next_id'] = $row['categories_id'];
	  }

	  $parent_id = $row['categories_id'];

	  if (!isset($first_id)) {
		$first_id = $row['categories_id'];
	  }

	  $last_id = $row['categories_id'];
	}
	$tree[$last_id]['next_id'] = $tree[$value]['next_id'];
	$tree[$value]['next_id'] = $first_id;
	$new_path .= '_';
  } else {
	break;
  }
}
 }
 $categories_string .=  '';
 tep_show_category($first_element); 
 $categories_string .=  '';

 echo $categories_string;
?>

				 <tr><td colspan=2 height=16></td></tr>
				</table>

<?   // ---- MANUFACTURERS




 $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
 if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {

  echo '	   <table cellspacing=0 cellpadding=0>'.
			   tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get')
			   .'<tr><td background=images/cat_head.gif width=229 height=36 class=bc>         <b>Browse by Brand:</b></td></tr>
				 <tr><td>
					  <table cellspacing=0 cellpadding=0 width=195 align=center>
					   <tr><td colspan=2 height=20></td></tr>
					   <tr><td align=right>
	   ';	  

  $manufacturers_array = array();
  while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
	$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
	$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
								   'text' => $manufacturers_name);
  }

  echo tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" class=se') . tep_hide_session_id();
  echo '				  </td><td align=left valign=top> <input type=image src=images/m23.gif width=34 height=19></td></tr>
					   <tr><td colspan=2 height=20></td></tr>
					  </table>
				 </td></tr>					
				</form>
				</table>
	   ';


 }
?>
		   <tr><td><img src=images/m22.gif width=229 height=3></td></tr>
		   <tr><td height=1></td></tr>
		   <tr><td><a href=<?=tep_href_link('index.php', 'cPath=50')?>><img src=images/size.jpg width=229 height=98 border=0></a></td></tr>
		   </td></tr>
		  </table>

		 </td>
		 <td width=10></td>
		 <td width=445 valign=top>

It is heavily modified for my site. ANY help would be great!

 

Thanks,

 

Sommar

Share this post


Link to post
Share on other sites

So...here I go again. I went into the /includes/boxes/categories.php file and deleted this part of the code:

  function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;

for ($i=0; $i<$tree[$counter]['level']; $i++) {
  $categories_string .= "  ";
}

$categories_string .= '<a href="';

if ($tree[$counter]['parent'] == 0) {
  $cPath_new = 'cPath=' . $counter;
} else {
  $cPath_new = 'cPath=' . $tree[$counter]['path'];
}

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

if (isset($cPath_array) && in_array($counter, $cPath_array)) {
  $categories_string .= '<b>';
}

// display category name
$categories_string .= $tree[$counter]['name'];

if (isset($cPath_array) && in_array($counter, $cPath_array)) {
  $categories_string .= '</b>';
}

if (tep_has_category_subcategories($counter)) {
  $categories_string .= '->';
}

$categories_string .= '</a>';

if (SHOW_COUNTS == 'true') {
  $products_in_category = tep_count_products_in_category($counter);
  if ($products_in_category > 0) {
	$categories_string .= ' (' . $products_in_category . ')';
  }
}

$categories_string .= '<br>';

if ($tree[$counter]['next_id'] != false) {
  tep_show_category($tree[$counter]['next_id']);
}
 }

 

This got rid of the error but now when I go to the "create an account" option my page looks all messed up.

I will include the url for people to look at...it is not safe for work as it is adult material.

 

http://www.sommartimemarketplace.com/create_account.php

Share this post


Link to post
Share on other sites
Well...I thought I might get some help as it appears that others do here. Anyways, I have one more piece of information to add in the chance that somebody responds to my questions. In the install instructions, it says:

The problem is that I do not have the code in my header.php file which it says to change. So I didn't do so. I don't know if that will cause a problem or not. Here is my header.php file again so that people can see what I am talking about:

 

It is heavily modified for my site. ANY help would be great!

 

Thanks,

 

Sommar

 

 

All that PWA code for header.php does is put in a rule that restricts when the "Logoff" link will be displayed, so that it isn't displayed for a customer using the PWA process. It isn't critical: if you don't change that code PWA will still work fine. If you want to have your site work that way you will have to go to the code that displays the logoff link and modify it as necessary. I haven't looked through your header.php code, maybe that link isn't even displayed in the header. The install instructions for this and almost every other contribution are written to work on a stock osCommerce site.


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
For a user to see the PWA option there has to be something in the cart and the user can't already be logged in. Start a session as a guest, put something in your cart, then hit checkout. You should see three login options.

 

If not I would say there was some sort of mistake made in uploading the catalog/login.php file (sometimes the upload just doesn't work right, this has happened to me quite a bit).

I'm having the same problem with not seeing the PWA option. I add something to the cart and hit checkout and all I get are the two standard login options.

 

I did try disabling PWA through the admin screen and the login DID change. I got the two standard boxes side-by-side. When I enable PWA I get them on top of each other instead.

 

Any ideas what could be causing this?

Share this post


Link to post
Share on other sites
I'm having the same problem with not seeing the PWA option. I add something to the cart and hit checkout and all I get are the two standard login options.

 

I did try disabling PWA through the admin screen and the login DID change. I got the two standard boxes side-by-side. When I enable PWA I get them on top of each other instead.

 

Any ideas what could be causing this?

 

The display is different for the two different cases, so the code for login.php is mostly correct. Are you using v0.910?

 

This is the code that controls whether or not the PWA box is displayed:

 

 
	  <?php
if (PWA_ON == 'true') { 
if (($cart->count_contents() > 0) && (!isset($HTTP_GET_VARS['my_account_f']) || $HTTP_GET_VARS['my_account_f'] !=1)) 	// only display of box if something in cart
{

?>

 

It should be in login.php at about line 152. If it's different or missing please let me know.

Edited by djmonkey1

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
The display is different for the two different cases, so the code for login.php is mostly correct. Are you using v0.910?

 

This is the code that controls whether or not the PWA box is displayed:

 

 
	  <?php
if (PWA_ON == 'true') { 
if (($cart->count_contents() > 0) && (!isset($HTTP_GET_VARS['my_account_f']) || $HTTP_GET_VARS['my_account_f'] !=1)) 	// only display of box if something in cart
{

?>

 

It should be in login.php at about line 152. If it's different or missing please let me know.

I think I'm using .90. I have checked the login.php and found what the problem is, but don't know how to fix it. Basically when I add something to my cart and click on checkout, I go from HTTP to HTTPS and my cart disappears. So when the login screen comes up I don't have anything in the cart so the PWA box doesn't display.

 

Any ideas what that might be?

Share this post


Link to post
Share on other sites
I think I'm using .90. I have checked the login.php and found what the problem is, but don't know how to fix it. Basically when I add something to my cart and click on checkout, I go from HTTP to HTTPS and my cart disappears. So when the login screen comes up I don't have anything in the cart so the PWA box doesn't display.

 

Any ideas what that might be?

 

Good news- it's probably not PWA that's causing this. I believe that losing your cart when you switch to HTTPS is a problem with your includes/configure.php file.

 

Check your cookie domain settings. They should look something like this:

 

define('HTTP_COOKIE_DOMAIN', 'www.yoursite.com');
  define('HTTPS_COOKIE_DOMAIN', 'www.yoursite.com');


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
Good news- it's probably not PWA that's causing this. I believe that losing your cart when you switch to HTTPS is a problem with your includes/configure.php file.

 

Check your cookie domain settings. They should look something like this:

 

define('HTTP_COOKIE_DOMAIN', 'www.yoursite.com');
  define('HTTPS_COOKIE_DOMAIN', 'www.yoursite.com');

ok, I added the "www" to both COOKIE_DOMAIN variables and it looks like it is working now. I'm not sure I understand why it is working, but I can live with just knowing that it works. :)

Share this post


Link to post
Share on other sites

v0.910 --

 

I've downloaded and followed both instruction files to install this on my new fantastico install of osC. The only contribution mods I have installed are the USPS Methods and Brian's Paypal WPP.

 

Followed all the instructions for changes etc for the original instruction file. As well as the instruction file in the extra/wpp folder to use both PWA & WPP together. I get no error messages any where at all. But if I visit the store place an item in the shopping cart then click checkout I still only see the original two options, login or create new account.

 

I have also gone in through admin and made sure the PWA is showing up and set to true.

 

Using the login.php file included with the pack found reffered to here in the instructions, "A catalog/login.php file formatted for use with both Brian Burton's PayPal WPP v0.5 and Purchase Without Account v0.90 and v0.910"

 

Noticed in the above mentioned login.php part of this line looks to be commented out.

<?php
if (PWA_ON == 'true') { 
//if (($cart->count_contents() > 0) && (!isset($HTTP_GET_VARS['my_account_f']) || $HTTP_GET_VARS['my_account_f'] !=1)) 	// only display of box if something in cart
//{
if ($checkout_login) {
?>

 

Thought that was the problem of why I don't see the PWA option on my store. So I took off the comments like so..

<?php
if (PWA_ON == 'true') { 
if (($cart->count_contents() > 0) && (!isset($HTTP_GET_VARS['my_account_f']) || $HTTP_GET_VARS['my_account_f'] !=1)) // only display of box if something in cart
{

?>

 

Did not seem to make a difference at all. Could some one please take a look see where I'm going wrong. I've read this topic from begining to end and can't find an answer. I may have just over looked it though. Any help would be so much appreciated. My store is live but not in use yet if you need the link for it find it here.

 

Thanks So Much -- Mindy

 

The login.php file I'm using straight out of the pack from v0.910 extras/wpp/catalog folder

<?php
/*
 $Id: login.php,v 1.80 2003/06/05 23:28:24 hpdl Exp $
 modified to include PWA v0.90 and PayPal WPP v0.4

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started)
 if ($session_started == false) {
tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN);

 $error = false;

 // PWA 0.70 :
 if($HTTP_GET_VARS['login'] == 'fail') {
  $fail_reason = (!empty($HTTP_GET_VARS['reason'])) ? urldecode($HTTP_GET_VARS['reason']): TEXT_LOGIN_ERROR;
  $messageStack->add('login', $fail_reason);
 }

 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);

// Check if email exists
$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
if (!tep_db_num_rows($check_customer_query)) {
  $error = true;
} else {
  $check_customer = tep_db_fetch_array($check_customer_query);
// Check that password is good
  if (!tep_validate_password($password, $check_customer['customers_password'])) {
	$error = true;
  } else {
	if (SESSION_RECREATE == 'True') {
	  tep_session_recreate();
	}

	$check_country_query = tep_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$check_customer['customers_id'] . "' and address_book_id = '" . (int)$check_customer['customers_default_address_id'] . "'");
	$check_country = tep_db_fetch_array($check_country_query);

	$customer_id = $check_customer['customers_id'];
	$customer_default_address_id = $check_customer['customers_default_address_id'];
	$customer_first_name = $check_customer['customers_firstname'];
	$customer_country_id = $check_country['entry_country_id'];
	$customer_zone_id = $check_country['entry_zone_id'];
	tep_session_register('customer_id');
	tep_session_register('customer_default_address_id');
	tep_session_register('customer_first_name');
	tep_session_register('customer_country_id');
	tep_session_register('customer_zone_id');

	tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int)$customer_id . "'");

// restore cart contents
	$cart->restore_contents();

	if (sizeof($navigation->snapshot) > 0) {
	  $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
	  $navigation->clear_snapshot();
	  tep_redirect($origin_href);
	} else {
	  tep_redirect(tep_href_link(FILENAME_DEFAULT));
	}
  }
}
 }

 if ($error == true) {
$messageStack->add('login', TEXT_LOGIN_ERROR);
 }

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_LOGIN, '', 'SSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function session_win() {
 window.open("<?php echo tep_href_link(FILENAME_INFO_SHOPPING_CART); ?>","info_shopping_cart","height=460,width=430,toolbar=no,statusbar=no,scrollbars=yes").focus();
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_login.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 if ($messageStack->size('login') > 0) {
?>
  <tr>
	<td><?php echo $messageStack->output('login'); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }

 if ($cart->count_contents() > 0) {
?>
  <tr>
	<td class="smallText"><?php echo TEXT_VISITORS_CART; ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>

<?php
 }
?>
  <tr>
	<td><table border="0" width="70%" cellspacing="0" cellpadding="2">

<!-- this is where PWA mods begin -->
	  <tr class="infoBoxContents">
	  <!-- this row has two columns, one for WPP and one for PWA -->

	  <td width="50%" valign="top">
	  <!-- this column for WPP -->
	  <? //---PayPal WPP Modification START ---// ?>
<?php
if ($ec_enabled) {
  if ($checkout_login) {
?>
	<!-- this is the beginning of WPP -->


	  <table><tr>
		<td class="infoboxHeading" valign="top"><b><?php echo TEXT_PAYPALWPP_EC_HEADER; ?></b>
		</td></tr>
	  <tr>
		<td width="100%" colspan=2 valign="top" class="main">
		<?php echo TEXT_PAYPALWPP_EC_HEADER2; ?></td></tr>

		<tr>
		<td width="100%" colspan=2 valign="top" class="main"><a href="<?php echo tep_href_link('ec_process.php', '', 'SSL'); ?>">
		<img src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" border=0></a></td></tr>
		<tr>
		<td width="100%" colspan=2 valign="top" class="main"><?php echo TEXT_PAYPALWPP_EC_BUTTON_TEXT; ?>

		</td>
	</tr></table>


	<!-- this is the end of WPP -->
<?php } } ?>
<? //---PayPal WPP Modification END ---// ?>

	  </td><!-- end of column for WPP -->

	  <td width="50%" valign="top">
	  <!-- this column for PWA -->
	  <?php
if (PWA_ON == 'true') { 
//if (($cart->count_contents() > 0) && (!isset($HTTP_GET_VARS['my_account_f']) || $HTTP_GET_VARS['my_account_f'] !=1)) 	// only display of box if something in cart
//{
if ($checkout_login) {
?>

<table>
<tr>
 <td class="infoboxHeading">
		<?php echo HEADING_CHECKOUT; ?>
</td></tr>
<tr>
<td width="100%" class="main" colspan="3"><?php echo TEXT_CHECKOUT_INTRODUCTION; ?></td>
 </tr>
 <tr>
<td width="100%" class="main" colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 </tr>
 <tr>

<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?>
</td>
 </tr>

</table>


<?php }} ?>
<!-- this is the end of the PWA code for this column -->
		</td>

	  </tr>
	  <tr class="infoBoxContents">
	  <!-- this row has two columns, one for new customer and one for returning customer -->


		<td width="50%" valign="top"><!-- this column for New Customer -->

		<table><tr><td class="infoboxHeading">
		<?php echo HEADING_NEW_CUSTOMER; ?></td></tr>
		<tr><td class="main">
		<?php echo TEXT_NEW_CUSTOMER . '<br><br>' . TEXT_NEW_CUSTOMER_INTRODUCTION; ?></td></tr>
		<tr>
				<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
			  </tr>
		<tr><td align="right">
		<?php echo '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a>'; ?>
		</td></tr></table>

		</td> <!-- end of column for New Customer -->


		<td width="50%" valign="top"><!-- this column for Returning Customer-->
	 <table>

	 <tr>
	 <td class="infoboxHeading"><?php echo HEADING_RETURNING_CUSTOMER; ?>
	 </td></tr>

	  <tr><td class="main"><?php echo TEXT_RETURNING_CUSTOMER; ?>
	  </td></tr>


	  <tr><td>

	 <table>
	 <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
	 <tr><td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
	 <td><?php echo tep_draw_input_field('email_address'); ?></td>
	  </tr>
	 <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
	  <tr>
	  <td class="main"><?php echo ENTRY_PASSWORD; ?></td>
	   <td><?php echo tep_draw_password_field('password'); ?>
	   </td></tr>

	   </table>

	   </td></tr>
			<tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>	
	<tr><td  class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?>
	</td></tr>  
	  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
	 <tr><td align="right"><?php echo tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN); ?>
	  </td></tr> 
	  </table>
	  </td> <!-- end of column for Returning Customer-->		  
	  </tr>
	</table>
	<!-- this is where PWA + WPP mods end -->
	</td>
  </tr>
</table></form></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Share this post


Link to post
Share on other sites

If any of you PWA Contribution users decide to use PWA (.09x) and the Package Tracking with E-Mail v1.23 Contribution, there is a code conflict in one file (/catalog/admin/orders.php). I was able to integrate the two contributions fairly easily and have provided a link to my post in the other contribution.

 

Package Tracking with E-Mail Contribution v1.23

 

Both contributions work great together with different e-mail notices at checkout and update. Shipping tracking number links are integrated with users that have an account. If you have a user that used PWA, then they get an e-mail confirmation and updates that provide the tracking numbers in the e-mail with a link back to your site where they can paste the tracking numbers back in to track the package. Both types of customers get a benefit.

 

Hope this helps someone...

 

Joe

Share this post


Link to post
Share on other sites

Mindy-

 

The login.php file I uploaded for WPP is all hosed up. My apologies for this.

 

It's missing all the meat of the code at the top of the page that defines what $checkout_login is and such.

 

At around line 16, directly underneath

 

require('includes/application_top.php');

 

 

add this:

 

//---PayPal WPP Modification START ---//	
  //Assign a variable to cut down on database calls
  //Don't show checkout option if cart is empty.  It does not satisfy the paypal
  if (tep_paypal_wpp_enabled() && $cart->count_contents() > 0) {
 $ec_enabled = true;
  } else {
 $ec_enabled = false;
  }

  if ($ec_enabled) {

 //If they're here, they're either about to go to paypal or were sent back by an error, so clear these session vars
 if (tep_session_is_registered('paypal_ec_temp')) tep_session_unregister('paypal_ec_temp');
 if (tep_session_is_registered('paypal_ec_token')) tep_session_unregister('paypal_ec_token');
 if (tep_session_is_registered('paypal_ec_payer_id')) tep_session_unregister('paypal_ec_payer_id');
 if (tep_session_is_registered('paypal_ec_payer_info')) tep_session_unregister('paypal_ec_payer_info');

 //Find out if the user is logging in to checkout so that we know to draw the EC box		  
 $checkout_login = false;
 if (sizeof($navigation->snapshot) > 0 || isset($HTTP_GET_VARS['payment_error'])) {
   if (strpos($navigation->snapshot['page'], 'checkout_') !== false || isset($HTTP_GET_VARS['payment_error'])) {
	 $checkout_login = true;
   }
 }
  }
//---PayPal WPP Modification END---//

 

Then, at about line 100, immediately before

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_LOGIN, '', 'SSL'));

 

add this:

 

//---PayPal WPP Modification START ---//
  if ($ec_enabled) {
 if (tep_session_is_registered('paypal_error')) {
   $checkout_login = true;
   $messageStack->add('login', $paypal_error);
   tep_session_unregister('paypal_error');
 }
  }
//---PayPal WPP Modification END ---//

 

and see what happens then.

 

Also, for the code that controls whether or not the PWA box is displayed,

 

 <?php
if (PWA_ON == 'true') { 
if ($checkout_login) {
?>

 

should work just fine.


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

Stew

 

I can't thank you enough for all your help and all the countless time you've put into this for us!!

 

Made the changes you stated above. I now have the PWA option displaying. However I have one small glitch showing up. In the table displaying PWA above the PWA checkout button this line appears "TEXT_PAYPALWPP_EC_HEADER2" screen cap below.

 

I've found the section of login.php where this is mentioned --

 

<table><tr>
		<td class="infoboxHeading" valign="top"><b><?php echo TEXT_PAYPALWPP_EC_HEADER; ?></b>
		</td></tr>
	  <tr>
		<td width="100%" colspan=2 valign="top" class="main">
		<?php echo TEXT_PAYPALWPP_EC_HEADER2; ?></td></tr>

		<tr>
		<td width="100%" colspan=2 valign="top" class="main"><a href="<?php echo tep_href_link('ec_process.php', '', 'SSL'); ?>">
		<img src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" border=0></a></td></tr>
		<tr>
		<td width="100%" colspan=2 valign="top" class="main"><?php echo TEXT_PAYPALWPP_EC_BUTTON_TEXT; ?>

		</td>
	</tr></table>

 

But my newbie eyes can't see anything wrong with it. Do you have any ideas how I can fix this part?

 

Many Thanks -- Mindy

 

Snap1.jpg

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
Sign in to follow this  

×