{strip} {$_errors = []} {if !empty($error_step_id) && $error_step_id === "shipping"}{$_errors = $errors}{/if} {$_error_text = null} {$_is_fast_render = false} {if !empty($_errors)} {foreach $_errors as $_error} {if !empty($_error["fast_render"])} {$_is_fast_render = true} {break} {/if} {/foreach} {/if} {$_types_sort = ["todoor", "pickup", "post"]} {$_is_default_mode = false} {$_is_minimal_mode = true} {if $config.order.show_pickuppoint_map === shopCheckoutConfig::PICKUPPOINT_MAP_TYPE_ALWAYS} {$_is_default_mode = true} {$_is_minimal_mode = false} {elseif $config.order.show_pickuppoint_map === shopCheckoutConfig::PICKUPPOINT_MAP_TYPE_EXCEPT_GADGETS} {$_is_default_mode = true} {$_is_minimal_mode = false} {/if} {$_map_display = "none"} {if !empty($_is_default_mode) && !empty($shipping.selected_type_id) && $shipping.selected_type_id == "pickup"} {if $config.order.show_pickuppoint_map === shopCheckoutConfig::PICKUPPOINT_MAP_TYPE_ALWAYS} {$_map_display = "always"} {elseif $config.order.show_pickuppoint_map === shopCheckoutConfig::PICKUPPOINT_MAP_TYPE_EXCEPT_GADGETS} {$_map_display = "desktop"} {/if} {/if} {$_variant_first = null} {$_variants_count = 0} {$_hide_shipping = !empty($shipping.disabled) || (empty($shipping.types) && empty($_errors))}
{* BODY *}
{if !empty($shipping.possible_addresses)} {* VARIANTS *} {/if} {if empty($shipping.disabled)} {if !empty($shipping.types)} {if !empty($_is_default_mode)} {$_active_type = null} {* TYPES *} {if !empty($_active_type)} {$_active_variant = null} {if !empty($shipping.selected_type_id) && !empty($_active_type.variants[$shipping.selected_variant_id])} {$_active_variant = $_active_type.variants[$shipping.selected_variant_id]} {/if} {* VARIANTS *} {else} {if !empty($_active_variant)} {$_error_text = "[`There are no shipping options available for specified location.`]
[`Please check values in location fields or contact us.`]"} {/if} {/if} {elseif !empty($_is_minimal_mode)} {$_active_type = null} {$_active_variant = null} {$_variants = []} {foreach $_types_sort as $_type_id} {if empty($shipping.types[$_type_id])}{continue}{/if} {$_type = $shipping.types[$_type_id]} {$_is_active_type = !empty($_type.is_selected)} {if !empty($_is_active_type)}{$_active_type = $_type}{/if} {foreach $_type.variants as $_variant} {if !empty($_is_active_type) && !empty($shipping.selected_variant_id) && $shipping.selected_variant_id === $_variant.variant_id} {$_active_variant = $_variant} {/if} {$_variants[] = $_variant} {/foreach} {/foreach} {* VARIANTS *} {/if} {elseif empty($_is_fast_render)} {$_error_text = "[`There are no shipping options available for specified location.`]
[`Please check values in location fields or contact us.`]"} {/if} {if !empty($_error_text)} {/if} {* @event checkout_render_shipping *} {foreach $event_hook.shipping as $_} {/foreach} {/if}
{$_map = [ "display" => $_map_display, "adapter" => null, "api_uri" => null ]} {if !empty($shipping.map.adapter)} {$_map["adapter"] = $shipping.map.adapter} {if $shipping.map.adapter === "yandex"} {$_api_uri = "//api-maps.yandex.ru/2.1/?lang=ru_RU&load=Geolink,Map,Placemark,Clusterer,Collection,geoObject.addon.balloon,control.FullscreenControl,control.GeolocationControl,control.SearchControl,control.ZoomControl"} {if !empty($shipping.map.api_key)} {$_api_uri = "`$_api_uri`&apikey=`$shipping.map.api_key`"} {/if} {$_map["api_uri"] = $_api_uri} {/if} {if $shipping.map.adapter === "google"} {$_api_uri = "//maps.googleapis.com/maps/api/js"} {if !empty($shipping.map.api_key)} {$_api_uri = "`$_api_uri`?key=`$shipping.map.api_key`"} {/if} {$_map["api_uri"] = $_api_uri} {/if} {/if}
{/strip}