How to Use Scripts to Apply a Default Address to Shopify Orders

Infoplus Scripts can be used to auto-populate a default billing address into certain orders coming from Shopify if they do not already have a billing address.

There are cases where orders will come from Shopify into Infoplus without a billing address. Since Infoplus requires that orders have a billing address, these orders would get rejected by Infoplus and an alert would be created explaining why.  Infoplus Scripts can be used to auto-populate a default billing address into these orders coming from Shopify if they do not already have a billing address.  The following script will make this happen by first identifying if the billing address is missing, then if so, populates a default address of your choice which will allow the order to import into Infoplus without errors.

Infoplus Support can help with general questions about how scripting works. For help with a specific script or its outputs, you will need to submit a Pro Services request for paid support. Pro Service request form can be found here.

The first step is creating a script with the Script Type of "Shopping Cart Connection Order".  Next, populate the code section of the script with the following, making changes to the address variable as needed.

After the script is written and saved, it must be applied to the Shopify Shopping Cart Connection record in Infoplus.  Navigate to this record, select edit from the actions menu (or press the 'e' key), then in the script field select the script that was previously created.  Finally, don't forget to save the connection by clicking the Save button at the bottom of the changes.  

Once the script has been applied to the shopping cart connection, the script log table can be used to confirm the script is working as expected.  

NOTE: If not receiving Gift Cards, go to the Alert Table, verify a Business Transaction Alert of "no bill to information" apply the above script to the Shopping Cart Connection to enable customers to use gift cards on your Shopify site. 

 

Use Case: My orders keep getting blocked from entering Infoplus because the billing address exists but not the shipping address. 

Solution: Use this script to replace the shipping address with the billing address so that Infoplus can accept your orders without error.