Search
 
SCRIPT & CODE EXAMPLE
 

CSS

adding script in vat for product order shopify

<script>
var selectCallback = function(variant, selector) {
  if (variant && variant.available) {
    // valid variant selected
    $('#add-to-cart').removeClass('disabled').removeAttr('disabled').val('Add to Cart'); // remove unavailable class from add-to-cart button, and re-enable button
    if (variant.compare_at_price == 0){
      $('.product-title .price').html(''+Shopify.formatMoney((variant.price*1.2), "{{shop.money_format}}")+' Excluding VAT');
    } else {
      $('.product-title .price').html('<span>'+Shopify.formatMoney((variant.price*1.2), "{{shop.money_format}}") + '</span> <del>' + Shopify.formatMoney(variant.compare_at_price, "{{shop.money_format}}") + ' Excluding VAT</del>');
    }
  } else {
    // variant doesn't exist
    $('#add-to-cart').addClass('disabled').attr('disabled', 'disabled').val('Sold Out'); // set add-to-cart button to unavailable class and disable button
    var message = variant ? "Sold Out" : "Unavailable";
    $('.product-title .price').text(message); // update price-field message
  }
};
Comment

PREVIOUS NEXT
Code Example
Css :: mount file share linux windows ubuntu 
Css :: css remive heading spacing 
Css :: css input auto-correct color 
Css :: browser renders before styles are applied 
Css :: css color properties 
Css :: less css file extension 
Css :: if navbar items not shown on responsive page 
Css :: remove line breaks css 
Css :: css animation-duration 
Css :: full meaning of css 
Css :: where to put media query 
Css :: blob without svg 
Css :: locale_translation_projects_alter 
Typescript :: add space between subplots matplotlib 
Typescript :: select elements id like jquery 
Typescript :: python get file contents as string 
Typescript :: yarn typescript 
Typescript :: flutter text button shape 
Typescript :: angular add httpclient 
Typescript :: show grants user 
Typescript :: featured products woocommerce shortcode 
Typescript :: typescript react input type 
Typescript :: styled components reset 
Typescript :: remove duplicate break line from string in typescript 
Typescript :: vetur change tsconfig location 
Typescript :: A Tree Diagram is a drawing with branches of all possible outcomes 
Typescript :: how to use typescript on createRoot 
Typescript :: headphone disconnects in ubuntu 
Typescript :: eslint typescript 
Typescript :: date time format typescript 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =