Jump to content

[Solved] Include stock level of products in confirmation email


Eutanasio

Recommended Posts

Hi

Anybody knows how to include the stock level (in stock OR out of stock) that has each product at the moment a customer places an order so it appears in the order confirmation email? as a proof for us and the customer to be aware of the availability of the products he ordered. PS v1.7

Regards

Edited by Eutanasio
PS v1.7 (see edit history)
Link to comment
Share on other sites

Well I did it,in case someone is interested....

in /classes/PaymentModule.php  before this:
$product_var_tpl = array

you can add this:

						// Get product stock to add availability in email order confirmation
						$real_stock_quantity = StockAvailable::getQuantityAvailableByProduct($product['id_product'], $product['id_product_attribute']);
						if ($real_stock_quantity > 0) {
    $availability_label = $this->trans('In stock', array(), 'Shop.Theme.Catalog');
} elseif (isset($product['availability_date']) && $product['availability_date']) {
    $availability_label = $this->trans('Available on: ', array(), 'Shop.Theme.Catalog') . $product['availability_date'];
} else {
    $availability_label = "Sur commande";
}

Then for this info to appear in the email confirmation, in themes/YourTheme/mails/YourLanguage/order_conf_product_list.tpl
Add this:
({$product['product_stock']})

Here like this:

<font size="2" face="Open-sans, sans-serif" color="#555454">
<strong>{$product['name']}</strong> ({$product['product_stock']})
</font>

 

Link to comment
Share on other sites

  • Eutanasio changed the title to [Solved] Include stock level of products in confirmation email

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...