Jump to content
Sign in to follow this  
bmcewan

Purchase Without Account Updated & Admin Functionality

Recommended Posts

Safoo>>interesting.

 

To me, all that matters is if joe bubblegum comes, orders with his email, signs up to order, but then 2 months later comes back and doesn't want to log-in, there isn't that error that I received.

 

So what you are saying is as long as he completes an order, when he signs up, any future 'non account' order will be without fail? If so, we should be fine.

 

However, I will check the mod you just talked about on page 34.

 

Thank you for your help. I am just making sure I understand everything. You have been INVALUABLE with your help, you have no idea.

Share this post


Link to post
Share on other sites

Safoo>>Sadly, this does not help at all

 

Since I have one email address in the system, anytime I test the 'without account' feature, it will NOT let me continue. Even after that code in page 34 (but I didn't test creating a new account, I worry about existing customers who forget their password and want to bypass this)

 

Is there a way to make sure any customers, who did order, and signed-up to do so, can later on come back and just order without an account even if they put in an email address that is in the system? If not, this mod isn't 100% convenient and sort of offsets the point of having it. Right?

Share this post


Link to post
Share on other sites

I think currently the way this mod is that if a customer has an existing account that they signed up for, if they now come to your site and try to use PWA using the same first name, last name, and email address as their existing account, the PWA will give them an error basically saying that an account already exists and they need to log in using that account.

 

If they use a different last name, first name, *or* email address, the PWA should let them checkout.

 

I'm sure you could bypass the checks and let anyone checkout. Just look through the code to see where the check is and you should be able to easily skip that step.

Edited by safoo

Share this post


Link to post
Share on other sites

I'm using the cutomer login routine modification as described HERE I've modified PWA to fit on the screen with it and it seems to work but I am worried that I might have changed something that should not have been changed. In catalog/login.php I changed

<?php
if (PWA_ON == 'false') {
require(DIR_WS_INCLUDES . FILENAME_PWA_ACC_LOGIN);
} else {
require(DIR_WS_INCLUDES . FILENAME_PWA_PWA_LOGIN);
}
?>

to this

<?php
if (PWA_ON == 'true') {
require(DIR_WS_INCLUDES . FILENAME_PWA_PWA_LOGIN);
}
?>

And in includes/login_pwa.php I deleted the sections of code that begin with //BOF: MaxiDVD Returning Customer Info SECTION and //MaxiDVD New Account Sign Up SECTION.

 

The result can be seen HERE. Is there anything wrong with doing this? Is there a better way to integrate it into my login page?

 

Jack

Share this post


Link to post
Share on other sites

I think if you gave the customer 3 options after entering their email address instead of 2 and the PWA separately, it would fit better.

 

So they enter email address and then have 3 options:

 

1. No, I am a new customer and would like to create an account.

2. No, I am a new customer. Please take me to checkout directly without creating an account.

3. Yes I am a returning customer. My password is...

Share this post


Link to post
Share on other sites

Jack,

 

THat is a lot better and looks very nice. I think this login routine is great from the customer's perspective. You used 'login a la amazon' correct?

Share this post


Link to post
Share on other sites
Jack,

 

THat is a lot better and looks very nice. I think this login routine is great from the customer's perspective. You used 'login a la amazon' correct?

I didn't use the contribution by that name but rather the code located in this thread. I think they are doing the same thing but the contribution is probably the better choice at this point since it is more recent and seems to have better support.

 

Jack

Share this post


Link to post
Share on other sites

safoo - Thanks for the update! I did a code comparison for the four stock OSC files and came up with this:

 

These 4 files exist in stock OSC, so if you do not want to overwrite them, look for the differences compared to your files:

 

****************************************************************

/catalog/checkout_process.php

 

JUST AFTER:         

// lets start with the email confirmation

 

ADD:

221> if (!tep_session_is_registered('noaccount')) {

 

JUST AFTER:         

EMAIL_SEPARATOR . "\n";

 

ADD:

  } else {

  $email_order = STORE_NAME . "\n" .

                EMAIL_SEPARATOR . "\n" .

                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .

                EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

  if ($order->info['comments']) {

    $email_order .= tep_db_output($order->info['comments']) . "\n\n";

  }

  $email_order .= EMAIL_TEXT_PRODUCTS . "\n" .

                  EMAIL_SEPARATOR . "\n" .

                  $products_ordered .

                  EMAIL_SEPARATOR . "\n";

  }

 

****************************************************************

/catalog/checkout_success.php

 

CHANGE:

  17<    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

 

TO:

    tep_redirect(tep_href_link(FILENAME_DEFAULT));

 

CHANGE:

  29<    tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));

 

TO:

//    tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));

// Added a check for a Guest checkout and cleared the session - 030411

    if (tep_session_is_registered('noaccount')) {

    tep_session_destroy();

    tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL'));

}

    else {

    tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string, 'SSL'));

}

 

CHANGE:

  35<  $breadcrumb->add(NAVBAR_TITLE_2);

 

