Jump to content


Welcome to the forum:

Welcome to the iThemes, PluginBuddy and WebDesign.com forum. We've created several tutorial video's to help you get you started with using the forum, please check them out!

Also take note of the forum guidelines.


Support hours:

Our moderators actively respond to forum support requests during normal business hours which are Monday-Friday, 8am - 5pm Central Standard Time, typically within one business day. Although some moderators choose to work during the weekends, we can not guarantee immediate attention to your requests. Thanks for understanding.

What is included with support:

Premium support includes theme/plugin issues such as: bugs encountered under normal operation, how to use basic features, basic WordPress help, and basic help with customization (meaning we point you to resources and will help in more depth as time allows). More information.

resolved

How To Add A Field To Billing Info?

add a field billing exchange

23 replies to this topic

#21 Ronald

Ronald

    Forum Admin

  • Administrators
  • Others: All Plugins, All Themes, Moderators, Webdesign
  • 32,122 posts

Posted 16 January 2015 - 02:29 PM

the same in functions that you can add to functions.php (so no need to edit template files):

//
// shipping:
//

// add phone and company to list of Shipping address fields in superwidget
function my_superwidget_shipping_fields( $fields ) {

	array_push( $fields, 'phone', 'company_name' );
	return $fields;
	
}
add_filter( 'it_exchange_get_super_widget_shipping_address_fields_elements', 'my_superwidget_shipping_fields' );

// add phone and company to list of Shipping address fields in checkout page
function my_checkout_shipping_fields( $fields ) {

	array_push( $fields, 'phone', 'company_name' );
	return $fields;
	
}
add_filter( 'it_exchange_get_content_checkout/elements/purchase-requirements/shipping-address/elements/_fields_elements', 'my_checkout_shipping_fields' );
			 
//
// billing:
//

// add phone and company to list of Shipping address fields in superwidget
function my_superwidget_billing_fields( $fields ) {

	array_push( $fields, 'phone', 'company_name' );
	return $fields;
	
}
add_filter( 'it_exchange_get_super_widget_billing_address_fields_elements', 'my_superwidget_billing_fields' );

function my_checkout_billing_fields( $fields ) {

	$my_fields = array( 'phone', 'company_name' );
	
	array_splice( $fields, 8, 0, $my_fields );

	return $fields;
	
}
add_filter( 'it_exchange_get_content_checkout/elements/purchase-requirements/billing-address/elements/_fields_elements', 'my_checkout_billing_fields' );

Ronald

Join the iThemes Builder Community on Google+.



To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. Please also read the forum guidelines.



When asking your question/posting your request on the forum, please be as concise and specific as possible. The shorter your request, the more to the point, the more specific, the easier it will be for us to try and help out.


#22 evita3

evita3

    Advanced Member

  • Members
  • Others: Toolkit, Premium Exchange Addon
  • PipPipPip
  • 48 posts
  • LocationMexico

Posted 20 January 2015 - 04:24 PM

Perhaps the situation was not clearly explained. The above mentioned methods (altering the core, template files, or adding functions) do indeed add the fields as inputs.

What does not occur is the ability to do anything with these fields. They are not displayed for example in the shipping data on the confirmation page, or in the transaction email sent to the store admin.

Digging deeper, it's as if the output of fields is hard-coded, such as in 'api/shipping.php'. The function for displaying shipping data is:

/**
* Formats the Shipping Address for display
*
* @todo this function sucks. Lets make a function for formatting any address. ^gta
* @since 1.4.0
*
* @param array|bool $shipping_address
*
* @return string HTML
*/
function it_exchange_get_formatted_shipping_address( $shipping_address=false ) {
$formatted   = array();
$shipping	 = empty( $shipping_address ) ? it_exchange_get_cart_shipping_address() : $shipping_address;
$formatted[] = implode( ' ', array( $shipping['first-name'], $shipping['last-name'] ) );
if ( ! empty( $shipping['company-name'] ) )
  $formatted[] = $shipping['company-name'];
if ( ! empty( $shipping['address1'] ) )
  $formatted[] = $shipping['address1'];
if ( ! empty( $shipping['address2'] ) )
  $formatted[] = $shipping['address2'];
if ( ! empty( $shipping['city'] ) || ! empty( $shipping['state'] ) || ! empty( $shipping['zip'] ) ) {
  $formatted[] = implode( ' ', array( ( empty( $shipping['city'] ) ? '': $shipping['city'] .',' ),
   ( empty( $shipping['state'] ) ? '': $shipping['state'] ),
   ( empty( $shipping['zip'] ) ? '': $shipping['zip'] ),
  ) );
}
if ( ! empty( $shipping['country'] ) )
  $formatted[] = $shipping['country'];
$formatted = implode( '<br />', $formatted );
return apply_filters( 'it_exchange_get_formatted_shipping_address', $formatted );
}


#23 Ronald

Ronald

    Forum Admin

  • Administrators
  • Others: All Plugins, All Themes, Moderators, Webdesign
  • 32,122 posts

Posted 21 January 2015 - 10:59 AM

Hi,

which is why I said in my first post on this topic:

View PostRonald, on 12 December 2014 - 03:23 PM, said:

Then. based on your requirements, these fields can be made visible, but you can first give the above a try,

So re:

View Postevita3, on 20 January 2015 - 04:24 PM, said:

What does not occur is the ability to do anything with these fields. They are not displayed for example in the shipping data on the confirmation page, or in the transaction email sent to the store admin.

that would be the next step to look into. Can you give me an example on which page exactly you would like to see this information. The more specific you can be, the easier it will be to work on finding a generic solution.

thanks,
Ronald

Join the iThemes Builder Community on Google+.



To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. Please also read the forum guidelines.



When asking your question/posting your request on the forum, please be as concise and specific as possible. The shorter your request, the more to the point, the more specific, the easier it will be for us to try and help out.


#24 evita3

evita3

    Advanced Member

  • Members
  • Others: Toolkit, Premium Exchange Addon
  • PipPipPip
  • 48 posts
  • LocationMexico

Posted 22 January 2015 - 08:05 AM

My site is now live, and until it works I do not have an example to show. The behavior is the same on a fresh install so what you see should be the same.

To narrow the example we could focus on just adding a phone number to the shipping address, and displaying it in the shipping address data shown on the confirmation page and in the transaction email.

The sticking point is the comment of

Quote

Then. based on your requirements, these fields can be made visible
.

How would one make them visible?



Reply to this Topic


ATTENTION
If this topic is marked RESOLVED or INFORMATION, or if you are NOT experiencing EXACTLY the same issue, please start a new topic to provide the details of your problem. If the solution provided doesn't work for you, you should start a new topic. If you feel this thread contains relevant information, you may include a link to it in your new topic. To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. When posting your question or request on the forum, please be as concise and specific as possible. The shorter and more to the point you can make your request, the better.

For BackupBuddy related issues, be sure to include the status log from your most recent backup.

CLICK HERE to start a new topic in the Exchange ecommerce plugin forum.


  



Also tagged with one or more of these keywords: resolved, add a field, billing, exchange

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users