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

  • anyone? no one has encountered this issue before? :( – Bogz Aug 18 '14 at 16:45
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
        }
    }
}`
  • 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 Aug 17 '14 at 12:44
  • Yes, if you want to modify magento you need to create some custom module. – Amasty Aug 18 '14 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 Aug 19 '14 at 1:13

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.