TO:

  $breadcrumb->add($NAVBAR_TITLE_2);

 

JUST AFTER:

  43

  44    $products_array = array();

  45    $products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders['orders_id'] . "' order by products_name");

  46    while ($products = tep_db_fetch_array($products_query)) {

  47      $products_array[] = array('id' => $products['products_id'],

  48                                'text' => $products['products_name']);

  49    }

  50  }

 

ADD: 

   

// PWA:  Added a check for a Guest checkout and cleared the session - 030411 v0.71

  if (tep_session_is_registered('noaccount')) {

  $order_update = array('purchased_without_account' => '1');

  tep_db_perform(TABLE_ORDERS, $order_update, 'update', "orders_id = '".$orders['orders_id']."'");

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

  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();

}

 

 

****************************************************************

/catalog/login.php

 

JUST AFTER:

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

  21

  22  $error = false;

 

ADD:

   

// 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);

}

 

 

JUST AFTER:

  71  if ($error == true) {

  72    $messageStack->add('login', TEXT_LOGIN_ERROR);

  73  }

 

ADD:

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

 

CHANGE:

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

141<          <tr>

142<            <td class="main" width="50%" valign="top"><b><?php echo HEADING_NEW_CUSTOMER; ?></b></td>

143<            <td class="main" width="50%" valign="top"><b><?php echo HEADING_RETURNING_CUSTOMER; ?></b></td>

144<          </tr>

145<          <tr>

146<            <td width="50%" height="100%" valign="top"><table border="0" width="100%" height="100%" cellspacing="1" cellpadding="2" class="infoBox">

147<              <tr class="infoBoxContents">

148<                <td><table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2">

149<                  <tr>

150<                    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

151<                  </tr>

152<                  <tr>

153<                    <td class="main" valign="top"><?php echo TEXT_NEW_CUSTOMER . '<br><br>' . TEXT_NEW_CUSTOMER_INTRODUCTION; ?></td>

154<                  </tr>

155<                  <tr>

156<                    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

157<                  </tr>

158<                  <tr>

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

160<                      <tr>

161<                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

162<                        <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>

163<                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

164<                      </tr>

165<                    </table></td>

166<                  </tr>

167<                </table></td>

168<              </tr>

169<            </table></td>

170<            <td width="50%" height="100%" valign="top"><table border="0" width="100%" height="100%" cellspacing="1" cellpadding="2" class="infoBox">

171<              <tr class="infoBoxContents">

172<                <td><table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2">

173<                  <tr>

174<                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

175<                  </tr>

176<                  <tr>

177<                    <td class="main" colspan="2"><?php echo TEXT_RETURNING_CUSTOMER; ?></td>

178<                  </tr>

179<                  <tr>

180<                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

181<                  </tr>

182<                  <tr>

183<                    <td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>

184<                    <td class="main"><?php echo tep_draw_input_field('email_address'); ?></td>

185<                  </tr>

186<                  <tr>

187<                    <td class="main"><b><?php echo ENTRY_PASSWORD; ?></b></td>

188<                    <td class="main"><?php echo tep_draw_password_field('password'); ?></td>

189<                  </tr>

190<                  <tr>

191<                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

192<                  </tr>

193<                  <tr>

194<                    <td class="smallText" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?></td>

195<                  </tr>

196<                  <tr>

197<                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

198<                  </tr>

199<                  <tr>

200<                    <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">

201<                      <tr>

202<                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

203<                        <td align="right"><?php echo tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN); ?></td>

204<                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

205<                      </tr>

206<                    </table></td>

207<                  </tr>

208<                </table></td>

209<              </tr>

210<            </table></td>

 

TO:

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

 

  <?php

  if (PWA_ON == 'false') {

  require(DIR_WS_INCLUDES . FILENAME_PWA_ACC_LOGIN);

  } else {

  require(DIR_WS_INCLUDES . FILENAME_PWA_PWA_LOGIN);

}

?>

****************************************************************

ADD:  /catalog/includes/languages/english/images/buttons/button_create_account.gif

 

****************************************************************

 

I've tried to indicate the original line numbers on the JUST BEFORE or CHANGE notations. Someone may want to look over it though, I think there is a problem with closing cell/row/table tags on the last change to in the login.php file. If someone could make that change I think this could be added to the install instructions.

 

Also, truthfully there are only three files above that are stock OSC, right? button_create_account.gif did not exist before and can be added without a problem.

 

