Adding "buy now" button on image

PamDigital
Excursionist
42 2 7

Hello,

I want to add "buy now" button on a image which is in product page.  This is my code;
There is a button on my image now, but its not working. What is wrong here?

<div class="bannersec" style="background-image: url({{section.settings.arkaplan |  img_url: 'master'}})">
   <div class="bannertext">
      <img src="{{section.settings.icongorsel |  img_url: 'master'}}" width="65">
      <h3>{{ section.settings.satinalbaslik }}</h3>
      <p>{{ section.settings.satinalaciklama_1 }}</p>
      <p>{{ section.settings.satinalaciklama_2 }}</p>
      <div id="product">
         {% form 'product', product, id: "form_buy", name: "form_buy" %}
         <div  class="selector-wrapper select form-group"  {% if product.variants.size == 1 and product.variants.first.title contains 'Default' %}style="display:none"{% endif %}>
         <select name="id" id="productSelect" class="form-control">
            {% for variant in product.variants %}
            {% if variant.available %}
            <option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} data-sku="{{ variant.sku }}" value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money_with_currency }}</option>
            {% else %}
            <option disabled="disabled">
               {{ variant.title }} - {{ 'products.product.sold_out' | t }}
            </option>
            {% endif %}
            {% endfor %}
         </select>
         {% if section.settings.show_variant_swatches != 'false' %}
         {% if product.available and product.variants.size > 1 %}
         {% for option in product.options %}
         {% include 'swatch' with option %}
         {% endfor %}
         {% endif %}
         {% else %}
         <style type="text/css">
            form#form_buy {
            margin: 0 auto;
            display: block;
            width: fit-content;
            }
            .selector-wrapper {
            margin: 0 auto;
            width: fit-content;
            display: block;
            }
            #productSelect {
            display: block;
            }
            .bannersec {
            margin: 40px 0px;
            }
         </style>
         {% endif %}
         <style>
            .bannersec {
            margin: 95px 0px;
            }
         </style>
      </div>
      <div class="selector-wrapper select form-group">
         {% if section.settings.product_quantity_enable %}
         <label class="control-label" for="Quantity">{{ 'products.product.quantity' | t }}:</label>
         <input type="text" name="quantity" value="1" size="2" id="Quantity" onkeyup="updatecartsticky(1)" class="form-control" />
         {% endif %}
         {% if section.settings.product_quantity_message %}
         <span id="variantQuantity" class="variant-quantity hidden"></span>
         {% endif %}      
         {% if product.description contains "[affiliate]" %}
         {% capture affiliate %} {{ product.description | split:'[affiliate]' | last | split :'[/affiliate]' | first }} {% endcapture %}
         <button class="button button-cart btn" type="button" onclick="window.open('{{ affiliate | split :'|' | last }}', '_blank')" id="button-cart-affiliate" data-loading-text="{{ 'products.product.loading' | t }}">
         {{ affiliate | split :'|' | first }}
         </button>
         {% else %}
         {% if template != 'product.pre-order' %}
         <button class="button button-cart btn" type="button" id="button-cart" data-loading-text="{{ 'products.product.loading' | t }}">
         {{ 'products.product.add_to_cart' | t }}
         </button>
         {% if section.settings.show_buy_now %}
         {{ form | payment_button }}
         {% endif %}
         {% include 'product-wishlist2' %}
         {% elsif template == 'product.pre-order' %}
         <button class="button button-cart btn" type="button" id="button-cart-buy" data-loading-text="{{ 'products.product.loading' | t }}">
         {{ 'products.product.pre_order' | t }}
         </button> 
         {% endif %}      
         {% endif %}
      </div>
      {% endform %}
      <!-- end-button -->
   </div>
</div>
<a href="{{ section.settings.urunlinki }}" class="bannersec__see-terms">{{ section.settings.satinalaltaciklama }}</a>
</div>
<div id='product-component-1611491615823'></div>

 

0 Likes