Jump to content
Sign in to follow this  
bmcewan

Purchase Without Account Updated & Admin Functionality

Recommended Posts

hi Spaceboy, what i mean is all pages where login information is entered, i.e: when checking out, you are redirected to login.php, i would like it to direct to Order_Info.php. or when you want to write a review it asks for login as well.

hope i clarified my question,

thanks

Share this post


Link to post
Share on other sites

Just my guess : in login.php, go directly to FILENAME_CHECKOUT instead of calling FILENAME_PWA_xxx_LOGIN.

 

Replace in login.php :

 

require(DIR_WS_INCLUDES . FILENAME_PWA_PWA_LOGIN);

 

by

 

require(FILENAME_CHECOUT);

 

I did not try it out but it should send you directly to Order_Info.php.

 

Didier.

Share this post


Link to post
Share on other sites

There is a fatal flaw in this contribution and I wish I knew how to fix it. There needs to be a way to delete a customer after they have made a purchase using PWA. I know you can already delete customers easily in admin but there has to be a way to tell the difference between customers who created an account with their own password and those who only used PWA. If a customer used PWA and wants to come back, they cannot use the email they used the first time unless they are removed. However, one cannot figure out who has intentionally created an account and who has used PWA because a password is generated automatically for both methods. A simple check mark next to the name of those who created an account or for those who used PWA would suffice but something must be done to differentiate.

Share this post


Link to post
Share on other sites
I've set up Pass Without Accounts (PWA) and it works fine, but under Configurations in Admin I get this at the bottom \'Accounts\'

and when I click on that I get this:

 

Title Value Action

\'Purchase Without Account\' \'true\'

 

 

Which I can't edit ??

 

Are you experiencing this?

Could you check your admin/order.php file and see what it looks like. From what i can see when you install you get 2 choices, upload the supplied order.php or edit it.

 

I have checked the supplied one and it does not seem to have the code in that you are told to add if you edit it, i.e. :

 

Supplied order.php :

 

if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {

$notify_comments = '';

if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {

$notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";

}

 

$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]);

 

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

 

$customer_notified = '1';

}

 

tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')");

 

$order_updated = true;

}

 

Now when i read the install instructions is says :

 

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

OPEN AND MAKE CHANGES IN THIS FILE: /admin/orders.php

change: (v0.71)Changed the email section in admin/orders.php

from:

 

  $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]);           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);           $customer_notified = '1';         }

 

to:

// start pwa changes  $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 = STOR_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]); } 
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" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); }           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

          $customer_notified = '1';         }

 

So my order.php file now looks like :

 

if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {

$notify_comments = '';

if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {

$notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";

}

 

// start pwa changes $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 = STOR_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]); }

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" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

$customer_notified = '1'; }

 

Which one is correct?????...I'm confused, maybe i'm missing something simple but it seems to me that the supplied order.php and the code alterations for the same file end up giving different results...........................

 

Simon

Share this post


Link to post
Share on other sites

Sorry, should have added :

 

I installed the PWA account contrib which appears to work ok but when i try to change the status of an order from processing to pending for example i get an error :

 

Fatal error: Call to undefined function: _query() in /home/httpd/vhosts/unlockmymobile.com/httpdocs/os/catalog/admin/orders.php on line 52

 

the code that its moaning about is here :

 

// start pwa changes $pwa_check_query= tep_db

 

_query("select purchased_without_account from " . TABLE_ORDERS . " where orders_id = '" . tep.....................

Share this post


Link to post
Share on other sites

Hello, everyone, I need some help to modify some thing also i found the answer from this thread....but don't kow where to modify in the MS2 files........

 

 

This comes from the PWA contribution trying to always set the address_id="1" in the database instead of auto-incrementing the number as it should. I found that the code by DM to checkout_success.php eliminated this error unless someone tried to pay via Paypal using the Paypal IPN contribution. If they do not make it all the way back to the site and hit the checkout_success.php page the same problem would occur the next time someone tried to checkout w/o an account because there would already be an address_id=1 in the db.

 

Anyway, I went through my files (MS2) and changed it so the address_id would auto-increment and the problem has been removed. The only problem that still remains is that if Paypal IPN is used then an account is created in the db. I have yet to figure out where to add the code that DM posted to the Paypal IPN contribution so that it will delete the customers info and address_book. So far if I delete the info it does not get passed to Paypal for obvious reasons. At the moment, I just figure for all orders that have the status "Paypal Processing" -meaning they did not click "return to site" button at Paypal I just need to delete that customers info. If anyone wants to give this a whirl with MS2 using the Paypal IPNv0981 contribution as well you can download my files from here:

 

 

This is the answer that i found...and the following is my problem

1062 - Duplicate entry '' for key 1

 

insert into orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, orders_status, currency, currency_value, date_purchased) values ('26', 'Joe Mark', '', '12333 Sheppard Ave.', '', 'Toronto', '234 542', 'Ontario', 'Canada', '416-7569512', 'contactmark@yadyshop.com', '1', ' ', '', '', '', '', '', '', '', '', 'Joe Mark', '', '12333 Sheppard Ave.', '', 'Toronto', '234 542', 'Ontario', 'Canada', '1', 'PayPal', '', '', '', '', '100000', 'USD', '1.00000000', now())

 

