Jump to content

Change get only address from delivery_address variable


ekodrive

Recommended Posts

Hi guys, im new in PS so. i can't find any solution for this problem.

I want add some text in invoice file for example add this text

 

Dear <customer name> thank your for your purchase. Your item will be send to <customer address> in 5-10 days.

 

soo i add some code to the HTMLTemplateInvoice.php

 $data = array(
            'order' => $this->order,
            'order_invoice' => $this->order_invoice,
            'order_details' => $order_details,
            'cart_rules' => $cart_rules,
            'delivery_address' => $formatted_delivery_address,
            'invoice_address' => $formatted_invoice_address,
            'addresses' => array('invoice' => $invoice_address, 'delivery' => $delivery_address),
            'tax_excluded_display' => $tax_excluded_display,
            'display_product_images' => $display_product_images,
            'layout' => $layout,
            'tax_tab' => $this->getTaxTabContent(),
            'customer' => $customer,
            'footer' => $footer,
            'ps_price_compute_precision' => _PS_PRICE_COMPUTE_PRECISION_,
            'round_type' => $round_type,
            'legal_free_text' => $legal_free_text,
            'firstname' => $customer->firstname,//from me
            'lastname' => $customer->lastname,//from me
            'only_address' => $this->formatted_delivery_address->address//from me

            
        );

and next i add to the invoice.tpl file 

	<tr>
		<td colspan="7" class="left small">

			<table>
				<tr>
					<td>
						<p>Dear {$firstname}{$lastname} thank your for your purchase. Your item will be send to {$only_address} in 5-10 days. {$legal_free_text|escape:'html':'UTF-8'|nl2br}

</p>
					</td>
				</tr>
			</table>

		</td>
	</tr>

the last name and firstname is working but address line is not working please help.

Edited by ekodrive (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...