By Rasmus Bech - Opdag Verden on Monday, 26 March 2018
Posted in General Issues
Replies 1
Likes 0
Views 591
Votes 0
Hi

I noticed in the database in the table #__payplans_user there are dedicated fields for address, state,city, country and zip code. But I couldn't find any way to "activate" them, besides adding the fields to the user.xml file in components/com_payplans/libraries/model/xml

This is the normal file

<?xml version="1.0" encoding="UTF-8"?>
<form>
<fieldset name="addressdetails">
<field name="country"
type="xicountry"
option_none="true"
label="COM_PAYPLANS_USER_EDIT_USER_COUNTRY" />
</fieldset>
<fields name="params">
<fieldset name="params">
<field
name="user_notes"
label="COM_PAYPLANS_USER_PREFERENCE_NOTES_LABEL"
description="COM_PAYPLANS_USER_PREFERENCE_NOTES_DESC"
type="textarea"
rows="3" cols="30"
default=""
/>

</fieldset>
</fields>
</form>


When modified to look like this, I could access and store information in these dedicated fields


<?xml version="1.0" encoding="UTF-8"?>
<form>
<fieldset name="addressdetails">
<field name="address"
type="xiaddress"
option_none="true"
label="COM_PAYPLANS_USER_EDIT_USER_ADDRESS" />
<field name="state"
type="xistate"
option_none="true"
label="COM_PAYPLANS_USER_EDIT_USER_STATE" />
<field name="zipcode"
type="xizipcode"
option_none="true"
label="COM_PAYPLANS_USER_EDIT_USER_ZIPCODE" />
<field name="city"
type="xicity"
option_none="true"
label="COM_PAYPLANS_USER_EDIT_USER_CITY" />
<field name="country"
type="xicountry"
option_none="true"
label="COM_PAYPLANS_USER_EDIT_USER_COUNTRY" />

</fieldset>
<fields name="params">
<fieldset name="params">
<field
name="user_notes"
label="COM_PAYPLANS_USER_PREFERENCE_NOTES_LABEL"
description="COM_PAYPLANS_USER_PREFERENCE_NOTES_DESC"
type="textarea"
rows="3" cols="30"
default=""
/>

</fieldset>
</fields>
</form>


So out of the box, only country field is available - why? How can we access and use these fields without modifying core files?
Hello Rasmas,

Let me know where you want to use these fields, on backend user screen only.
Please explain your requirement in details , so i can assist you properly.
·
Monday, 26 March 2018 11:25
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post