| | #1 | |
| Happy Days War Room Member Join Date: 2007 Location: Melbourne, Australia.
Posts: 408
Thanks: 58
Thanked 105 Times in 66 Posts
|
Hey guys, Basically I've got a vertical nav menu in a magento ecommerce site. The code below is displaying the vertical nav menu the sub-categories on the home page, but they're not hyperlinked (yet). PHP Code: it'll hyperlink the categories. Here's the "instructions" that were given...
Code: #a href="<?php echo ()?>"> <?php echo ()?></a# OK, seems as though the Warrior Forum wont allow me to show you the code... So if you could kindly check this site out, all the code is there. Magento Custom Category Listing Block | Devin R. Olsen Web Developer There's a youtuibe video there as well, but mentions nothing of the hyperlinking code. Now, Im not sure if this is enough info, but Im pretty sure a php expert could easily pick this up and whip their magic to give some much needed advice? Any assistance would be greatly appreciated, Thanks a bunch in advance, - aj | |
| | ||
| |
| | #2 |
| Article Publisher War Room Member Join Date: 2009 Location: Out West!
Posts: 140
Thanks: 9
Thanked 18 Times in 18 Posts
|
I don't use Magento, but I believe you're looking for something like this: Now, for every occurrence of echo $category->getName(); use the code below: ?> <a href="<?php echo $category->getUrl()?>"> <?php echo $category->getName()?> </a> <?php For every occurrence of echo $subCategory->getName(); use this code: ?> <a href="<?php echo $subCategory->getUrl()?>"> <?php echo $subCategory->getName()?> </a> <?php Note: The author uses only the echo $category->getName(); to reference both the top and sub categories. That may be an oversight. Give that a try. |
|
--= -Spazzle- =--
| |
| |
| The Following User Says Thank You to Havenhood For This Useful Post: |
| | #3 |
| Happy Days War Room Member Join Date: 2007 Location: Melbourne, Australia.
Posts: 408
Thanks: 58
Thanked 105 Times in 66 Posts
|
Ray, You're a legend! Your solutions works ... but now magento is spitting out errors when clicking on the hyperlinks. Just wondering if this is the correct method? PHP Code: or have I inserted them wrong? Thank you so much for your help mate, |
| | |
| |
| | #4 |
| Happy Days War Room Member Join Date: 2007 Location: Melbourne, Australia.
Posts: 408
Thanks: 58
Thanked 105 Times in 66 Posts
|
Disregard Ray .... It was a magento issue. Thanks again for your assistance mate. Legend. - aj |
| | |
| |
|
| Bookmarks |
| Tags |
| experts, magento, php |
| |