if ($total_excluding_tax-$shippingCost > '135' && Context::getContext()->country->id == 17) {
$totals = array(
'total' => array(
'type' => 'total',
'label' => $this->translator->trans('Total', array(), 'Shop.Theme.Checkout'),
'amount' => $this->includeTaxes() ? $total_including_tax : $total_including_tax,
'value' => $this->priceFormatter->format(
$this->includeTaxes() ? $total_including_tax : $total_including_tax
),
),
'total_including_tax' => array(
'type' => 'total',
'label' => $this->translator->trans('Total (tax incl.)', array(), 'Shop.Theme.Checkout'),
'amount' => $total_including_tax,
'value' => $this->priceFormatter->format($total_including_tax),
),
'total_excluding_tax' => array(
'type' => 'total',
'label' => $this->translator->trans('Total (tax incl.)', array(), 'Shop.Theme.Checkout'),
'amount' => $total_including_tax,
'value' => $this->priceFormatter->format($total_including_tax),
),
);
} elseif ($total_excluding_tax-$shippingCost < '135' && Context::getContext()->country->id == 17) {
$totals = array(
'total' => array(
'type' => 'total',
'label' => $this->translator->trans('Total', array(), 'Shop.Theme.Checkout'),
'amount' => $this->includeTaxes() ? $total_excluding_tax : $total_excluding_tax,
'value' => $this->priceFormatter->format(
$this->includeTaxes() ? $total_excluding_tax : $total_excluding_tax
),
),
'total_including_tax' => array(
'type' => 'total',
'label' => $this->translator->trans('Total', array(), 'Shop.Theme.Checkout'),
'amount' => $total_excluding_tax,
'value' => $this->priceFormatter->format($total_excluding_tax),
),
'total_excluding_tax' => array(
'type' => 'total',
'label' => $this->translator->trans('Total', array(), 'Shop.Theme.Checkout'),
'amount' => $total_excluding_tax,
'value' => $this->priceFormatter->format($total_excluding_tax),
),
);
} else {
$totals = array(
'total' => array(
'type' => 'total',
'label' => $this->translator->trans('Total', array(), 'Shop.Theme.Checkout'),
'amount' => $this->includeTaxes() ? $total_including_tax : $total_excluding_tax,
'value' => $this->priceFormatter->format(
$this->includeTaxes() ? $total_including_tax : $total_excluding_tax
),
),
'total_including_tax' => array(
'type' => 'total',
'label' => $this->translator->trans('Total (tax incl.)', array(), 'Shop.Theme.Checkout'),
'amount' => $total_including_tax,
'value' => $this->priceFormatter->format($total_including_tax),
),
'total_excluding_tax' => array(
'type' => 'total',
'label' => $this->translator->trans('Total (tax excl.)', array(), 'Shop.Theme.Checkout'),
'amount' => $total_excluding_tax,
'value' => $this->priceFormatter->format($total_excluding_tax),
),
);
}
la dernière section à remplacer sera.
$labels = array(
'tax_short' => ($this->includeTaxes())
? $this->translator->trans('(tax incl.)', array(), 'Shop.Theme.Global')
: $this->translator->trans('(tax excl.)', array(), 'Shop.Theme.Global'),
'tax_long' => ($this->includeTaxes())
? $this->translator->trans('(tax included)', array(), 'Shop.Theme.Global')
: $this->translator->trans('(tax excluded)', array(), 'Shop.Theme.Global'),
);
pour:
if ($total_excluding_tax-$shippingCost > '135' && Context::getContext()->country->id == 17) {
$labels = array(
'tax_short' => ($this->includeTaxes())
? $this->translator->trans('(tax incl.)', array(), 'Shop.Theme.Global')
: '',
'tax_long' => ($this->includeTaxes())
? $this->translator->trans('(tax included)', array(), 'Shop.Theme.Global')
: $this->translator->trans('(tax excluded)', array(), 'Shop.Theme.Global'),
);
} elseif ($total_excluding_tax-$shippingCost < '135' && Context::getContext()->country->id == 17){
$labels = array(
'tax_short' => ($this->includeTaxes())
? $this->translator->trans('', array(), 'Shop.Theme.Global')
: '',
'tax_long' => ($this->includeTaxes())
? $this->translator->trans('(tax included)', array(), 'Shop.Theme.Global')
: $this->translator->trans('(tax excluded)', array(), 'Shop.Theme.Global'),
);
} else {
$labels = array(
'tax_short' => ($this->includeTaxes())
? $this->translator->trans('(tax incl.)', array(), 'Shop.Theme.Global')
: $this->translator->trans('(tax excl.)', array(), 'Shop.Theme.Global'),
'tax_long' => ($this->includeTaxes())
? $this->translator->trans('(tax included)', array(), 'Shop.Theme.Global')
: $this->translator->trans('(tax excluded)', array(), 'Shop.Theme.Global'),
);
}
Et ce serait suffisant. Dans les règles, vous pouvez apporter plus de corrections et ajuster le code pour prendre 135 à la bonne conversion s'il s'agit d'une autre devise.