- Posts: 137
- Thank you received: 2
Is there a way to see which variable exist? SOLVED
14 years 10 months ago - 14 years 10 months ago #30381
by 1fcb
Is there a way to see which variable exist? SOLVED was created by 1fcb
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!
Thanks (as always) in advance!
Last edit: 14 years 10 months ago by 1fcb.
Please Log in or Create an account to join the conversation.
14 years 10 months ago #30406
by nicolas
Replied by nicolas on topic Re: Is there a way to see which variable exist?
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.
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.
14 years 10 months ago #30476
by 1fcb
Replied by 1fcb on topic Re: Is there a way to see which variable exist?
nicolas wrote:
hmm... unfortunately it does not work. No output...
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.
14 years 10 months ago #30489
by nicolas
Replied by nicolas on topic Re: Is there a way to see which variable exist?
What about:
echo $data->cart->billing_address->address_title;
echo $data->cart->billing_address->address_title;
Please Log in or Create an account to join the conversation.
14 years 10 months ago #30541
by 1fcb
Replied by 1fcb on topic Re: Is there a way to see which variable exist?
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.
14 years 10 months ago #30549
by nicolas
Replied by nicolas on topic Re: Is there a way to see which variable exist?
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...
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.
14 years 10 months ago #30563
by 1fcb
Replied by 1fcb on topic Re: Is there a way to see which variable exist?
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.
14 years 10 months ago #30575
by nicolas
Replied by nicolas on topic Re: Is there a way to see which variable exist?
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';
}
?>
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.
14 years 10 months ago #30583
by 1fcb
Replied by 1fcb on topic Re: Is there a way to see which variable exist?
works! Thanks so much.
Please Log in or Create an account to join the conversation.
Time to create page: 0.198 seconds