0

Have an issue with a Magento 1.6 store. When i have a configurable product in the wishlist and i select edit for that individual item it takes me to a wishlist version of that product page, all good.

I change my product options and select update wishlist button. At this point i get returned back to the wishlist index page and i can see none of the configurable options are updated!

I track this down to an issue with the Mage Core Wishlist indexController. Around line 267 you have this code:

        $productId = (int) $this->getRequest()->getParam('product');
    if (!$productId) {
        $this->_redirect('*/');
        return;
    }

Simple, it gets the product parameter from the url. but the if statement redirects me back to the wishlist page because there is no parameter "product" in the url so this action always fails. I do however see there is an ID parameter in the url which seems to

Is this a known bug in magento? Or has anyone come across it?

if so how did you fix?

Thanks

EDIT

I have manually added an extra parameter to the url using the Core/Url helper to do so and it works fine. But id still like to know what is happening here

  • put getParam('id') in that if condition and then checks whether it works correctly. – Rajeev K Tomy Sep 29 '14 at 14:03
  • Ive just done this as i recieved your comment. It fails because its getting the product id in relation to the wishlist not the product id of the product list. So unfortunately it returned a cannot specify product. – Tom Burman Sep 29 '14 at 14:07
  • when you click on edit link in wishlist page, how url looks like ? – Rajeev K Tomy Sep 29 '14 at 14:30
  • example.com/uk/wishlist/index/configure/id/5/ – Tom Burman Sep 29 '14 at 14:31
  • For now i have appended an extra param to the url using core url helper and it works fine, but would still like to know whats happening – Tom Burman Sep 29 '14 at 14:32
2

When you do update options operation from wishlist page, the method that Magento process that time will be updateItemOptionsAction(). So I assume you are in the right location. But when we make look at a glance on that method, it seems almost all conditions uses the same url redirect in it. ie

 $this->_redirect('*/');

So it is very important to make sure that, you are in the above described if condition itself.

Now when you do the following operations, the parameters that is passing to the updateItemOptionsAction() are

<?php /*   DEMO VALUES  */  ?>
Array
(
    [id] => 2
    [form_key] => uuWSJ3zV5nCsu7lp
    [product] => 119
    [related_product] => 
    [super_attribute] => Array
        (
            [525] => 99
        )

    [qty] => 2
)

Have a look on product parameter. It does exist. So obviously, it is not at all a bug.

If you so sure that, this is the condition that fails here, then it means, it does not return a product id. Magento uses a hidden field to store the product id value in the form. In wishlist, magento uses the same form that is used for product view page. So the template that holds the form resides here

app\design\frontend\<package>\<theme>\template\catalog\product\view.phtml

So an error occurs here is rare. However you need to dig more using this information. Basically you need to find, why product id is not setting in the form.

So check the form that is generating while you do edit from wishlist. Check whether product id is setting correctly there.

  • That makes complete sense now you have said it!. The hidden form fields were outside the form itself! Thanks very much – Tom Burman Sep 29 '14 at 15:08
  • Happy to help you – Rajeev K Tomy Sep 29 '14 at 15:26

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.