Anyway, again, someone needs to double check the above. I am still testing and have run into some issues (that I'll post about below).

Share this post


Link to post
Share on other sites

Ok, my issue...

 

I noticed a posting by millyramsey (Jan 20 2004, 08:03 PM) and am running into the same problem. I tried to follow the issue but it doesn't look like it was every resolved.

 

This is the error I'm getting on Order_Info_Process.php just after filling out my the info on Order_Info.php:

 

1054 - Unknown column 'purchased_without_account' in 'field list'

select customers_id, purchased_without_account, customers_firstname, customers_password, customers_email_address, customers_default_address_id from customers  where upper(customers_email_address) = 'EMAIL@EMAIL.COM' and upper(customers_firstname) = 'JOSHUA' and  upper(customers_lastname) = 'BEVAN'

[TEP STOP]

 

Is anyone familiar with this? Any suggestions?

Share this post


Link to post
Share on other sites

JABevan,

 

Did you run all the SQL scripts? I believe there are 5 in the new version and previously there were 4. This is Step 3 in the new instructions.

Edited by safoo

Share this post


Link to post
Share on other sites

safoo -

 

Thanks for the quick reply. Yes I did run all the SQL scripts. I thought maybe I missed something so I re-ran them to double check and make sure they were all successful. This is what I ran:

 

ALTER TABLE customers ADD purchased_without_account TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL AFTER customers_id;
ALTER TABLE customers ADD INDEX (purchased_without_account);
INSERT INTO configuration_group VALUES (40, 'Accounts', 'Configuration of Account settings', 40, 1);
INSERT INTO configuration VALUES ('', 'Purchase Without Account', 'PWA_ON', 'true', 'Allow Customers to purchase without an account', 40, 1, '2003-04-08 13:07:44', '2003-04-08 12:10:51', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');
ALTER TABLE orders ADD purchased_without_account TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL;

 

I can recheck to make absolutely certain.

 

Do you have any other ideas?

Share this post


Link to post
Share on other sites

yes, could you recheck first and make sure there is a purchased_without_account column in your customers table. I don't know what else it could be but I am sure someone else will let you know.

Share this post


Link to post
Share on other sites

Yup, that was it. I triple checked to be sure and found that the purchase_without_account column was not in the customers table. I ran the scripts line by line and it works now.

 

I did run into one other problem. I have the Print Order w/ Store Logo contrib installed for customers to print out check/money orders and mail them in with payment. The problem is if you select this method of payment and proceed through checkout using PWA at the end of your order when you click on Print Order it gives you a pop-up asking you to log in (instead of a pop-up with your printable order).

 

Any ideas on this one?

Share this post


Link to post
Share on other sites

Well,

 

The print order contribution probably has an 'if' statement that checks if customer is logged in. The customer has a different login status.

 

On which page is the print order button shown? Checkoutsuccess.php?

Share this post


Link to post
Share on other sites

Yes, the checkout_success.php page. I'll post in the Print Order thread too so we can figure out how to get these two working together...

Share this post


Link to post
Share on other sites

Well,

 

As long as it tries to pull info from the orders table, you should be able to get it to work. Look for an 'if' statement that checks if the cusotmer is logged in and compare it to the 'if' statements in the PWA.

 

A cusomter is logged in normally :

 

if(tep_session_is_registered('customer_id'))

 

A customer is logged in with PWA:

 

if (tep_session_is_registered('noaccount'))

 

The above should help when you post in the other thread.

 

 

Also, was the issue of customers being able to print other customer's orders ever corrected?

Edited by safoo

Share this post


Link to post
Share on other sites

This is the statement in the latest 2.0 release of the PrintOrder contrib:

 

- added code to printorder.php that will immediately close the window and logout

the individual if the selected Order ID does not match the Order ID requested

 

However, there was a posting about it a while back indicating that it does not work yet. I've posted the code you provided on the other thread and will also experiment myself with it this week and return with anything I find.

 

Thanks for your help!

 

p.s. Did the install instructions for the four (three) stock OSC files look about right? I think they're all correct accept for some ending column/row/table tags in the last edit....

Edited by JABevan

Share this post


Link to post
Share on other sites

JABevan,

 

I haven't had time to look it at. It would be good if you or someone else could post an update to the contribution with those changes included.

 

Everyone here has done a good job of contributing. We've made a lot of progress.

Share this post


Link to post
Share on other sites

Has anyone else had problems with the email address always giving an error during the PWA Order_Info_Process.php checking?

 

At the moment everytime I try to submit a PWA "registration" from Order_Info.php or Order_Info_Process.php it gives the email error "Your E-Mail Address must contain a minimum of 6 characters."

 

The weird thing is that if I change line 35 of Order_Info_Process.php from:

  $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);

to:

  $email_address = tep_db_prepare_input($HTTP_POST_VARS['fax']);

and then put a valid email address in the fax field it works OK.

 

Anyone seent his before or got any odea why it's happening.

 

I also tried returning to the original PWA files but the same thing occurs.

 

TIA

Tim

Share this post


Link to post
Share on other sites

Hello, I have installed this contr. " Nice I must say", to a store with the following added. Ultra Pics, html pacage 1.2, info skin manager, and a coupld that don't involve any of these files. When I go to checkout without an account, the box that asks for a country in the address box, the only option is "please select" there are no countries to choose from.

 

Any idea's?

 

 

Thanks, Kevin

Share this post


Link to post
Share on other sites

I don't think it should affect the country drop down unless maybe you did an overwrite of the files. I assume you didn't. Just double check your installation is the only and best advice for now. Double check and then post back if you still have problems.

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  

×