Cookies help us enhance your experience on our site by storing
information about your preferences and interactions. You can customize your
cookie settings by choosing which cookies to allow. Please note that disabling
certain cookies might impact the functionality and features of our services,
such as personalized content and suggestions.
Cookie Policy
These cookies are strictly necessary for the site to work and may not be disabled.
Cookie name
Description
Lifetime
Provider
_ce.clock_data
Store the difference in time from the server's time and the current browser.
1 day
Crazy Egg
_ce.clock_event
Prevent repeated requests to the Clock API.
1 day
Crazy Egg
_ce.irv
Store isReturning value during the session
Session
Crazy Egg
_ce.s
Track a recording visitor session unique ID, tracking host and start time
1 year
Crazy Egg
_hjSessionUser_2909345
Store a unique user identifier to track user sessions and interactions for analytics purposes.
1 year
HotJar
_hjSession_2909345
Store session data to identify and analyze individual user sessions.
1 day
HotJar
apt.uid
Store a unique user identifier for tracking and personalization.
1 year
Mageplaza
cebs
Store user preferences and settings.
Session
Mageplaza
cf_clearance
Store a token that indicates a user has passed a Cloudflare security challenge.
1 year
Cloudflare
crisp-client
The crisp-client/session cookie is used to identify and maintain a user session within the Crisp platform. It allows the live chat system to recognize returning users, maintain chat history, and ensure continuity in customer service interactions.
Session
Crisp
_ga
Store a unique client identifier (Client ID) for tracking user interactions on the
2 years
Google
_ga_7B0PZZW26Z
Store session state information for Google Analytics 4.
2 years
Google
_ga_JTRV42NV3L
Store session state information for Google Analytics 4.
2 years
Google
_ga_R3HWQ50MM4
Store a unique client identifier (Client ID) for tracking user interactions on the website.
2 years
Google
_gid
Store a unique client identifier (Client ID) for tracking user interactions on the website.
1 day
Google
_gat_UA-76130628-1
Throttle the request rate to Google Analytics servers.
1 day
Google
Advertising cookies
Advertising cookies deliver ads relevant to your interests, limit ad frequency, and measure ad effectiveness.
Advertising cookies deliver ads relevant to your interests, limit ad frequency, and measure ad effectiveness.
Cookie name
Description
Lifetime
Provider
_gcl_au
The cookie is used by Google to track and store conversions.
1 day
Google
__Secure-3PAPISID
This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising.
2 years
Google
HSID
This security cookie is used by Google to confirm visitor authenticity, prevent fraudulent use of login data and protect visitor data from unauthorized access.
2 years
Google
__Secure-1PSID
This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising.
2 years
Google
SID
This security cookie is used by Google to confirm visitor authenticity, prevent fraudulent use of login data and protect visitor data from unauthorized access.
2 years
Google
APISID
This cookie is used by Google to display personalized advertisements on Google sites, based on recent searches and previous interactions.
2 years
Google
__Secure-1PAPISID
This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising.
2 years
Google
__Secure-3PSID
This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising.
2 years
Google
SSID
This cookie is used by Google to display personalized advertisements on Google sites, based on recent searches and previous interactions.
2 years
Google
SAPISID
This cookie is used by Google to display personalized advertisements on Google sites, based on recent searches and previous interactions.
2 years
Google
__Secure-3PSIDTS
This cookie collects information about visitor's interactions with Google services and ads. It is used to measure advertising effectiveness and deliver personalised content based on interests. The cookie contains a unique identifier.
2 years
Google
__Secure-1PSIDTS
This cookie collects information about visitor's interactions with Google services and ads. It is used to measure advertising effectiveness and deliver personalised content based on interests. The cookie contains a unique identifier.
2 years
Google
SIDCC
This security cookie is used by Google to confirm visitor authenticity, prevent fraudulent use of login data, and protect visitor data from unauthorized access.
3 months
Google
__Secure-1PSIDCC
This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising.
1 year
Google
__Secure-3PSIDCC
This cookie is used for targeting purposes to build a profile of the website visitor's interests in order to show relevant and personalized Google advertising.
1 year
Google
1P_JAR
This cookie is a Google Analytics Cookie created by Google DoubleClick and used to show personalized advertisements (ads) based on previous visits to the website.
1 month
Google
NID
Show Google ads in Google services for signed-out users.
6 months
Google
Analytics cookies
Analytics cookies collect information and report website usage statistics without personally identifying individual visitors to Google.
Analytics cookies collect information and report website usage statistics without personally identifying individual visitors to Google.
Cookie name
Description
Lifetime
Provider
_dc_gtm
Manage and deploy marketing tags through Google Tag Manager.
1 year
Google
1P_JAR
Gather website statistics and track conversion rates for Google AdWords campaigns.
1 month
Google
AEC
1 month
Google
ar_debug
Debugging purposes related to augmented reality (AR) functionalities.
1 month
Doubleclick
IDE
The IDE cookie is used by Google DoubleClick to register and report the user's actions after viewing or clicking on one of the advertiser's ads with the purpose of measuring the effectiveness of an ad and to present targeted ads to the user.
1 year
Doubleclick
ad_storage
Enables storage, such as cookies (web) or device identifiers (apps), related to advertising.
1 year
Google
ad_user_data
Sets consent for sending user data to Google for online advertising purposes.
1 year
Google
ad_personalization
Sets consent for personalized advertising.
1 year
Google
analytics_storage
Enables storage, such as cookies (web) or device identifiers (apps), related to analytics, for example, visit duration.
How to Create Shipping Method in Magento 2 - Mageplaza
How to Create Shipping Method in Magento 2
Vinh Jacker|03-17-2025
E-commerce success is strongly dependent on customer convenience, and a seamless shipping experience is vital for any online store. Of course, Magento 2 is a rich eCommerce platform and it also supports few shipping methods in the checkout process. Magento 2 provides default shipping methods like Free Shipping, Flat Rates, Table Rates, UPS, and FedEx, among others.
However, as e-commerce grows, businesses often need custom solutions. Programmatic creating a custom shipping method that is suitable to your business requirements is essential. Real-time cost calculation during checkout will enhance user experience, and offering free shipping can boost sales.
There are several pieces of evidence proving this with data. According to 99firms, 61% of shoppers abandon transactions due to additional costs like shipping fees, and 46.5% of small to mid-sized businesses said that providing free shipping increases their profits.
Remember, an optimized shipping strategy brings benefits to both customers and profits. Let’s explore how to create custom shipping methods in Magento 2!
With the simple explanation, it is accessible to follow step-by-step and complete the creation of new shipping methods. All generated shipping methods are stored in Magento Admin Panel. Please go to Stores > Settings > Configuration > Sales > Delivery Methods to find and enable it on the storefront. But hold on, access the file /Model/Carries/Generatedshippingmethod.php in which you can set the specific shipping cost for each shipping method. Namely to create the shipping method, please keep tracking on the following steps.
How to create simple shipping method in Magento 2
Step 1: Declare a Shipping module
Create a module call: Simpleshipping located in app/code/Mageplaza/Simpleshipping
<?xml version="1.0"?><configxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"><default><carriers><simpleshipping><active>1</active><sallowspecific>0</sallowspecific><model>Mageplaza\Simpleshipping\Model\Carrier\Shipping</model><name>Mageplaza Sample Shipping Method</name><price>10.00</price><title>Mageplaza Sample Shipping Method</title><specificerrmsg>This shipping method is not available. To use this shipping method, please contact us.</specificerrmsg><handling_type>F</handling_type></simpleshipping></carriers></default></config>
The shipping method code should be child of default > carriers. And this code should be exactly same with $_code in app/code/Mageplaza/Simpleshipping/Model/Carrier/Shipping.php:13
Step 2: Create shipping model
Next, we need to create a model class for this shipping method in Magento 2
Create a Shipping.php at app/code/Mageplaza/Simpleshipping/Model/Carrier/Shipping.php
<?xml version="1.0"?><configxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"><system><sectionid="carriers"translate="label"type="text"sortOrder="320"showInDefault="1"showInWebsite="1"showInStore="1"><groupid="simpleshipping"translate="label"type="text"sortOrder="0"showInDefault="1"showInWebsite="1"showInStore="1"><label>Mageplaza Simple Shipping Method</label><fieldid="active"translate="label"type="select"sortOrder="1"showInDefault="1"showInWebsite="1"showInStore="0"canRestore="1"><label>Enabled</label><source_model>Magento\Config\Model\Config\Source\Yesno</source_model></field><fieldid="name"translate="label"type="text"sortOrder="3"showInDefault="1"showInWebsite="1"showInStore="1"canRestore="1"><label>Method Name</label></field><fieldid="price"translate="label"type="text"sortOrder="5"showInDefault="1"showInWebsite="1"showInStore="0"canRestore="1"><label>Price</label><validate>validate-number validate-zero-or-greater</validate></field><fieldid="handling_type"translate="label"type="select"sortOrder="7"showInDefault="1"showInWebsite="1"showInStore="0"canRestore="1"><label>Calculate Handling Fee</label><source_model>Magento\Shipping\Model\Source\HandlingType</source_model></field><fieldid="handling_fee"translate="label"type="text"sortOrder="8"showInDefault="1"showInWebsite="1"showInStore="0"><label>Handling Fee</label><validate>validate-number validate-zero-or-greater</validate></field><fieldid="sort_order"translate="label"type="text"sortOrder="100"showInDefault="1"showInWebsite="1"showInStore="0"><label>Sort Order</label></field><fieldid="title"translate="label"type="text"sortOrder="2"showInDefault="1"showInWebsite="1"showInStore="1"canRestore="1"><label>Title</label></field><fieldid="sallowspecific"translate="label"type="select"sortOrder="90"showInDefault="1"showInWebsite="1"showInStore="0"canRestore="1"><label>Ship to Applicable Countries</label><frontend_class>shipping-applicable-country</frontend_class><source_model>Magento\Shipping\Model\Config\Source\Allspecificcountries</source_model></field><fieldid="specificcountry"translate="label"type="multiselect"sortOrder="91"showInDefault="1"showInWebsite="1"showInStore="0"><label>Ship to Specific Countries</label><source_model>Magento\Directory\Model\Config\Source\Country</source_model><can_be_empty>1</can_be_empty></field><fieldid="showmethod"translate="label"type="select"sortOrder="92"showInDefault="1"showInWebsite="1"showInStore="0"><label>Show Method if Not Applicable</label><source_model>Magento\Config\Model\Config\Source\Yesno</source_model><frontend_class>shipping-skip-hide</frontend_class></field><fieldid="specificerrmsg"translate="label"type="textarea"sortOrder="80"showInDefault="1"showInWebsite="1"showInStore="1"canRestore="1"><label>Displayed Error Message</label></field></group></section></system></config>
Step 4: Enable module
This is the final step, you need to run the upgrade command to enable Simple Shipping method.
Mageplaza knows what your store needs to be flexible with your delivery options. That is why we highly recommend these extensions for you to start with:
Shipping methods can affect stores’ costs and customers’ purchase decisions due to the convenience, popularity, and required fees. That is why creating additional delivery methods is essential for all online merchants. This guide hopefully brings you useful instructions for your shipping method settings. Besides that, you may also be interested in Magento 2 Create Payment Methods to customize the payment methods as expected. Every question and comment are welcomed in the below section, or feel free to contact us for direct support.
Jacker is the Chief Technology Officer (CTO) at Mageplaza, bringing over 10 years of experience in Magento, Shopify, and other eCommerce platforms. With deep technical expertise, he has led numerous successful projects, optimizing and scaling online stores for global brands. Beyond his work in eCommerce development, he is passionate about running and swimming.
Discover a step-by-step framework for effective social media marketing. Learn how to optimize content, run ads, track KPIs, and future-proof your strategy across all major platforms.
Discover a step-by-step framework for effective social media marketing. Learn how to optimize content, run ads, track KPIs, and future-proof your strategy across all major platforms.
Discover a step-by-step framework for effective social media marketing. Learn how to optimize content, run ads, track KPIs, and future-proof your strategy across all major platforms.
Discover a step-by-step framework for effective social media marketing. Learn how to optimize content, run ads, track KPIs, and future-proof your strategy across all major platforms.