Jump to content

Add Client ID to order-return.tpl


Recommended Posts

Hi there

 

I looked arround and i didn't found anything similar, or maybe i didn't look for the good info.

 

Anyway, I'm looking for some help here in order to make some changes to my order-return.tpl.

 

I was looking to add Client ID, Order Number and the text client write in is account to return the product.

 

I'm currently using prestashop 1.5.4

 

Thank you very much

Link to comment
Share on other sites

Hi again.

 

Hi did some progress. I add the Client ID and Order Number, however I'm looking for a way to add the reason in the PDF.

 

I will post here for everyone who wants to do the changes.

 

You need to change the HTMLTemplateOrderSlip.php in /classes/pdf/

 

and add replace the code with these :

	/**
	 * Returns the template's HTML content
	 * @return string HTML content
	 */
	public function getContent()
	{
		$delivery_address = new Address((int)$this->order->id_address_delivery);
		$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
		$formatted_invoice_address = '';

		if ($this->order->id_address_delivery != $this->order->id_address_invoice)
		{
			$invoice_address = new Address((int)$this->order->id_address_invoice);
			$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
		}
		
		$customer = new Customer((int)$this->order->id_customer);
		

		$this->smarty->assign(array(
			'order' => $this->order,
			'order_return' => $this->order_return,
			'return_nb_days' => (int)Configuration::get('PS_ORDER_RETURN_NB_DAYS'),
			'products' => OrderReturn::getOrdersReturnProducts((int)$this->order_return->id, $this->order),
			'delivery_address' => $formatted_delivery_address,
			'invoice_address' => $formatted_invoice_address,
			'customer' => $customer,
			'shop_address' => AddressFormat::generateAddress($this->shop->getAddress(), array(), '<br />', ' ')
		));
		return $this->smarty->fetch($this->getTemplate('order-return'));
	}

Then you change your order-return.tpl and add the following code

			{l s='Order Number:' pdf='true'}
			{$order->id}
			
			{l s='Client ID:' pdf='true'}
			{$customer->id}

However i would apreciate any help to add the client reason in the file.

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