Jump to content
Sign in to follow this  
bmcewan

Purchase Without Account Updated & Admin Functionality

Recommended Posts

I am new

can help me this problem.

I make up the PWA 7.0

I USE IIS ,PHP4, But don't have SSL

 

I test my web can buy prodect,and type the order info, but after is blank web,

how can fix this .

THANK

 

error1.jpg

Share this post


Link to post
Share on other sites

Hi All,

 

just wondering if anyone has seen this error before with the Purchase without Account modification:

 

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /homepages/46/d97520346/htdocs/catalog_new/includes/functions/general.php on line 42

 

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /homepages/46/d97520346/htdocs/catalog_new/includes/functions/general.php on line 42

 

I'm getting this on order_confirmation.php in the delivery address area, which seems to be because the delivery address has not been set (although the billing address has).

 

Have I missed something in installing this contrib - I also have BTS installed, but I don't think this issue is connected.

 

Any thoughts much appreciated.

 

Thanks,

Share this post


Link to post
Share on other sites

I installed PWA 7.0, and encountered a problem. After I pass in my details in order_info ,but filled in click continue order_info_process is just a blank page, no errors is displayed, too

 

Anyone know what can be the problem?

 

THANK

Share this post


Link to post
Share on other sites
I installed PWA 7.0, and encountered a problem. After I pass in my details in order_info ,but filled in click continue order_info_process is just a blank page, no errors is displayed, too

 

Anyone know what can be the problem?

 

THANK

OK I HAVE FIX THIS PROBLEM

IN order_info_process is add this code too

 

<!-- 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 //--

Share this post


Link to post
Share on other sites

I am having the same problem:

I installed PWA 7.0, and encountered a problem. After I pass in my details in order_info ,but filled in click continue order_info_process is just a blank page, no errors is displayed, too

 

Anyone know what can be the problem?

 

THANK

 

I saw this post:

OK I HAVE FIX THIS PROBLEM

IN order_info_process is add this code too

 

<!-- 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 //--

 

My question is, where EXACTLY in catalog/order_info_process.php did you put this code to remedy the problem?

Share this post


Link to post
Share on other sites
IN order_info_process is add this code too

 

<!-- 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 //--

 

My question is, where EXACTLY in catalog/order_info_process.php did you put this code to remedy the problem?

Yes , I add this code in catalog/order_info_process.php

is fix blank page problem

Share this post


Link to post
Share on other sites

I am asking where in the file you placed these lines? For example, did you place it after these lines

?>

