1"use strict";(self.webpackChunkcoreshop_docs=self.webpackChunkcoreshop_docs||[]).push([[1227],{53024:(e,i,r)=>{r.r(i),r.d(i,{assets:()=>s,contentTitle:()=>c,default:()=>h,frontMatter:()=>a,metadata:()=>n,toc:()=>l});const n=JSON.parse('{"id":"CoreShop/Development/Shipping/Carrier/Price_Calculation","title":"Carrier Price Calculation","description":"In CoreShop, the calculation of shipping prices for various carriers involves multiple methods. These methods are","source":"@site/versioned_docs/version-4.0/01_CoreShop/03_Development/07_Shipping/01_Carrier/03_Price_Calculation.md","sourceDirName":"01_CoreShop/03_Development/07_Shipping/01_Carrier","slug":"/CoreShop/Development/Shipping/Carrier/Price_Calculation","permalink":"/4.0/CoreShop/Development/Shipping/Carrier/Price_Calculation","draft":false,"unlisted":false,"tags":[],"version":"4.0","sidebarPosition":3,"frontMatter":{},"sidebar":"defaultSidebar","previous":{"title":"Carrier Discovery","permalink":"/4.0/CoreShop/Development/Shipping/Carrier/Carrier_Discovery"},"next":{"title":"Shipping Rules","permalink":"/4.0/CoreShop/Development/Shipping/Shipping_Rules/"}}');var t=r(74848),o=r(28453);const a={},c="Carrier Price Calculation",s={},l=[{value:"Calculator Implementation",id:"calculator-implementation",level:2},{value:"Default Implementation",id:"default-implementation",level:2}];function p(e){const i={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.header,{children:(0,t.jsx)(i.h1,{id:"carrier-price-calculation",children:"Carrier Price Calculation"})}),"\n",(0,t.jsx)(i.p,{children:"In CoreShop, the calculation of shipping prices for various carriers involves multiple methods. These methods are\ncrucial for determining the appropriate shipping cost for a carrier based on the specifics of a given cart."}),"\n",(0,t.jsx)(i.h2,{id:"calculator-implementation",children:"Calculator Implementation"}),"\n",(0,t.jsxs)(i.p,{children:["To calculate shipping prices, a Calculator must implement the\ninterface ",(0,t.jsx)(i.code,{children:"CoreShop\\Component\\Shipping\\Calculator\\CarrierPriceCalculatorInterface"}),". This interface defines the necessary\nfunctionality for calculating shipping costs."]}),"\n",(0,t.jsxs)(i.p,{children:["Calculators should be registered in the container with the tag ",(0,t.jsx)(i.code,{children:"coreshop.shipping.price_calculator"}),", and should include\na ",(0,t.jsx)(i.code,{children:"type"})," attribute and a ",(0,t.jsx)(i.code,{children:"priority"}),". This registration process ensures that CoreShop recognizes and utilizes the\ncalculator correctly during the shipping price calculation process."]}),"\n",(0,t.jsx)(i.h2,{id:"default-implementation",children:"Default Implementation"}),"\n",(0,t.jsxs)(i.p,{children:["The default implementation for carrier price calculation in CoreShop is based\non ",(0,t.jsx)(i.a,{href:"/4.0/CoreShop/Development/Shipping/Shipping_Rules/",children:"Shipping Rules"}),". This method takes into account various rules defined for shipping,\nwhich can include factors like the weight of the cart, the destination, and other relevant criteria. By using these\nrules, CoreShop can accurately calculate the shipping price for different carriers, ensuring a fair and consistent\napproach to shipping costs."]})]})}function h(e={}){const{wrapper:i}={...(0,o.R)(),...e.components};return i?(0,t.jsx)(i,{...e,children:(0,t.jsx)(p,{...e})}):p(e)}},28453:(e,i,r)=>{r.d(i,{R:()=>a,x:()=>c});var n=r(96540);const t={},o=n.createContext(t);function a(e){const i=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function c(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),n.createElement(o.Provider,{value:i},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.