Use Scripts to apply a default address to Shopify orders

Use Scripts to apply a default address to Shopify orders

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.

 

Due to the ever-changing nature of writing and maintaining scripts, Infoplus does not provide support in this area. We recommend someone in your IT Department handles scripting requests internally so that you keep all control over the process.

 

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 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.