Telenor - Online Store' . date('Y-m-d H:i') . ''; // //If the array exists go through the products and group them // if (isset($nodes['node']) && !empty($nodes['node'])) { // foreach ($nodes['node'] as $node) { // _cognity_product_for_dynamic_remarketing_xml($node); // } // } // print ''; // drupal_exit(); // } // /** // * Function for each product of the skroutz xml // * @param [type] $item [description] // * @return [type] [description] // */ // function _cognity_product_for_dynamic_remarketing_xml($item) { // $node = node_load($item->nid); // $product_xml = ''; // $product_ids = array(); // if (isset($node->field_device_product[LANGUAGE_NONE][0]['product_id'])) { // foreach ($node->field_device_product[LANGUAGE_NONE] as $value) { // if (isset($product_ids[$value['product_id']])) { // continue; // } // $product = commerce_product_load($value['product_id']); // $product_xml .= _cognity_product_with_plan_for_xml($node, $product); // $product_ids[$value['product_id']] = $product->sku; // if ($product->status == 0) { // continue; // } // $product_xml .= ''; // $json = json_decode(variable_get('dynamic_remarketing_settings', '')); // $json = (array) $json; // $size = ''; // if (isset($product->field_shoe_size[LANGUAGE_NONE][0]['tid'])) { // $size = taxonomy_term_load($product->field_shoe_size[LANGUAGE_NONE][0]['tid']); // $size = $size->name; // } // foreach ($json as $key => $field) { // if (strstr($key, 'select_') && $field != '') { // $key = str_replace('select_', '', $key); // if ($json['default_' . $key] != '') { // $product_xml .= ''; // } // elseif ($field == 'node_nid') { // if (isset($node->field_old_id[LANGUAGE_NONE][0]['value'])) { // $product_xml .= '' . $node->field_old_id[LANGUAGE_NONE][0]['value'] . ''; // } // else { // $nid = (int) $node->nid; // $id = 300000 + $nid; // $product_xml .= '' . $id . ''; // } // } // elseif ($field == 'node_link') { // $product_xml .= '' . url('node/' . $node->nid, array('absolute' => TRUE)) . '?tab=device'; // } // elseif ($key == 'description') { // $field = str_replace('node_', '', $field); // if (isset($node->$field)) { // $field = $node->$field; // if (is_array($field)) { // if (isset($field['el'][0]['value']) && $field['el'][0]['value'] != '') { // $product_xml .= ''; // } // elseif (isset($field['en'][0]['value']) && $field['en'][0]['value'] != '') { // $product_xml .= ''; // } // elseif (isset($field[LANGUAGE_NONE][0]['value']) && $field[LANGUAGE_NONE][0]['value'] != '') { // $product_xml .= ''; // } // else { // $body = ""; // $product_xml .= ''; // } // } // } // } // elseif (strstr($field, 'node_')) { // $field = str_replace('node_', '', $field); // if ($key == 'additional_image_link') { // $field = $node->$field; // if (isset($field[LANGUAGE_NONE][0]['uri'])) { // foreach ($field[LANGUAGE_NONE] as $additional_image) { // $product_xml .= '' . file_create_url($additional_image['uri']) . ''; // } // } // } // else { // if (isset($node->$field)) { // $field = $node->$field; // if (is_array($field)) { // if (isset($field['el'][0]['value'])) { // $product_xml .= ''; // } // elseif (isset($field[LANGUAGE_NONE][0]['value'])) { // $product_xml .= ''; // } // elseif (isset($field[LANGUAGE_NONE][0]['uri'])) { // $product_xml .= ''; // } // elseif (isset($field[LANGUAGE_NONE][0]['tid'])) { // if ($key == 'product_type') { // $categories = ''; // foreach ($field[LANGUAGE_NONE] as $category) { // $term = taxonomy_term_load($category['tid']); // if ($term->name != '') { // if ($categories == '') { // $categories = $term->name; // } // else { // $categories .= ' - ' . $term->name; // } // } // } // $product_xml .= ''; // } // else { // $term = taxonomy_term_load($field[LANGUAGE_NONE][0]['tid']); // $product_xml .= 'name . ']]>'; // } // } // } // else { // if ($key == 'title') { // // $field = $field . ' - ' . $size; // $product_xml .= ''; // } // else { // $product_xml .= ''; // } // } // } // } // } // else { // $field = substr($field, 8); // if (isset($product->$field)) { // $field = $product->$field; // if ($key == 'additional_image_link') { // if (isset($field[LANGUAGE_NONE][0]['uri'])) { // foreach ($field[LANGUAGE_NONE] as $additional_image) { // $product_xml .= '' . file_create_url($additional_image['uri']) . ''; // } // } // } // else { // if (is_array($field)) { // if (isset($field[LANGUAGE_NONE][0]['value'])) { // $product_xml .= ''; // } // elseif (isset($field[LANGUAGE_NONE][0]['amount'])) { // $amount = $field[LANGUAGE_NONE][0]['amount']/100; // if (isset($node->field_on_sale[LANGUAGE_NONE][0]['value']) && $node->field_on_sale[LANGUAGE_NONE][0]['value'] == 1 && isset($node->field_sale_price[LANGUAGE_NONE][0]['amount']) && $node->field_sale_price[LANGUAGE_NONE][0]['amount'] > 0) { // $sale_amount = $node->field_sale_price[LANGUAGE_NONE][0]['amount']/100; // $product_xml .= '' . $amount . ' EUR'; // $product_xml .= '' . $sale_amount . ' EUR'; // } // else { // $product_xml .= '' . $amount . ' EUR'; // } // } // elseif (isset($field[LANGUAGE_NONE][0]['tid'])) { // $term = taxonomy_term_load($field[LANGUAGE_NONE][0]['tid']); // $product_xml .= 'name . ']]>'; // } // elseif (isset($field[LANGUAGE_NONE][0]['uri'])) { // $product_xml .= ''; // } // } // else { // $product_xml .= ''; // } // } // } // } // } // } // if ($product->commerce_stock[LANGUAGE_NONE][0]['value'] < 1) { // $product_xml .= ''; // } // else { // $product_xml .= ''; // } // $product_xml .= ''; // } // } // else { // return; // } // return $product_xml; // } // function _cognity_product_with_plan_for_xml($node, $product) { // $tariff_array = array(); // if (isset($product->field_price_option_fc[LANGUAGE_NONE]) && !empty($product->field_price_option_fc[LANGUAGE_NONE])) { // foreach ($product->field_price_option_fc[LANGUAGE_NONE] as $fc_id => $collection) { // $collection = field_collection_item_load($collection['value']); // if (isset($collection->field_price_option[LANGUAGE_NONE][0]['target_id'])) { // $tariff = node_load($collection->field_price_option[LANGUAGE_NONE][0]['target_id']); // if ($tariff->status == 0) { // continue; // } // $tariff_product = commerce_product_load($tariff->field_tariff_product[LANGUAGE_NONE][0]['product_id']); // if ($tariff_product->status == 0) { // continue; // } // if (isset($tariff_product->field_is_retention[LANGUAGE_NONE][0]['value']) && $tariff_product->field_is_retention[LANGUAGE_NONE][0]['value'] == '1' && (!isset($tariff->field_is_new[LANGUAGE_NONE][0]['value']) || $tariff->field_is_new[LANGUAGE_NONE][0]['value'] != '1')) { // continue; // } // $tariff_array[$tariff->field_tariff_contract[LANGUAGE_NONE][0]['value']][] = array( // $tariff_product->product_id => array( // 'title' => isset($tariff->title_field[$language->language][0]['value']) ? $tariff->title_field[$language->language][0]['value'] : $tariff->title, // 'sku' => $tariff_product->sku, // 'plan_id' => $tariff_product->product_id, // 'cash_price' => isset($collection->field_po_price_in_cash[LANGUAGE_NONE][0]['amount']) ? $collection->field_po_price_in_cash[LANGUAGE_NONE][0]['amount'] : '', // 'promo_price' => (isset($collection->field_promo_price[LANGUAGE_NONE][0]['amount']) && $collection->field_promo_price[LANGUAGE_NONE][0]['amount'] > 0) ? $collection->field_promo_price[LANGUAGE_NONE][0]['amount'] : '', // 'tariff_price' => $tariff_product->commerce_price[LANGUAGE_NONE][0]['amount'], // 'tariff_promo_price' => (isset($tariff_product->field_product_promotion_price[LANGUAGE_NONE][0]['amount']) && $tariff_product->field_product_promotion_price[LANGUAGE_NONE][0]['amount'] > 0) ? $tariff_product->field_product_promotion_price[LANGUAGE_NONE][0]['amount'] : '', // ), // ); // } // } // } // $product_xml = ''; // if (!empty($tariff_array)) { // $product_xml .= ''; // $json = json_decode(variable_get('dynamic_remarketing_settings', '')); // $json = (array) $json; // $size = ''; // if (isset($product->field_shoe_size[LANGUAGE_NONE][0]['tid'])) { // $size = taxonomy_term_load($product->field_shoe_size[LANGUAGE_NONE][0]['tid']); // $size = $size->name; // } // foreach ($json as $key => $field) { // if (strstr($key, 'select_') && $field != '') { // $key = str_replace('select_', '', $key); // if (strstr($key, 'price') || $key == 'id') { // continue; // } // if ($json['default_' . $key] != '') { // $product_xml .= ''; // } // elseif ($field == 'node_nid') { // $nid = (int) $node->nid; // $product_xml .= '' . $id . ''; // } // elseif ($key == 'description') { // $field = str_replace('node_', '', $field); // if (isset($node->$field)) { // $field = $node->$field; // if (is_array($field)) { // if (isset($field['el'][0]['value']) && $field['el'][0]['value'] != '') { // $product_xml .= ''; // } // elseif (isset($field['en'][0]['value']) && $field['en'][0]['value'] != '') { // $product_xml .= ''; // } // elseif (isset($field[LANGUAGE_NONE][0]['value']) && $field[LANGUAGE_NONE][0]['value'] != '') { // $product_xml .= ''; // } // else { // $body = ""; // $product_xml .= ''; // } // } // } // } // elseif (strstr($field, 'node_')) { // $field = str_replace('node_', '', $field); // if ($key == 'additional_image_link') { // $field = $node->$field; // if (isset($field[LANGUAGE_NONE][0]['uri'])) { // foreach ($field[LANGUAGE_NONE] as $additional_image) { // $product_xml .= '' . file_create_url($additional_image['uri']) . ''; // } // } // } // else { // if (isset($node->$field)) { // $field = $node->$field; // if (is_array($field)) { // if (isset($field['el'][0]['value'])) { // $product_xml .= ''; // } // elseif (isset($field[LANGUAGE_NONE][0]['value'])) { // $product_xml .= ''; // } // elseif (isset($field[LANGUAGE_NONE][0]['uri'])) { // $product_xml .= ''; // } // elseif (isset($field[LANGUAGE_NONE][0]['tid'])) { // if ($key == 'product_type') { // $categories = ''; // foreach ($field[LANGUAGE_NONE] as $category) { // $term = taxonomy_term_load($category['tid']); // if ($term->name != '') { // if ($categories == '') { // $categories = $term->name; // } // else { // $categories .= ' - ' . $term->name; // } // } // } // $product_xml .= ''; // } // else { // $term = taxonomy_term_load($field[LANGUAGE_NONE][0]['tid']); // $product_xml .= 'name . ']]>'; // } // } // } // else { // if ($key == 'title') { // // $field = $field . ' - ' . $size; // $product_xml .= ''; // } // else { // $product_xml .= ''; // } // } // } // } // } // else { // $field = substr($field, 8); // if (isset($product->$field)) { // $field = $product->$field; // if ($key == 'additional_image_link') { // if (isset($field[LANGUAGE_NONE][0]['uri'])) { // foreach ($field[LANGUAGE_NONE] as $additional_image) { // $product_xml .= '' . file_create_url($additional_image['uri']) . ''; // } // } // } // else { // if (is_array($field)) { // if (isset($field[LANGUAGE_NONE][0]['value'])) { // $product_xml .= ''; // } // elseif (isset($field[LANGUAGE_NONE][0]['amount'])) { // $amount = $field[LANGUAGE_NONE][0]['amount']/100; // if (isset($node->field_on_sale[LANGUAGE_NONE][0]['value']) && $node->field_on_sale[LANGUAGE_NONE][0]['value'] == 1 && isset($node->field_sale_price[LANGUAGE_NONE][0]['amount']) && $node->field_sale_price[LANGUAGE_NONE][0]['amount'] > 0) { // $sale_amount = $node->field_sale_price[LANGUAGE_NONE][0]['amount']/100; // $product_xml .= '' . $amount . ' EUR'; // $product_xml .= '' . $sale_amount . ' EUR'; // } // else { // $product_xml .= '' . $amount . ' EUR'; // } // } // elseif (isset($field[LANGUAGE_NONE][0]['tid'])) { // $term = taxonomy_term_load($field[LANGUAGE_NONE][0]['tid']); // $product_xml .= 'name . ']]>'; // } // elseif (isset($field[LANGUAGE_NONE][0]['uri'])) { // $product_xml .= ''; // } // } // else { // $product_xml .= ''; // } // } // } // } // } // } // if ($product->commerce_stock[LANGUAGE_NONE][0]['value'] < 1) { // $product_xml .= ''; // } // else { // $product_xml .= ''; // } // $product_xml_final = ''; // foreach ($tariff_array as $months => $tariffs) { // foreach ($tariffs as $tariff) { // $tariff = array_shift($tariff); // $product_xml_tmp = $product_xml; // $product_xml_tmp .= '' . $tariff['cash_price']/100 . ' BGN'; // if ($tariff['promo_price'] != '') { // $product_xml_tmp .= '' . $tariff['promo_price']/100 . ' BGN'; // } // $product_xml_tmp .= 'nid, array('absolute' => TRUE)) . '?plan=' . $tariff['plan_id'] . ' ]]>'; // $product_xml_tmp .= 'sku . '-' . $tariff['sku'] . ' ]]>'; // $product_xml_tmp .= ''; // $product_xml_final .= $product_xml_tmp; // } // } // // $product_xml .= ''; // } // return $product_xml_final; // } // function cognity_dynamic_remarketing_export_page() { // ini_set('memory_limit', '50000M'); // ini_set('mysql.connect_timeout', 14400); // ini_set('default_socket_timeout', 14400); // set_time_limit(0); // $query = new EntityFieldQuery; // $query->entityCondition('entity_type', 'node', '=') // ->propertyCondition('type', 'product') // ->fieldCondition('field_in_dynamic_remarketing', 'value', 1, '='); // $nodes = $query->execute(); // $json = json_decode(variable_get('dynamic_remarketing_settings', '')); // $json = (array) $json; // $seperate_json = _cognity_dynamic_remarketing_seperate_json($json); // $csv_array = array(); // foreach ($seperate_json['select'] as $key => $value) { // $row[] = '"' . $key . '"'; // } // $csv_array[] = implode(',', $row); // foreach ($nodes['node'] as $node) { // $row_array = _cognity_dynamic_remarketing_node_row($node, $seperate_json); // foreach ($row_array as $row) { // $row = implode(',', $row); // $row = preg_replace( "/\r|\n/", '', $row); // $csv_array[] = $row; // } // } // $csv = implode("\n", $csv_array); // $new_file = drupal_get_path('module', 'cognity_dynamic_remarketing') . '/files/export.csv'; // $file = fopen($new_file, 'w'); // fwrite($file, $csv); // fclose($file); // return t('Download here the file.') . ' CSV'; // } // function _cognity_dynamic_remarketing_seperate_json($json) { // $new_json = array(); // foreach ($json as $key => $value) { // $key = ' ' . $key; // if (strstr($key, ' default_')) { // $key = str_replace('default_', '', $key); // $new_json['default'][$key] = $value; // } // else { // $key = str_replace(' select_', '', $key); // $new_json['select'][$key] = $value; // } // } // return $new_json; // } // function _cognity_dynamic_remarketing_node_row($node, $seperate_json) { // $lang = language_default(); // $return_arrays = array(); // $node = node_load($node->nid); // foreach ($node->field_device_product[LANGUAGE_NONE] as $current_product_id) { // $return_array = array(); // foreach ($seperate_json['select'] as $key => $value) { // if ($value != '') { // $value = ' ' . $value; // if (strstr($value, ' node_')) { // $value = str_replace(' node_', '', $value); // if (isset($node->$value)) { // $field = $node->$value; // if (is_array($field) && isset($field[LANGUAGE_NONE][0])) { // if (isset($field[LANGUAGE_NONE][0]['value'])) { // $return_array[] = '"' . $field[LANGUAGE_NONE][0]['value'] . '"'; // } // elseif (isset($field[LANGUAGE_NONE][0]['tid'])) { // $term = taxonomy_term_load($field[LANGUAGE_NONE][0]['tid']); // if (isset($term->name)) { // $return_array[] = '"' . $term->name . '"'; // } // else { // $return_array[] = ''; // } // } // elseif ($field[LANGUAGE_NONE][0]['uri']) { // $return_array[] = '"' . file_create_url($field[LANGUAGE_NONE][0]['uri']) . '"'; // } // } // elseif (is_array($field) && isset($field[$lang->language][0])) { // if (isset($field[$lang->language][0]['value'])) { // $return_array[] = '"' . $field[$lang->language][0]['value'] . '"'; // } // elseif (isset($field[$lang->language][0]['tid'])) { // $term = taxonomy_term_load($field[$lang->language][0]['tid']); // if (isset($term->name)) { // $return_array[] = '"' . $term->name . '"'; // } // else { // $return_array[] = ''; // } // } // elseif ($field[$lang->language][0]['uri']) { // $return_array[] = '"' . file_create_url($field[$lang->language][0]['uri']) . '"'; // } // } // else { // if (is_array($field) && empty($field)) { // $return_array[] = ''; // } // else { // $return_array[] = '"' . $field . '"'; // } // } // } // else { // if ($value == 'link') { // $return_array[] = '"' . url('node/' . $node->nid, array('absolute' => TRUE)) . '"'; // } // else { // $return_array[] = ''; // } // } // } // elseif (strstr($value, ' product_')) { // $product = commerce_product_load($current_product_id['product_id']); // if ($product->product_id) { // $value = str_replace(' product_', '', $value); // if (isset($product->$value)) { // $field = $product->$value; // if (is_array($field) && isset($field[LANGUAGE_NONE][0])) { // if (isset($field[LANGUAGE_NONE][0]['value'])) { // $return_array[] = '"' . $field[LANGUAGE_NONE][0]['value'] . '"'; // } // elseif (isset($field[LANGUAGE_NONE][0]['tid'])) { // $term = taxonomy_term_load($field[LANGUAGE_NONE][0]['tid']); // if (isset($term->name)) { // $return_array[] = '"' . $term->name . '"'; // } // else { // $return_array[] = ''; // } // } // elseif (isset($field[LANGUAGE_NONE][0]['amount'])) { // $price = $field[LANGUAGE_NONE][0]['amount']/100; // $price = $price . ' EUR'; // $return_array[] = '"' . $price . '"'; // } // elseif ($field[LANGUAGE_NONE][0]['uri']) { // $return_array[] = '"' . file_create_url($field[LANGUAGE_NONE][0]['uri']) . '"'; // } // else { // $return_array[] = ''; // } // } // elseif (is_array($field) && isset($field[$lang->language][0])) { // if (isset($field[$lang->language][0]['value'])) { // $return_array[] = '"' . $field[$lang->language][0]['value'] . '"'; // } // elseif (isset($field[$lang->language][0]['tid'])) { // $term = taxonomy_term_load($field[$lang->language][0]['tid']); // if (isset($term->name)) { // $return_array[] = '"' . $term->name . '"'; // } // else { // $return_array[] = ''; // } // } // elseif (isset($field[$lang->language][0]['amount'])) { // $price = $field[LANGUAGE_NONE][0]['amount']/100; // $price = $price . ' EUR'; // $return_array[] = '"' . $price . '"'; // } // elseif ($field[$lang->language][0]['uri']) { // $return_array[] = '"' . file_create_url($field[$lang->language][0]['uri']) . '"'; // } // else { // $return_array[] = ''; // } // } // else { // $return_array[] = '"' . $field . '"'; // } // } // else { // $return_array[] = ''; // } // } // else { // $return_array[] = ''; // } // } // } // else { // if (isset($seperate_json['default'][$key]) && $seperate_json['default'][$key] != '') { // $return_array[] = '"' . $seperate_json['default'][$key] . '"'; // } // else { // $return_array[] = ''; // } // } // } // $return_arrays[] = $return_array; // } // return $return_arrays; // } // function cognity_dynamic_remarketing_page_form($form, &$form_state) { // $form = array( // '#prefix' => '
', // '#suffix' => '
', // ); // $json = json_decode(variable_get('dynamic_remarketing_settings', '')); // $json = (array) $json; // $node_fields = field_info_instances('node', 'device_smart_phone'); // $product_fields = field_info_instances('commerce_product', 'device_smart_phone'); // $options = array(); // $options[0] = '- Select -'; // foreach ($node_fields as $field_name => $field) { // $options['Node']['node_' . $field_name] = $field['label'] . ': ' . $field['field_name']; // } // $options['Node']['node_link'] = 'Link: Node Url'; // $options['Node']['node_nid'] = 'ID: NID'; // $options['Node']['node_title'] = 'Node: Title'; // foreach ($product_fields as $field_name => $field) { // $options['Product']['product_' . $field_name] = $field['label'] . ': ' . $field['field_name']; // } // $options['Product']['product_sku'] = 'Product: SKU'; // $adwords_attributes = _cognity_dynamic_remarketing_adwords_feed_attributes(); // $form['table'] = array( // '#prefix' => '', // '#suffix' => '
', // ); // $form['table']['header'] = array( // '#markup' => '' . t('Attribute') . '' . t('Default Value') . '' . t('Supported Values') . '', // ); // $form['table']['rows'] = array( // '#prefix' => '', // '#suffix' => '', // ); // $odd = FALSE; // foreach ($adwords_attributes as $attribute => $format) { // $format['title'] = isset($format['title']) ? $format['title'] : ''; // $format['syntax'] = isset($format['syntax']) ? $format['syntax'] : ''; // $format['supported_values'] = isset($format['supported_values']) ? $format['supported_values'] : ''; // if ($odd) { // $row_class = 'odd'; // $odd = FALSE; // } // else { // $row_class = 'even'; // $odd = TRUE; // } // $default_default = $select_default = ''; // if (isset($json['select_' . $attribute]) && $json['select_' . $attribute] != NULL) { // $select_default = $json['select_' . $attribute]; // } // if (isset($json['default_' . $attribute]) && $json['default_' . $attribute] != NULL) { // $default_default = $json['default_' . $attribute]; // } // $form['table']['rows'][$attribute] = array( // '#prefix' => '', // '#suffix' => '', // 'select_' . $attribute => array( // '#type' => 'select', // '#title' => $attribute, // '#options' => $options, // '#default_value' => $select_default, // '#prefix' => '', // '#suffix' => '
' . $format['title'] . '
', // ), // 'default_' . $attribute => array( // '#type' => 'textfield', // '#attributes' => array( // 'placeholder' => $format['example'] // ), // '#default_value' => $default_default, // '#prefix' => '', // '#suffix' => '
' . t('Syntax: ') . $format['syntax'] . '
', // ), // 'supported' => array( // '#prefix' => '', // '#suffix' => '', // '#markup' => '