Thank you for any kind help :rolleyes:


OS-commerce is great, but with other magical contributions, that is just so "COOL"!

Share this post


Link to post
Share on other sites

Hello, JB, are you still here can help me?? I found your solution on correcting the problem of duplicating entry....but the Order_Info_Process.php is no longer used after 0.70 version, so could you please help me to locate the right php page??? ;)

 

 

Thank you million times :rolleyes:


OS-commerce is great, but with other magical contributions, that is just so "COOL"!

Share this post


Link to post
Share on other sites

never mind....although I don't if this fix is correct...but before i change the orders table of order_id to "no auto increment" and that is why it caused my site not working fine.....but now it works like charm again... :lol:


OS-commerce is great, but with other magical contributions, that is just so "COOL"!

Share this post


Link to post
Share on other sites
Here is my file /catalog/includes/modules/Order_Info_Check.php that should behave exactly the same as create_account.php

 

Spaceboy, Thank-you so much for posting the code. I merged yours to mine and it is almost perfect like the way I wanted. I had consitance look in all the log in pages like the orignal osC.

 

As I said it is almost perfect, I still can not change the input boxes to span the entire page right now it is just taking 60% of the page and leave me with the big gap between the input box and the right columm. Also do you know how to change the color of the * from black to red?. I have serverel block with black and the rest of the * is red :-). Thanks for all the help.

Share this post


Link to post
Share on other sites

Hey guys,

 

I'm having a problem with the login.php. Anytime I upload the PWA version, I get an error from my web server saying it can't find the /catalog/cookie_usage.php. This only happens if a customer would like to log in or complete an order. It seems to try to get to an outside path from which should be reading the following:

 

Correct Path:

/~xhiyldom/catalog/cookie_usage.php  

Incorrect Path:

/catalog/cookie_usage.php

Any idea's?

 

Thanks!

Share this post


Link to post
Share on other sites

I have installed v8 of this contribution and am having apretty major issue wherby I get the following error after clicking on 'proceed to checkout' or after I have completed and order and added cc info and confirm checkout

 

No input file specified.

 

I've rolled back to ver 7.1 and still have this error, I suspect it's a database mod but can't find it anywhere - can anyone help or suggest a fix?

 

Thanks to all

 

G

Share this post


Link to post
Share on other sites

Spaceboy,

Replace in login.php :

 

require(DIR_WS_INCLUDES . FILENAME_PWA_PWA_LOGIN);

 

by

 

require(FILENAME_CHECKOUT);

 

and this is what i recieve:

Fatal error: Cannot redeclare tep_db_connect() (previously declared in f:\htdocs\martin\includes\functions\database.php:13) in f:\htdocs\martin\includes\functions\database.php on line 13

 

i dont need login.php to come up, and i dont need any membership options for my customers.

 

thanks

Edited by late

Share this post


Link to post
Share on other sites

1. * : it's the class "inputRequirement" of your stylesheet

2. span input boxes : I think the size is dependant of the datatype used. I had a look at the class, but I really have no clue how to increase their size.

 

Didier.

Share this post


Link to post
Share on other sites
Hey guys,

 

I'm having a problem with the login.php. Anytime I upload the PWA version, I get an error from my web server saying it can't find the /catalog/cookie_usage.php. This only happens if a customer would like to log in or complete an order. It seems to try to get to an outside path from which should be reading the following:

 

Correct Path:

/~xhiyldom/catalog/cookie_usage.php ?

Incorrect Path:

/catalog/cookie_usage.php

Any idea's?

 

Thanks!

Did you configure correctly the file configure.php ? There are some settings to do for the cookies.

 

Didier.

Share this post


Link to post
Share on other sites
I have installed v8 of this contribution and am having apretty major issue wherby I get the following error after clicking on 'proceed to checkout' or after I have completed and order and added cc info and confirm checkout

 

No input file specified.

 

I've rolled back to ver 7.1 and still have this error, I suspect it's a database mod but can't find it anywhere - can anyone help or suggest a fix?

 

Thanks to all

 

G

hmmm..do you have a php file and/or line number with this error ?

 

I never got this so no idea where the problem could be.

 

Didier.

Share this post


Link to post
Share on other sites
Spaceboy,
Replace in login.php :

 

