<script>
 const orderId = '#tmp_orpo-14083-133';
 const product_images = {
  3175006:{type:'text', content: '#tmp_headline1-70489'},
  3175009:{type:'text', content: '#headline-65181'}
 };
 $(orderId+' > div').on('change', function(){
  const selectedProduct = $('[name="purchase[product_id]"]:checked').val();
  $('#upsell_banner').remove();
  if(product_images[selectedProduct].type == 'text'){
   $(orderId+" > div > div:nth-child("+(Object.keys(product_images).findIndex((num) => num == selectedProduct)+2)+")").append('<div id="upsell_banner" style="display:inline-block;padding:5px;">'+$(product_images[selectedProduct].content).get(0).outerHTML+'</div>');
   $('#upsell_banner > div').show()
  }
 });
</script>
<script>
 var attrs = { };
 var attrs2 = { };
 $.each($('[data-title="add_bump_offer"] > a')[0].attributes, function(idx, attr) {
  attrs[attr.nodeName] = attr.nodeValue;
 });
 $('[data-title="add_bump_offer"] > a').replaceWith(function () {
  return $("<div />", attrs).append($(this).contents());
 });
 $.each($('[data-title="add_bump_offer_remove"] > a')[0].attributes, function(idx, attr) {
  attrs2[attr.nodeName] = attr.nodeValue;
 });
 $('[data-title="add_bump_offer_remove"] > a').replaceWith(function () {
  return $("<div />", attrs2).append($(this).contents());
 });
 const int_shipping_product = '3852777';
 const banned_products_bump = [];
 $('[name="purchase[product_id]"]').on('change', function(){
  checkShipping();
 });
 $(function(){
  checkShipping();
 });
 $('[name="shipping_country"]').on('change',function(){
  checkShipping();
 });
  $('[name="country"]').on('change',function(){
  checkShipping();
 });
 function checkShipping(){
 const selectedProduct = $('[name="purchase[product_id]"]:checked').val();
  if(banned_products_bump.includes(selectedProduct)){
   $('[data-title="not-int"]').hide();
   $('[data-title="int"]').hide();
   return;
  }else{
   $('[data-title="not-int"]').show();
  }
  const country = $('[name="shipping_country"]').find('option:selected').val() || $('[name="country"]').find('option:selected').val();
  if(country == 'US' || country == ''){
   $('[data-title="not-int"]').show();
   $('[data-title="int"]').hide();
  $('[data-title="add_bump_offer"]').hide();
   $('[data-title="add_bump_offer_remove"]').hide();
   $('input[type="checkbox"][value="'+int_shipping_product+'"]').prop('checked', false);
   cfpeRebuildOrderSummary();
  }else{
   $('[data-title="not-int"]').hide();
   $('[data-title="int"]').show();
   $('[data-title="add_bump_offer"]').show();
  }
 }
 $('[data-title="add_bump_offer"]').on('click', function(){
  $('input[type="checkbox"][value="'+int_shipping_product+'"]').prop('checked', true);
  cfpeRebuildOrderSummary();
  $('[data-title="add_bump_offer_remove"]').show();
  $(this).hide();
 });
 $('[data-title="add_bump_offer_remove"]').on('click', function(){
  $('input[type="checkbox"][value="'+int_shipping_product+'"]').prop('checked', false);
  cfpeRebuildOrderSummary();
  $('[data-title="add_bump_offer"]').show();
  $(this).hide();
 });
</script>
<!-- © 2020 CF Pro Tools | DWD BUMP -->
<script src="https://cdn.cfprotools.com/55503724-8e67-405f-b83c-276f63593d1c.js" name="DWD BUMP" defer="defer"></script>