[Resolved] How Do I enter Java script cart coding info into my nav menu bars?

Home Forums Support [Resolved] How Do I enter Java script cart coding info into my nav menu bars?

Home Forums Support How Do I enter Java script cart coding info into my nav menu bars?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #262883
    Jason

    I was able to use the custom link in menus to add the actual cart image with <i class=”fa fa-shopping-cart” aria-hidden=”true”></i>

    But I would like to add the below cart info to display on my site when people add actual items to the cart, the amounts update in real time to the amount. How do i add the below script to the nav menu bar?

    I changed my actual cart numbers to all 000000,

    #263006
    Tom
    Lead Developer
    Lead Developer

    You wouldn’t add scripts into your menu items, you would want to add it to the wp_footer hook in GP Hooks.

    #263150
    Jason

    then how do I point it back to my menu nav bar?

    #263192
    Tom
    Lead Developer
    Lead Developer

    That’s up to whatever is in those javascript files.

    You might want to try a plugin: https://generatepress.com/forums/topic/multiple-static-frontpage-selected-posts-on-frontpage/#post-157558

    #263205
    Jason

    How does puting the code in the footer get it on the nav bar? that doesn’t make any sense at all.

    #263206
    Tom
    Lead Developer
    Lead Developer

    That’s not how javascript works. The code itself targets the elements it needs to change – you can place it wherever you like and it won’t make a difference. The footer is just best practice when it comes to JS.

    #263207
    Jason

    ok thanks,

    #263242
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.