Jump to content
Sign in to follow this  
bmcewan

Purchase Without Account Updated & Admin Functionality

Recommended Posts

FILENAME_CREATE_ACCOUNT_PROCESS

 

needs to be defined in:

 

if MS1 --> /catalog/application_top.php

 

if MS2 --> /catalog/filenames.php

 

Lee

Share this post


Link to post
Share on other sites
needs to be defined in:

 

What do I define it as?

 

define('FILENAME_CREATE_ACCOUNT_PROCESS', '????.php');

 

 

Thanks for your help!!

-Dennis[/code]

Share this post


Link to post
Share on other sites

oh yeah..

 

  define('FILENAME_CREATE_ACCOUNT_PROCESS', 'create_account_Process.php');

 

Would make since, eh? :oops:

 

Thanks a lot for your help!

 

-Dennis

Share this post


Link to post
Share on other sites

very sorry to keep bothering you guys...

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in C:webwebjunctiontwisterchatcomtwisterchat.comwwwsitesd2catalogincludesfunction
sdatabase.php:13) in C:webwebjunctiontwisterchatcomtwisterchat.comwwwsitesd2catalogincludesfunction
sdatabase.php on line 13

 

I get this only if the user selects "proceed directly to checkout" (rather than registering)

 

I know that its a problem where a file is requiring/referencing database.php twice.. but I can't for the life of me find where it does so.

 

I looked in all files required/defined by Order_Info_Process.php (which is what is in the address bar when the error occurs) as well as all the files I was required to edit for the contribution, as well as all files added for the contribution.

 

I tried just re-installing the contribution to no avail, and backing up to before the contribution works fine.... I promise I looked in the forums, and on the readme as well as I could before bugging this forum :(

 

Thanks for your help!

-Dennis

Share this post


Link to post
Share on other sites

I am trying to add this contribution to my site. I am not that familiar with mysql.

 

Included below are two screen shots of where I think I should make the following changes given in the contribution instructions.

________

Database changes new as of v0.57

 

INSERT INTO configuration_group VALUES (40, 'Accounts', 'Configuration of Account settings', 40, 1);

________

 

Can someone tell me if I am going down the right path. Just in case, I have made a back up thru the backup tool in osCommerce admin.

 

Thanks!!

 

 

myphpadmin.jpg

 

 

insert.jpg

Share this post


Link to post
Share on other sites

that's one way of doing it. An easier way since you're using phpMyAdmin would be to simply click the 'SQL' tab up top, cut and paste your query i.e.:

 

INSERT INTO configuration_group VALUES (40, 'Accounts', 'Configuration of Account settings', 40, 1);

 

in the big box, then hit 'Go' and you're all set.


-D. M. 8)

Share this post


Link to post
Share on other sites
oh yeah..

 

  define('FILENAME_CREATE_ACCOUNT_PROCESS', 'create_account_Process.php');

 

Would make since, eh?  :oops:  

 

Thanks a lot for your help!

 

-Dennis

 

Where can i find create_account_Process.php ?

I only see create_account.php and create_account_success.php

 

Thanks,

TEN

Share this post


Link to post
Share on other sites

i change the create_account_process.php to create_account.php

and seems working. However, when i try to order second time with

different info, it said the address_book_id was duplicated

 

1062 - Duplicate entry '1' for key 1

 

any idea?

 

Thanks,

TEN

Share this post


Link to post
Share on other sites
i change the create_account_process.php to create_account.php

and seems working. However, when i try to order second time with

different info, it said the address_book_id was duplicated

 

1062 - Duplicate entry '1' for key 1

 

any idea?

 

Thanks,

TEN

 

Ihave exactly the same problem as you have, if you find a solution please let me know!

 

Cheers

Share this post


Link to post
Share on other sites

Hi everybody,

 

I have attempted to install this contribution several times. Is it compatible with with MS2 and if it is can somebody explain how to install it without destroying my webshop?

Share this post


Link to post
Share on other sites
i change the create_account_process.php to create_account.php

