{block "delivery-pickup"}
   <div class="delivery-class" data-delivery-class="DPDPickup"
        data-DPDPickup-wrapper
        data-delivery-validity_check
        data-delivery-id-wrapper="{$object.id}"
        data-delivery-lang-wrapper="{$ctrl.active_language|default:'en'}"
        data-delivery-country-wrapper="{$ctrl.active_country|default:'CZ'}"
        data-delivery-supported-countries-wrapper="{json_encode(array_values($object->getSupportedCountries()))}"
        data-delivery-hidden-points-wrapper="{json_encode($object.custom_data.widget_options.hidden_points|default:[])}">
       {block "delivery-pickup-description"}
           {if $object.cart_description}
               {$object.cart_description nofilter}
           {else}
              <p>{t escape=false}Zásilky běžně doručujeme do&nbsp;druhého dne.{/t}</p>
           {/if}
       {/block}

      {$info=$object.DPDPickup_data}
      <input type="hidden" name="{$deliveryPrefix}[DPDPickup_data]" value="{$info|json_encode}" data-delivery-DPDPickup>
      <div data-reload="DPDPickup_{$object.id}" class="delivery-class-info">
          {if $info.id}
             <input type="hidden" name="delivery_DPDPickup_valid" value="1">
             <p><strong>{t}Zboží doručíme na pobočku{/t}:</strong> {$info.firm}</p>
             <p><strong>{t}Adresa{/t}:</strong>
                {$info.name}{$info.address.street}, {$info.address.city}, {$info.address.zip}, {$info.address.country}</p>
             <button type="button" class="btn {$tpl_vars.zasilkovna_btn_class}"
                     data-delivery-id="{$object.id}">{t}Změnit pobočku{/t}</button>
          {else}
             <button type="button" class="btn {$tpl_vars.zasilkovna_btn_class}"
                     data-delivery-id="{$object.id}"
                     data-delivery-invalid="{t}Pobočka nebyla nalezena. Vyberte prosím jinou pobočku, nebo změňte způsob dopravy.{/t}">
                 {t}Vybrat pobočku{/t}</button>
          {/if}
      </div>
   </div>
{/block}
<script>
   wpj.onReady.push(() => {
      dpdPickupWidget($('[name="{$deliveryPrefix}[DPDPickup_data]"]').parent());
   });
</script>
