0

I've checked that isContextCheckout() function is not working on the site. Where can I find it? I'm using the 1.8.1 version of Magento. Is there a bug reported for that function? It is being used in some template files, like account login (/template/persistent/customer/form/login.phtml):

<?php if (Mage::helper('checkout')->isContextCheckout()): ?><input name="context" type="hidden" value="checkout" /><?php endif; ?>

For me, its function is check if the buyer comes from checkout and add a parameter "context" with the value "checkout" in the url, so, in this way Magento can handle the success url and redirect to the checkout page. However, it's not working, I mean, the input hidden with name "context" doesn't appear in html because "isContextCheckout" probably is not working. I need that function because when the buyer wants to checkout, he/she is redirected to login page, and if he/she is not registered, it will be necessary make click on "Register" and to be taken to the registration page, however, the registration page url needs to have "?context=checkout" as a parameter.

Any helps?

1 Answer 1

1

The function can be found in the file app/code/core/Mage/Checkout/Helper/Data.php. This function is fairly simple in terms of code as it simply checks the parameters for a value.

/**
 * Check if context is checkout
 *
 * @return bool
 */
public function isContextCheckout()
{
    return (Mage::app()->getRequest()->getParam('context') == 'checkout');
}

For your needs I guess you will need to update the url for the registration page to contain the correct parameter but I wonder why you would redirect the user from the checkout page rather than the standard to include the registration in the billing step of checkout.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.