# fluent-cart/1.5.3/assets/orderbump.js

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.5.3. 2 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.5.3/code/assets/orderbump.js
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.5.3/raw/assets/orderbump.js
- Modified: 2026-07-09T14:48:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.5.3/code/assets/orderbump.js#L10-L20`.

```javascript
import{U as g}from"./chunks/Url.js?ver=1.5.3";import"./chunks/Str.js?ver=1.5.3";import"./chunks/Arr.js?ver=1.5.3";import"./chunks/vue-router.js?ver=1.5.3";import"./chunks/vue.esm-bundler.js?ver=1.5.3";document.addEventListener("DOMContentLoaded",function(){const u=document.querySelectorAll("[data-fct_order_bump]");u&&u.forEach(t=>{t.addEventListener("input",function(s){var o,p;s.preventDefault();let c=t.getAttribute("data-upgrade_to"),i=t.getAttribute("data-upgrade_form"),_=t.getAttribute("data-fct_bump_id");const d=s.target.checked;if(d||(i=t.getAttribute("data-upgrade_to"),c=t.getAttribute("data-upgrade_form")),(!c||!i)&&!_)return;(p=(o=window.fluent_cart_checkout_ui_service)==null?void 0:o.disableCheckoutButton)==null||p.call(o);let l=window.fluentcart_checkout_vars.ajaxurl+"?action=fluent_cart_checkout_routes&fc_checkout_action=apply_order_bump";const h=new URLSearchParams(window.location.search),a={};h.has("fct_cart_hash")&&(a.fct_cart_hash=h.get("fct_cart_hash")),a.upgrade_to=c,a.upgrade_form=i,a.is_upgraded=d?"yes":"no",a.bump_id=_;const f=g.appendQueryParams(l,a);fetch(f,{method:"POST",headers:{"X-WP-Nonce":window.fluentCartRestVars.rest.nonce,"Content-Type":"application/json"},credentials:"include"}).then(r=>{let e=r.json(),n=r.ok;return e.then(m=>({isOk:n,data:m}))}).then(r=>{var e;if(!r.isOk)throw new Error(r.data.message||"Something went wrong");if((e=r.data)!=null&&e.shipping_changed){window.location.reload();return}window.dispatchEvent(new Event("fluentCartNotifyCartDrawerItemChanged"))}).catch(r=>{var e,n;t.checked=!d,(n=(e=window.fluent_cart_checkout_ui_service)==null?void 0:e.enableCheckoutButton)==null||n.call(e)})})})});

```