<!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 (getenv('HTTPS') == 'on' ? 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" align="center">

  <tr>

around line 218?

Share this post


Link to post
Share on other sites

Ok, I've been able to sort out everything except for an error when mistyping a state name. In most of the forms for account creation, if you misspell a state name, an error message pops up and a state drop down list is offered. However, when I do this while checking out with PWA, I just get a blank screen after hitting continue. I am running STS and if I turn the display output on this file to normal (not intercepted by the template) the form comes out all messed up. Is there a way to spawn the dropdown within the order_info.php file or order_info_check.php file rather than trying to spaw a new form with order_info_process.php?

Share this post


Link to post
Share on other sites

Guys,

 

Have been considering installing PWA in my store. Just wondered if anybody could help me understand the pro's & con's / differences compared with the rather similar sounding Guest Account contribution.

 

Thanks,

 

H.

Share this post


Link to post
Share on other sites

I've got this contrib running and it works like a charm! Thanks to all who've contributed to its functionality!

 

Only one thing I've found that I'd like to correct if I can... When I change an order's status, the 'Order Status Update' Email is still sent to the customer. I like that idea, but one small glitch: the Email includes a link to the invoice which obviously won't work for a non-registered customer.

 

I tried changing it with language similar to that used in /catalog/checkout_process.php, but the link is still appearing for some reason. :(

 

Can anyone see what I'm doing wrong here?

 

if (!tep_session_is_registered('noaccount')) {
           $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_SEPARATOR . "\n" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . "\n" . EMAIL_SEPARATOR . "\n" . $notify_comments;
 } else {
           $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . EMAIL_SEPARATOR . "\n" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . "\n" . EMAIL_SEPARATOR . "\n" . $notify_comments;
 }

           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

           $customer_notified = '1';
 }

 

TIA for your help!

 

Terry


Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Share this post


Link to post
Share on other sites

Terry,

 

The if (!tep_session_is_registered('noaccount')) will always be true, since there is no one registered with noaccount anymore, so you can't check the sessions because it doesn't exist anymore.

 

What you need to do is query the 'customers' database for the new field that was added, "purchased_without_account," and check if that is true. It should be a simple script. I may have time to try it out after a few days, but unfortunately not at the moment.

 

Let everyone know if you get it to work.

 

edit: also is this in admin/orders.php?

Edited by safoo

Share this post


Link to post
Share on other sites

Hi Safoo,

 

Sorry, I should have noted that originally... Yes, the code is in admin/orders.php.

 

I'll try later using the parameters you suggested and if I get it to work, will definitely report back here.

 

Thanks!

 

Terry


Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Share this post


Link to post
Share on other sites

Hello TerryK,

 

I think what we are looking to do is as follows:

For the case:

 

if (tep_not_null($action)) {

switch ($action) {

case 'update_order':

 

we have the orderID stored in the variable " $oID". What we need to do is get the customers_id for this order:

 

$pwa_check_query = tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

$pwa_check = tep_db_fetch_array($pwa_status_query);

 

So now we have the customerID stored in $pwa_check array. (dunno if we need array... :blink: )

 

Now we check if this customer account was created with PWA or not.

 

$pwa_check_query2 = tep_db_query("select purchased_without_account from " . TABLE_customers . " where customers_id = '" . (int)$pwa_check['customers_id'] . "'");

$pwa_check2 = tep_db_fetch_array($pwa_status_query2);

 

Then just check if $pwa_check2['purchased_without_account'] = '1', in which case the account was created using pwa and we do not include the URL in the email.

 

I'm pretty sure theres a few mistakes in what I just wrote, but I think the idea is correct. Let me know what you think.

Share this post


Link to post
Share on other sites

Hi Safoo,

 

Thanks for your reply and code suggestion. I tried adding the code (and some variations), but run into a problem...

 

When a non-account customer goes through registration, their customer details are deleted at checkout_success.php, so they can no longer be found in the CUSTOMERS table. (Even if they were still listed in the table, there is no PWA field in the table to check for an 'if' statement -- at least not that I can see. There was nothing in the SQL statement creating the field.)

 

In re-reading all of the posts in this forum, I came across a suggestion from one member to use the customers_info_date_account_created field from the CUSTOMERS_INFO table for the criteria. Given, though, that the customer info has already been deleted from the database by the time I go in to change the status and send an Email update, I'm not sure this would work either. :( ( And, if there IS the chance it could work, I'm too PHP-challenged to figure out the code anyway! )

 

I know I can simply uncheck the option to send an Email, but even that gets a little tricky as a customer cannot be readily identified as having purchased without account in the admin order information. I'd really rather not have to go and check the customer database in admin for each order to determine whether they're an account holder or not before updating the status.

 

Would appreciate further suggestions...

 

TIA,

 

Terry


Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Share this post


Link to post
Share on other sites

hmmmm...for some reason then my details in the customers table werent getting deleted. so i tried another test order and it seems to delete correctly. Maybe the checkout_success was still in my cache or something. anyways....it does delete the info from customers table as you mentioned.

 

What if we made another table in the database that keeps only 'customers_id' and 'purchased_without_account'. Its still anonymous so we are not keeping any of the customer's personal information. Or cant we just add a 'purchased_without_account' field in the ORDERS table?? We have to access the orders table to get the email address and what not as it is. I think the solution to add a field in the orders table will be better so we don't have to access 2 tables...we are accessing just the orders table.

Edited by safoo

Share this post


Link to post
Share on other sites

Hi Safoo,

 

I think that would work for me. Any kind of flag that I could use for the Email change would be great! Can you help me figure out what it would take to get this done? Sadly, I'm not PHP-savvy enough to tackle it without assistance...

 

Many thanks!

 

Terry


Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Share this post


Link to post
Share on other sites

Terry...I am no PHP guru either....but here is what I think it will take:

 

 

1)we need to add the 'purchased_without_account' column in the 'orders' table by running the following script in PhpMyAdmin:

 

 

ALTER TABLE orders ADD purchased_without_account TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL;

 

 

 

2)in checkout_success.php:

 

