Changeset 3808150
- Timestamp:
- 11/17/2026 09:11:18 PM (less than one hour ago)
- Location:
- canvas-prints-ltd-print-on-demand-for-woocommerce
- Files:
-
- 4 edited
- 1 copied
-
tags/1.10.1 (copied) (copied from canvas-prints-ltd-print-on-demand-for-woocommerce/trunk )
-
tags/1.10.1/canvas-printing-fulfillment.php (modified) (7 diffs)
-
tags/1.10.1/readme.txt (modified) (3 diffs)
-
trunk/canvas-printing-fulfillment.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
canvas-prints-ltd-print-on-demand-for-woocommerce/tags/1.10.1/canvas-printing-fulfillment.php
r3667824 r3808150 4 4 * Plugin URI: https://www.canvasprintscalgary.com/art-dropshipping 5 5 * Description: Create and fulfill custom canvas print-on-demand products in WooCommerce with automated orders, shipping, and tracking. 6 * Version: 1.10. 06 * Version: 1.10.1 7 7 * Requires at least: 6.2 8 8 * Requires PHP: 8.1 … … 141 141 register_setting('cplpod_print_on_demand_settings', self::OPTION_API_URL, [ 142 142 'sanitize_callback' => static function ($value): string { 143 $host = strtolower((string) wp_parse_url(esc_url_raw((string) $value), PHP_URL_HOST)); 144 145 return in_array($host, ['canvasprintsusa.com', 'www.canvasprintsusa.com'], true) 146 ? self::OPTION_API_URL_US 147 : self::OPTION_API_URL_DEFAULT; 143 return self::canonical_api_url((string) $value) ?: self::OPTION_API_URL_DEFAULT; 148 144 }, 149 145 ]); … … 160 156 : ['status' => __('Not connected. Choose the pricing market and paste the API key supplied by Canvas Prints.', 'canvas-prints-ltd-print-on-demand-for-woocommerce')]; 161 157 $market = $this->market(); 162 $accountUrl = $market === 'US' 163 ? 'https://www.canvasprintsusa.com/customer/dropshipping' 164 : 'https://www.canvasprintscalgary.com/customer/dropshipping'; 158 $accountUrl = str_replace('/api/partner/v1', '/customer/dropshipping', $this->api_url()); 165 159 ?> 166 160 <div class="wrap"> … … 194 188 </tr> 195 189 <tr> 190 <th scope="row"><label for="cplpod_api_url"><?php esc_html_e('Canvas account site', 'canvas-prints-ltd-print-on-demand-for-woocommerce'); ?></label></th> 191 <td><select id="cplpod_api_url" name="<?php echo esc_attr(self::OPTION_API_URL); ?>"> 192 <?php foreach (['canvasprintscalgary.com' => __('Calgary (Canada)', 'canvas-prints-ltd-print-on-demand-for-woocommerce'), 'canvasprintsedmonton.com' => __('Edmonton (Canada)', 'canvas-prints-ltd-print-on-demand-for-woocommerce'), 'canvasprintstoronto.ca' => __('Toronto (Canada)', 'canvas-prints-ltd-print-on-demand-for-woocommerce'), 'canvasprintsvancouver.ca' => __('Vancouver (Canada)', 'canvas-prints-ltd-print-on-demand-for-woocommerce'), 'canvasprintsusa.com' => __('USA', 'canvas-prints-ltd-print-on-demand-for-woocommerce')] as $site => $label): $endpoint = 'https://www.' . $site . '/api/partner/v1'; ?> 193 <option value="<?php echo esc_attr($endpoint); ?>" <?php selected($this->api_url(), $endpoint); ?>><?php echo esc_html($label); ?></option> 194 <?php endforeach; ?> 195 </select><p class="description"><?php esc_html_e('Choose the same Canvas Prints site where you created this store API key. An Edmonton key needs the Edmonton site.', 'canvas-prints-ltd-print-on-demand-for-woocommerce'); ?></p></td> 196 </tr> 197 <tr> 196 198 <th scope="row"><label for="cplpod_api_key"><?php esc_html_e('API Key', 'canvas-prints-ltd-print-on-demand-for-woocommerce'); ?></label></th> 197 199 <td><input id="cplpod_api_key" name="<?php echo esc_attr(self::OPTION_API_KEY); ?>" type="password" class="regular-text" value="<?php echo esc_attr($this->api_key()); ?>"></td> … … 204 206 </p> 205 207 <p class="description"><?php esc_html_e('This is your account home market. Buyer delivery country does not switch your Canvas price list. To move the business to another market later, disconnect and create a new connection on the matching Canvas Prints site.', 'canvas-prints-ltd-print-on-demand-for-woocommerce'); ?></p> 208 <script> 209 document.addEventListener('DOMContentLoaded', function () { 210 var market = document.getElementById('cplpod_market'); 211 var site = document.getElementById('cplpod_api_url'); 212 if (!market || !site) return; 213 function syncMarket() { market.value = site.value.indexOf('canvasprintsusa.com') !== -1 ? 'US' : 'CA'; } 214 syncMarket(); 215 site.addEventListener('change', syncMarket); 216 market.addEventListener('change', function () { 217 if (market.value === 'US') site.value = 'https://www.canvasprintsusa.com/api/partner/v1'; 218 else if (site.value.indexOf('canvasprintsusa.com') !== -1) site.value = 'https://www.canvasprintscalgary.com/api/partner/v1'; 219 }); 220 }); 221 </script> 206 222 <?php submit_button(__('Save connection', 'canvas-prints-ltd-print-on-demand-for-woocommerce')); ?> 207 223 </form> … … 350 366 } 351 367 352 wp_register_style('cplpod-print-on-demand-preview', false, [], '1.10. 0');368 wp_register_style('cplpod-print-on-demand-preview', false, [], '1.10.1'); 353 369 wp_enqueue_style('cplpod-print-on-demand-preview'); 354 370 wp_add_inline_style('cplpod-print-on-demand-preview', $this->preview_css()); 355 371 356 wp_register_script('cplpod-print-on-demand-preview', false, [], '1.10. 0', true);372 wp_register_script('cplpod-print-on-demand-preview', false, [], '1.10.1', true); 357 373 wp_enqueue_script('cplpod-print-on-demand-preview'); 358 374 wp_add_inline_script('cplpod-print-on-demand-preview', $this->preview_js()); … … 1077 1093 ); 1078 1094 } 1079 $host = strtolower((string) wp_parse_url($url, PHP_URL_HOST)); 1080 if (!in_array($host, ['canvasprintscalgary.com', 'www.canvasprintscalgary.com', 'canvasprintsusa.com', 'www.canvasprintsusa.com'], true)) { 1081 return $this->market() === 'US' ? self::OPTION_API_URL_US : self::OPTION_API_URL_DEFAULT; 1082 } 1083 1084 return in_array($host, ['canvasprintsusa.com', 'www.canvasprintsusa.com'], true) 1085 ? self::OPTION_API_URL_US 1086 : self::OPTION_API_URL_DEFAULT; 1095 return self::canonical_api_url($url) 1096 ?: ($this->market() === 'US' ? self::OPTION_API_URL_US : self::OPTION_API_URL_DEFAULT); 1097 } 1098 1099 private static function canonical_api_url(string $url): string 1100 { 1101 $parts = wp_parse_url(trim($url)); 1102 if (!is_array($parts) || strtolower((string) ($parts['scheme'] ?? '')) !== 'https' 1103 || isset($parts['user']) || isset($parts['pass']) || isset($parts['port'])) return ''; 1104 $host = preg_replace('/^www\./', '', strtolower((string) ($parts['host'] ?? ''))); 1105 if (!in_array($host, ['canvasprintscalgary.com', 'canvasprintsedmonton.com', 'canvasprintstoronto.ca', 'canvasprintsvancouver.ca', 'canvasprintsusa.com'], true)) return ''; 1106 return 'https://www.' . $host . '/api/partner/v1'; 1087 1107 } 1088 1108 -
canvas-prints-ltd-print-on-demand-for-woocommerce/tags/1.10.1/readme.txt
r3667824 r3808150 5 5 Tested up to: 7.1 6 6 Requires PHP: 8.1 7 Stable tag: 1.10. 07 Stable tag: 1.10.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 50 50 4. Create and immediately copy the store API key. 51 51 5. In WordPress, open WooCommerce > Canvas Print-on-Demand. 52 6. Confirm the automatically detected Canada or United States pricing market, paste the matching key and save.52 6. Select the exact Canvas account site where the key was created (Calgary, Edmonton, Toronto, Vancouver or USA), paste the current store key and save. Canada alone does not identify which site owns the connection. 53 53 7. Confirm the Connection section reports an active connection. 54 54 55 55 == Frequently Asked Questions == 56 57 = I have an Edmonton key but the connection says unauthorized. What should I do? = 58 59 Update to version 1.10.1 or later. In WooCommerce > Canvas Print-on-Demand, select Edmonton under Canvas account site, paste the current key from your Edmonton Dropshipping account and save. Previous versions routed all Canadian keys to Calgary. You do not need to disconnect or move the store to another Canvas account. 60 56 61 57 62 = Can one account connect multiple WooCommerce stores? = … … 81 86 == External services == 82 87 83 This plugin connects to the Canadian Canvas Prints fulfillment API at https://www.canvasprintscalgary.com/api/partner/v1 or the U.S. Canvas Prints fulfillment API at https://www.canvasprintsusa.com/api/partner/v1 according to the merchant-selected fulfillment pricing market. It sends the connected store URL, paid-order identifiers, canvas configuration, production image URL, delivery contact and address, and fulfillment totals needed to validate, charge and produce the order. It receives connection, catalog, validation, order, billing and fulfillment status responses.88 This plugin connects only to the selected Canvas account site: https://www.canvasprintscalgary.com/api/partner/v1, https://www.canvasprintsedmonton.com/api/partner/v1, https://www.canvasprintstoronto.ca/api/partner/v1, https://www.canvasprintsvancouver.ca/api/partner/v1 or https://www.canvasprintsusa.com/api/partner/v1. Select the same site where the store API key was created; Canadian sites use CAD and the USA site uses USD. It sends the connected store URL, paid-order identifiers, canvas configuration, production image URL, delivery contact and address, and fulfillment totals needed to validate, charge and produce the order. It receives connection, catalog, validation, order, billing and fulfillment status responses. 84 89 85 90 The service is provided by Canvas Prints Ltd. Review the service privacy policy at https://www.canvasprintscalgary.com/canvas-prints-privacy-policy and terms at https://www.canvasprintscalgary.com/canvas-prints-terms before connecting a store. 86 91 87 92 == Changelog == 93 94 = 1.10.1 = 95 * Select the exact Canvas account site, including Edmonton, Toronto and Vancouver, without silently switching its API key to Calgary. 88 96 89 97 = 1.10.0 = -
canvas-prints-ltd-print-on-demand-for-woocommerce/trunk/canvas-printing-fulfillment.php
r3667824 r3808150 4 4 * Plugin URI: https://www.canvasprintscalgary.com/art-dropshipping 5 5 * Description: Create and fulfill custom canvas print-on-demand products in WooCommerce with automated orders, shipping, and tracking. 6 * Version: 1.10. 06 * Version: 1.10.1 7 7 * Requires at least: 6.2 8 8 * Requires PHP: 8.1 … … 141 141 register_setting('cplpod_print_on_demand_settings', self::OPTION_API_URL, [ 142 142 'sanitize_callback' => static function ($value): string { 143 $host = strtolower((string) wp_parse_url(esc_url_raw((string) $value), PHP_URL_HOST)); 144 145 return in_array($host, ['canvasprintsusa.com', 'www.canvasprintsusa.com'], true) 146 ? self::OPTION_API_URL_US 147 : self::OPTION_API_URL_DEFAULT; 143 return self::canonical_api_url((string) $value) ?: self::OPTION_API_URL_DEFAULT; 148 144 }, 149 145 ]); … … 160 156 : ['status' => __('Not connected. Choose the pricing market and paste the API key supplied by Canvas Prints.', 'canvas-prints-ltd-print-on-demand-for-woocommerce')]; 161 157 $market = $this->market(); 162 $accountUrl = $market === 'US' 163 ? 'https://www.canvasprintsusa.com/customer/dropshipping' 164 : 'https://www.canvasprintscalgary.com/customer/dropshipping'; 158 $accountUrl = str_replace('/api/partner/v1', '/customer/dropshipping', $this->api_url()); 165 159 ?> 166 160 <div class="wrap"> … … 194 188 </tr> 195 189 <tr> 190 <th scope="row"><label for="cplpod_api_url"><?php esc_html_e('Canvas account site', 'canvas-prints-ltd-print-on-demand-for-woocommerce'); ?></label></th> 191 <td><select id="cplpod_api_url" name="<?php echo esc_attr(self::OPTION_API_URL); ?>"> 192 <?php foreach (['canvasprintscalgary.com' => __('Calgary (Canada)', 'canvas-prints-ltd-print-on-demand-for-woocommerce'), 'canvasprintsedmonton.com' => __('Edmonton (Canada)', 'canvas-prints-ltd-print-on-demand-for-woocommerce'), 'canvasprintstoronto.ca' => __('Toronto (Canada)', 'canvas-prints-ltd-print-on-demand-for-woocommerce'), 'canvasprintsvancouver.ca' => __('Vancouver (Canada)', 'canvas-prints-ltd-print-on-demand-for-woocommerce'), 'canvasprintsusa.com' => __('USA', 'canvas-prints-ltd-print-on-demand-for-woocommerce')] as $site => $label): $endpoint = 'https://www.' . $site . '/api/partner/v1'; ?> 193 <option value="<?php echo esc_attr($endpoint); ?>" <?php selected($this->api_url(), $endpoint); ?>><?php echo esc_html($label); ?></option> 194 <?php endforeach; ?> 195 </select><p class="description"><?php esc_html_e('Choose the same Canvas Prints site where you created this store API key. An Edmonton key needs the Edmonton site.', 'canvas-prints-ltd-print-on-demand-for-woocommerce'); ?></p></td> 196 </tr> 197 <tr> 196 198 <th scope="row"><label for="cplpod_api_key"><?php esc_html_e('API Key', 'canvas-prints-ltd-print-on-demand-for-woocommerce'); ?></label></th> 197 199 <td><input id="cplpod_api_key" name="<?php echo esc_attr(self::OPTION_API_KEY); ?>" type="password" class="regular-text" value="<?php echo esc_attr($this->api_key()); ?>"></td> … … 204 206 </p> 205 207 <p class="description"><?php esc_html_e('This is your account home market. Buyer delivery country does not switch your Canvas price list. To move the business to another market later, disconnect and create a new connection on the matching Canvas Prints site.', 'canvas-prints-ltd-print-on-demand-for-woocommerce'); ?></p> 208 <script> 209 document.addEventListener('DOMContentLoaded', function () { 210 var market = document.getElementById('cplpod_market'); 211 var site = document.getElementById('cplpod_api_url'); 212 if (!market || !site) return; 213 function syncMarket() { market.value = site.value.indexOf('canvasprintsusa.com') !== -1 ? 'US' : 'CA'; } 214 syncMarket(); 215 site.addEventListener('change', syncMarket); 216 market.addEventListener('change', function () { 217 if (market.value === 'US') site.value = 'https://www.canvasprintsusa.com/api/partner/v1'; 218 else if (site.value.indexOf('canvasprintsusa.com') !== -1) site.value = 'https://www.canvasprintscalgary.com/api/partner/v1'; 219 }); 220 }); 221 </script> 206 222 <?php submit_button(__('Save connection', 'canvas-prints-ltd-print-on-demand-for-woocommerce')); ?> 207 223 </form> … … 350 366 } 351 367 352 wp_register_style('cplpod-print-on-demand-preview', false, [], '1.10. 0');368 wp_register_style('cplpod-print-on-demand-preview', false, [], '1.10.1'); 353 369 wp_enqueue_style('cplpod-print-on-demand-preview'); 354 370 wp_add_inline_style('cplpod-print-on-demand-preview', $this->preview_css()); 355 371 356 wp_register_script('cplpod-print-on-demand-preview', false, [], '1.10. 0', true);372 wp_register_script('cplpod-print-on-demand-preview', false, [], '1.10.1', true); 357 373 wp_enqueue_script('cplpod-print-on-demand-preview'); 358 374 wp_add_inline_script('cplpod-print-on-demand-preview', $this->preview_js()); … … 1077 1093 ); 1078 1094 } 1079 $host = strtolower((string) wp_parse_url($url, PHP_URL_HOST)); 1080 if (!in_array($host, ['canvasprintscalgary.com', 'www.canvasprintscalgary.com', 'canvasprintsusa.com', 'www.canvasprintsusa.com'], true)) { 1081 return $this->market() === 'US' ? self::OPTION_API_URL_US : self::OPTION_API_URL_DEFAULT; 1082 } 1083 1084 return in_array($host, ['canvasprintsusa.com', 'www.canvasprintsusa.com'], true) 1085 ? self::OPTION_API_URL_US 1086 : self::OPTION_API_URL_DEFAULT; 1095 return self::canonical_api_url($url) 1096 ?: ($this->market() === 'US' ? self::OPTION_API_URL_US : self::OPTION_API_URL_DEFAULT); 1097 } 1098 1099 private static function canonical_api_url(string $url): string 1100 { 1101 $parts = wp_parse_url(trim($url)); 1102 if (!is_array($parts) || strtolower((string) ($parts['scheme'] ?? '')) !== 'https' 1103 || isset($parts['user']) || isset($parts['pass']) || isset($parts['port'])) return ''; 1104 $host = preg_replace('/^www\./', '', strtolower((string) ($parts['host'] ?? ''))); 1105 if (!in_array($host, ['canvasprintscalgary.com', 'canvasprintsedmonton.com', 'canvasprintstoronto.ca', 'canvasprintsvancouver.ca', 'canvasprintsusa.com'], true)) return ''; 1106 return 'https://www.' . $host . '/api/partner/v1'; 1087 1107 } 1088 1108 -
canvas-prints-ltd-print-on-demand-for-woocommerce/trunk/readme.txt
r3667824 r3808150 5 5 Tested up to: 7.1 6 6 Requires PHP: 8.1 7 Stable tag: 1.10. 07 Stable tag: 1.10.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 50 50 4. Create and immediately copy the store API key. 51 51 5. In WordPress, open WooCommerce > Canvas Print-on-Demand. 52 6. Confirm the automatically detected Canada or United States pricing market, paste the matching key and save.52 6. Select the exact Canvas account site where the key was created (Calgary, Edmonton, Toronto, Vancouver or USA), paste the current store key and save. Canada alone does not identify which site owns the connection. 53 53 7. Confirm the Connection section reports an active connection. 54 54 55 55 == Frequently Asked Questions == 56 57 = I have an Edmonton key but the connection says unauthorized. What should I do? = 58 59 Update to version 1.10.1 or later. In WooCommerce > Canvas Print-on-Demand, select Edmonton under Canvas account site, paste the current key from your Edmonton Dropshipping account and save. Previous versions routed all Canadian keys to Calgary. You do not need to disconnect or move the store to another Canvas account. 60 56 61 57 62 = Can one account connect multiple WooCommerce stores? = … … 81 86 == External services == 82 87 83 This plugin connects to the Canadian Canvas Prints fulfillment API at https://www.canvasprintscalgary.com/api/partner/v1 or the U.S. Canvas Prints fulfillment API at https://www.canvasprintsusa.com/api/partner/v1 according to the merchant-selected fulfillment pricing market. It sends the connected store URL, paid-order identifiers, canvas configuration, production image URL, delivery contact and address, and fulfillment totals needed to validate, charge and produce the order. It receives connection, catalog, validation, order, billing and fulfillment status responses.88 This plugin connects only to the selected Canvas account site: https://www.canvasprintscalgary.com/api/partner/v1, https://www.canvasprintsedmonton.com/api/partner/v1, https://www.canvasprintstoronto.ca/api/partner/v1, https://www.canvasprintsvancouver.ca/api/partner/v1 or https://www.canvasprintsusa.com/api/partner/v1. Select the same site where the store API key was created; Canadian sites use CAD and the USA site uses USD. It sends the connected store URL, paid-order identifiers, canvas configuration, production image URL, delivery contact and address, and fulfillment totals needed to validate, charge and produce the order. It receives connection, catalog, validation, order, billing and fulfillment status responses. 84 89 85 90 The service is provided by Canvas Prints Ltd. Review the service privacy policy at https://www.canvasprintscalgary.com/canvas-prints-privacy-policy and terms at https://www.canvasprintscalgary.com/canvas-prints-terms before connecting a store. 86 91 87 92 == Changelog == 93 94 = 1.10.1 = 95 * Select the exact Canvas account site, including Edmonton, Toronto and Vancouver, without silently switching its API key to Calgary. 88 96 89 97 = 1.10.0 =
Note:
See TracChangeset
for help on using the changeset viewer.