Jump to content


Welcome to the forum:

Welcome to the iThemes 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.

Memorial Weekend:

Monday, May 25 2015 is Memorial Day. Please note that the iThemes offices are closed during National Holidays.
Support will resume on Tuesday May 26.

resolved

How To Add A Field To Billing Info?

add a field billing exchange

26 replies to this topic

#21 Ronald

Ronald

    Forum Admin

  • Administrators
  • Others: All Plugins, All Themes, Moderators, Webdesign
  • 32,955 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
  • 51 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,955 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
  • 51 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?

#25 brandxp

brandxp

    New Member

  • Members
  • Others: BackupBuddy, Toolkit, Exchange - Stripe
  • 3 posts

Posted 16 March 2015 - 10:38 AM

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

Hi,

phone and company actually exist in the Billing address, they just are not being used. You can include the fields in the Billing Address fields by adding this code (either in your child themes functions.php or in the functions.php in the exchange folder in your child theme):

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

array_push( $fields, 'phone', 'company_name' );
return $fields;

}
add_filter( 'it_exchange_get_super_widget_billing_address_fields_elements', 'my_exchange_billing_fields' );

This will allow you to at least capture and store phone and company.

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

Hopefully my post here is relevant to this topic...

I successfully added the code above to my child theme's functions.php, and both the company name and phone number appear and function just fine on the web form. However, for some reason, only the company name is appearing with the remainder of the billing information on the admin's Sales Notification Email; for some reason the phone number is not being brought over (?)

If I understand correctly, I'm guessing there are not currently any additional shortcodes that can be added to bring over that phone number?  My email currently looks like this...

[it_exchange_email show=purchase_date]
[it_exchange_email show=receipt_id]
[it_exchange_email show=fullname]
[it_exchange_email show=billing_address]
[it_exchange_email show=order_table]


Any ideas? My apologies if I've missed anything else in this thread regarding this...

Mitchy

#26 megaken

megaken

    New Member

  • Members
  • Others: Exchange - Stripe, 3rd Party Exchange Addons
  • 2 posts

Posted 21 May 2015 - 11:38 AM

Hi, I'm tackling the same issue here: http://www.bidetto.com/product/toto-sw584-washlet-s350e/
Only need to add and capture the phone number field.
I got it to show up - but what is the step to collect it?
I don't care how or where it gets stored, as long as I can get to it.
thanks

#27 Ronald

Ronald

    Forum Admin

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

Posted 22 May 2015 - 03:11 PM

Hi,

I will try to work out an example soon,

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.




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