0

I read this Remove from wishlist URL? but I have a problem with.

I'm trying to find $removeID in this link: xx.com/wishlist/index/remove/item/$removeID/

Because wishlist remove url almost same. Only difference is $removeID

  • I'm not sure what you're trying to accomplish. Are you looking for the numeric ID in an existing URL? – Sander Mangel Feb 28 '14 at 20:55
  • Yes, I'm trying to find numeric ID in wishlist remove link. – Ibrahim Mumcu Mar 3 '14 at 8:14
  • I've posted some code in an answer – Sander Mangel Mar 3 '14 at 12:31
  • did you manage to solve your issue? – Sander Mangel Mar 6 '14 at 12:24
1

In case you're trying to find the ID from a string that holds the URL use a preg_match

$url = 'xx.com/wishlist/index/remove/item/5/';
preg_match('/item\/([0-9]+)/', $url, $matches);
var_dump($matches); // just will hold a multidimensional array with your ID

If you're trying to get the ID from a url you can use

$id = Mage::app()->getRequest()->getParam('item');
var_dump($id); // this will be the id
|improve this answer|||||
  • Actually, sorry. I can't tell very well. I'm trying to find remove link for remove product from wishlist. – Ibrahim Mumcu Mar 10 '14 at 14:53

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.