Add InPost Pay integration to admin templates
- Created a new template for the cart rule form with custom label, switch, and choice widgets. - Implemented the InPost Pay block in the order details template for displaying delivery method, APM, and VAT invoice request. - Added legacy support for the order details template to maintain compatibility with older PrestaShop versions.
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
{function inpostizi_form_label}
|
||||
<label for="{$form->vars.id}" class="control-label col-lg-3">
|
||||
{if !empty($form->vars.help)}
|
||||
<span class="label-tooltip" title="{$form->vars.help}">
|
||||
{$form->vars.label}
|
||||
</span>
|
||||
{else}
|
||||
{$form->vars.label}
|
||||
{/if}
|
||||
</label>
|
||||
{/function}
|
||||
|
||||
{function inpostizi_switch_widget}
|
||||
<div class="col-lg-9">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
{foreach $form as $child}
|
||||
<input
|
||||
type="radio"
|
||||
name="{$form->vars.full_name}"
|
||||
id="{$child->vars.id}"
|
||||
value="{$child->vars.value}"
|
||||
{if $child->vars.checked} checked="checked"{/if}
|
||||
>
|
||||
<label class="t" for="{$child->vars.id}">{$child->vars.label}</label>
|
||||
{/foreach}
|
||||
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
{/function}
|
||||
|
||||
{function inpostizi_choice_widget}
|
||||
<div class="col-lg-9">
|
||||
<select
|
||||
name="{$form->vars.full_name}"
|
||||
id="{$form->vars.id}"
|
||||
>
|
||||
{if isset($form->vars.placeholder)}
|
||||
<option value=""{if $form->vars.required && !$form->vars.value} selected="selected"{/if}>
|
||||
{$form->vars.placeholder}
|
||||
</option>
|
||||
{/if}
|
||||
|
||||
{foreach $form->vars.choices as $choice}
|
||||
<option value="{$choice->value}"{if $form->vars.value === $choice->value} selected="selected"{/if}>
|
||||
{$choice->label}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
{/function}
|
||||
|
||||
<template id="inpostizi_form_tab">
|
||||
<div id="cart_rule_{$form->vars.id}" class="panel cart_rule_tab" style="display: none">
|
||||
<div class="form-group">
|
||||
{inpostizi_form_label form=$form.omnibus}
|
||||
{inpostizi_switch_widget form=$form.omnibus}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{inpostizi_form_label form=$form.promoDetailsPageId}
|
||||
{inpostizi_choice_widget form=$form.promoDetailsPageId}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id="inpostizi_nav_link">
|
||||
<li class="tab-row">
|
||||
<a id="cart_rule_link_{$form->vars.id}" class="tab-page" href="javascript:displayCartRuleTab('{$form->vars.id}');">
|
||||
<i class="icon-cog"></i>
|
||||
{$form->vars.label}
|
||||
</a>
|
||||
</li>
|
||||
</template>
|
||||
@@ -0,0 +1,31 @@
|
||||
<div id="inpostizi_block_backend" class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-header-title">
|
||||
InPost Pay
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row mt-3">
|
||||
<div class="col">
|
||||
<p class="mb-1">
|
||||
<strong>{l s='Delivery method' mod='inpostizi'}:</strong>
|
||||
</p>
|
||||
<p>{$delivery}</p>
|
||||
|
||||
{if $apm != ''}
|
||||
<p class="mb-1">
|
||||
<strong>{l s='APM' mod='inpostizi'}:</strong>
|
||||
</p>
|
||||
<p>{$apm}</p>
|
||||
{/if}
|
||||
|
||||
{if $issue_invoice}
|
||||
<p>
|
||||
<strong>{l s='The customer requested a VAT invoice' mod='inpostizi'}</strong>
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user