and seems working. However, when i try to order second time with

different info, it said the address_book_id was duplicated

 

1062 - Duplicate entry '1' for key 1

 

 

It sounds like it's keeping the sessions.. did you do this:

 

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



find 



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



and replace with



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

}

 

That will delete the session if its a guest

 

-Dennis[/code]

Share this post


Link to post
Share on other sites

Okay - this is how I fixed the problem:

 

Go to your admin page

Click 'Customers'

Delete all customers (that it will let you delete)

 

It worked fine after that :D

 

Hope that helps

-Dennis

Share this post


Link to post
Share on other sites
Fatal error: Failed opening required 'includes/languages/english/FILENAME_CREATE_ACCOUNT_PROCESS' (include_path='.;c:php4pear') in C:webwebjunctiontwisterchatcomtwisterchat.comwwwsitesd2catalogOrder_Info_Process

.php on line 21

 

After selecting "Continue Without Registering" and Typing in all your info, I get this error message in the browser

 

:cry:

 

Thanks for your help

-Dennis

 

Not sure which version you are using, but you have a missing define in either application_top.php or filenames.php or, most likely, you are using version MS2 of osC and it is not compatible with this contribution......not calling filenames.php


Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
Share on other sites
i change the create_account_process.php to create_account.php

and seems working. However, when i try to order second time with

different info, it said the address_book_id was duplicated

 

1062 - Duplicate entry '1' for key 1

 

 

It sounds like it's keeping the sessions.. did you do this:

 

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



find 



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



and replace with



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

}

 

That will delete the session if its a guest

 

-Dennis[/code]

 

Having some problems with the code.

In account_succes the"tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string, 'SSL'));" dont exist, however there is a simular string "tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));

" so i replace that with "// 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'));"

When i do this a get a error message = unexpected $ in line 163

 

Any ideas? I get the script to work but i doesnt work when the time comes to kill the session.

 

Cheers m8!

Share this post


Link to post
Share on other sites

Is there anyway to modify this so that a customer can do the following:

1. Come to my store, purchase their items

2. Go directly to customer information and checkout without an account (in other words, bypassing the login page totally)

3. Come back later and purchase another item with the same email address they used before?

 

The first order goes through fine. However, when coming back to purchase a second item using the same email address, it gives me the 'Email address and/or password do not match' error followed by the login screen. I am just wanting to use osCommerce as the purchase center as I keep all of my customers' information in a separate database.

 

Any help would be appreciated! :D

Share this post


Link to post
Share on other sites
Okay - this is how I fixed the problem:

 

Go to your admin page

Click 'Customers'

Delete all customers (that it will let you delete)

 

It worked fine after that :D

 

Hope that helps

-Dennis

 

Well this code maybe not work wit osc2.2 ms2, perhaps its not compitable. What version are you using?

 

Has anyone got this code to work with osc2.2 ms2? Its a shame i can?t get this too work, its a fine cont.! Im a newbie that could explain a lot ;)

Share this post


Link to post
Share on other sites
Is there anyway to modify this so that a customer can do the following:

1. Come to my store, purchase their items

2. Go directly to customer information and checkout without an account (in other words, bypassing the login page totally)

3. Come back later and purchase another item with the same email address they used before?

 

The first order goes through fine. However, when coming back to purchase a second item using the same email address, it gives me the 'Email address and/or password do not match' error followed by the login screen. I am just wanting to use osCommerce as the purchase center as I keep all of my customers' information in a separate database.

 

Any help would be appreciated! :D

 

 

Check out the post by dmGremlin earlier in this thread. This fix worked for me and I am using 2.2MS1

 

dmGremlin - Mon Jul 07, 2003 12:35 pm

Post subject:

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

I can't remember who the original author if this was, but this seems to be a fix... this mod clears out the account on checkout, so it fixes the problem of if they purchase something and come back. Well, whoever the original poster of this fix was, sorry I forgot to write down your name. Here's that person's fix:

 

Quote:

Posted: Thu Jul 03, 2003 11:13 pm Post subject:

 

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

 

