Jump to content

PS 1.4 Order Confirmation specified Product


m3442a

Recommended Posts

Hello,

 

i want some specific parameters for the order-confirmation.tpl is a little bit complicated:

 

1. i have 4 specific products: If the customer order one of them, i want show the price for the product in the order-confirmation without tax, without shipping cost and - 4$ (or something) 

 

2. i have normal products:  If the customer order one of them, i want show the price for the product in the order-confirmation without tax and without shipping cost.

 

3. if the customer order  both products togehther, than doing the same action for both products.

Than i need the cart products without tax and shipping price - 4$.

 

So i try for the first step an override for the  total_products parameters in Hook.php:

 

public static function paymentReturn($id_order, $id_module)
{
   if (Validate::isUnsignedId($id_order) AND Validate::isUnsignedId($id_module))
   {
$params = array();
$order = new Order((int)($id_order));
$currency = new Currency((int)($order->id_currency));
   
    if (Validate::isLoadedObject($order))
    {
$params['total_to_pay'] = $order->total_paid;
$params['total_products'] = $order->total_products - $order->total_shipping - $order->total_wrapping + $order->total_discounts;
$params['currency'] = $currency->sign;
$params['objOrder'] = $order;
$params['currencyObj'] = $currency;
 
return Module::hookExec('paymentReturn', $params, (int)($id_module));
}
   }
   return false;
}
 
in the order-confirmation.tpl  and payment modules i have the variable total_products and that works.
 
But how can i change the variable to specific product ID?
 
Something like this:
 
if $product_id  == '1' OR  == '2' {
$params['total_products'] = $order->total_products - $order->total_shipping - $order->total_wrapping + $order->total_discounts -4$;
}
else
{$params['total_products'] = $order->total_products - $order->total_shipping - $order->total_wrapping + $order->total_discounts;}
Edited by m3442a (see edit history)
Link to comment
Share on other sites

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