{block "delivery-parcelshop"}
   <div class="delivery-class" data-delivery-class="PPLParcelShop" data-PPLParcelShop-wrapper data-delivery-validity_check data-delivery-id-wrapper="{$object.id}">
       {block "delivery-parcelshop-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.PPLParcelShop_data}
      <input type="hidden" name="{$deliveryPrefix}[PPLParcelShop_data]" value="{$info|json_encode}" data-delivery-PPLParcelShop>
      <div data-reload="PPLParcelShop_{$object.id}" class="delivery-class-info">
          {if $info.id}
             <input type="hidden" name="delivery_PPLParcelShop_valid" value="1">
             <p><strong>{t}Zboží doručíme na pobočku{/t}:</strong> {$info.name}</p>
             <p><strong>{t}Adresa{/t}:</strong>
                 {$info.street} {$info.number} {$info.zipCode} {$info.city}</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(() => {
      pplParcelShopWidget($('[name="{$deliveryPrefix}[PPLParcelShop_data]"]').parent());
   });
</script>
