How to disable user registration and offer ONLY guest checkout

I saw a few other posts on this, so I figured I would chime in with how I accomplished this.





EDIT: The code below does NOT work for current versions of CS-Cart. For updated code, see here: Disable User Registration & Offer Only Guest Checkout (Updated) - Configuration - CS-Cart Community Forums





First, make sure “Anonymous checkout” is enabled in your Administration settings.





Secondly, this is only for the one-page checkout, so make sure that is enabled.





Then, edit this file: /skins/[YOUR-SKIN]/customer/views/checkout/components/checkout_steps.tpl





Basically, the way this page works is it just hides either the guest checkout, or the login/register section, depending on whether you're signed in and if you've clicked the “Guest checkout” button.





So, what I did was basically hide everything except the guest checkout, and I removed the “if” statements, so regardless of whether you try to register, it should show only the guest checkout.





I don't have time right now to list out the lines I changed, but it was only about 4 lines, so here is the section where I made the changes:





```php









1.





{if $complete || $edit}







{/if}





{if !$edit}



{include file=“buttons/button.tpl” but_href=“$index_script?dispatch=checkout.checkout&edit_step=step_one&from_step=$edit_step” but_rev=“checkout_steps,cart_items,checkout_totals” but_meta=“float-right cm-ajax” but_text=$lang.edit but_role=“tool”}



{/if}





{$lang.contact_information}







{assign var=“curl” value=$config.current_url|fn_query_remove:“login_type”}







{if ($settings.General.disable_anonymous_checkout == “Y” && !$auth.user_id) || ($settings.General.disable_anonymous_checkout != “Y” && !$auth.user_id && !$contact_info_population) || $smarty.session.failed_registration == true}











{include file=“views/checkout/components/checkout_login.tpl” checkout_type=“one_page”}





























{include file=“views/profiles/components/profiles_account.tpl” nothing_extra=“Y” location=“checkout”}



{include file=“views/profiles/components/profile_fields.tpl” section=“C” nothing_extra=“Y”}





{hook name=“checkout:checkout_steps”}{/hook}





{if $settings.Image_verification.use_for_register == “Y”}



{include file=“common_templates/image_verification.tpl” id=“register” align=“center”}



{/if}









{include file=“buttons/button.tpl” but_name=“dispatch[checkout.add_profile]” but_text=$title}



 {$lang.or}Â



{include file=“buttons/button.tpl” but_href=$curl but_onclick=“$('#step_one_register').hide(); $('#step_one_login').show();” but_text=$lang.cancel but_role=“tool”}

















{if $settings.General.disable_anonymous_checkout != “Y”}

















{include file=“views/profiles/components/profile_fields.tpl” section=“C” nothing_extra=“Y” id_prefix="soacf
"}





{hook name=“checkout:checkout_steps”}{/hook}





{if $settings.Image_verification.use_for_checkout == “Y”}



{include file=“common_templates/image_verification.tpl” id=“checkout” align=“center”}



{/if}









{include file=“buttons/button.tpl” but_name=“dispatch[checkout.customer_info]” but_text=$_title}





















{/if}



{else}























{if !$edit}



{include file=“views/profiles/components/step_profile_fields.tpl” section=“C”}



{else}



{include file=“views/profiles/components/profile_fields.tpl” section=“C” nothing_extra=“Y”}





{hook name=“checkout:checkout_steps”}







{include file=“buttons/button.tpl” but_name=“dispatch[checkout.update_steps]” but_text=$_title}



{if $smarty.request.from_step}



 {$lang.or}Â



{include file=“buttons/button.tpl” but_href=“$index_script?dispatch=checkout.checkout&edit_step=$smarty.request.from_step” but_meta=“cm-ajax cm-ajax-force” but_rev=“checkout_steps,cart_items,checkout_totals” but_text=$lang.cancel but_role=“tool”}



{/if}







{/hook}



{/if}











{/if}






```

Hi trevorgehman,



Thanks for your post on how to disable User Registration so that the user can simply check out as a guest.

I’ve found the file in question “checkout_steps.tpl”, but haven’t been able to figure out exactly which lines to comment out. I’ve tried a few combinations, with no real success… or… the check out process gets hung, and can’t proceed.



Could you be more specific about which lines of code to look for?



thanks!

Della

Hi,



I am also trying to only enable the guest checkout. Can you please highlight the changes you have made in steps, so I can apply it towards my store.



Thank you

please provide a detailed solutions.

Can someone please help…I really need to change the checkout to only guest checkout.

The above code doesn’t work…

[quote name='super9xman' timestamp='1303789049' post='110936']

The above code doesn't work…

[/quote]



Sorry guys, they changed the way checkout works, and so all this code is broken with the latest version.



I'm working on a way to do this as we speak, and will post when I get it finished.



Thanks.

Okay, I’ve updated the code for 2.1.4, and posted here: