On 6/12/2025 at 10:55 AM, ps8modules said:Hi.
Availability parameter is not available in PaymentModule.php (Not tested!!!)
updated (added in green box):
$productAvailableQuantity = StockAvailable::getQuantityAvailableByProduct( (int) $product['id_product'], (int) $product['id_product_attribute'], (int) $order->id_shop ); $productInfo = new Product((int) $product['id_product'], false, $order->id_lang); $productAvailableNow = $productInfo->available_now; $productAvailableLater = $productInfo->available_later; $returnAvailabilityText = ''; if ($productAvailableQuantity > 0) { if ($productAvailableNow) { $returnAvailabilityText = $productAvailableNow; } else { $returnAvailabilityText = $this->trans('Available now', [], 'Emails.Subject', $order->id_lang); } } else { $availableDate = Product::getAvailableDate((int) $product['id_product'], $product['id_product_attribute']); if ($productAvailableLater) { if ($availableDate) { $returnAvailabilityText = $productAvailableLater. '('.Tools::displayDate($availableDate, null, false).')'; } else { $returnAvailabilityText = $productAvailableLater; } } else { if ($availableDate) { $returnAvailabilityText = $this->trans('Available later', [], 'Emails.Subject', $order->id_lang). '('.Tools::displayDate($availableDate, null, false).')'; } else { $returnAvailabilityText = $this->trans('Available later', [], 'Emails.Subject', $order->id_lang); } } } $product_var_tpl = [ 'id_product' => $product['id_product'], 'id_product_attribute' => $product['id_product_attribute'], 'reference' => $product['reference'], 'name' => $product['name'] . (isset($product['attributes']) ? ' - ' . $product['attributes'] : ''), 'price' => Tools::getContextLocale($this->context)->formatPrice($product_price * $product['quantity'], $this->context->currency->iso_code), 'quantity' => $product['quantity'], 'availability' => $returnAvailabilityText, 'customization' => [], ];
and in the TPL email template (order_conf_product_list.tpl):
updated (added in green box):
<td style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="5"> </td> <td align="right"> <font size="2" face="Open-sans, sans-serif" color="#555454"> {$product['quantity']} {if isset($product['availability']) && $product['availability']} <br>{$product['availability'] nofilter} {/if} </font> </td> <td width="5"> </td> </tr> </table> </td>You can do the same with the ps_emailalerts module 😉
Working great on order conf. How to make it in mail alerts where we dont have tpl. only txt / html.
i.e:
{shop_url}
Gratulacje!
Nowe zamówienie w {shop_name} zostało złożone przez klienta: {firstname} {lastname} ({email})
Szczegóły zamówienia
Zamówienie: {order_name} Złożone w {date}
Płatność: {payment}
Indeks Produkt Cena jednostkowa Ilość Cena końcowa {items}
Produkty {total_products}
Rabaty {total_discounts}
Pakowanie prezentowe {total_wrapping}
Wysyłka {total_shipping}
Z podatkiem {total_tax_paid}
Zapłacono w sumie {total_paid}
Przewoźnik
Przewoźnik: {carrier}
Płatność: {payment}
Adres dostawy
{delivery_block_html}
Adres do faktury
{invoice_block_html}
Wiadomość klienta:
{message}
[{shop_name}]({shop_url})
Powered by [PrestaShop](https://www.prestashop-project.org/)