I had the same problem, when I did some test purchases without creating an account. I was able to go back and click on 'Password Forgotten?' link and get a new password and of course get access to the account, which this is not the way it is supposed to work.

 

Here is the way I fixed it:

in /catalog/checkout_success.php insert the following code right before the HTML code but within the php tags.

Code:

 

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

 

}

 

 

 

this will get rid of the customer account information, therefore the customer will not have access to the account nor the order history but you will keep the order information.

 

If you have any problems just let me know.

 

 

The only thing this doesn't take care of is if the customer closes his / her browser or leaves your site after putting in their information in the Order_Info.php, but before completing their checkout.... then obviously the customer information is still saved... I haven't been able to think of any logical or easy way to fix this. Shouldn't be a problem most of the time though.

Share this post


Link to post
Share on other sites

I did what you said, and now i works for me too! Its incredible i?ve been trying with that code for days!

 

You?re great! ;)

 

Cheers Appelkvist

Share this post


Link to post
Share on other sites
i change the create_account_process.php to create_account.php

and seems working. However, when i try to order second time with

different info, it said the address_book_id was duplicated

 

1062 - Duplicate entry '1' for key 1

 

any idea?

 

Thanks,

TEN

 

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:

 

http://www.diyreef.com/PWA_MS2.zip

 

If it works for several of you, with the exception of the Paypal IPN problem I mentioned above I will go ahead and contribute it since it contains DMs code as well as the add-on fixes that have been posted here and in the contributions section, along with being done on MS2 files.

Share this post


Link to post
Share on other sites

