Skip to content

Commit

Permalink
set region (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
rheber authored Jul 30, 2024
1 parent 56a768a commit b7aa3b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions spiff-connect/public/js/create-design-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,6 @@ const spiffLaunchCustomerPortal = (applicationKey, redirectUrl) => {
hostedExperience.execute({});
};

window.Spiff.setRegion(ajax_object.region_code);
window.spiffAppendCreateDesignButton = spiffAppendCreateDesignButton;
window.spiffLaunchCustomerPortal = spiffLaunchCustomerPortal;
5 changes: 4 additions & 1 deletion spiff-connect/spiff-connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,10 @@ function spiff_enqueue_ecommerce_client() {
array(),
null
);
wp_localize_script('spiff-create-design-button', 'ajax_object', array('ajax_url' => admin_url( 'admin-ajax.php' )));
wp_localize_script('spiff-create-design-button', 'ajax_object', array(
'ajax_url' => admin_url( 'admin-ajax.php' ),
'region_code' => esc_js(strtolower(get_option('spiff_infrastructure') ?? "AU"))
));
}

/**
Expand Down

0 comments on commit b7aa3b1

Please sign in to comment.