Is there a way to see which variable exist? SOLVED

  • Posts: 137
  • Thank you received: 2
13 years 1 week ago #30381

Hi, I would like to include the title (Mr or Mrs) in the greeting of an e-mail. this would be easy to implemnt, if I would know, how this variable is named. I have tried with $title and $address_title but have not been successful. Can you please tell me the correct name of the var. Also... is there a list of variable name,s so I can easily customize front-end or e-mails?

Thanks (as always) in advance!

Last edit: 13 years 1 week ago by 1fcb.

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 1 week ago #30406

Hi,

It should be like that:

$address =& $data->order_addresses[$data->cart->billing_address->address_id];
echo $address->address_title;

You can use the code:
var_dump($data);

to get a dump of all the variables you can use.

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
13 years 1 week ago #30476

nicolas wrote:

Hi,

It should be like that:

$address =& $data->order_addresses[$data->cart->billing_address->address_id];
echo $address->address_title;


hmm... unfortunately it does not work. No output...

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 1 week ago #30489

What about:

echo $data->cart->billing_address->address_title;

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
13 years 1 week ago #30541

still not working. Wouldn't be be title (Mr or Mrs) not a standard attribute of the object customer like first name or last name? It is a standard field filled out during registration. What I am missing is the data model or a similar description to know how to access the information of the registration fields.

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 1 week ago #30549

The address information is not part of the customer object.

As I said, the address information is available in $data->cart->billing_address in the emails sent by HikaShop. The system itself use it display display the billing address on the email so there is no way it's not working...

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
13 years 1 week ago #30563

Ok, I think I narrowed it down a bit. In some areas of the confirmation status change e-mail (the lower part) the information would dhow up, in the part, where I address my customers (the very top part), it wold not show p. I guess I need to alloate/get the correct claass first and then be able to display the infrormation thereafter. Can you share the php code to get the class?

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 1 week ago #30575

Then, you need to move the block of code which loads the $data object before where you want to use it.


I'm talking about that big block of code:

<?php
$order_url = $data->order_url;

$mail_status = $data->mail_status;
$customer = $data->customer;
$order_status = $data->order_status;
$class = hikashop_get('class.order');
$data = $class->get($data->order_id);
$url = $data->order_number;
$data->order_url = $order_url;
$data->order_status = $order_status;
$data->mail_status = $mail_status;
$config =& hikashop_config();
if($config->get('simplified_registration',0)!=2){
$url = '<a href="'.$order_url.'">'. $url.'</a>';
}
echo JText::sprintf('ORDER_STATUS_CHANGED_TO',$url,$data->mail_status);


$data->cart = $class->loadFullOrder($data->order_id,true,false);
$data->cart->coupon = null;
$price = null;
$tax = $data->cart->order_subtotal - $data->cart->order_subtotal_no_vat + $data->order_discount_tax + $data->order_shipping_tax;
//$tax = $data->cart->order_subtotal - $data->cart->order_subtotal_no_vat;
$price->price_value = $data->order_full_price-$tax;
$price->price_value_with_tax = $data->order_full_price;
$data->cart->full_total = null;
$data->cart->full_total->prices = array($price);
$data->cart->coupon->discount_value =& $data->order_discount_price;
$app=&JFactory::getApplication();
if($app->isAdmin()){
$view = 'order';
}else{
$view = 'address';
}
?>

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
13 years 1 week ago #30583

works! Thanks so much.

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum