App reviews, troubleshooting, and recommendations
Hi evryone, I develop new app, and trying to add two shipping method on checkout page(standard and fast), but when I tring to push two methods for /admin/api/2024-04/carrier_services.json I got an error: body: {source: '{"errors":{"base":["Standard is already configured"]}}} . Add my code below:
export const action = async ({ request }) => {
try {
const { admin, session } = await authenticate.admin(request);
const carrier_service_courier = new admin.rest.resources.CarrierService({ session: session });
carrier_service_courier.name = "Standard";
carrier_service_courier.callback_url = "https://mystore/carrier";
carrier_service_courier.active = true;
await carrier_service_courier.save();
const carrier_service = new admin.rest.resources.CarrierService({ session: session });
carrier_service.name = "Fast";
carrier_service.callback_url = "https://mystore/carrierFast";
carrier_service.active = true;
await carrier_service.save();
return json({status: 'success'});
} catch (error) {
console.error('Error adding carrier services:', error);
return json({ error: 'Failed to add carrier services' }, 500);
}
};
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024