Why do my sub-menu icons not show in OpenCart during import from Wordpress?

My wordpress site is:
http://demo.missionfamily.org/content

My opencart site is:
http://demo.missionfamily.org

I am using the following script and the file_get_content method to import the wordpress sub-menu into my Opencart theme:
<?php
require($_SERVER['DOCUMENT_ROOT'].'/content/wp-load.php');
wp_nav_menu( array( 'menu' => 'New Home Menu' ) );
?>

Everythign works just fine and I am able to use Wordpress' "appearance > menu" to create my sub-menus and the menu gets updated simultaneously on both my wordpress and opencart pages.

There is only one problem.
If you open this wordpress page: http://demo.missionfamily.org/content
Then hover over the top menu item "NEWS & BLOG" you will see a dropdown menu with icons on the left side (which I choose in wordpress)

After that open the opencart page: http://demo.missionfamily.org
and hover over the same item, the sub-menu is the same but no icons.

What am I doing wrong and where? Please guide me. This is driving me nuts.

thanks in advance
badwolfffAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

F PCommented:
In your wordpress theme there's probably an output like what I see with a span tag, or conditional if statement which checks to see if it's set, and it's not there on the opencart theme.

<li id="menu-item-2339" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2339">
    <a href="http://demo.missionfamily.org/content/news-e-blog/news-blog/">Anziani</a>
</li>

Open in new window


vs with the icon....

<li id="menu-item-2339" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2339 menu-item-icon">
    <a href="http://demo.missionfamily.org/content/news-e-blog/news-blog/">
        <span class="cmsms-icon-wheelchair">Anziani</span>
    </a>	
</li>

Open in new window


So go change your theme to include that span around the content if it's existing.
0
badwolfffAuthor Commented:
Hi,

I am sending you some files which I think might help you in understanding what is going on.

First the wordpress file:
header.php

Then the php file I created in the wordpress theme folder which I am using to import and graft the wordpress menu into opencart:
customsubnav.php

Then the php file in the opencart root folder which imports the wordpress menu:
wp-menu.php
You can see this working here: http://demo.missionfamily.org/wp-menu.php

Does any of it makes any more sense now?

thanks
0
F PCommented:
Sorry, I just saw this. I'll take a look shortly.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

F PCommented:
I need to see your $nav_args prior to the invocation of the wp_nav_menu() function. Please before every single call to it, do this:

echo '<pre>' . print_r($nav_args) . '</pre>';

Open in new window


or to make it appear in comments only...

echo '<!-- ' . print_r($nav_args) . ' -->';

Open in new window


and if you do that I won't have to see what the wp_nav_bar function looks like.
0
badwolfffAuthor Commented:
Hi,

Thanks for the message.

I know you asked me to put one or the other, but just for testing I put in both of them like this in the customsubnav.php (placed inside the wordpress theme folder):

<?php
require($_SERVER['DOCUMENT_ROOT'].'/content/wp-load.php'); 
echo '<!-- ' . print_r($nav_args) . ' -->';
echo '<pre>' . print_r($nav_args) . '</pre>';
wp_nav_menu( array( 'menu' => 'New Home Menu' ) );
?>

Open in new window


You can see output on http://demo.missionfamily.org

thanks
0
badwolfffAuthor Commented:
I had an idea and solved it myself using another technique. I set the icon's class in wordpress menu apart from setting the icon and then in OC I used jQuery to move the class to child <a> tag:

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Jquery/Q_28682855.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
F PCommented:
OK great! I was just going to suggest duplicating the parameters passed to the function, but the other option would've been to pull it into a variable once and echo it twice. It would've been a little easier. I'm glad you got it fixed!
0
badwolfffAuthor Commented:
I solved it myself
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.