1133.style-rtl.css
1 month ago
1133.style.css
1 month ago
1226.style-rtl.css
1 month ago
1226.style.css
1 month ago
1339.js
1 month ago
1339.style-rtl.css
1 month ago
1339.style.css
1 month ago
1438.style-rtl.css
1 month ago
1438.style.css
1 month ago
1494.style-rtl.css
1 month ago
1494.style.css
1 month ago
1497.js
1 month ago
2152.style-rtl.css
1 month ago
2152.style.css
1 month ago
225.js
1 month ago
2499.js
1 month ago
266.js
4 months ago
266.js.LICENSE.txt
4 months ago
2684.js
1 month ago
2981.style-rtl.css
1 month ago
2981.style.css
1 month ago
2985.style-rtl.css
1 month ago
2985.style.css
1 month ago
3132.js
1 month ago
3132.style-rtl.css
1 month ago
3132.style.css
1 month ago
3151.style-rtl.css
1 month ago
3151.style.css
1 month ago
3182.js
1 month ago
3203.js
2 months ago
3203.js.LICENSE.txt
2 months ago
3256.style-rtl.css
1 month ago
3256.style.css
1 month ago
3404.style-rtl.css
1 month ago
3404.style.css
1 month ago
3501.style-rtl.css
1 month ago
3501.style.css
1 month ago
3534.style-rtl.css
1 month ago
3534.style.css
1 month ago
3663.js
1 month ago
3663.js.LICENSE.txt
1 month ago
3678.style-rtl.css
1 month ago
3678.style.css
1 month ago
4040.style-rtl.css
1 month ago
4040.style.css
1 month ago
4379.style-rtl.css
1 month ago
4379.style.css
1 month ago
4409.style-rtl.css
1 month ago
4409.style.css
1 month ago
5113.style-rtl.css
1 month ago
5113.style.css
1 month ago
5242.js
4 months ago
5242.js.LICENSE.txt
4 months ago
5359.style-rtl.css
1 month ago
5359.style.css
1 month ago
5845.style-rtl.css
1 month ago
5845.style.css
1 month ago
592.style-rtl.css
1 month ago
592.style.css
1 month ago
5941.style-rtl.css
1 month ago
5941.style.css
1 month ago
5945.js
4 months ago
5945.js.LICENSE.txt
1 year ago
6049.js
1 month ago
6071.style-rtl.css
1 month ago
6071.style.css
1 month ago
6115.style-rtl.css
1 month ago
6115.style.css
1 month ago
6349.js
1 month ago
6424.style-rtl.css
1 month ago
6424.style.css
1 month ago
6620.style-rtl.css
1 month ago
6620.style.css
1 month ago
7202.style-rtl.css
1 month ago
7202.style.css
1 month ago
7210.style-rtl.css
1 month ago
7210.style.css
1 month ago
7241.js
1 month ago
7241.style-rtl.css
1 month ago
7241.style.css
1 month ago
7247.js
1 month ago
7553.js
1 month ago
7734.js
4 months ago
7752.style-rtl.css
1 month ago
7752.style.css
1 month ago
7956.style-rtl.css
1 month ago
7956.style.css
1 month ago
8.style-rtl.css
1 month ago
8.style.css
1 month ago
8013.style-rtl.css
1 month ago
8013.style.css
1 month ago
8039.style-rtl.css
1 month ago
8039.style.css
1 month ago
8068.style-rtl.css
1 month ago
8068.style.css
1 month ago
823.style-rtl.css
1 month ago
823.style.css
1 month ago
8286.style-rtl.css
1 month ago
8286.style.css
1 month ago
860.js
1 month ago
8783.js
1 month ago
945.style-rtl.css
1 month ago
945.style.css
1 month ago
9680.style-rtl.css
1 month ago
9680.style.css
1 month ago
9942.js
1 month ago
9942.style-rtl.css
1 month ago
9942.style.css
1 month ago
abandoned-cart-recovery-recommendations.js
1 month ago
activity-panels-help.js
1 month ago
activity-panels-inbox.js
1 month ago
activity-panels-setup.js
1 month ago
analytics-report-categories.js
1 month ago
analytics-report-coupons.js
1 month ago
analytics-report-customers.js
1 month ago
analytics-report-downloads.js
1 month ago
analytics-report-orders.js
1 month ago
analytics-report-products.js
1 month ago
analytics-report-revenue.js
1 month ago
analytics-report-stock.js
1 month ago
analytics-report-taxes.js
1 month ago
analytics-report-variations.js
1 month ago
analytics-report.js
1 month ago
analytics-settings.js
1 month ago
core-profiler.js
1 month ago
customizable-dashboard.js
1 month ago
customize-store.js
1 month ago
customize-store.js.LICENSE.txt
7 months ago
dashboard-charts.js
1 month ago
dashboard.js
1 month ago
experimental-products-app-variation-view-main.js
1 month ago
homescreen.js
1 month ago
launch-store.js
1 month ago
launch-store.js.LICENSE.txt
4 months ago
leaderboards.js
1 month ago
marketplace.js
1 month ago
mobile-app-login.js
1 month ago
multichannel-marketing.js
1 month ago
settings-payments-bacs.js
1 month ago
settings-payments-cheque.js
1 month ago
settings-payments-cod.js
1 month ago
settings-payments-main.js
1 month ago
settings-payments-offline.js
1 month ago
settings-payments-woocommerce-payments.js
1 month ago
shipping-recommendations.js
1 month ago
store-alerts.js
1 month ago
store-performance.js
1 month ago
tax-recommendations.js
1 month ago
wcpay-payment-welcome-page.js
1 month ago
settings-payments-cod.js
1 lines
| 1 | "use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[3501],{15322:(e,t,o)=>{o.d(t,{W:()=>a});var s=o(56427),i=o(39793);const a=({size:e="medium"})=>(0,i.jsx)("div",{className:`woocommerce-field-placeholder woocommerce-field-placeholder--${e}`,children:(0,i.jsx)(s.Placeholder,{})})},19796:(e,t,o)=>{o.d(t,{w:()=>n});var s=o(56427),i=o(51609),a=o(39793);const n=({children:e})=>(0,a.jsx)(a.Fragment,{children:e});n.Layout=({children:e})=>((0,i.useEffect)(()=>{const e=document.getElementById("wpbody");e&&e.querySelector(".settings-layout")&&e.classList.add("has-settings-layout")},[]),(0,a.jsx)("div",{className:"settings-layout",children:e})),n.Section=({title:e,description:t,children:o,id:s})=>(0,a.jsxs)("div",{className:"settings-section",id:s,children:[(0,a.jsxs)("div",{className:"settings-section__details",children:[(0,a.jsx)("h2",{children:e}),(0,a.jsx)("p",{children:t})]}),(0,a.jsx)("div",{className:"settings-section__controls",children:o})]}),n.Actions=({children:e})=>(0,a.jsx)(s.Card,{className:"settings-card__wrapper ",children:(0,a.jsx)(s.CardBody,{className:"form__actions",children:e})}),n.Form=({children:e,onSubmit:t})=>(0,a.jsx)("form",{onSubmit:t,className:"settings-form",children:e})},50332:(e,t,o)=>{o.d(t,{C0:()=>a,lV:()=>l,mF:()=>n});var s=o(56427),i=o(39793);const a=({data:e,field:t,onChange:o})=>(0,i.jsx)(s.CheckboxControl,{label:t.label,help:t.description,checked:Boolean(t.getValue({item:e})),onChange:e=>o({[t.id]:e})}),n=({data:e,field:t,onChange:o})=>(0,i.jsx)(s.TextControl,{label:t.label,help:t.description,placeholder:t.placeholder,value:String(t.getValue({item:e})??""),onChange:e=>o({[t.id]:e})}),l=({data:e,field:t,onChange:o})=>(0,i.jsx)(s.TextareaControl,{label:t.label,help:t.description,value:String(t.getValue({item:e})??""),onChange:e=>o({[t.id]:e})})},24100:(e,t,o)=>{o.r(t),o.d(t,{SettingsPaymentsCod:()=>p,default:()=>g});var s=o(56427),i=o(98846),a=o(27723),n=o(47143),l=o(40314),r=o(86087),c=o(50860);function d(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}var m=o(19796),h=o(15322),u=o(50332),_=o(39793);const p=()=>{const{createSuccessNotice:e,createErrorNotice:t}=(0,n.useDispatch)("core/notices"),{codSettings:o,isLoading:p}=(0,n.useSelect)(e=>({codSettings:e(l.paymentGatewaysStore).getPaymentGateway("cod"),isLoading:!e(l.paymentGatewaysStore).hasFinishedResolution("getPaymentGateway",["cod"])}),[]),{updatePaymentGateway:g,invalidateResolutionForStoreSelector:b}=(0,n.useDispatch)(l.paymentGatewaysStore),{invalidateResolution:y,invalidateResolutionForStoreSelector:w}=(0,n.useDispatch)(l.paymentSettingsStore),[f,v]=(0,r.useState)({}),[x,j]=(0,r.useState)(!1),[S,C]=(0,r.useState)(!1);(0,r.useEffect)(()=>{o&&(v({enabled:o.enabled,title:o.settings.title.value,description:o.description,instructions:o.settings.instructions.value,enable_for_methods:Array.isArray(o.settings.enable_for_methods.value)?o.settings.enable_for_methods.value:[],enable_for_virtual:"yes"===o.settings.enable_for_virtual.value}),C(!1))},[o]);const A=(0,r.useMemo)(()=>{return o?.settings.enable_for_methods?.options?(e=o.settings.enable_for_methods.options,Object.entries(e).map(([e,t])=>({label:d(e),value:e,children:Object.entries(t).map(([e,t])=>({value:e,label:d(t)}))}))):[];var e},[o]),E=(0,r.useMemo)(()=>[{id:"enabled",label:(0,a.__)("Enable cash on delivery payments","woocommerce"),Edit:u.C0},{id:"title",label:(0,a.__)("Title","woocommerce"),description:(0,a.__)("Payment method name that the customer will see during checkout.","woocommerce"),placeholder:(0,a.__)("Cash on delivery payments","woocommerce"),Edit:u.mF},{id:"description",label:(0,a.__)("Description","woocommerce"),description:(0,a.__)("Payment method description that the customer will see during checkout.","woocommerce"),Edit:u.lV},{id:"instructions",label:(0,a.__)("Instructions","woocommerce"),description:(0,a.__)("Instructions that will be added to the thank you page and emails.","woocommerce"),Edit:u.lV},{id:"enable_for_methods",label:(0,a.__)("Enable for shipping methods","woocommerce"),description:(0,a.__)("Select shipping methods for which this payment method is enabled.","woocommerce"),Edit:({data:e,field:t,onChange:o})=>{const s=t.getValue({item:e});return(0,_.jsx)(i.TreeSelectControl,{label:t.label,help:t.description,options:A,value:Array.isArray(s)?s:[],onChange:e=>o({[t.id]:e}),selectAllLabel:!1})}},{id:"enable_for_virtual",label:(0,a.__)("Accept for virtual orders","woocommerce"),description:(0,a.__)("Accept cash on delivery if the order is virtual","woocommerce"),Edit:u.C0}],[A]);return(0,_.jsx)(m.w,{children:(0,_.jsx)(m.w.Layout,{children:(0,_.jsxs)(m.w.Form,{onSubmit:s=>{s.preventDefault(),(()=>{if(!o)return;j(!0);const s={title:String(f.title),instructions:String(f.instructions),enable_for_methods:Array.isArray(f.enable_for_methods)?f.enable_for_methods:[],enable_for_virtual:f.enable_for_virtual?"yes":"no"};g("cod",{enabled:Boolean(f.enabled),description:String(f.description),settings:s}).then(()=>{C(!1),b("getPaymentGateway"),e((0,a.__)("Settings updated successfully","woocommerce"))}).catch(()=>{t((0,a.__)("Failed to update settings","woocommerce"))}).finally(()=>{j(!1),y("getPaymentProviders",[]),w("getOfflinePaymentGateways")})})()},children:[(0,_.jsx)(m.w.Section,{title:(0,a.__)("Enable and customise","woocommerce"),description:(0,a.__)("Choose how you want to present cash on delivery payments to your customers during checkout.","woocommerce"),children:p?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(h.W,{size:"small"}),(0,_.jsx)(h.W,{size:"medium"}),(0,_.jsx)(h.W,{size:"large"}),(0,_.jsx)(h.W,{size:"large"}),(0,_.jsx)(h.W,{size:"medium"}),(0,_.jsx)(h.W,{size:"small"})]}):(0,_.jsx)(c.A,{data:f,fields:E,form:{layout:{type:"regular"},fields:["enabled","title","description","instructions","enable_for_methods","enable_for_virtual"]},onChange:e=>{v(t=>({...t,...e})),C(!0)}})}),(0,_.jsx)(m.w.Actions,{children:(0,_.jsx)(s.Button,{variant:"primary",type:"submit",isBusy:x,disabled:x||!S,children:(0,a.__)("Save changes","woocommerce")})})]})})})},g=p}}]); |