0

I have a custom page where the customer will be redirected when he/she orders more than the remaining inventory of the product.

Here's my scenario :

Product 1 remaining inventory is 5 and the customer input a quantity 10 and pressed the Add to Cart button.

If the scenario above happens, i want to redirect to my custom page called http://www.example.com/errorcartpage

Is this possible? If yes, how do i do this?

P.S. Even though magento has default redirect if the scenario above happens, i still want to redirect to a custom page. It's a requirement.

Thanks

1
  • anyone? no one has encountered this issue before? :(
    – Bogz
    Commented Aug 18, 2014 at 16:45

1 Answer 1

1

Use event catalog_product_type_prepare_full_options

`class Company_Example_Model_Observer
{
    public function catalogProductTypePrepare($observer)
    {
        $quote = Mage::getSingleton('checkout/session')->getQuote();
        if( your-condition-here){
            // do the magic here
        }
    }
}`
3
  • do i need to create my own module on this or what? and what should be the code in 'your-condition-here' part..sorry im a complete noob
    – Bogz
    Commented Aug 17, 2014 at 12:44
  • Yes, if you want to modify magento you need to create some custom module.
    – Amasty
    Commented Aug 18, 2014 at 19:24
  • your code is still not clear. what shoul i put in 'your-condition-here'? can give complete code of the function instead?
    – Bogz
    Commented Aug 19, 2014 at 1:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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