/** * Display value for a given attribute * * @param unknown_type $attributeDefinition * @return multitype:Ambigous <unknown, string> Ambigous <string, string> Ambigous <> */ public static function wps_attribute_values_display($attributeDefinition) { $attribute_unit_list = ''; if (!empty($attributeDefinition['unit'])) { /** Template parameters */ $template_part = 'product_attribute_unit'; $tpl_component = array(); $tpl_component['ATTRIBUTE_UNIT'] = $attributeDefinition['unit']; /** Build template */ $attribute_unit_list = wpshop_display::display_template_element($template_part, $tpl_component); unset($tpl_component); } $attribute_value = $attributeDefinition['value']; if ($attributeDefinition['data_type'] == 'decimal') { $attribute_value = is_numeric($attribute_value) ? number_format($attribute_value, 2, ',', '') : $attribute_value; if (in_array($attributeDefinition['code'], unserialize(WPSHOP_ATTRIBUTE_PRICES))) { if ($attributeDefinition['is_requiring_unit'] == 'yes') { $attribute_unit_list = ' ' . wpshop_tools::wpshop_get_currency(); } $attributeDefinition['value'] = wpshop_display::format_field_output('wpshop_product_price', $attributeDefinition['value']); } } if ($attributeDefinition['data_type'] == 'datetime') { $attribute_value = mysql2date('d/m/Y', $attributeDefinition['value'], true); } if ($attributeDefinition['backend_input'] == 'select') { $attribute_value = wpshop_attributes::get_attribute_type_select_option_info($attributeDefinition['value'], 'label', $attributeDefinition['data_type_to_use']); } /** Manage differently if its an array of values or not */ if ($attributeDefinition['backend_input'] == 'multiple-select') { $attribute_value = ''; if (is_array($attributeDefinition['value'])) { foreach ($attributeDefinition['value'] as $v) { $attribute_value .= ' / ' . wpshop_attributes::get_attribute_type_select_option_info($v, 'label', $attributeDefinition['data_type_to_use']); } } else { $attribute_value = ' / ' . wpshop_attributes::get_attribute_type_select_option_info($attributeDefinition['value'], 'label', $attributeDefinition['data_type_to_use']); } $attribute_value = substr($attribute_value, 3); } return array($attribute_value, $attributeDefinition['value'], $attribute_unit_list); }
/** * Retrieve and display the variation for a given product * @param integer $product_id The product identifier to get variation for */ public static function wpshop_variation($post_id = '', $from_admin = false, $order_id = '', $qty = 1) { global $wp_query; $output = ''; $product_id = empty($post_id) ? $wp_query->post->ID : $post_id; $wpshop_product_attributes_frontend_display = get_post_meta($product_id, '_wpshop_product_attributes_frontend_display', true); $head_wpshop_variation_definition = get_post_meta($product_id, '_wpshop_variation_defining', true); /** Get attribute order for current product */ $product_attribute_order_detail = wpshop_attributes_set::getAttributeSetDetails(get_post_meta($product_id, WPSHOP_PRODUCT_ATTRIBUTE_SET_ID_META_KEY, true)); $output_order = array(); if (count($product_attribute_order_detail) > 0) { if (!empty($product_attribute_order_detail)) { foreach ($product_attribute_order_detail as $product_attr_group_id => $product_attr_group_detail) { foreach ($product_attr_group_detail['attribut'] as $position => $attribute_def) { if (!empty($attribute_def->code)) { $output_order[$attribute_def->code] = $position; } } } } } $variations_params = array(); $variation_attribute = array(); $variation_attribute_ordered = array(); $possible_values = array(); $possible_values_for_selection_calculation = array(); /* Vérification de l'existence de déclinaison pour le produit */ $wpshop_variation_list = self::get_variation($product_id); if (!empty($wpshop_variation_list)) { foreach ($wpshop_variation_list as $variation) { if (!empty($variation['variation_def'])) { $display_option = get_post_meta($post_id, '_wpshop_product_attributes_frontend_display', true); foreach ($variation['variation_def'] as $attribute_code => $attribute_value) { if (empty($display_option) || !empty($display_option['attribute']) && !empty($display_option['attribute'][$attribute_code]) && !empty($display_option['attribute'][$attribute_code]['complete_sheet'])) { $tpl_component = array(); $attribute_db_definition = wpshop_attributes::getElement($attribute_code, "'valid'", 'code'); $default_value_is_serial = false; $attribute_list_first_element = $attribute_db_definition->default_value; if (!empty($attribute_db_definition->default_value) && ($attribute_db_definition->default_value == serialize(false) || @unserialize($attribute_db_definition->default_value) !== false)) { $default_value_is_serial = true; $tmp_default_value = unserialize($attribute_db_definition->default_value); $attribute_list_first_element = !empty($tmp_default_value['field_options']['label_for_first_item']) ? $tmp_default_value['field_options']['label_for_first_item'] : null; } if ($default_value_is_serial && !empty($attribute_list_first_element) && $attribute_list_first_element != 'none') { $possible_values[$attribute_code][0][0] = $default_value_is_serial && !empty($attribute_list_first_element) && $attribute_list_first_element != 'none' ? stripslashes(sprintf($attribute_list_first_element, strtolower($attribute_db_definition->frontend_label))) : __('Choose a value', 'wpshop'); } if (!empty($attribute_value) && $attribute_db_definition->data_type_to_use == 'custom') { $tpl_component['VARIATION_VALUE'] = stripslashes(wpshop_attributes::get_attribute_type_select_option_info($attribute_value, 'label', 'custom')); $position = wpshop_attributes::get_attribute_type_select_option_info($attribute_value, 'position', 'custom'); } else { if (!empty($attribute_value) && $attribute_db_definition->data_type_to_use == 'internal') { $post_def = get_post($attribute_value); $tpl_component['VARIATION_VALUE'] = stripslashes($post_def->post_title); $position = $post_def->menu_order; } } if (!empty($variation['variation_dif'])) { foreach ($variation['variation_dif'] as $attribute_dif_code => $attribute_dif_value) { $wpshop_prices_attributes = unserialize(WPSHOP_ATTRIBUTE_PRICES); $the_value = $attribute_dif_value; if (in_array($attribute_dif_code, $wpshop_prices_attributes)) { $the_value = wpshop_display::format_field_output('wpshop_product_price', $attribute_dif_value); } $tpl_component['VARIATION_DIF_' . strtoupper($attribute_dif_code)] = stripslashes($the_value); } } if (!empty($attribute_value)) { $possible_values[$attribute_code][$position][$attribute_value] = wpshop_display::display_template_element('product_variation_item_possible_values', $tpl_component, array('type' => 'attribute_for_variation', 'id' => $attribute_code)); $possible_values_for_selection_calculation[$attribute_code][$attribute_value] = $tpl_component['VARIATION_VALUE']; } unset($tpl_component); } } } } $variation_tpl = array(); if (!empty($head_wpshop_variation_definition['attributes'])) { foreach ($head_wpshop_variation_definition['attributes'] as $attribute_code) { $attribute_db_definition = wpshop_attributes::getElement($attribute_code, "'valid'", 'code'); if (!empty($attribute_db_definition)) { $attribute_display_state = wpshop_attributes::check_attribute_display($attribute_db_definition->is_visible_in_front, $wpshop_product_attributes_frontend_display, 'attribute', $attribute_code, 'complete_sheet'); $is_required = !empty($head_wpshop_variation_definition['options']) && !empty($head_wpshop_variation_definition['options']['required_attributes']) && in_array($attribute_code, $head_wpshop_variation_definition['options']['required_attributes']) ? true : false; if (!$is_required && $attribute_db_definition->is_required == 'yes') { $is_required = true; } $input_def = array(); $input_def['type'] = $attribute_db_definition->frontend_input; $value = isset($head_wpshop_variation_definition['options']['attributes_default_value'][$attribute_code]) ? $head_wpshop_variation_definition['options']['attributes_default_value'][$attribute_code] : (!empty($attribute_db_definition->default_value) ? $attribute_db_definition->default_value : null); if (in_array($attribute_db_definition->frontend_input, array('radio', 'checkbox'))) { unset($possible_values[$attribute_code][0]); $value = array($value); } $input_def['id'] = 'wpshop_variation_attr_' . $attribute_code; $input_def['name'] = $attribute_code; $real_possible_values = array(); if (!empty($possible_values[$attribute_code])) { ksort($possible_values[$attribute_code]); foreach ($possible_values[$attribute_code] as $position => $def) { foreach ($def as $attribute_value => $attribute_value_output) { $real_possible_values[$attribute_value] = $attribute_value_output; } } } $input_def['possible_value'] = $real_possible_values; $input_def['valueToPut'] = 'index'; $input_def['value'] = $value; $input_def['options']['more_input'] = ''; if (!empty($possible_values_for_selection_calculation[$attribute_code])) { foreach ($possible_values_for_selection_calculation[$attribute_code] as $value_id => $value) { $input_def['options']['more_input'] .= '<input type="hidden" disabled="disabled" value="' . str_replace("\\", "", $value) . '" name="' . $input_def['id'] . '_current_value" id="' . $input_def['id'] . '_current_value_' . $value_id . '" />'; } } $input_def['options_label']['original'] = true; $input_def['option'] = ' class="wpshop_variation_selector_input' . ($is_required ? ' attribute_is_required_input attribute_is_required_input_' . $attribute_code . ' ' : '') . ($attribute_db_definition->_display_informations_about_value == 'yes' ? ' wpshop_display_information_about_value' : '') . ' ' . (is_admin() ? $attribute_db_definition->backend_css_class : $attribute_db_definition->frontend_css_class) . '" '; if (!empty($real_possible_values)) { $tpl_component = array(); $attribute_output_def['value'] = isset($head_wpshop_variation_definition['options']['attributes_default_value'][$attribute_code]) ? $head_wpshop_variation_definition['options']['attributes_default_value'][$attribute_code] : $input_def['value']; $tpl_component['VARIATION_INPUT'] = wpshop_form::check_input_type($input_def, WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION) . $input_def['options']['more_input']; $tpl_component['VARIATION_LABEL'] = $is_required ? '<span class="attribute_is_required attribute_is_required_' . $attribute_code . '" >' . stripslashes($attribute_db_definition->frontend_label) . '</span> <span class="required" >*</span>' : stripslashes($attribute_db_definition->frontend_label); $tpl_component['VARIATION_CODE'] = $attribute_code; $tpl_component['VARIATION_LABEL_HELPER'] = !empty($attribute_db_definition->frontend_help_message) ? ' title="' . $attribute_db_definition->frontend_help_message . '" ' : ''; $tpl_component['VARIATION_LABEL_CLASS'] = !empty($attribute_db_definition->frontend_help_message) ? ' wpshop_att_variation_helper' : ''; $tpl_component['VARIATION_IDENTIFIER'] = $input_def['id']; $tpl_component['VARIATION_PARENT_ID'] = $product_id; $tpl_component['VARIATION_PARENT_TYPE'] = WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT; $tpl_component['VARIATION_CONTAINER_CLASS'] = ($is_required ? ' attribute_is_required_container attribute_is_required_container_' . $attribute_code : '') . ' wpshop_variation_' . $attribute_code . ' wpshop_variation_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . ' wpshop_variation_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_' . $product_id; $tpl_component['VARIATION_REQUIRED_INDICATION'] = $is_required ? __('Required variation', 'wpshop') : ''; $variation_tpl['VARIATION_COMPLETE_OUTPUT_' . strtoupper($attribute_code)] = wpshop_display::display_template_element('product_variation_item', $tpl_component); $variation_attribute_ordered[$output_order[$attribute_code]] = $variation_tpl['VARIATION_COMPLETE_OUTPUT_' . strtoupper($attribute_code)]; } $variation_attribute[] = $attribute_code; } } } } $variation_tpl['VARIATION_FORM_ELEMENT_ID'] = $product_id; wp_reset_query(); $attribute_defined_to_be_user_defined = wpshop_attributes::get_attribute_user_defined(array('entity_type_id' => self::currentPageCode)); if (!empty($attribute_defined_to_be_user_defined)) { foreach ($attribute_defined_to_be_user_defined as $attribute_not_in_variation_but_user_defined) { $is_required = !empty($head_wpshop_variation_definition['options']) && !empty($head_wpshop_variation_definition['options']['required_attributes']) && in_array($attribute_not_in_variation_but_user_defined->code, $head_wpshop_variation_definition['options']['required_attributes']) || $attribute_not_in_variation_but_user_defined->is_required == 'yes' ? true : false; $attribute_display_state = wpshop_attributes::check_attribute_display($attribute_not_in_variation_but_user_defined->is_visible_in_front, $wpshop_product_attributes_frontend_display, 'attribute', $attribute_not_in_variation_but_user_defined->code, 'complete_sheet'); if ($attribute_display_state && array_key_exists($attribute_not_in_variation_but_user_defined->code, $output_order) && !in_array($attribute_not_in_variation_but_user_defined->code, $variation_attribute) && $attribute_not_in_variation_but_user_defined->is_used_for_variation == 'no') { $attribute_output_def = wpshop_attributes::get_attribute_field_definition($attribute_not_in_variation_but_user_defined, is_array($head_wpshop_variation_definition) && isset($head_wpshop_variation_definition['options']['attributes_default_value'][$attribute_not_in_variation_but_user_defined->code]) ? $head_wpshop_variation_definition['options']['attributes_default_value'][$attribute_not_in_variation_but_user_defined->code] : null); $tpl_component = array(); $attribute_output_def['option'] = ' class="wpshop_variation_selector_input' . ($is_required ? ' attribute_is_required_input attribute_is_required_input_' . $attribute_not_in_variation_but_user_defined->code : '') . ' ' . str_replace('"', '', str_replace('class="', '', $attribute_output_def['option'])) . ' ' . (is_admin() ? $attribute_not_in_variation_but_user_defined->backend_css_class : $attribute_not_in_variation_but_user_defined->frontend_css_class) . '" '; $tpl_component['VARIATION_INPUT'] = wpshop_form::check_input_type($attribute_output_def, WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION . '[free]') . $attribute_output_def['options']; $tpl_component['VARIATION_LABEL'] = $is_required ? '<span class="attribute_is_required attribute_is_required_' . $attribute_not_in_variation_but_user_defined->code . '" >' . stripslashes($attribute_not_in_variation_but_user_defined->frontend_label) . '</span> <span class="required" >*</span>' : stripslashes($attribute_not_in_variation_but_user_defined->frontend_label); $tpl_component['VARIATION_CODE'] = $attribute_not_in_variation_but_user_defined->code; $tpl_component['VARIATION_LABEL_HELPER'] = !empty($attribute_not_in_variation_but_user_defined->frontend_help_message) ? ' title="' . $attribute_not_in_variation_but_user_defined->frontend_help_message . '" ' : ''; $tpl_component['VARIATION_LABEL_CLASS'] = !empty($attribute_not_in_variation_but_user_defined->frontend_help_message) ? ' wpshop_att_variation_helper' : ''; $tpl_component['VARIATION_REQUIRED_INDICATION'] = $is_required ? __('Required variation', 'wpshop') : ''; $tpl_component['VARIATION_IDENTIFIER'] = $attribute_output_def['id']; $tpl_component['VARIATION_PARENT_ID'] = $product_id; $tpl_component['VARIATION_PARENT_TYPE'] = WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT; $tpl_component['VARIATION_CONTAINER_CLASS'] = ($is_required ? ' attribute_is_required_container attribute_is_required_container_' . $attribute_not_in_variation_but_user_defined->code : '') . ' wpshop_variation_' . $attribute_not_in_variation_but_user_defined->code . ' wpshop_variation_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . ' wpshop_variation_' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT . '_' . $product_id; $variation_tpl['VARIATION_COMPLETE_OUTPUT_' . strtoupper($attribute_not_in_variation_but_user_defined->code)] = $attribute_output_def['type'] != 'hidden' ? wpshop_display::display_template_element('product_variation_item', $tpl_component) : wpshop_form::check_input_type($attribute_output_def, WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION . '[free]') . $attribute_output_def['options']; $variation_attribute_ordered[$output_order[$attribute_not_in_variation_but_user_defined->code]] = $variation_tpl['VARIATION_COMPLETE_OUTPUT_' . strtoupper($attribute_not_in_variation_but_user_defined->code)]; } } } $variation_tpl['VARIATION_FORM_VARIATION_LIST'] = ''; if (!empty($variation_attribute_ordered) && is_array($variation_attribute_ordered)) { ksort($variation_attribute_ordered); foreach ($variation_attribute_ordered as $attribute_variation_to_output) { $variation_tpl['VARIATION_FORM_VARIATION_LIST'] .= $attribute_variation_to_output; } } $variation_tpl['FROM_ADMIN_INDICATOR'] = $variation_tpl['ORDER_ID_INDICATOR'] = ''; $variation_tpl['PRODUCT_ADDED_TO_CART_QTY'] = !empty($qty) ? $qty : 1; if ($from_admin && !empty($order_id)) { $variation_tpl['FROM_ADMIN_INDICATOR'] = '<input type="hidden" name="wps_orders_from_admin" value="1" />'; $variation_tpl['ORDER_ID_INDICATOR'] = '<input type="hidden" name="wps_orders_order_id" value="' . $order_id . '" />'; } $output = !empty($variation_tpl['VARIATION_FORM_VARIATION_LIST']) ? wpshop_display::display_template_element('product_variation_form', $variation_tpl) : ''; return $output; }
/** Give the content by column * @return array */ public static function orders_custom_columns($column, $post_id) { if (get_post_type($post_id) == WPSHOP_NEWTYPE_IDENTIFIER_ORDER) { global $civility, $order_status; $metadata = get_post_custom(); $order_postmeta = isset($metadata['_order_postmeta'][0]) ? unserialize($metadata['_order_postmeta'][0]) : ''; $addresses = get_post_meta($post_id, '_order_info', true); switch ($column) { case "order_identifier": if (!empty($order_postmeta['order_key'])) { echo '<b>' . $order_postmeta['order_key'] . '</b><br>'; } if (!empty($order_postmeta['order_invoice_ref'])) { echo !empty($order_postmeta['order_temporary_key']) ? '<b>' . $order_postmeta['order_invoice_ref'] . '</b>' : '<i>' . $order_postmeta['order_invoice_ref'] . '</i>'; } break; case "order_status": echo !empty($order_postmeta['order_status']) ? sprintf('<mark class="%s" id="order_status_' . $post_id . '">%s</mark>', sanitize_title(strtolower($order_postmeta['order_status'])), __($order_status[strtolower($order_postmeta['order_status'])], 'wpshop')) : __('Unknown Status', 'wpshop'); break; case "order_billing": if (!empty($addresses['billing']) && !empty($addresses['billing']['address']) && is_array($addresses['billing']['address'])) { $billing = $addresses['billing']['address']; } else { if (!empty($addresses['billing'])) { $billing = $addresses['billing']; } } if (!empty($billing)) { echo (!empty($billing['civility']) ? __(wpshop_attributes::get_attribute_type_select_option_info($billing['civility'], 'label', 'custom'), 'wpshop') : null) . ' <strong>' . (!empty($billing['address_first_name']) ? $billing['address_first_name'] : null) . ' ' . (!empty($billing['address_last_name']) ? $billing['address_last_name'] : null) . '</strong>'; echo empty($billing['company']) ? '<br />' : ', <i>' . $billing['company'] . '</i><br />'; echo (!empty($billing['address']) ? $billing['address'] : null) . '<br />'; echo (!empty($billing['postcode']) ? $billing['postcode'] : null) . ' ' . (!empty($billing['city']) ? $billing['city'] : null) . ', ' . (!empty($billing['country']) ? $billing['country'] : null); } else { echo __('No information available for user billing', 'wpshop'); } break; case "order_shipping": if (!empty($addresses['shipping']) && !empty($addresses['shipping']['address']) && is_array($addresses['shipping']['address'])) { $shipping = $addresses['shipping']['address']; } else { if (!empty($addresses['shipping'])) { $shipping = $addresses['shipping']; } } if (!empty($shipping)) { echo '<strong>' . (!empty($shipping['address_first_name']) ? $shipping['address_first_name'] : null) . ' ' . (!empty($shipping['address_last_name']) ? $shipping['address_last_name'] : null) . '</strong>'; echo empty($shipping['company']) ? '<br />' : ', <i>' . $shipping['company'] . '</i><br />'; echo (!empty($shipping['address']) ? $shipping['address'] : null) . '<br />'; echo (!empty($shipping['postcode']) ? $shipping['postcode'] : null) . ' ' . (!empty($shipping['city']) ? $shipping['city'] : null) . ', ' . (!empty($shipping['country']) ? $shipping['country'] : null); } else { echo __('No information available for user shipping', 'wpshop'); } break; case "order_type": echo '<a href="' . admin_url('post.php?post=' . $post_id . '&action=edit') . '">' . (!empty($order_postmeta['order_temporary_key']) ? __('Quotation', 'wpshop') : __('Basic order', 'wpshop')) . '</a>'; $buttons = '<p class="row-actions">'; // Voir la commande $buttons .= '<a class="button button-small" href="' . admin_url('post.php?post=' . $post_id . '&action=edit') . '">' . __('View', 'wpshop') . '</a>'; // Marquer comme envoy� if (!empty($order_postmeta['order_status']) && $order_postmeta['order_status'] == 'completed') { $buttons .= '<a data-id="' . $post_id . '" class="wps-bton-second-mini-rounded markAsShipped order_' . $post_id . ' wps-bton-loader">' . __('Mark as shipped', 'wpshop') . '</a> '; } else { if (!empty($order_postmeta['order_status']) && $order_postmeta['order_status'] == 'awaiting_payment') { // $buttons .= '<a class="button markAsCompleted order_'.$post_id.' alignleft" >'.__('Payment received', 'wpshop').'</a>' . wpshop_payment::display_payment_receiver_interface($post_id) . ' '; } } $buttons .= '</p>'; $buttons .= '<input type="hidden" name="input_wpshop_change_order_state" id="input_wpshop_change_order_state" value="' . wp_create_nonce("wpshop_change_order_state") . '" />'; $buttons .= '<input type="hidden" name="input_wpshop_dialog_inform_shipping_number" id="input_wpshop_dialog_inform_shipping_number" value="' . wp_create_nonce("wpshop_dialog_inform_shipping_number") . '" />'; $buttons .= '<input type="hidden" name="input_wpshop_validate_payment_method" id="input_wpshop_validate_payment_method" value="' . wp_create_nonce("wpshop_validate_payment_method") . '" />'; echo $buttons; break; case "order_total": $currency = !empty($order_postmeta['order_currency']) ? $order_postmeta['order_currency'] : get_option('wpshop_shop_default_currency'); echo isset($order_postmeta['order_grand_total']) ? number_format($order_postmeta['order_grand_total'], 2, '.', '') . ' ' . wpshop_tools::wpshop_get_sigle($currency) : 'NaN'; break; /*case "order_actions": $buttons = '<p class="row-actions">'; // Marquer comme envoy� if (!empty($order_postmeta['order_status']) && ($order_postmeta['order_status'] == 'completed')) { $buttons .= '<a class="button markAsShipped order_'.$post_id.'">'.__('Mark as shipped', 'wpshop').'</a> '; } else if (!empty($order_postmeta['order_status']) && ($order_postmeta['order_status'] == 'awaiting_payment' )) { // $buttons .= '<a class="button markAsCompleted order_'.$post_id.' alignleft" >'.__('Payment received', 'wpshop').'</a>' . wpshop_payment::display_payment_receiver_interface($post_id) . ' '; } // Voir la commande $buttons .= '<a class="button alignright" href="'.admin_url('post.php?post='.$post_id.'&action=edit').'">'.__('View', 'wpshop').'</a>'; $buttons .= '</p>'; $buttons .= '<input type="hidden" name="input_wpshop_change_order_state" id="input_wpshop_change_order_state" value="' . wp_create_nonce("wpshop_change_order_state") . '" />'; $buttons .= '<input type="hidden" name="input_wpshop_dialog_inform_shipping_number" id="input_wpshop_dialog_inform_shipping_number" value="' . wp_create_nonce("wpshop_dialog_inform_shipping_number") . '" />'; $buttons .= '<input type="hidden" name="input_wpshop_validate_payment_method" id="input_wpshop_validate_payment_method" value="' . wp_create_nonce("wpshop_validate_payment_method") . '" />'; echo $buttons; break;*/ } } }
?> " /> </div> <div class="customer_address wps-boxed"> <span class="wps-h4"><?php _e('Billing address', 'wpshop'); ?> </span> <?php $billing_option = get_option('wpshop_billing_address'); $addresses_customer = wps_address::get_addresses_list_no_hidden_attributes($customer_id); if (!empty($addresses_customer[$billing_option['choice']])) { $billing = reset($addresses_customer[$billing_option['choice']]); //echo '<strong>' . $billing['address_title']['value'] . '</strong>' . '' . '<br>'; echo @(__(wpshop_attributes::get_attribute_type_select_option_info($billing['civility']['value'], 'label', 'custom')) . ' <strong>' . $billing['address_first_name']['value'] . ' ' . $billing['address_last_name']['value'] . '</strong><br>'); echo @($billing['address']['value'] . '<br>'); echo @($billing['city']['value'] . ' ' . $billing['postcode']['value'] . ' ' . $billing['country']['value']) . '<br>'; } ?> </div> <div class="order_historic wps-boxed"> <a href="#" class="toggle-historic dashicons dashicons-arrow-down alignright"></a> <span class="wps-h4"><?php _e('Historic', 'wpshop'); ?> </span> <?php foreach ($this->get_orders_customer(3, $customer_id) as $order) { ?>