' . $format['supported_values'] . '

', // ), // ); // } // $form['submit'] = array( // '#type' => 'submit', // '#value' => t('Save'), // '#submit' => array('cognity_dynamic_remarketing_page_form_sumbit'), // ); // return $form; // } // function cognity_dynamic_remarketing_page_form_sumbit($form, &$form_state) { // $json = array(); // $json_string = ''; // foreach ($form_state['values'] as $key => $value) { // if (strstr($key, 'select_')) { // if ($value == '0') { // $json[$key] = NULL; // } // else { // $json[$key] = $value; // } // } // if (strstr($key, 'default_')) { // if ($value == '') { // $json[$key] = NULL; // } // else { // $json[$key] = $value; // } // } // } // $json_string = json_encode($json); // variable_set('dynamic_remarketing_settings', $json_string); // } // function _cognity_dynamic_remarketing_adwords_feed_attributes() { // return array( // 'id' => array( // 'title' => t('Your product’s unique identifier'), // 'example' => t('A2B4'), // 'syntax' => t('Max 50 characters'), // ), // 'title' => array( // 'title' => t('Your product’s name'), // 'example' => t('Mens Pique Polo Shirt'), // 'syntax' => t('Max 150 characters'), // ), // 'description' => array( // 'title' => t('Your product’s description'), // 'example' => t('Red, 100% cotton, large men’s t-shirt'), // 'syntax' => t('Max 5000 characters'), // ), // 'link' => array( // 'title' => t('Your product’s landing page'), // 'example' => t('http://​www.example.​com/​asp​/sp.asp?cat=​12&id=1030'), // 'syntax' => t('Max 2000 characters'), // ), // 'image_link' => array( // 'title' => t('The URL of your product’s main image'), // 'example' => t('http://​www.example.​com/​image1.​jpg'), // 'syntax' => t('Max 2000 characters'), // ), // 'mobile_link' => array( // 'title' => t('Your product’s mobile-optimized landing page when you have a different URL for mobile and desktop traffic'), // 'example' => t('http://www.m.​example.​com/asp​/sp.asp?​cat=12&id=1030'), // 'syntax' => t('Max 2000 alphanumeric characters'), // ), // 'additional_image_link' => array( // 'title' => t('The URL of an additional image for your product'), // 'example' => t('http://​www.example.​com/​image1.​jpg'), // 'syntax' => t('Max 2000 characters'), // ), // 'availability' => array( // 'title' => t('Your product\'s availability'), // 'example' => t('in stock'), // 'supported_values' => t('in stock, out of stock, preorder'), // ), // 'availability_date' => array( // 'title' => t('The date a pre-ordered product becomes available for delivery'), // 'example' => t('2016-02-24T11:07:31​+0100 (UTC+1)'), // 'syntax' => t('Max 25 alphanumeric characters, ISO 8601 (YYYY-MM-DD, YYYY-MM-DDThh:mm:ss, YYYY-MM-DDThh:mm:ssZ)'), // ), // 'expiration_date' => array( // 'title' => t('The date that your product should stop showing'), // 'example' => t('2016-02-24T11:07:31​+0100 (UTC+1)'), // 'syntax' => t('Max 25 alphanumeric characters, ISO 8601 (YYYY-MM-DD, YYYY-MM-DDThh:mm:ss, YYYY-MM-DDThh:mm:ssZ)'), // ), // 'price' => array( // 'title' => t('Your product’s price'), // 'example' => t('15.00 USD'), // 'syntax' => t('Numeric, ISO 4217'), // ), // 'sale_price' => array( // 'title' => t('Your product\'s sale price'), // 'example' => t('15.00 USD'), // 'syntax' => t('Numeric, ISO 4217'), // ), // 'sale_price_effective_date' => array( // 'title' => t('The date range during which the product’s sale_​price applies'), // 'example' => t('2016-02-24T11:07:31​+0100 (UTC+1) / 2016-02-29T23:07:31​+0100 (UTC+1)'), // 'syntax' => t('Max 51 alphanumeric characters, ISO 8601 (YYYY-MM-DD, YYYY-MM-DDThh:mm:ss, YYYY-MM-DDThh:mm:ssZ), Separate start date and and end date with /'), // ), // 'unit_pricing_measure' => array( // 'title' => t('The measure and dimension of your product as it is sold'), // 'example' => t('1.5kg'), // 'syntax' => t('Numerical value + unit'), // 'supported_values' => t('Weight: oz, lb, mg, g, kg. Volume US imperial: floz, pt, qt, gal. Volume metric: ml, cl, l, cbm. Length: in, ft, yd, cm, m. Area: sqft, sqm. Per unit: ct'), // ), // 'unit_pricing_base_measure' => array( // 'title' => t('The product’s base measure for pricing (e.g. 100ml means the price is calculated based on a 100ml units)'), // 'example' => t('100g'), // 'syntax' => t('Integer + unit'), // 'supported_values' => t('Supported integers:1, 10, 100, 2, 4, 8. Weight: oz, lb, mg, g, kg. Volume US imperial: floz, pt, qt, gal. Volume metric: ml, cl, l, cbm. Length: in, ft, yd, cm, m. Area: sqft, sqm. Per unit: ct. Additional supported metric integer + unit combinations: 75cl, 750ml, 50kg, 1000kg.'), // ), // 'installment' => array( // 'title' => t('Details of an installment payment plan'), // 'example' => t('6, 50 BRL'), // 'syntax' => t('installment uses 2 sub-attributes: months (required): Integer, the number of installments the buyer has to pay. amount (optional): ISO 4217, the amount the buyer has to pay per month'), // ), // 'loyalty_points' => array( // 'title' => t('The number and type of loyalty points a customer receives when buying a product'), // 'example' => t('Program A, 100, 1.5'), // 'syntax' => t('loyalty_​points uses 3 sub-attributes: points_​value (required): Number of points earned for the product. name (optional): Name of the loyalty points program, 12 full-width characters or 24 roman characters. ratio (optional): Number, the ratio of a point when converted to currency'), // ), // 'google_product_category' => array( // 'title' => t('Google-defined product category for your product'), // 'example' => t('Apparel & Accessories > Clothing > Outerwear > Coats & Jackets'), // 'syntax' => t('Value from the Google product taxonomy The numerical category ID, or The full path of the category'), // 'supported_values' => t('https://support.google.com/merchants/answer/1705911'), // ), // 'product_type' => array( // 'title' => t('Product category that you define for your product'), // 'example' => t('Home > Women > Dresses > Maxi Dresses'), // 'syntax' => t('Max 750 alphanumeric character'), // ), // 'brand' => array( // 'title' => t('Your product’s brand name'), // 'example' => t('Google'), // 'syntax' => t('Max 70 characters'), // ), // 'gtin' => array( // 'title' => t('Your product’s Global Trade Item Number (GTIN)'), // 'example' => t('3234567890126'), // 'syntax' => t('Max 50 numeric characters (max 14 per value - added spaces and dashes are ignored)'), // 'supported_values' => t('UPC (in North America / GTIN-12): 12-digit number like 323456789012 8-digit UPC-E codes should be converted to 12-digit codes. EAN (in Europe / GTIN-13): 13-digit number like 3001234567892. JAN (in Japan / GTIN-13): 8 or 13-digit number like 49123456 or 4901234567894. ISBN (for books): 10 or 13-digit number like 1455582344 or 978-1455582341. If you have both, only include the 13-digit number. ISBN-10 are deprecated and should be converted to ISBN-13. ITF-14 (for multipacks / GTIN-14): 14-digit number like 10856435001702'), // ), // 'mpn' => array( // 'title' => t('Your product’s Manufacturer Part Number (mpn)'), // 'example' => t('GO12345OOGLE'), // 'syntax' => t('Max 70 alphanumeric characters'), // ), // 'identifier_exists' => array( // 'title' => t('To be used if your new product doesn’t have a GTIN and brand or MPN and brand'), // 'example' => t('no'), // 'supported_values' => t('yes: Product identifiers are assigned to the new product by the manufacturer. no: No GTIN, brand, or MPN are assigned to the new product by the manufacturer'), // ), // 'condition' => array( // 'title' => t('Your product’s condition'), // 'example' => t('new'), // 'supported_values' => t('new: Brand new, original, unopened packaging. refurbished: Professionally restored to working order, comes with a warranty, may or may not have the original packaging. used: Previously used, original packaging opened or missing'), // ), // 'adult' => array( // 'title' => t('Indicate a product includes sexually suggestive content'), // 'example' => t('yes'), // 'supported_values' => t('yes, no'), // ), // 'multipack' => array( // 'title' => t('The number of identical products sold within a merchant-defined multipack (No of Items'), // 'example' => t('6'), // 'syntax' => t('Integer, greater than 1 (multipacks cannot contain 1 product)'), // ), // 'is_bundle' => array( // 'title' => t('Indicates a product is a merchant-defined custom group of different products featuring one main product'), // 'example' => t('yes'), // 'supported_values' => t('yes, no'), // ), // 'energy_efficiency_class' => array( // 'title' => t('Your product’s energy label'), // 'example' => t('A+'), // 'supported_values' => t('G, F, E, D, C, B, A, A+, A++, A+++'), // ), // 'age_group' => array( // 'title' => t('Your product’s targeted demographic'), // 'example' => t('infant'), // 'supported_values' => t('newborn (Up to 3 months old), infant (Between 3-12 months old), toddler (Between 1-5 years old), kids (Between 5-13 years old), adult (Typically teens or older)'), // ), // 'color' => array( // 'title' => t('Your product’s color(s)'), // 'example' => t('Black'), // 'syntax' => t('Max 100 alphanumeric characters (max 40 characters per color)'), // ), // 'gender' => array( // 'title' => t('Your product’s targeted gender'), // 'example' => t('Unisex'), // 'supported_values' => t('male, female, unisex'), // ), // 'material' => array( // 'title' => t('Your product’s fabric or material'), // 'example' => t('leather'), // 'syntax' => t('Max 200 characters'), // ), // 'pattern' => array( // 'title' => t('Your product’s pattern or graphic print'), // 'example' => t('striped polka dot paisley'), // 'syntax' => t('Max 100 characters'), // ), // 'size' => array( // 'title' => t('Your product’s size'), // 'example' => t('XL'), // 'syntax' => t('Max 100 characters'), // ), // 'size_type' => array( // 'title' => t('Your apparel product’s cut'), // 'example' => t('maternity'), // 'syntax' => t('regular, petite, plus, big and tall, maternity'), // ), // 'size_system' => array( // 'title' => t('The country of the size system used by your product '), // 'example' => t('US'), // 'supported_values' => t('US, UK, EU, DE, FR, JP, CN (China), IT, BR, MEX, AU'), // ), // 'item_group_id' => array( // 'title' => t('ID for a group of products that come in different versions (variants)'), // 'example' => t('AB12345'), // 'syntax' => t('Max 50 alphanumeric characters'), // ), // 'adwords_redirect' => array( // 'title' => t('A URL that includes tracking parameters to help you understand traffic to your landing page'), // 'example' => t('http://www.​example.com/​product.​html'), // 'syntax' => t('Max 2000 characters'), // ), // 'promotion_id' => array( // 'title' => t('An identifier that allows to you match products to Merchant promotions'), // 'example' => t('ABC123'), // 'syntax' => t('Max 50 characters'), // ), // 'shipping' => array( // 'title' => t('Your product\'s shipping cost'), // 'example' => t('US:CA:Overnight:16.00 USD'), // 'syntax' => t('shipping uses 4 sub-attributes: country (optional): ISO 3166 country code. region or postal_​code or location_​id or location_group_name (optional). service (optional): Service class or shipping speed. price (required): Fixed shipping cost, including VAT if required'), // ), // 'included_destination' => array( // 'title' => t('A setting that you can use to include a product in a specific type of advertising campaign'), // 'example' => t('Shopping'), // 'supported_values' => t('Shopping, Display Ads'), // ), // 'excluded_destination' => array( // 'title' => t('A setting that you can use to exclude a product from participating in a specific type of advertising campaign'), // 'example' => t('Shopping'), // 'supported_values' => t('Shopping, Display Ads'), // ), // 'shipping_label' => array( // 'title' => t('Label that you assign to a product to help assign correct shipping costs in Merchant Center account settings'), // 'example' => t('perishable'), // 'syntax' => t('Max 100 characters'), // ), // 'shipping_weight' => array( // 'title' => t('The weight of the product used to calculate the shipping cost'), // 'example' => t('3 kg'), // 'syntax' => t('Integer + unit '), // 'supported_values' => t('Supported weights: 0–2000 lbs for imperial, 0–1000 kgs for metric. Supported units: lb, oz, g, kg'), // ), // 'shipping_length' => array( // 'title' => t('The length of the product used to calculate the shipping cost by dimensional weight'), // 'example' => t('20 in'), // 'syntax' => t('Integer + unit'), // 'supported_values' => t('Supported integers: 1 - 150 for inches, 1 - 400 for cm. Supported units: in, cm'), // ), // 'shipping_width' => array( // 'title' => t('The width of the product used to calculate the shipping cost by dimensional weight'), // 'example' => t('20 in'), // 'syntax' => t('Integer + unit'), // 'supported_values' => t('Supported integers: A value between 1 and 1000. Supported units: in, cm'), // ), // 'shipping_height' => array( // 'title' => t('The height of the product used to calculate the shipping cost by dimensional weight'), // 'example' => t('20 in'), // 'syntax' => t('Integer + unit'), // 'supported_values' => t('Supported integers: A value between 1 and 1000. Supported units: in, cm'), // ), // 'max_handling' => array( // 'title' => t('The longest amount of time between when an order is placed for a product and when the product ships.'), // 'example' => t('3'), // 'syntax' => t('Integer, greater than 1'), // ), // 'min_handling' => array( // 'title' => t('The shortest amount of time between when an order is placed for a product and when the product ships.'), // 'example' => t('1'), // 'syntax' => t('Integer, greater than 1'), // ), // 'tax' => array( // 'title' => t('Your product’s sales tax rate in percent'), // 'example' => t('US:CA:5.00:y'), // 'syntax' => t('tax uses 4 sub-attributes: rate (required): Tax rate as a percentage. country (optional): ISO 3166 country code. region or postal_​code or location_​id (optional). tax_​ship (optional): Specify if you charge tax on shipping. Accepted values are yes or no'), // ), // ); // } // /** // * Implements hook_menu(). // */ // function cognity_dynamic_remarketing_search_api_alter_callback_info() { // $callbacks['cognity_elastic_node_based_xml'] = array( // 'name' => t('cognity Elastic Node Based XML'), // 'description' => t('Node Based XML.'), // 'class' => 'CognityElasticNodeBasedXML', // ); // $callbacks['cognity_elastic_product_based_xml'] = array( // 'name' => t('cognity Elastic Product Based XML'), // 'description' => t('Product Based XML.'), // 'class' => 'CognityElasticProductBasedXML', // ); // return $callbacks; // } // /** // * @file // * Search API data alteration callback that adds the workflow state info to the entity. // */ // class CognityElasticNodeBasedXML extends SearchApiAbstractAlterCallback { // public function alterItems(array &$items) { // // Prevent session information from being saved while indexing. // drupal_save_session(FALSE); // foreach ($items as &$item) { // // $xml = _cognity_product_for_xml($item); // // $item->cognity_elastic_node_based_xml = str_replace('http://default/', 'https://www.telenor.bg/', $xml); // } // drupal_save_session(TRUE); // } // public function propertyInfo() { // return array( // 'cognity_elastic_node_based_xml' => array( // 'label' => t('Elastic Node Based XML'), // 'description' => t('Custom Elastic Node Based XML.'), // 'type' => 'text', // ), // ); // } // } // /** // * @file // * Search API data alteration callback that adds the workflow state info to the entity. // */ // class CognityElasticProductBasedXML extends SearchApiAbstractAlterCallback { // public function alterItems(array &$items) { // // Prevent session information from being saved while indexing. // drupal_save_session(FALSE); // foreach ($items as &$item) { // $xml = _cognity_product_for_dynamic_remarketing_xml($item); // $item->cognity_elastic_product_based_xml = str_replace('http://default/', 'https://www.telenor.bg/', $xml); // } // drupal_save_session(TRUE); // } // public function propertyInfo() { // return array( // 'cognity_elastic_product_based_xml' => array( // 'label' => t('Elastic Product Based XML'), // 'description' => t('Custom Elastic Product Based XML.'), // 'type' => 'text', // ), // ); // } // } Смартфони | Теленор

Смартфони