1
votes

How do I determine the checkout method selected at the billing stage?

We have a plugin that shows an option for a customer to select a customer group when checking out from our website.

The problem is we wish to hide this option if they want to checkout as a guest, so the option is only visible if they are registering or are logged in.

I tried to do this using the isCustomerLoggedIn() function but that then doesn't show the option when they have selected register.

Does anyone know of a way of telling in the persistent/checkout/onepage/billing.phtml template if a customer has selected register or guest checkout?

Thanks in advance!

2

2 Answers

3
votes

I think, it'd have been better to have worded the question "How do I determine the checkout method selected at the billing stage?"

Anyway, you should be able to tell which checkout method was selected via

$this->getQuote()->getCheckoutMethod()

So:

if($this->getQuote()->getCheckoutMethod() == "register" || 
Mage::getSingleton('customer/session')->isLoggedIn() )
{
...
1
votes

You should be able to tell which checkout method was selected via

$this->getQuote()->getCheckoutMethod()

So:

if($this->getQuote()->getCheckoutMethod() == "register" || 
Mage::getSingleton('customer/session')->isLoggedIn() )
{
...