Tracking Number Custom Field not working

  • Posts: 63
  • Thank you received: 0
9 years 7 months ago #199166

-- url of the page with the problem -- : www.dreamlordpress.it
-- HikaShop version -- : 2-4-0
-- Joomla version -- : 3.4.1

Hi,

I created a custom field "Tracking Number" with column name "tracking_number", in the order table.

1) Added code

<?php echo $this->element->tracking_number; ?>
to the order view but it doesn't show up.

2) Added code:
<?php
if($data->mail_status == 'shipped'){
  ?><span style="color:#1c8faf !important;font-size:12px;font-weight:bold;">Tracciamento Spedizione: </span> <?php echo $this->element->tracking_number;
} 
?>
to the order status notification but all the line doesn't show up.
It seams nothing I add to the HTML version of the mail do actually show up.

Thanks in advance,
Nicola.


Dreamlord Press
www.dreamlordpress.it
Roleplaying Games in the new era

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 7 months ago #199193

Hi,

1. To which order view did you add that code exactly ? And where do you want to have the tracking code displayed exactly ?

2. In the order status notification, the "shipped" status is in the variable $data->order_status and the tracking code is in the variable:
$data->cart->tracking_number

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

  • Posts: 63
  • Thank you received: 0
9 years 7 months ago #199275

Hi nicolas,

Thank you for the insigtht, but it still doesn't work.

Here's the code from the order status notification mail:

<!--{IF:SHIPPING}-->
<p>
	<span style="color:#1c8faf !important;font-size:12px;font-weight:bold;">{TXT:HIKASHOP_SHIPPING_METHOD} :</span> {VAR:SHIPPING} {VAR:order.shipping_tracking}
<?php
if($data->order_status == 'shipped'){
  ?><span style="color:#1c8faf !important;font-size:12px;font-weight:bold;">Tracciamento Spedizione: </span> <?php echo $data->cart->tracking_number;
} 
?>
</p>
<!--{ENDIF:SHIPPING}-->

I added the "if($data->order_status == 'shipped'){..." part, but it doesn't show when I open the mail popup in the order view in the administrazion panel, or the popup mail view when I change order status from order list in administration.
No Tracking Number, just "Tracciamento Spedizione" in the actual mail sent (the copy I receive as administrator).

In the front order view (order->view view, the one you open fron your user account to see a single order):
<fieldset class="hikashop_order_custom_fields_fieldset">
					<legend><?php echo JText::_('ADDITIONAL_INFORMATION'); ?></legend>
					<table class="hikashop_order_custom_fields_table adminlist" cellpadding="1" width="100%">
                            <tr class="hikashop_order_custom_field_<?php echo $fieldName;?>_line">
                                <td class="key">
									Numero di Tracciamento :
								</td>
								<td>
									<?php echo $this->element->tracking_number; ?>
								</td>
                            </tr>
						<?php foreach($this->fields['order'] as $fieldName => $oneExtraField) {
							if(!@$oneExtraField->field_frontcomp || empty($this->order->$fieldName)) continue;
						?>
							<tr class="hikashop_order_custom_field_<?php echo $fieldName;?>_line">
								<td class="key">
									<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
								</td>
								<td>
									<?php echo $this->fieldsClass->show($oneExtraField,$this->order->$fieldName); ?>
								</td>
							</tr>
                            <tr class="hikashop_order_custom_field_<?php echo $fieldName;?>_line">
                                <td class="key">
									Numero di Tracciamento Raccomandata :
								</td>
								<td>
									<?php echo $data->cart->tracking_number; ?>
								</td>
                            </tr>
						<?php }	?>
					</table>
				</fieldset>

Here I added a line in the additional informations table. It shows "Numero di Tracciamento Raccomandata", AND the tracking number value.

So Everything works but the tracking number value in the notification mail.

Thanks!


Dreamlord Press
www.dreamlordpress.it
Roleplaying Games in the new era

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

  • Posts: 12953
  • Thank you received: 1778
9 years 7 months ago #199288

Hello,
Regarding the tracking number value in the notification mail, the solution can firstly be to directly test and display the value of your tracking number custom field to know if it's correctly saved through the "$data->cart" variable.

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

  • Posts: 63
  • Thank you received: 0
9 years 6 months ago #202166

Hi,

Finally solved the problem, thank you all!


Dreamlord Press
www.dreamlordpress.it
Roleplaying Games in the new era

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

Time to create page: 0.075 seconds
Powered by Kunena Forum