• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

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

Add custom js using extension

Modules
2
4
345
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 5 Nov 2020, 13:47

    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 6 Nov 2020, 15:04

      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 6 Nov 2020, 16:23 Reply Quote 0
      • D
        Dmitry @devansh-webkul last edited by 6 Nov 2020, 16:23

        @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 9 Nov 2020, 05:57

          @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
          3 out of 4
          • First post
            3/4
            Last post