:(

I have used the latest version of the os commerce

 

I have now done 4 installs and a fresh one on another new version of OS comm. and still no joy.

 

I have followed the instructions and when I go to input and enter information about me I get this

 

Fatal error: Failed opening required 'includes/languages/english/FILENAME_CREATE_ACCOUNT_PROCESS' (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site2/fst/var/www/html/OSCOMMERCETEST/catalog/Order_Info_Process.php on line 21

 

Obviously it does not want to open create_account_process.php . . . . .because it does'nt exist on the latest rlease of OSC . . . but create_account.php does

 

so if I change to create_account and run through the process again I get this:

 

1062 - Duplicate entry '1' for key 1

 

insert into address_book (customers_id, address_book_id, entry_firstname, entry_lastname, entry_street_address, entry_postcode, entry_city, entry_country_id, entry_gender, entry_company, entry_suburb, entry_zone_id, entry_state) values ('11', '1', 'czvbxcvb', 'xcvbxcvb', 'vbcxvbc', 'bxcvbxcb', 'cxvbbfgf', '238', 'm', 'z', 'xcbxc', '0', 'gsdgf')

 

[TEP STOP]

 

 

Which is interesting because (obviously) it represents a duplicaiton of the imputted information. According to various MySql help sites, this problem occurs if there is a duplicaiton of a table on the database. the problem here, is that I have now tried using Purchase without account on 2 sepeerate installs and the message still comes up

 

and the information entered does go in to the database.

 

Have you any ideas on a work around?

 

 

further notes on the subject:

 

 

 

 

anyone any thoughts?

Share this post


Link to post
Share on other sites

:) I've been knocking my head against a wall for the last 2 days trying to work out this error:

 

Fatal error: Failed opening required 'includes/languages/english/FILENAME_CREATE_ACCOUNT_PROCESS' (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site2/fst/var/www/html/OSCOMMERCETEST/catalog/Order_Info_Process.php on line 21

 

when I change the code so it reads creaate account.php rather than the non existant create_account_process.php

 

and it works sort of . . .

 

but i get this :

 

1062 - Duplicate entry '1' for key 1

 

insert into address_book (customers_id, address_book_id, entry_firstname, entry_lastname, entry_street_address, entry_postcode, entry_city, entry_country_id, entry_gender, entry_company, entry_suburb, entry_zone_id, entry_state) values ('11', '1', 'czvbxcvb', 'xcvbxcvb', 'vbcxvbc', 'bxcvbxcb', 'cxvbbfgf', '238', 'm', 'z', 'xcbxc', '0', 'gsdgf')

 

I have tried several thing and to no avail - except this : (SEE BELOW)

 

and it works ! ! ! ! so a BIG thanks to JB Justin for helping keep my hair! :)

 

 

 

Joined: 09 Dec 2002

Posts: 175

 

 

TEN wrote:

i change the create_account_process.php to create_account.php

and seems working. However, when i try to order second time with

different info, it said the address_book_id was duplicated

 

1062 - Duplicate entry '1' for key 1

 

any idea?

 

Thanks,

TEN

 

 

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:

 

http://www.diyreef.com/PWA_MS2.zip

 

If it works for several of you, with the exception of the Paypal IPN problem I mentioned above I will go ahead and contribute it since it contains DMs code as well as the add-on fixes that have been posted here and in the contributions section, along with being done on MS2 files.

Share this post


Link to post
Share on other sites
1146 - Table 'compusite.TABLE_PAYPALIPN_TXN' doesn't exist

 

select o.orders_status,p.* from orders o LEFT JOIN TABLE_PAYPALIPN_TXN p on p.item_number = o.orders_id AND o.customers_id = '14' order by o.date_purchased desc limit 1

 

[TEP STOP]

 

I installed the contribution and whitnissed almost every problem stated in this thread, and solved them. I downloaded the file above my post and. But this is my final error, it seems that it cannot find paypal. Well that's right because I haven't activated it. So what is the fix for this. It seems a database problem. Btw I got MS2

Share this post


Link to post
Share on other sites
1146 - Table 'compusite.TABLE_PAYPALIPN_TXN' doesn't exist

 

select o.orders_status,p.* from orders o LEFT JOIN TABLE_PAYPALIPN_TXN p on p.item_number = o.orders_id AND o.customers_id = '14' order by o.date_purchased desc limit 1

 

[TEP STOP]

 

I installed the contribution and whitnissed almost every problem stated in this thread, and solved them. I downloaded the file above my post and. But this is my final error, it seems that it cannot find paypal. Well that's right because I haven't activated it. So what is the fix for this. It seems a database problem. Btw I got MS2

 

This is because my files have Paypal IPN included in them, so if you don't have Paypal IPN loaded they will probably not work out too well. What you can do is download the Paypal IPN contribution and look in the install file to see what changes where made to these same files that are involved in the PWA contribution and then "uninstall" them. I will see if I can find the few changes I made to get rid of the "duplicate entry" error problem. So then you could take a out of the box MS2 version and just do the changes found throughout this thread as well as the address_id fix. It will take me a few minutes I am sure. :lol:

Share this post


Link to post
Share on other sites

Ok here we go:

 

In catalogincludesmodulesOrder_Info_Process.php here are the edits I made:

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

Around line 307 find this:

                where customers_id = '" . $check_customer['customers_id'] . "' and address_book_id = '1'");

 

Change it to this:

                where customers_id = '" . $check_customer['customers_id'] . "' and address_book_id = '[address_book_id]'");

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

 

I commented out these lines around line 310 and 315, but I don't remember why?? :oops:

          $customer_default_address_id = $check_customer['customers_default_address_id'];

         tep_session_register('customer_default_address_id');

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

 

Around line 345 find this (now I remember why):

          tep_session_register('customer_default_address_id');

                           'customers_password' => crypt_password($password),

                           'customers_default_address_id' => 1);

 

Change it to this:

                            'customers_password' => crypt_password($password));

//                            'customers_default_address_id' => 1);

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

 

Around line 356 find this:

                            'address_book_id' => 1,

 

Change it to this:

                            'address_book_id' => $address_id,

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

 

Around line 377 find this:

                            'address_book_id' => 1,

   tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

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

   $customer_first_name = $firstname;

   $customer_default_address_id = 1;

 

Change it to this:

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

   $customer_first_name = $firstname;

   $customer_default_address_id = $address_id;

 

And I think that is it....

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  

×