Custom field in delivery address in checkout - previewfinish.php

20.08.2012 21:31
#1
communicat
Joomshopping forum user no avatar
Name: communicat
17.05.2011
Posts: 65
Quote
Custom field in delivery address in checkout - previewfinish.php

Hi,

I use the custom field _JSHOP_EXT_FIELD_1 as a middle name field - between first name and last name. This works fine except when needed to show during checkout (step 'confirm order'). I don't know how to get this field to show. I have tried to add the following in components/com_jshopping/ /templates/default/checkout/previewfinish.php (in bold):

1) <?php print $this->delivery_info['f_name'] ?>
<?php print $this->delivery_info['ext_field_1'] ?>
<?php print $this->delivery_info['l_name'] ?>,

2) <?php print $this->delivery_info['f_name'] ?>
<?php if ($this->delivery_info['ext_field_1']) print $this->delivery_info['ext_field_1'].", ";?>
<?php print $this->delivery_info['l_name'] ?>,

I don't know much about php, am I missing something?
Any help is greatly appreciated!


Joomla: 2.5.6
JoomShopping: 3.7.1
PHP: 5.2.17
Website Url: offline
 
20.08.2012 21:44
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25934
Quote
Aw: Custom field in delivery address in checkout - previewfinish.php

components\com_jshopping\controllers\checkout.php

function step5()

...

if ($adv_user->delivery_adress){
$country = &JTable::getInstance('country', 'jshop');
$country->load($adv_user->d_country);
$delivery_info['f_name'] = $adv_user->d_f_name;
$delivery_info['l_name'] = $adv_user->d_l_name;
$delivery_info['firma_name'] = $adv_user->d_firma_name;
$delivery_info['street'] = $adv_user->d_street;
$delivery_info['zip'] = $adv_user->d_zip;
$delivery_info['state'] = $adv_user->d_state;
$delivery_info['city'] = $adv_user->d_city;
$field_country_name = $lang->get("name");
$delivery_info['country'] = $country->$field_country_name;
$delivery_info['home'] = $adv_user->d_home;
$delivery_info['apartment'] = $adv_user->d_apartment;
} else {
$country = &JTable::getInstance('country', 'jshop');
$country->load($adv_user->country);
$delivery_info['f_name'] = $adv_user->f_name;
$delivery_info['l_name'] = $adv_user->l_name;
$delivery_info['firma_name'] = $adv_user->firma_name;
$delivery_info['street'] = $adv_user->street;
$delivery_info['zip'] = $adv_user->zip;
$delivery_info['state'] = $adv_user->state;
$delivery_info['city'] = $adv_user->city;
$field_country_name = $lang->get("name");
$delivery_info['country'] = $country->$field_country_name;
$delivery_info['home'] = $adv_user->home;
$delivery_info['apartment'] = $adv_user->apartment;
}

 
20.08.2012 22:43
#3
communicat
Joomshopping forum user no avatar
Name: communicat
17.05.2011
Posts: 65
Quote
Aw: Custom field in delivery address in checkout - previewfinish.php

Unfortunately, if I make changes here, like beneith, nothing happens...

if ($adv_user->delivery_adress){
$country = &JTable::getInstance('country', 'jshop');
$country->load($adv_user->d_country);
$delivery_info['f_name'] = $adv_user->d_f_name;
--> $delivery_info['ext_field_1'] = $adv_user->d_ext_field_1;
$delivery_info['l_name'] = $adv_user->d_l_name;
$delivery_info['firma_name'] = $adv_user->d_firma_name;
$delivery_info['street'] = $adv_user->d_street;
$delivery_info['zip'] = $adv_user->d_zip;
$delivery_info['state'] = $adv_user->d_state;
$delivery_info['city'] = $adv_user->d_city;
$field_country_name = $lang->get("name");
$delivery_info['country'] = $country->$field_country_name;
$delivery_info['home'] = $adv_user->d_home;
$delivery_info['apartment'] = $adv_user->d_apartment;
} else {
$country = &JTable::getInstance('country', 'jshop');
$country->load($adv_user->country);
$delivery_info['f_name'] = $adv_user->f_name;
--> $delivery_info['ext_field_1'] = $adv_user->ext_field_1;
$delivery_info['l_name'] = $adv_user->l_name;
$delivery_info['firma_name'] = $adv_user->firma_name;
$delivery_info['street'] = $adv_user->street;
$delivery_info['zip'] = $adv_user->zip;
$delivery_info['state'] = $adv_user->state;
$delivery_info['city'] = $adv_user->city;
$field_country_name = $lang->get("name");
$delivery_info['country'] = $country->$field_country_name;
$delivery_info['home'] = $adv_user->home;
$delivery_info['apartment'] = $adv_user->apartment;
}

 
21.08.2012 07:39
#4
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25934
Quote
Aw: Custom field in delivery address in checkout - previewfinish.php

change 2 files

chackout.php
previewfinish.php


Last change: 21.08.2012 07:39
 
22.08.2012 22:38
#5
communicat
Joomshopping forum user no avatar
Name: communicat
17.05.2011
Posts: 65
Quote
Aw: Custom field in delivery address in checkout - previewfinish.php

Thank you, this worked excellent!

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.