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

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

1 Answer 1

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
1
  • Actually, sorry. I can't tell very well. I'm trying to find remove link for remove product from wishlist. Commented Mar 10, 2014 at 14:53

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.