Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Add custom js using extension

    Modules
    2
    4
    312
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      Dmitry last edited by

      Hi!

      How can I add specific javascript code to storefront using extension logic? It should appear on all pages. For example, add it in footer or header.

      I understand that there is already such ability in Bagisto admin panel (Configure -> Content). But we need add javascript code that depends on Extension Settings. For example, user fill in his phone number in your Bagisto extension (we already did settings page), and then we should add javascript which depends on this number.

      This extension in general looks like Google Analytics.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • devansh-webkul
        devansh-webkul last edited by

        Hi @Dmitry,

        As per your query, you are trying some real-time js on the basis of phone numbers. This can only be possible from code.

        D 1 Reply Last reply Reply Quote 0
        • D
          Dmitry @devansh-webkul last edited by

          @devansh-webkul so there is no way to do it from extension, and we should say to user: "hey, you should change your code manually..". Right?

          1 Reply Last reply Reply Quote 0
          • devansh-webkul
            devansh-webkul last edited by

            @Dmitry

            That depends on development, as per your requirement can simply save mobile number in settings and fetch in the blade file.

            But the point is you need to go to code as well.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post