We previously added:

// Added a check for a Guest checkout and cleared the session - 030411 
if (tep_session_is_registered('noaccount')) { 
tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . tep_db_input($customer_id) . "'"); 
tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . tep_db_input($customer_id) . "'"); 
tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . tep_db_input($customer_id) . "'"); 
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . tep_db_input($customer_id) . "'"); 
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . tep_db_input($customer_id) . "'"); 
tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . tep_db_input($customer_id) . "'"); 
tep_session_destroy(); 

}

 

 

On the line following the "if (tep_session_is_registered('noaccount')) { ", add:

tep_db_query("insert into " . TABLE_ORDERS . " (purchased_without_account) values ('1') where orders_id = '" . (int)$orders['orders_id'] . "'");

 

3) In admin/orders.php:

 

Replace:

$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . EMAIL_TEXT_QUESTION_REPLY;

 

With:

 

$pwa_check_query= tep_db_query("select purchased_without_account from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");
$pwa_check= tep_db_fetch_array($pwa_check_query);

if ($pwa_check['purchased_without_account'] == '1'){
 $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . EMAIL_TEXT_QUESTION_REPLY;
}
         else  $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . EMAIL_TEXT_QUESTION_REPLY;

 

Note, the third step's code may not be exactly the same for you. It depends on what values you are including in the email, but basically we want to exclude the url when the 'if statement' is true. Let me know if the above 3 steps make sense and more importantly if it works. I haven't been able to test it yet, but I will soon if you, TerryK, don't do try it before me.

Share this post


Link to post
Share on other sites

Hi Safoo,

 

Thanks again for your help!

 

I've updated my files as above, and the good news is that nothing is broken! :)

 

The bad news is that it doesn't seem to be changing the value for the purchased_without_account field to 1 on applicable orders. All the test orders I've added since updating the code still show as 0. :(

 

Any ideas on why it might not be updating?

 

TIA,

 

Terry


Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Share this post


Link to post
Share on other sites

Okay, I goofed. The first time I added the "tep_db_query("insert into " . TABLE_ORDERS ... " code, I put it in the wrong place. Now that I've put it in the *right* place, I'm getting this error:

 

2000 - You have an error in your SQL syntax near 'where orders_id = '101'' at line 1

insert into orders (purchased_without_account) values ('1') where orders_id = '101'

[TEP STOP]

 

I don't see an error in the syntax, but it's not like I'd know anyhow! :blink:

 

Terry

Edited by TerryK

Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Share this post


Link to post
Share on other sites

TerryK,

 

Try this instead:

 

tep_db_query("insert into " . TABLE_ORDERS . " (purchased_without_account) values ('1') where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");

 

Or possibly this:

 

tep_db_query("insert into " . TABLE_ORDERS . " (purchased_without_account) values ('1') where customers_id = '" . tep_db_input($customer_id) . "' order by date_purchased desc limit 1");

 

 

Let me know. I will try it myself as soon as I get a chance.

Edited by safoo

Share this post


Link to post
Share on other sites

Hi Safoo,

 

As always, thanks again for your efforts to help on this!

 

The first bit of code causes this error:

 

2000 - You have an error in your SQL syntax near 'where customers_id = '74' order by date_purchased desc limit 1' at line 1

insert into orders (purchased_without_account) values ('1') where customers_id = '74' order by date_purchased desc limit 1

[TEP STOP]

 

and the second does the same:

 

2000 - You have an error in your SQL syntax near 'where customers_id = '74' order by date_purchased desc limit 1' at line 1

insert into orders (purchased_without_account) values ('1') where customers_id = '74' order by date_purchased desc limit 1

[TEP STOP]

 

I'll keep trying to see if I can come up with anything else. Will report back if I do.

 

Thanks again!

 

Terry


Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Share this post


Link to post
Share on other sites

*sigh*...Maybe I'll post somewhere else on the forums and have some database experts help us out....It's supposed to be 1 simple line of code!

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  

×