PHP string array casting - php

I'm trying to find a way to cast the following into a real array. The data is stored as a string in the system I am working on.
I have tried (array) $stringArrayData; but that didn't work.
The string data is as follows:
array(
4 => array(
'nid' => 4099,
'cid' => '4',
'pid' => '0',
'form_key' => 'event_details',
'name' => 'Event Details',
'type' => 'fieldset',
'value' => '',
'extra' => array(
'title_display' => 0,
'private' => 0,
'collapsible' => 0,
'collapsed' => 0,
'conditional_operator' => '=',
'description' => '',
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '0',
'weight' => '1',
'page_num' => 1,
),
5 => array(
'nid' => 4099,
'cid' => '5',
'pid' => '4',
'form_key' => 'name',
'name' => 'Name',
'type' => 'textfield',
'value' => '',
'extra' => array(
'title_display' => 'inline',
'private' => 0,
'disabled' => 0,
'unique' => 0,
'conditional_operator' => '=',
'width' => '',
'maxlength' => '',
'field_prefix' => '',
'field_suffix' => '',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '2',
'page_num' => 1,
),
6 => array(
'nid' => 4099,
'cid' => '6',
'pid' => '4',
'form_key' => 'description',
'name' => 'Description',
'type' => 'textarea',
'value' => '',
'extra' => array(
'description' => 'please include who the event is aimed at',
'title_display' => 0,
'private' => 0,
'resizable' => 0,
'disabled' => 0,
'conditional_operator' => '=',
'cols' => '',
'rows' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '3',
'page_num' => 1,
),
21 => array(
'nid' => 4099,
'cid' => '21',
'pid' => '4',
'form_key' => 'add_an_image',
'name' => 'Add an image',
'type' => 'file',
'value' => '',
'extra' => array(
'scheme' => 'public',
'directory' => 'event-suggestions',
'title_display' => 'before',
'private' => 0,
'progress_indicator' => 'throbber',
'filtering' => array(
'size' => '2 MB',
'types' => array(
'gif',
'jpg',
'png',
),
'addextensions' => '',
),
'conditional_operator' => '=',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '0',
'weight' => '4',
'page_num' => 1,
),
7 => array(
'nid' => 4099,
'cid' => '7',
'pid' => '4',
'form_key' => 'venue',
'name' => 'Venue',
'type' => 'fieldset',
'value' => '',
'extra' => array(
'title_display' => 0,
'private' => 0,
'collapsible' => 0,
'collapsed' => 0,
'conditional_operator' => '=',
'description' => '',
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '0',
'weight' => '5',
'page_num' => 1,
),
23 => array(
'nid' => 4099,
'cid' => '23',
'pid' => '7',
'form_key' => 'please_select_your_venue',
'name' => 'Please select your venue',
'type' => 'select',
'value' => '',
'extra' => array(
'items' => "3257|639 Enterprise Centre\n3267|Alexandra Palace\n126|Alexandra Park Library\n142|Asian Centre\n153|Bernie Grant Arts Centre\n127|Bruce Castle Museum\n3259|Community Use For the Old Station\n128|Coombes Croft Library\n147|Crowland Primary School\n146|Delicia Cafe\n138|Fortismere School\n3385|Haringey Sixth Form Centre\n135|Harmony Gardens Wins!\n149|Highgate Gallery\n129|Highgate Library\n130|Hornsey Library\n154|Jacksons Lane\n148|Kurdish Community Centre\n155|Lauderdale House\n3235|Living Under One Sun Community Allotment\n132|Marcus Garvey Library\n139|Methodist Church Hall\n133|Muswell Hill Library\n150|Northumberland Park Neighbourhood Resource Centre\n141|Open Smart Homes around Haringey\n156|Park Road Leisure Centre\n134|St Ann's Library\n157|Stroud Green and Harringay Library\n145|T Chances\n144|The Beehive Pub\n140|The Old Dairy\n136|The Tagore Centre\n143|Tottenham Community Sports Centre\n158|Tottenham Green Leisure Centre\n152|Tottenham Seventh-Day Adventist Church\n137|Triangle Centre\n151|Victoria Stakes\n159|White Hart Lane Community Sports Centre\n131|Wood Green Central Library\nother|Other\n",
'options_source' => 'event_venue',
'multiple' => 0,
'title_display' => 'none',
'private' => 0,
'aslist' => 1,
'optrand' => 0,
'other_option' => NULL,
'other_text' => 'Other...',
'description' => '',
'custom_keys' => FALSE,
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '12',
'page_num' => 1,
),
27 => array(
'nid' => 4099,
'cid' => '27',
'pid' => '7',
'form_key' => 'other_venue',
'name' => 'Other Venue',
'type' => 'fieldset',
'value' => '',
'extra' => array(
'title_display' => 'none',
'private' => 0,
'collapsible' => 0,
'collapsed' => 0,
'webform_conditional_field_value' => 'other',
'webform_conditional_cid' => '23',
'webform_conditional_operator' => '=',
'description' => '',
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '0',
'weight' => '14',
'page_num' => 1,
),
28 => array(
'nid' => 4099,
'cid' => '28',
'pid' => '27',
'form_key' => 'venue_company_name',
'name' => 'Venue/Company name',
'type' => 'textfield',
'value' => '',
'extra' => array(
'title_display' => 'inline',
'private' => 0,
'disabled' => 0,
'unique' => 0,
'webform_conditional_field_value' => 'other',
'webform_conditional_cid' => '23',
'webform_conditional_operator' => '=',
'width' => '',
'maxlength' => '',
'field_prefix' => '',
'field_suffix' => '',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '15',
'page_num' => 1,
),
29 => array(
'nid' => 4099,
'cid' => '29',
'pid' => '27',
'form_key' => 'address_line_1',
'name' => 'Address Line 1',
'type' => 'textfield',
'value' => '',
'extra' => array(
'title_display' => 'before',
'private' => 0,
'disabled' => 0,
'unique' => 0,
'webform_conditional_field_value' => 'other',
'webform_conditional_cid' => '23',
'webform_conditional_operator' => '=',
'width' => '',
'maxlength' => '',
'field_prefix' => '',
'field_suffix' => '',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '16',
'page_num' => 1,
),
30 => array(
'nid' => 4099,
'cid' => '30',
'pid' => '27',
'form_key' => 'address_line_2',
'name' => 'Address Line 2',
'type' => 'textfield',
'value' => '',
'extra' => array(
'title_display' => 'before',
'private' => 0,
'disabled' => 0,
'unique' => 0,
'webform_conditional_field_value' => 'other',
'webform_conditional_cid' => '23',
'webform_conditional_operator' => '=',
'width' => '',
'maxlength' => '',
'field_prefix' => '',
'field_suffix' => '',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '0',
'weight' => '17',
'page_num' => 1,
),
31 => array(
'nid' => 4099,
'cid' => '31',
'pid' => '27',
'form_key' => 'town_city',
'name' => 'Town/City',
'type' => 'textfield',
'value' => '',
'extra' => array(
'title_display' => 'before',
'private' => 0,
'disabled' => 0,
'unique' => 0,
'webform_conditional_field_value' => 'other',
'webform_conditional_cid' => '23',
'webform_conditional_operator' => '=',
'width' => '',
'maxlength' => '',
'field_prefix' => '',
'field_suffix' => '',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '18',
'page_num' => 1,
),
32 => array(
'nid' => 4099,
'cid' => '32',
'pid' => '27',
'form_key' => 'county',
'name' => 'County',
'type' => 'textfield',
'value' => '',
'extra' => array(
'title_display' => 'before',
'private' => 0,
'disabled' => 0,
'unique' => 0,
'webform_conditional_field_value' => 'other',
'webform_conditional_cid' => '23',
'webform_conditional_operator' => '=',
'width' => '',
'maxlength' => '',
'field_prefix' => '',
'field_suffix' => '',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '0',
'weight' => '19',
'page_num' => 1,
),
33 => array(
'nid' => 4099,
'cid' => '33',
'pid' => '27',
'form_key' => 'postcode',
'name' => 'Postcode',
'type' => 'textfield',
'value' => '',
'extra' => array(
'title_display' => 'before',
'private' => 0,
'width' => '20',
'disabled' => 0,
'unique' => 0,
'maxlength' => '7',
'webform_conditional_field_value' => 'other',
'webform_conditional_cid' => '23',
'webform_conditional_operator' => '=',
'field_prefix' => '',
'field_suffix' => '',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '20',
'page_num' => 1,
),
8 => array(
'nid' => 4099,
'cid' => '8',
'pid' => '4',
'form_key' => 'dates',
'name' => 'Dates',
'type' => 'fieldset',
'value' => '',
'extra' => array(
'title_display' => 0,
'private' => 0,
'collapsible' => 0,
'collapsed' => 0,
'conditional_operator' => '=',
'description' => '',
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '0',
'weight' => '6',
'page_num' => 1,
),
9 => array(
'nid' => 4099,
'cid' => '9',
'pid' => '8',
'form_key' => 'starting',
'name' => 'Starting',
'type' => 'date',
'value' => '',
'extra' => array(
'timezone' => 'user',
'title_display' => 'before',
'private' => 0,
'datepicker' => 1,
'year_textfield' => 0,
'start_date' => '0 years',
'end_date' => '+2 years',
'description' => '',
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '7',
'page_num' => 1,
),
25 => array(
'nid' => 4099,
'cid' => '25',
'pid' => '8',
'form_key' => 'number_of_occurrences',
'name' => 'Number of occurrences',
'type' => 'select',
'value' => '1',
'extra' => array(
'items' => "1|1\n2|2\n3|3\n4|4\n5|5\n6|6\n7|7\n8|8\n9|9\n10|10",
'multiple' => 0,
'title_display' => 'before',
'private' => 0,
'aslist' => 1,
'optrand' => 0,
'other_option' => NULL,
'other_text' => 'Other...',
'description' => '',
'custom_keys' => FALSE,
'options_source' => '',
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '8',
'page_num' => 1,
),
11 => array(
'nid' => 4099,
'cid' => '11',
'pid' => '8',
'form_key' => 'how_often_does_this_event_occur',
'name' => 'How often does this event occur?',
'type' => 'select',
'value' => '',
'extra' => array(
'items' => "655|One off\n656|Daily\n657|Weekly\n658|Forthnightly\n659|Monthly\n660|Other\n",
'options_source' => 'event_frequency',
'multiple' => 0,
'title_display' => 'before',
'private' => 0,
'aslist' => 1,
'optrand' => 0,
'other_option' => NULL,
'other_text' => 'Other...',
'description' => '',
'custom_keys' => FALSE,
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '9',
'page_num' => 1,
),
13 => array(
'nid' => 4099,
'cid' => '13',
'pid' => '4',
'form_key' => 'event_contact_details',
'name' => 'Event Contact Details ',
'type' => 'textarea',
'value' => '',
'extra' => array(
'description' => 'Please note that these contact details WILL be published with the event details, in case customers want any more information',
'title_display' => 0,
'private' => 0,
'resizable' => 0,
'disabled' => 0,
'conditional_operator' => '=',
'cols' => '',
'rows' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '7',
'page_num' => 1,
),
1 => array(
'nid' => 4099,
'cid' => '1',
'pid' => '0',
'form_key' => 'your_contact_details',
'name' => 'Your Contact Details',
'type' => 'fieldset',
'value' => '',
'extra' => array(
'description' => 'Please note that your contact details are for internal use only in case we have a query with the details submitted. These details will not be published on the site.',
'title_display' => 0,
'private' => 0,
'collapsible' => 0,
'collapsed' => 0,
'conditional_operator' => '=',
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '0',
'weight' => '2',
'page_num' => 1,
),
2 => array(
'nid' => 4099,
'cid' => '2',
'pid' => '1',
'form_key' => 'full_name',
'name' => 'Full Name',
'type' => 'textfield',
'value' => '',
'extra' => array(
'title_display' => 'inline',
'private' => 0,
'disabled' => 0,
'unique' => 0,
'conditional_operator' => '=',
'width' => '',
'maxlength' => '',
'field_prefix' => '',
'field_suffix' => '',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '1',
'page_num' => 1,
),
24 => array(
'nid' => 4099,
'cid' => '24',
'pid' => '1',
'form_key' => 'phone_number',
'name' => 'Phone Number',
'type' => 'textfield',
'value' => '',
'extra' => array(
'title_display' => 'inline',
'private' => 0,
'disabled' => 0,
'unique' => 0,
'width' => '',
'maxlength' => '',
'field_prefix' => '',
'field_suffix' => '',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '2',
'page_num' => 1,
),
3 => array(
'nid' => 4099,
'cid' => '3',
'pid' => '1',
'form_key' => 'email_address',
'name' => 'Email Address',
'type' => 'email',
'value' => '',
'extra' => array(
'title_display' => 'inline',
'private' => 0,
'disabled' => 0,
'unique' => 0,
'conditional_operator' => '=',
'width' => '',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '3',
'page_num' => 1,
),
14 => array(
'nid' => 4099,
'cid' => '14',
'pid' => '0',
'form_key' => 'admission_details',
'name' => 'Admission Details',
'type' => 'fieldset',
'value' => '',
'extra' => array(
'title_display' => 0,
'private' => 0,
'collapsible' => 0,
'collapsed' => 0,
'conditional_operator' => '=',
'description' => '',
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '0',
'weight' => '3',
'page_num' => 1,
),
15 => array(
'nid' => 4099,
'cid' => '15',
'pid' => '14',
'form_key' => 'cost',
'name' => 'Cost',
'type' => 'select',
'value' => '',
'extra' => array(
'items' => "616|Free Event\n628|Under £10\n630|£10 or over\n",
'options_source' => 'event_cost',
'multiple' => 0,
'title_display' => 'before',
'private' => 0,
'aslist' => 1,
'optrand' => 0,
'other_option' => NULL,
'other_text' => 'Other...',
'description' => '',
'custom_keys' => FALSE,
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '3',
'page_num' => 1,
),
16 => array(
'nid' => 4099,
'cid' => '16',
'pid' => '14',
'form_key' => 'concessions_etc',
'name' => 'Concessions etc',
'type' => 'textarea',
'value' => '',
'extra' => array(
'description' => 'Please add any additional pricing details, including any available concessions',
'title_display' => 0,
'private' => 0,
'resizable' => 0,
'disabled' => 0,
'conditional_operator' => '=',
'cols' => '',
'rows' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '0',
'weight' => '4',
'page_num' => 1,
),
17 => array(
'nid' => 4099,
'cid' => '17',
'pid' => '0',
'form_key' => 'type_of_event',
'name' => 'Type of event',
'type' => 'fieldset',
'value' => '',
'extra' => array(
'title_display' => 0,
'private' => 0,
'collapsible' => 0,
'collapsed' => 0,
'conditional_operator' => '=',
'description' => '',
'conditional_component' => '',
'conditional_values' => '',
),
'mandatory' => '0',
'weight' => '4',
'page_num' => 1,
),
18 => array(
'nid' => 4099,
'cid' => '18',
'pid' => '17',
'form_key' => 'event_category',
'name' => 'Event Category',
'type' => 'select',
'value' => '',
'extra' => array(
'items' => "615|Advice, jobs and training\n629|Art and crafts\n646|Children and families\n653|Cinema/film\n654|Comedy\n619|Community events\n648|Energy efficiency scheme\n649|Food market\n618|Health and well-being\n647|Literature\n636|Local history\n623|Music\n632|Nature and wildlife\n652|Other\n622|Play session\n639|Sports\n642|Theatre and dance\n",
'options_source' => 'event_category',
'multiple' => 1,
'title_display' => 'none',
'private' => 0,
'aslist' => 0,
'optrand' => 0,
'other_option' => NULL,
'other_text' => 'Other...',
'description' => '',
'custom_keys' => FALSE,
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '4',
'page_num' => 1,
),
19 => array(
'nid' => 4099,
'cid' => '19',
'pid' => '17',
'form_key' => 'please_give_details',
'name' => 'Please give any other details',
'type' => 'textarea',
'value' => '',
'extra' => array(
'title_display' => 0,
'private' => 0,
'resizable' => 0,
'disabled' => 0,
'webform_conditional_field_value' => "Other\n652",
'webform_conditional_cid' => '18',
'webform_conditional_operator' => '=',
'cols' => '',
'rows' => '',
'description' => '',
'attributes' => array(),
'conditional_component' => '',
'conditional_operator' => '=',
'conditional_values' => '',
),
'mandatory' => '1',
'weight' => '5',
'page_num' => 1,
),
)

If you have the option, preferably, you should store the items individually - It will be much easier to change parts of the data, and will allow you to abstract the language you're using away from the data storage
If that's not an option, consider storing the data in a different way - Maybe serialize the data before you save it to the DB, and then unserialize it when you retrieve it. Unserialize keeps the data type and structure.
If you can't do that, then you would probably have to parse the string and build a new array from that, or eval the entire string to a variable and then use the variable.

Try this:
eval("\$array = " . $stringArrayData);
Then,
print_r($array);

# try this:
# fileA:array.txt(file contains the strings)
# fileB:
$ar_source = include 'array.txt';
var_dump($ar_source );

Related

Retrieving repeater data from ACF Pro and adding it to Woocommerce Tab

I'm attempting to add repeater data from Advanced Custom Fields Pro onto a Woocommerce product page. I have 3 custom fields, all repeaters. All 3 fields have subfields, such as a Title, and a Value.
For example, Technical Specifics (technical_specifics) has 2 subfields, Titles (titles) and Values (values). This data is being displayed as a table.
SDS and TDS both have File Name (file_name) and PDF link (pdf_file). This data is being displayed as a file name and a link to a PDF on the server.
I have the below code, which adds the tabs correctly, but no data is coming into the page, so the tabs have blank data. What am I doing wrong to retrieve the array data?
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
/*
* Add 3 custom product data tabs
*/
function woo_new_product_tab( $tabs ) {
// Adds the new tab
if(get_field('technical_specifics'))
$tabs['technical_specifics'] = array(
'title' => __( 'Technical Specifics', 'woocommerce' ),
'priority' => 15,
'callback' => 'technical_specifics_callback'
);
if(get_field('sds'))
$tabs['sds'] = array(
'title' => __( 'SDS', 'woocommerce' ),
'priority' => 20,
'callback' => 'sds_callback'
);
if(get_field('tds'))
$tabs['tds'] = array(
'title' => __( 'TDS', 'woocommerce' ),
'priority' => 25,
'callback' => 'tds_callback'
);
return $tabs;
}
function technical_specifics_callback() {
// The new tab content
$per_unit_or_square = get_field( 'pricem2_or_priceunit_', $item->get_product_id() );
$technical_specifics = get_field('technical_specifics');
$technical_spec = $technical_specifics[0];
?>
<div>
<table style="width: 100%;">
<tr>
<?php
foreach ($technical_spec['titles'] as $key => $values)
{
?>
<th><?php echo $values['title1']; ?></th>
<th><?php echo $values['title2']; ?></th>
<th><?php echo $values['title3']; ?></th>
<th><?php echo $values['title4']; ?></th>
<th><?php echo $values['title5']; ?></th>
<th><?php echo $values['title6']; ?></th>
<?php
}
?>
</tr>
<?php
foreach ($technical_spec['values'] as $key => $value)
{
?>
<tr>
<td><?php echo $value['value1']; ?></td>
<td><?php echo $value['value2']; ?></td>
<td><?php echo $value['value3']; ?></td>
<td><?php echo $value['value4']; ?></td>
<td><?php echo $value['value5']; ?></td>
<td><?php echo $value['value6']; ?></td>
</tr>
<?php
}
?>
</table>
</div>
<?php
}
function sds_callback(){
// The new tab content
$sds = get_field('sds');
if(isset($sds[0]))
{
?>
<div class="sds-spec">
<ul class="list">
<?php
foreach ($sds as $key => $value)
{
?>
<li>
Download <?php echo $value['file_name']; ?>
</li>
<?php
}
?>
</ul>
</div>
<?php
}
}
function tds_callback(){
// The new tab content
$tds = get_field('tds');
if(isset($tds[0]))
{
?>
<div class="sds-spec">
<ul class="list">
<?php
foreach ($tds as $key => $value)
{
?>
<li>
Download <?php echo $value['file_name']; ?>
</li>
<?php
}
?>
</ul>
</div>
<?php
}
}
This is the PHP code generated by my ACF fields.
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array(
'key' => 'group_5e326b8892b0f',
'title' => 'Product Technical Specifics',
'fields' => array(
array(
'key' => 'field_5e326be12fa37',
'label' => 'Technical Specifics',
'name' => 'technical_specifics',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'collapsed' => '',
'min' => 1,
'max' => 1,
'layout' => 'block',
'button_label' => '',
'sub_fields' => array(
array(
'key' => 'field_5e326c132fa38',
'label' => 'Titles',
'name' => 'titles',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'collapsed' => '',
'min' => 1,
'max' => 1,
'layout' => 'table',
'button_label' => '',
'sub_fields' => array(
array(
'key' => 'field_5e4a7d6ed08c1',
'label' => 'Title1',
'name' => 'title1',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5e4a81283bc92',
'label' => 'Title2',
'name' => 'title2',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5e4a81323bc93',
'label' => 'Title3',
'name' => 'title3',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5e4a813c3bc94',
'label' => 'Title4',
'name' => 'title4',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5e4a81463bc95',
'label' => 'Title5',
'name' => 'title5',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5e4a81533bc96',
'label' => 'Title6',
'name' => 'title6',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
),
),
array(
'key' => 'field_5e326c642fa39',
'label' => 'Values',
'name' => 'values',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'collapsed' => '',
'min' => 1,
'max' => 0,
'layout' => 'table',
'button_label' => '',
'sub_fields' => array(
array(
'key' => 'field_5e4a80478bb97',
'label' => 'Value1',
'name' => 'value1',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5e4a80598bb98',
'label' => 'Value2',
'name' => 'value2',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5e4a80658bb99',
'label' => 'Value3',
'name' => 'value3',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5e4a80718bb9a',
'label' => 'Value4',
'name' => 'value4',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5e4a807c8bb9b',
'label' => 'Value5',
'name' => 'value5',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5e4a808b8bb9c',
'label' => 'Value6',
'name' => 'value6',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
),
),
),
),
array(
'key' => 'field_5f2a9e5a6ec81',
'label' => 'SDS',
'name' => 'sds',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'collapsed' => '',
'min' => 0,
'max' => 0,
'layout' => 'table',
'button_label' => '',
'sub_fields' => array(
array(
'key' => 'field_5f2a9e726ec82',
'label' => 'File Name',
'name' => 'file_name',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5f2a9e776ec83',
'label' => 'Pdf File',
'name' => 'pdf_file',
'type' => 'file',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'url',
'library' => 'all',
'min_size' => '',
'max_size' => '',
'mime_types' => '',
),
),
),
array(
'key' => 'field_5f2a9e906ec84',
'label' => 'TDS',
'name' => 'tds',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'collapsed' => '',
'min' => 0,
'max' => 0,
'layout' => 'table',
'button_label' => '',
'sub_fields' => array(
array(
'key' => 'field_5f2a9e906ec85',
'label' => 'File Name',
'name' => 'file_name',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5f2a9e906ec86',
'label' => 'Pdf File',
'name' => 'pdf_file',
'type' => 'file',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'url',
'library' => 'all',
'min_size' => '',
'max_size' => '',
'mime_types' => '',
),
),
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'product',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => true,
'description' => '',
'show_in_rest' => false,
));
endif;
Based on how you describe your repeater fields & the code you've given, it sounds like you might be accessing them incorrectly.
I'll put what I believe the code needs to be to access the values correctly below, however, for debugging sake, in the "technical_specifics_callback" function, could you try var_dump the following variables (per_unit_or_square, technical_specifics & technical_spec) and see if they return values?
From my understanding, I suspect that you either need to add the post id to the get_field('technical_specifics') call. Or the foreach call needs to be updated to work with how repeaters work (code example below).
<?php
<?php
function technical_specifics_callback() {
$per_unit_or_square = get_field( 'pricem2_or_priceunit_', $item->get_product_id() );
$technical_specifics = get_field('technical_specifics');
$title_row = "";
$values_row = "";
foreach( $technical_specifics as $item ) {
$title_row .= "<th>" . $item["title"] . "</th>";
$values_row .= "<td>" . $item["values"] . "</td>";
}
?>
<div>
<table style="width: 100%;">
<tr><?php echo $title_row;?></tr>
<tr><?php echo $values_row;?></tr>
</table>
</div>
<?php
}

post_object fields don't work any more after including ACF

After I included ACF into my Plugin fields of type 'user' and 'post_object' don't work any more. They worked perfectly fine before I included ACF. They are displayed but they don't show me any options any more. Any clue what this might have caused? I guess that some link might have changed but I can't find any hint to that in the code:
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array(
'key' => 'group_5f65057cd8301',
'title' => 'Employees Details',
'fields' => array(
array(
'key' => 'field_5f8a0c6792e45',
'label' => 'Display Name',
'name' => 'display_name',
'type' => 'user',
'instructions' => '',
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'role' => array(
0 => 'employee',
1 => 'administrator',
),
'allow_null' => 0,
'multiple' => 0,
'return_format' => 'array',
),
array(
'key' => 'field_5f65089dbbe1d',
'label' => 'Occupation',
'name' => 'occupation',
'type' => 'post_object',
'instructions' => '',
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'post_type' => array(
0 => 'occupations',
),
'taxonomy' => '',
'allow_null' => 0,
'multiple' => 0,
'return_format' => 'object',
'ui' => 1,
),
array(
'key' => 'field_5f8b42ca6c4c6',
'label' => 'Costs per Hour',
'name' => 'costs_per_hour',
'type' => 'number',
'instructions' => 'Enter a number with max 2 decimals, separated by ".", e.g. "35.46"',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'min' => '',
'max' => '',
'step' => '0.01',
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'employees',
),
),
),
'menu_order' => 0,
'position' => 'acf_after_title',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => true,
'description' => '',
));
endif;
In the meantime I found this:
In the console there are errors as these:
Failed to load resource: the server responded .../advanced-custom-fields/assets/css/acf-global.css?ver=5.9.1
ReferenceError:Can't find variable: acf Global Code post-new.php 1972
(actually my post-new.php doesn't even have so many lines)
When I click on the last one the debugger gives me this:
acf.data = {"postboxes":[{...
acf.doAction( 'prepare' )
And when I finally look into the apache_error.log there are errors like:
File does not exist: /Applications/MAMP/htdocs/myPlugin/Applications, referrer: http://localhost:8888/myPlugin/wp-admin/post-new.php?post_type=jobs

WP ACF Generate php – Where and how to put the code?

On my WordPress website I have the ACF plugin installed and I'm using the fields on several pages in the 'regular' way. So I created the groups and fields in the backend. Everything works fine.
Now I want to generate php code of a couple of those field groups (because I want to change the code slightly). Where do I put the code and what’s the best way to do this?
I've created a new php file acf-deals.php and uploaded it to the /php-includes/ directory in the root directory. It includes the following code:
<?php
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array(
'key' => 'group_deal1',
'title' => 'Deal One (displayed on homepage)',
'fields' => array(
array(
'key' => 'field_5c66e017f8359',
'label' => 'Title',
'name' => 'deal_title_one',
'type' => 'text',
'instructions' => '(max. 100 characters)',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => 'deals-title',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => 100,
),
array(
'key' => 'field_5c6d43781bcb1',
'label' => 'Deal or Discount',
'name' => 'discount_deal_or_special_one',
'type' => 'radio',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_5c66e017f8359',
'operator' => '!=empty',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
'Discount' => 'Discount',
'Deal' => 'Deal',
),
'allow_null' => 1,
'other_choice' => 0,
'default_value' => '',
'layout' => 'vertical',
'return_format' => 'value',
'save_other_choice' => 0,
),
array(
'key' => 'field_5c66e094f835a',
'label' => 'Description',
'name' => 'deal_description_one',
'type' => 'textarea',
'instructions' => '(max. 600 characters)',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_5c66e017f8359',
'operator' => '==empty',
),
),
),
'wrapper' => array(
'width' => '',
'class' => 'deals-description',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'maxlength' => 600,
'rows' => '',
'new_lines' => '',
),
array(
'key' => 'field_5c66e0d4f835b',
'label' => 'Regular price',
'name' => 'regular_price_one',
'type' => 'number',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => 'deals-regular-price',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '$',
'append' => '',
'min' => '',
'max' => '',
'step' => '',
),
array(
'key' => 'field_5c66e130f835c',
'label' => 'Discounted price / deal price',
'name' => 'discounted_price_one',
'type' => 'number',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => 'deals-discounted-price',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '$',
'append' => '',
'min' => '',
'max' => '',
'step' => '',
),
array(
'key' => 'field_5c703c1fd5851',
'label' => 'Valid until',
'name' => 'valid_until_one',
'type' => 'date_picker',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'display_format' => 'm/d/Y',
'return_format' => 'm/d/Y',
'first_day' => 1,
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'post',
),
array(
'param' => 'post_format',
'operator' => '==',
'value' => 'aside',
),
),
array(
array(
'param' => 'post_format',
'operator' => '==',
'value' => 'status',
),
),
),
'menu_order' => 1,
'position' => 'acf_after_title',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
));
endif;
?>
I've added this code to my single-aside.php file:
<?php get_template_part( '/php-includes/acf-deals.php', 'acf-deals' ); ?>
Unfortunately the field are not showing up in the WP admin backend. What am I doing wrong? I searched and searched but can't find a proper explanation or a way to fix it. I hope someone can help.
Thanks for your help!
add_action('acf/init', function(){
... add local fields
})

How to wrap hardcoded array in PHP?

I want to separate some part of my arrays so I can make the details dynamic and different in my WordPress website.
I'm using ACF to get my custom post type taxonomy and trying to generate some attributes and make them tabs using the acf_add_local_field_group function but unfortunately am not able to make it work.
The reason why I want to separate the array is because am not able to call global $post; and I have a function which is a meta box for that to retrieve the taxonomy terms.
Here is my code:
function my_acf_add_local_field_groups()
{
acf_add_local_field_group(array(
'key' => 'tab_group_1',
'title' => 'Product Sizes and Prices',
'name' => 'group_sizes_tab',
'fields' => array(
array(
'key' => 'field_tab_size_1',
'label' => 'First Size',
'name' => 'store_sizes_',
'type' => 'tab',
'parent' => 'tab_group_1',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
) ,
'collapsed' => '',
'min' => '',
'max' => '',
) ,
array(
'key' => 'field_unique_key',
'label' => 'Simple Repeater',
'name' => 'simple_repeater',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
) ,
'collapsed' => '',
'min' => 0,
'max' => 10,
'layout' => 'table',
'button_label' => 'Add row',
'sub_fields' => array(
array(
'key' => 'field_unique_key_1',
'label' => 'Total Products',
'name' => 'total_products',
'type' => 'text',
) ,
array(
'key' => 'field_unique_key_2',
'label' => 'Total Prices',
'name' => 'total_prices',
'type' => 'text',
) ,
) ,
) ,
array(
'key' => 'field_tab_size_2',
'label' => 'Second Size',
'name' => 'store_sizes_2',
'type' => 'tab',
'parent' => 'tab_group_1',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
) ,
'collapsed' => '',
'min' => '',
'max' => '',
) ,
) ,
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'products',
) ,
) ,
) ,
));
}
add_action('acf/init', 'my_acf_add_local_field_groups');
As you can see in the group_sizes_tab the fields value is the one I want to separate. Am thinking storing it in a variable but when I tested it it doesn't work.
Just to make it short, basically outside the function it'll be like this:
$fields = array(
'key' => 'field_tab_size_1',
'label' => 'First Size',
'name' => 'store_sizes_',
'type' => 'tab',
'parent' => 'tab_group_1',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
) ,
'collapsed' => '',
'min' => '',
'max' => '',
);
Then I replace this value inside the function but it is not working.
How can I wrap the array and replace it with a variable in the function?

CakePHP get an ordered hash as a result of query

I create a web application which is using CakePHP2. I build up a query with CakePHP ORM but the result is not as what I am expected. So my question is: Is it possible to set up query with CakePHP ORM to get result like as I expected.
Here my query:
$addresses = $this->User->Profile->Address->AddressType->find('all', array(
'recursive' => -1,
'joins' => array(
array(
'table' => 'addresses',
'alias' => 'Address',
'type' => 'LEFT',
'conditions' => array(
'AddressType.id = Address.address_type_id'
)
),
array(
'table' => 'profiles',
'alias' => 'Profile',
'type' => 'LEFT',
'conditions' => array(
'Address.profile_id = Profile.id'
),
),
array(
'table' => 'users',
'alias' => 'User',
'type' => 'LEFT',
'conditions' => array(
'User.profile_id = Profile.id'
),
)
),
'conditions' => array(
'User.id' => $id
),
//'group' => array('AddressType.id'),
'fields' => array(
'Address.*',
'AddressType.*',
'Profile.id',
'User.id'
),
));
Here my result:
array(
(int) 0 => array(
'Address' => array(
'id' => '4',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '1',
'name' => 'test',
'zip' => 'test',
'city' => 'test',
'street' => 'test',
'number' => 'test',
),
'AddressType' => array(
'id' => '1',
'name' => 'Shipping Address',
'code' => 'shipping_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 1 => array(
'Address' => array(
'id' => '5',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '2',
'name' => 'test - (invoice)',
'zip' => 'test',
'city' => 'test',
'street' => 'test',
'number' => 'test',
),
'AddressType' => array(
'id' => '2',
'name' => 'Invoice Address',
'code' => 'invoice_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 2 => array(
'Address' => array(
'id' => '6',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '1',
'name' => 'Test 3',
'zip' => 'Test 3',
'city' => 'Test 3',
'street' => 'Test 3',
'number' => 'Test 3',
),
'AddressType' => array(
'id' => '1',
'name' => 'Shipping Address',
'code' => 'shipping_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 3 => array(
'Address' => array(
'id' => '7',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '4',
'name' => 'Test 4',
'zip' => 'Test 4',
'city' => 'Test 4',
'street' => 'Test 4',
'number' => '',
),
'AddressType' => array(
'id' => '4',
'name' => 'test_type',
'code' => 'test_type'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 4 => array(
'Address' => array(
'id' => '8',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '1',
'name' => 'test5',
'zip' => 'test5',
'city' => 'test5',
'street' => 'test5',
'number' => 'test5',
),
'AddressType' => array(
'id' => '1',
'name' => 'Shipping Address',
'code' => 'shipping_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 5 => array(
'Address' => array(
'id' => '9',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '4',
'name' => 'Tesztecske',
'zip' => 'Test 41',
'city' => 'Test 41',
'street' => 'Test 41',
'number' => 'test',
),
'AddressType' => array(
'id' => '4',
'name' => 'test_type',
'code' => 'test_type'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 6 => array(
'Address' => array(
'id' => '10',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '2',
'name' => 'test - (invoice)2222758',
'zip' => 'test',
'city' => 'test',
'street' => 'test',
'number' => 'test',
),
'AddressType' => array(
'id' => '2',
'name' => 'Invoice Address',
'code' => 'invoice_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 7 => array(
'Address' => array(
'id' => '13',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '2',
'name' => 'sdfgdfgsdfgdsfg',
'zip' => 'sdfg',
'city' => 'sdfg',
'street' => 'sdfgsdfg',
'number' => 'sdfgsdfg',
),
'AddressType' => array(
'id' => '2',
'name' => 'Invoice Address',
'code' => 'invoice_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
)
)
So i want result which is grouped by address type name.
array(
'Shipping Address' =>array(
(int) 0 => array(
'Address' => array(
'id' => '4',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '1',
'name' => 'test',
'zip' => 'test',
'city' => 'test',
'street' => 'test',
'number' => 'test',
),
'AddressType' => array(
'id' => '1',
'name' => 'Shipping Address',
'code' => 'shipping_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 1 => array(
'Address' => array(
'id' => '8',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '1',
'name' => 'test5',
'zip' => 'test5',
'city' => 'test5',
'street' => 'test5',
'number' => 'test5',
),
'AddressType' => array(
'id' => '1',
'name' => 'Shipping Address',
'code' => 'shipping_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 2 => array(
'Address' => array(
'id' => '6',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '1',
'name' => 'Test 3',
'zip' => 'Test 3',
'city' => 'Test 3',
'street' => 'Test 3',
'number' => 'Test 3',
),
'AddressType' => array(
'id' => '1',
'name' => 'Shipping Address',
'code' => 'shipping_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
),
'test_type' => array(
(int) 0 => array(
'Address' => array(
'id' => '7',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '4',
'name' => 'Test 4',
'zip' => 'Test 4',
'city' => 'Test 4',
'street' => 'Test 4',
'number' => '',
),
'AddressType' => array(
'id' => '4',
'name' => 'test_type',
'code' => 'test_type'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 1 => array(
'Address' => array(
'id' => '9',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '4',
'name' => 'Tesztecske',
'zip' => 'Test 41',
'city' => 'Test 41',
'street' => 'Test 41',
'number' => 'test',
),
'AddressType' => array(
'id' => '4',
'name' => 'test_type',
'code' => 'test_type'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 2 => array(
'Address' => array(
'id' => '5',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '2',
'name' => 'test - (invoice)',
'zip' => 'test',
'city' => 'test',
'street' => 'test',
'number' => 'test',
),
'AddressType' => array(
'id' => '2',
'name' => 'Invoice Address',
'code' => 'invoice_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
),
'Invoice Address' =>array(
(int) 0 => array(
'Address' => array(
'id' => '10',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '2',
'name' => 'test - (invoice)2222758',
'zip' => 'test',
'city' => 'test',
'street' => 'test',
'number' => 'test',
),
'AddressType' => array(
'id' => '2',
'name' => 'Invoice Address',
'code' => 'invoice_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
),
(int) 1 => array(
'Address' => array(
'id' => '13',
'profile_id' => '10',
'country_id' => '1',
'address_type_id' => '2',
'name' => 'sdfgdfgsdfgdsfg',
'zip' => 'sdfg',
'city' => 'sdfg',
'street' => 'sdfgsdfg',
'number' => 'sdfgsdfg',
),
'AddressType' => array(
'id' => '2',
'name' => 'Invoice Address',
'code' => 'invoice_address'
),
'Profile' => array(
'id' => '10'
),
'User' => array(
'id' => '10'
)
)
)
)

Categories