corvée(fmt) formate
This commit is contained in:
parent
4720c46ff8
commit
fdb6aaa7e9
23 changed files with 138 additions and 155 deletions
|
|
@ -13,7 +13,7 @@ use Illuminate\Support\Str;
|
|||
use Timber\Timber;
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Initialise Timber
|
||||
|
|
@ -41,7 +41,7 @@ $email = [
|
|||
'numero_suivi' => $commande->get_meta('tracking_number'),
|
||||
],
|
||||
'paiement' => ['methode' => ''],
|
||||
'produits' => collect($commande->get_items())->map(function (WC_Order_Item_Product $article) {
|
||||
'produits' => collect($commande->get_items())->map(static function (WC_Order_Item_Product $article) {
|
||||
$produit = $article->get_product();
|
||||
|
||||
if (is_bool($produit) || $produit === null) {
|
||||
|
|
@ -52,7 +52,7 @@ $email = [
|
|||
// Récupère l'Attribut d'un Produit variable ou renvoie un tableau vide
|
||||
'attribut' => $produit->is_type('variable')
|
||||
? collect($produit->get_attributes())
|
||||
->mapWithKeys(fn($_atr, $cle) => [
|
||||
->mapWithKeys(static fn($_atr, $cle): array => [
|
||||
'nom' => Str::lower(wc_attribute_label($cle, $produit)),
|
||||
'valeur' => $produit->get_attribute($cle),
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue