Jump to content

Show product availability in confirmation e-mail


Recommended Posts

Hi there,

This forum already helped me with a lot of problems and edits, but there is one issue I wasn't able to fix:


In my shop, customers are allowed to order out of stock items by placing a reservation. In the shopping cart the availability of the product is shown by using the following code in the shopping-cart-product-line.tpl file:

{if $product.quantity <= $product.stock_quantity}Available now!{else}Reservation{/if}



This works perfectly. However, I want to add the same status to the confirmation e-mail, so that customers are able to see which of the products they ordered were available and which were on reservation. I tried using the code above, but this doesn't work, since within the confirmation e-mail the value of $product.stock_quantity is the stock quantity after the customers order. I'm looking for a way to display the stock quantity on the moment of ordering, to be able to show the same status as in the cart before order.


I think the (only) solution is to generate (or post) an extra value when the customer submits the order:
if available: stock_on_order = 1. if out of stock: stock_on_order = 2. (no actual code)

to be able to call this value within product line (PaymentModule.php) of the confirmation e-mail:
if stock_on_order = 1: display 'Available now!'. if stock_on_order = 2: display 'Reservation'. (no actual code)


Unfortunately I have no clue on how to achieve this and maybe there is much easier solution available? Could anyone help me out with this? Thanks in advance!

EDIT: I'm using version 1.3.2.3 btw

Link to comment
Share on other sites

  • 1 month later...

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...