require(DIR_WS_INCLUDES . FILENAME_PWA_PWA_LOGIN);

 

by

 

require(FILENAME_CHECKOUT);

 

and this is what i recieve:

Fatal error: Cannot redeclare tep_db_connect() (previously declared in f:\htdocs\martin\includes\functions\database.php:13) in f:\htdocs\martin\includes\functions\database.php on line 13

 

i dont need login.php to come up, and i dont need any membership options for my customers.

 

thanks

hmm.I've got the same error as you and I do not know why. Dropping the login.php file can cause serious problems I guess.

 

I tried to hack the login.php but it always gives that database error.

 

Really no idea how to call Order_Info.php without going through the login page.

 

Someone else ?

 

Didier.

Share this post


Link to post
Share on other sites
I have installed v8 of this contribution and am having apretty major issue wherby I get the following error after clicking on 'proceed to checkout' or after I have completed and order and added cc info and confirm checkout

 

No input file specified.

 

I've rolled back to ver 7.1 and still have this error, I suspect it's a database mod but can't find it anywhere - can anyone help or suggest a fix?

 

Thanks to all

 

G

hmmm..do you have a php file and/or line number with this error ?

 

I never got this so no idea where the problem could be.

 

Didier.

Didier

 

No filename or script error at all reported, just when I ckick on checkout from a created account or without an account.

 

Updateas of 19/07/2004 :- have rolled back even further to basic level without PWA installed, original scripts etc and most database updates removed and it still causes the same fault!

 

Am now resorting to complete scrub and starting again to rebuild from new site.

Share this post


Link to post
Share on other sites

Hello Everyone,

I am trying to add the contrib to my site to allow users to purchase without an account. Unfortunately, I am having no luck. Can anyone help?

Share this post


Link to post
Share on other sites

OK I have looked till I cant look anymore lol... You will most likely be able to answer this right off.. I am in the process of installing several contribs and I am taking special care to install with the readme files the contribs that involve core files.... I am trying to get this contrib installed and it would seem that it is working until I go into the orders to update status ect. I click on update status and it goes to a blank screen... I refresh and allow IE to reinput the info and it comes back as nothing to change in header... yet there has been no change that I can see in the status of the order.... I opted in my endevors to trouble shoot the problem to leave out the edit to orders.php.. and from what I can tell.. It works without this edit... What is this edit for and why is it breaking my orders.php file?

 

Also on a side note the only other contrib I have installed at this point that involves orders.php is the USPS Shipping Label contrib which is just the addition of two button links between invoice/packingslip and the back button

Share this post


Link to post
Share on other sites

I am getting an error on the following code in Order_Info_Process when a customer who already has an account tries to purchase without an account. I want it to bypass this check altogether.

 

if ($check_customer['purchased_without_account'] != 1) {

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

 

The error I am getting is:

 

The requested URL /login.php/login/fail/reason/An+account+already+exists+for+the+email+address+<i>donna@ukgoods.com</i>.++You+must+login+here+with+the+password+for+that+account+before+proceeding+t

o+checkout. was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

How can I get rid of this error?

 

Thanks,

 

Donna Gordon

UKGoods

 

PS Sorry for the multiple postings. I didn't realize I was supposed to post my question in this thread.

Share this post


Link to post
Share on other sites

I have ran into a problem in create_account.php where I get the error

Parse error: parse error, unexpected $ in /home/dragon26/public_html/shop/create_account.php on line 558

 

This is the only contrib I have installed that involves this file... Can someone please help me to understand the issue here? :blink:

Share this post


Link to post
Share on other sites

Can I give some suggestions?

 

If I am the customer, and I already decide to use paypal as my payment method, can I skip every thing and go straight to paypal site to pay?

 

1. If I am already a paypal user, I will not need to enter those personal information again because paypal will have my profile info.

 

2. If I am not a paypal user, paypal will ask me to enter personal info again. So I will have to enter my personal info twice.

 

3. By pass security concern because paypal is the one who responsible for secure customer's personal info.

Share this post


Link to post
Share on other sites

Hello,

 

I am using 0.8. PWA destroys session in checkout_success.php and that makes downloadable product undownloadable.

 

The easiest way to hack is moving all the patched part in checkout_success.php into download.php, but this may make other tangible purchases fail.

 

Is there any other better and smoother "fix" for this ?

 

ywliu

Share this post


Link to post
Share on other sites
I have ran into a problem in create_account.php where I get the error

Parse error: parse error, unexpected $ in /home/dragon26/public_html/shop/create_account.php on line 558

 

This is the only contrib I have installed that involves this file... Can someone please help me to understand the issue here? :blink:

what's your code around these lines ? You must have a simple php syntax error.

 

Didier.

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  

×