SELECT
cscart_shippings.shipping_id,
cscart_shipping_descriptions.shipping,
cscart_shipping_descriptions.delivery_time,
cscart_shipping_descriptions.description,
cscart_shippings.rate_calculation,
cscart_shippings.service_params,
cscart_shippings.destination,
cscart_shippings.min_weight,
cscart_shippings.max_weight,
cscart_shippings.service_id,
cscart_shippings.free_shipping,
cscart_shipping_services.module,
cscart_shipping_services.code as service_code,
cscart_shippings.is_address_required
FROM
cscart_shippings
LEFT JOIN cscart_shipping_descriptions ON cscart_shippings.shipping_id = cscart_shipping_descriptions.shipping_id
LEFT JOIN cscart_shipping_services ON cscart_shipping_services.service_id = cscart_shippings.service_id
LEFT JOIN cscart_storefronts_shippings AS storefronts_shippings ON storefronts_shippings.shipping_id = cscart_shippings.shipping_id
WHERE
cscart_shippings.status = 'A'
AND cscart_shippings.shipping_id IN ('')
AND (
cscart_shippings.min_weight <= 0.001
AND (
cscart_shippings.max_weight >= 0.001
OR cscart_shippings.max_weight = 0.00
)
)
AND cscart_shipping_descriptions.lang_code = 'en'
AND (
cscart_shippings.usergroup_ids = ''
OR FIND_IN_SET(
0, cscart_shippings.usergroup_ids
)
OR FIND_IN_SET(
1, cscart_shippings.usergroup_ids
)
)
AND (
storefronts_shippings.storefront_id = 1
OR storefronts_shippings.storefront_id IS NULL
)
ORDER BY
cscart_shippings.position