Skip to content

Commit

Permalink
Update wpc2o-options-api.php
Browse files Browse the repository at this point in the history
  • Loading branch information
AshleyRedman committed Jan 17, 2024
1 parent 741625d commit 4a7207f
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions includes/wpc2o-options-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
*/
function wpc2o_get_api_view(): string
{
$content = '<h1>API Credentials</h1>';
$content .= '<div style="padding:6px 0;">';
$content .= '<ol style="margin-left: 16px;">';
$content .= '<li>Test mode: <strong>' . get_option(constant('WPC2O_API_TEST_MODE')) . '</strong></li>';
$content .= '<li>Key: <strong>' . get_option(constant('WPC2O_API_KEY')) . '</strong></li>';
$content .= '<li>Order endpoint: <strong>' . get_option(constant('WPC2O_API_ENDPOINT')) . '</strong></li>';
$content .= '<li>Stock endpoint: <strong>' . get_option(constant('WPC2O_API_STOCK_ENDPOINT')) . '</strong></li>';
$content .= '<li>Store manager email: <strong>' . get_option(constant('WPC2O_API_STORE_MANAGER_EMAIL')) . '</strong></li>';
$content .= '</div>';
$content .= '<a href="' . get_admin_url() . 'admin.php?page=wc-settings&tab=products&section=wpc2o" style="margin: 10px 0;" class="button">Update your API credentials</a>';
$content .= '<hr>';
$content .= '<h2 style="padding-left:0;">Example request sent to Clothes2Order</h2>';
$content .= '<p style="margin-top: 0;">The below example will be useful to provide to Clothes2Order if you encounter any issues</p>';
$content .= '<button id="wpc2o-expand-api-request" class="button button-primary">Show example request</button>';
$content .= '<button id="wpc2o-copy-api-request" style="margin-left:12px;" class="button">Copy to clipboard</button>';
$content .= '<pre id="wpc2o-example-json"><code>';
$json = '
$content = '<h1>API Credentials</h1>';
$content .= '<div style="padding:6px 0;">';
$content .= '<ol style="margin-left: 16px;">';
$content .= '<li>Test mode: <strong>' . get_option(constant('WPC2O_API_TEST_MODE')) . '</strong></li>';
$content .= '<li>Key: <strong>' . get_option(constant('WPC2O_API_KEY')) . '</strong></li>';
$content .= '<li>Order endpoint: <strong>' . get_option(constant('WPC2O_API_ENDPOINT')) . '</strong></li>';
$content .= '<li>Stock endpoint: <strong>' . get_option(constant('WPC2O_API_STOCK_ENDPOINT')) . '</strong></li>';
$content .= '<li>Store manager email: <strong>' . get_option(constant('WPC2O_API_STORE_MANAGER_EMAIL')) . '</strong></li>';
$content .= '</div>';
$content .= '<a href="' . get_admin_url() . 'admin.php?page=wc-settings&tab=products&section=wpc2o" style="margin: 10px 0;" class="button">Update your API credentials</a>';
$content .= '<hr>';
$content .= '<h2 style="padding-left:0;">Example request sent to Clothes2Order</h2>';
$content .= '<p style="margin-top: 0;">The below example will be useful to provide to Clothes2Order if you encounter any issues</p>';
$content .= '<button id="wpc2o-expand-api-request" class="button button-primary">Show example request</button>';
$content .= '<button id="wpc2o-copy-api-request" style="margin-left:12px;" class="button">Copy to clipboard</button>';
$content .= '<pre id="wpc2o-example-json"><code>';
$json = '
{
"api_key": "' . get_option(constant('WPC2O_API_KEY')) . '",
"order": {
Expand Down Expand Up @@ -65,8 +65,8 @@ function wpc2o_get_api_view(): string
}
}
';
$content .= wpc2o_code_block($json);
$content .= '</code></pre>';
$content .= wpc2o_code_block($json);
$content .= '</code></pre>';

return $content;
}

0 comments on commit 4a7207f

Please sign in to comment.