Announcement

Collapse
No announcement yet.

Why Does This Link Not Work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Why Does This Link Not Work

    When the below is added to a custom product field (a link to a pdf file) when the cursor hovers over the button it indicates that it is pointing to the pdf file. However, when clicked it adds the product to the basket. Any help would be appreciated.

    <a href="/Label-PDF/sandpurge.pdf" target="_blank"><button class="c-button u-bg-blue u-color-white u-text-bold u-text-uppercase" "type="button">View Label Info</button> </a>

    #2
    Hey Greggc:
    What is the url?
    James Byrne, (USMC Vet.)
    After Dark Grafx
    "We Work After Dark So You Don't Have To!"
    E-Commerce - Design - Hosting - Printing
    Miva Standard Partner. Get up and running fast!
    http://www.afterdarkgrafx.com :: sales [ at ] afterdarkgrafx.com

    Comment


      #3
      Originally posted by afterdark View Post
      Hey Greggc:
      What is the url?
      https://www.horseandkennel.com/first...sandpurge.html

      Comment


        #4
        Hey Greggc:

        The link is within the FORM action - when selecting the PDF link, it adds the product to the cart. The custom field needs to be outside of this form.

        Do you know code? you would need to change the link to:

        Untitled 9.jpg

        OR you can make me an admin and I can do this for you call to discuss now if you like (619)702-7377 - James
        James Byrne, (USMC Vet.)
        After Dark Grafx
        "We Work After Dark So You Don't Have To!"
        E-Commerce - Design - Hosting - Printing
        Miva Standard Partner. Get up and running fast!
        http://www.afterdarkgrafx.com :: sales [ at ] afterdarkgrafx.com

        Comment


          #5
          Greggc:
          Good talk. Basically there is some logic on that custom field that says "if the field contains youtube.." to make this field a button and pop open a modal, "if the field contains X..." to make it a button. Otherwise, it is creating a text link and INCLUDING the link within the ADD to cart form. This could be edited in the USER INTERFACE --> PROD template but you should have developer look at it. Good luck.
          James Byrne, (USMC Vet.)
          After Dark Grafx
          "We Work After Dark So You Don't Have To!"
          E-Commerce - Design - Hosting - Printing
          Miva Standard Partner. Get up and running fast!
          http://www.afterdarkgrafx.com :: sales [ at ] afterdarkgrafx.com

          Comment


            #6
            Changed the syntax on the button to <a href="/Label-PDF/sandpurge.pdf" target="_blank"><button type="button" style="font: bold 14px Arial;">View Label Info </button></a> All is fine now.

            Comment


              #7
              greggc I would reccomend not using the button tag at all and style the anchor (a) tag with css to look like a button.

              The button tag nested inside the anchor tag is not valid html.

              You can do it using a class or inline style like you currently have it.

              HTML:
              Code:
              <a href="/Label-PDF/sandpurge.pdf" target="_blank" style="background-color:#3300ff;color:white;font:14pt Arial, Helvetica, sans-serif, bold;-webkit-appearance: button;-moz-appearance: button;appearance: button;letter-spacing: 0.05em;padding: 1px 6px;border: 2px solid black;">View Label Info</a>
              
              OR
              
              <a href="/Label-PDF/sandpurge.pdf" target="_blank" class="view-label-button">View Label Info</a>
              CSS:
              Code:
              .view-label-button {
                  background-color: #3300ff;
                  color: white;
                  font: 14pt Arial, Helvetica, sans-serif, bold;
                  -webkit-appearance: button;
                  -moz-appearance: button;
                  appearance: button;
                  letter-spacing: 0.05em;
                  padding: 1px 6px;
                  border: 2px solid black;
              }
              The CSS is based off your site's button CSS styling.
              Last edited by SidFeyDesigns; 11-03-22, 01:14 PM.
              Nick Harkins
              www.loveisarose.com
              *Web Developer
              *Miva
              *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

              Comment


                #8
                Originally posted by SidFeyDesigns View Post
                greggc I would reccomend not using the button tag at all and style the anchor (a) tag with css to look like a button.

                The button tag nested inside the anchor tag is not valid html.

                You can do it using a class or inline style like you currently have it.

                HTML:
                Code:
                <a href="/Label-PDF/sandpurge.pdf" target="_blank" style="background-color:#3300ff;color:white;font:14pt Arial, Helvetica, sans-serif, bold;-webkit-appearance: button;-moz-appearance: button;appearance: button;letter-spacing: 0.05em;padding: 1px 6px;border: 2px solid black;">View Label Info</a>
                
                OR
                
                <a href="/Label-PDF/sandpurge.pdf" target="_blank" class="view-label-button">View Label Info</a>
                CSS:
                Code:
                .view-label-button {
                background-color: #3300ff;
                color: white;
                font: 14pt Arial, Helvetica, sans-serif, bold;
                -webkit-appearance: button;
                -moz-appearance: button;
                appearance: button;
                letter-spacing: 0.05em;
                padding: 1px 6px;
                border: 2px solid black;
                }
                The CSS is based off your site's button CSS styling.
                Thank you. The css option was the way to go.

                Comment

                Working...
                X