Changeset 3490633
- Timestamp:
- 03/25/2026 08:04:50 AM (8 days ago)
- Location:
- pdc-pod
- Files:
-
- 4 added
- 24 edited
- 1 copied
-
tags/1.2.0 (copied) (copied from pdc-pod/trunk)
-
tags/1.2.0/CHANGELOG.md (modified) (1 diff)
-
tags/1.2.0/README.txt (modified) (2 diffs)
-
tags/1.2.0/admin/AdminCore.php (modified) (5 diffs)
-
tags/1.2.0/admin/PrintDotCom/APIClient.php (modified) (6 diffs)
-
tags/1.2.0/admin/partials/pdc-pod-admin-producttab.php (modified) (1 diff)
-
tags/1.2.0/admin/partials/pdc-pod-admin-variation-data.php (modified) (2 diffs)
-
tags/1.2.0/admin/partials/pdc-pod-html-order-metabox.php (modified) (1 diff)
-
tags/1.2.0/includes/Compatibility (added)
-
tags/1.2.0/includes/Compatibility/PrintApp.php (added)
-
tags/1.2.0/includes/Core.php (modified) (3 diffs)
-
tags/1.2.0/pdc-pod.php (modified) (2 diffs)
-
tags/1.2.0/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
tags/1.2.0/vendor/composer/autoload_static.php (modified) (1 diff)
-
tags/1.2.0/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/AdminCore.php (modified) (5 diffs)
-
trunk/admin/PrintDotCom/APIClient.php (modified) (6 diffs)
-
trunk/admin/partials/pdc-pod-admin-producttab.php (modified) (1 diff)
-
trunk/admin/partials/pdc-pod-admin-variation-data.php (modified) (2 diffs)
-
trunk/admin/partials/pdc-pod-html-order-metabox.php (modified) (1 diff)
-
trunk/includes/Compatibility (added)
-
trunk/includes/Compatibility/PrintApp.php (added)
-
trunk/includes/Core.php (modified) (3 diffs)
-
trunk/pdc-pod.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_static.php (modified) (1 diff)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pdc-pod/tags/1.2.0/CHANGELOG.md
r3475432 r3490633 5 5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), 6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 8 ## [1.2.0] 9 10 ### Added 11 12 - added filter to override the pdf url on an order 13 - compatibility layer for other plugins 7 14 8 15 ## [1.1.1] -
pdc-pod/tags/1.2.0/README.txt
r3475432 r3490633 5 5 Requires at least: 3.4 6 6 Tested up to: 6.9 7 Stable tag: 1. 1.17 Stable tag: 1.2.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 41 41 == Changelog == 42 42 43 = 1.2.0 = 44 45 * feat: added filter to override the pdf url on an order 46 * feat: added compatibility with [Print.app](https://wordpress.org/plugins/printapp/) 47 43 48 = 1.1.1 = 44 49 -
pdc-pod/tags/1.2.0/admin/AdminCore.php
r3472718 r3490633 44 44 * Initialize the class and set its properties. 45 45 * 46 * @param APIClient $pdc_api_client 46 * @param APIClient $pdc_api_client The api client. 47 47 * @since 1.0.0 48 48 */ … … 240 240 $order = wc_get_order( $post->get_ID() ); 241 241 include plugin_dir_path( __FILE__ ) . 'partials/' . PDC_POD_NAME . '-html-order-metabox.php'; 242 } 243 244 /** 245 * Retrieves the PDF URL for a specific order item. 246 * 247 * This method checks for a PDF URL in the order item metadata. 248 * It also provides a filter to allow external overrides of the URL. 249 * 250 * @since 1.2.0 251 * @param int $pdc_pod_order_item_id The WooCommerce order item ID. 252 * @return string|bool The PDF URL if found, or false. 253 */ 254 private function get_pdf_url_by_order_item_id( $pdc_pod_order_item_id ) { 255 $pdf_url = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'pdf_url' ), true ); 256 257 /** 258 * Filter the PDF URL for an order item. 259 * 260 * This allows developers to override the PDF URL retrieval logic 261 * for specific order items. 262 * 263 * @since 1.2.0 264 * @param string|bool $pdf_url The PDF URL, or false if not found. 265 * @param int $order_item_id The WooCommerce order item ID. 266 */ 267 return apply_filters( 'pdc_pod_order_item_pdf_url', $pdf_url, $pdc_pod_order_item_id ); 242 268 } 243 269 … … 680 706 } 681 707 708 $order_item = new \WC_Order_Item_Product( $order_item_id ); 709 $order_id = wc_get_order_id_by_order_item_id( $order_item_id ); 710 $order = wc_get_order( $order_id ); 711 712 $pdc_pod_preset_id = wc_get_order_item_meta( $order_item_id, $this->get_meta_key( 'preset_id' ), true ); 713 $pdc_pod_preset_url = $this->get_pdf_url_by_order_item_id( $order_item_id ); 714 682 715 $pdc_product_config = get_option( PDC_POD_NAME . '-product' ); 683 716 684 $result = $this->pdc_client->purchase_order_item( $order _item_id, $pdc_product_config );717 $result = $this->pdc_client->purchase_order_item( $order, $order_item, $pdc_pod_preset_url, $pdc_pod_preset_id, $pdc_product_config ); 685 718 if ( is_wp_error( $result ) ) { 686 719 $status = absint( $result->get_error_code() ); … … 702 735 $pdc_order_item = $pdc_order->items[0]; 703 736 $pdc_order_item_shipment = $pdc_order_item->shipments[0]; 704 $order_item = new \WC_Order_Item_Product( $order_item_id );705 737 706 738 $order_item->update_meta_data( $this->get_meta_key( 'order' ), $pdc_order ); … … 722 754 $order_item->save(); 723 755 724 $order_id = wc_get_order_id_by_order_item_id( $order_item_id );725 $order = wc_get_order( $order_id );726 727 756 $note = sprintf( 728 757 // translators: placeholder is the order number. -
pdc-pod/tags/1.2.0/admin/PrintDotCom/APIClient.php
r3475432 r3490633 273 273 * @since 1.0.0 274 274 * 275 * @param int $order_item_id The WooCommerce order item ID to purchase. 276 * @param array $args { 275 * @param \WC_Order $order The WooCommerce order. 276 * @param \WC_Order_Item_Product $order_item The WooCommerce order item. 277 * @param string $pdc_pod_preset_url The PDF URL for the print item. 278 * @param string $pdc_pod_preset_id The Print.com preset ID. 279 * @param array $args { 277 280 * Optional. Arguments for customizing the purchase behavior. 278 281 * … … 281 284 * } 282 285 * 283 * @return object| WP_Error Returns the Print.com order response object on success,284 * or WP_Error on failure with error details.286 * @return object|\WP_Error Returns the Print.com order response object on success, 287 * or \WP_Error on failure with error details. 285 288 * 286 289 * @phpcsSuppress WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid 287 290 */ 288 public function purchase_order_item( $order_item_id, $args ) { 289 $order_item = new \WC_Order_Item_Product( $order_item_id ); 290 $order_id = wc_get_order_id_by_order_item_id( $order_item_id ); 291 $order = wc_get_order( $order_id ); 291 public function purchase_order_item( $order, $order_item, $pdc_pod_preset_url, $pdc_pod_preset_id, $args = array() ) { 292 292 $shipping_address = $order->get_address( 'shipping' ); 293 293 … … 296 296 } 297 297 298 $pdc_preset_id = wc_get_order_item_meta( $order_item_id, Core::get_meta_key( 'preset_id' ), true ); 299 $pdc_pdf_url = wc_get_order_item_meta( $order_item_id, Core::get_meta_key( 'pdf_url' ), true ); 300 301 $result = $this->perform_authenticated_request( 'GET', '/customerpresets/' . rawurlencode( $pdc_preset_id ), null ); 298 $result = $this->perform_authenticated_request( 'GET', '/customerpresets/' . rawurlencode( $pdc_pod_preset_id ), null ); 302 299 if ( is_wp_error( $result ) ) { 303 300 if ( $result->get_error_message() === '[404] Preset not found.' ) { … … 306 303 'Preset does not exist.', 307 304 array( 308 'preset_id' => $pdc_p reset_id,305 'preset_id' => $pdc_pod_preset_id, 309 306 'environment' => $this->pdc_pod_api_base_url, 310 307 ) … … 318 315 'Preset does not exist.', 319 316 array( 320 'preset_id' => $pdc_p reset_id,317 'preset_id' => $pdc_pod_preset_id, 321 318 'environment' => $this->pdc_pod_api_base_url, 322 319 ) … … 336 333 unset( $item_options->deliveryPromise ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 337 334 338 $restapi_url = esc_url_raw( rest_url() ); 335 $order_item_id = $order_item->get_id(); 336 $order_id = $order->get_id(); 337 338 $webhook_url = add_query_arg( 339 array( 340 'order_item_id' => $order_item_id, 341 'order_id' => $order_id, 342 ), 343 rest_url( 'pdc/v1/orders/webhook' ) 344 ); 345 339 346 $order_request = array( 340 347 'customerReference' => $order->get_order_number() . '-' . $order_item_id, 341 'webhookUrl' => $restapi_url . 'pdc/v1/orders/webhook?order_item_id=' . $order_item_id . '&order_id=' . $order_id,348 'webhookUrl' => esc_url_raw( $webhook_url ), 342 349 'items' => array( 343 350 array( 344 351 'sku' => $preset->sku, 345 'fileUrl' => $pdc_p df_url,352 'fileUrl' => $pdc_pod_preset_url, 346 353 'options' => $item_options, 347 354 'approveDesign' => true, -
pdc-pod/tags/1.2.0/admin/partials/pdc-pod-admin-producttab.php
r3472718 r3490633 33 33 id="js-pdc-product-selector" 34 34 data-testid="pdc-product-sku" 35 data-product_id="<?php echo $post->ID; ?>"35 data-product_id="<?php echo esc_attr( $post->ID ); ?>" 36 36 name="<?php echo esc_attr( $this->get_meta_key( 'product_sku' ) ); ?>" 37 37 value="<?php echo esc_attr( (string) $pdc_pod_sku ); ?>"> -
pdc-pod/tags/1.2.0/admin/partials/pdc-pod-admin-variation-data.php
r3472718 r3490633 40 40 <select 41 41 class="js-pdc-product-selector" 42 data-product_id="<?php echo $pdc_pod_variation_id; ?>"42 data-product_id="<?php echo esc_attr( $pdc_pod_variation_id ); ?>" 43 43 id="js-pdc-variant-product-<?php echo esc_attr( $pdc_pod_variation_id ); ?>" 44 data-testid="<?php echo esc_attr( 'variation_sku_' .$pdc_pod_variation_id ); ?>"44 data-testid="<?php echo 'variation_sku_' . esc_attr( $pdc_pod_variation_id ); ?>" 45 45 name="<?php echo esc_attr( $pdc_pod_sku_input_name ); ?>" 46 46 value="<?php echo esc_attr( (string) $pdc_pod_sku ); ?>"> … … 48 48 <?php 49 49 foreach ( $pdc_pod_products as $pdc_pod ) { 50 $ title = isset( $pdc_pod->title ) ? $pdc_pod->title : '';51 $ sku = isset( $pdc_pod->sku ) ? $pdc_pod->sku : '';50 $pdc_pod_product_title = isset( $pdc_pod->title ) ? $pdc_pod->title : ''; 51 $pdc_pod_product_sku = isset( $pdc_pod->sku ) ? $pdc_pod->sku : ''; 52 52 ?> 53 <option value="<?php echo esc_attr( $ sku ); ?>" <?php selected( $sku, $pdc_pod_sku ); ?>><?php echo esc_attr( $title ); ?></option>53 <option value="<?php echo esc_attr( $pdc_pod_product_sku ); ?>" <?php selected( $pdc_pod_product_sku, $pdc_pod_sku ); ?>><?php echo esc_html( $pdc_pod_product_title ); ?></option> 54 54 <?php } ?> 55 55 </select> -
pdc-pod/tags/1.2.0/admin/partials/pdc-pod-html-order-metabox.php
r3421416 r3490633 36 36 $pdc_pod_purchase_date = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'purchase_date' ), true ); 37 37 $pdc_pod_image_url = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'image_url' ), true ); 38 $pdc_pod_pdf_url = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'pdf_url' ), true);38 $pdc_pod_pdf_url = $this->get_pdf_url_by_order_item_id( $pdc_pod_order_item_id ); 39 39 $pdc_pod_order_item_status = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'order_item_status' ), true ); 40 40 $pdc_pod_tnt_url = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'order_item_tnt_url' ), true ); -
pdc-pod/tags/1.2.0/includes/Core.php
r3472718 r3490633 70 70 $this->define_admin_hooks(); 71 71 $this->define_public_hooks(); 72 $this->define_compatibility_hooks(); 72 73 } 73 74 … … 95 96 /** 96 97 * Load the required dependencies for this plugin. 97 *98 * Include the following files that make up the plugin:99 *100 * - Pdc_Pod_Loader. Orchestrates the hooks of the plugin.101 * - Pdc_Pod_I18n. Defines internationalization functionality.102 * - Pdc_Pod_Admin. Defines all hooks for the admin area.103 * - Pdc_Pod_Public. Defines all hooks for the public side of the site.104 98 * 105 99 * Create an instance of the loader which will be used to register the hooks … … 172 166 173 167 /** 168 * Register all of the hooks related to compatibility functionality. 169 * 170 * @since 1.2.0 171 * @access private 172 */ 173 private function define_compatibility_hooks() { 174 $print_app = new Compatibility\PrintApp(); 175 176 $this->loader->add_filter( 'pdc_pod_order_item_pdf_url', $print_app, 'get_print_app_pdf_url', 10, 2 ); 177 } 178 179 /** 174 180 * Run the loader to execute all of the hooks with WordPress. 175 181 * -
pdc-pod/tags/1.2.0/pdc-pod.php
r3475432 r3490633 25 25 * Plugin URI: https://github.com/printdotcom/pdc-pod 26 26 * Description: Allows customers to configure, edit and purchase products via the Print.com API. 27 * Version: 1. 1.127 * Version: 1.2.0 28 28 * Author: Print.com 29 29 * Author URI: https://print.com … … 55 55 * @var string PDC_POD_VERSION Plugin version. 56 56 */ 57 define( 'PDC_POD_VERSION', '1. 1.1' );57 define( 'PDC_POD_VERSION', '1.2.0' ); 58 58 59 59 /** -
pdc-pod/tags/1.2.0/vendor/composer/autoload_classmap.php
r3465930 r3490633 13 13 'PdcPod\\Admin\\PrintDotCom\\Product' => $baseDir . '/admin/PrintDotCom/Product.php', 14 14 'PdcPod\\Front\\FrontCore' => $baseDir . '/front/FrontCore.php', 15 'PdcPod\\Includes\\Compatibility\\PrintApp' => $baseDir . '/includes/Compatibility/PrintApp.php', 15 16 'PdcPod\\Includes\\Core' => $baseDir . '/includes/Core.php', 16 17 'PdcPod\\Includes\\I18n' => $baseDir . '/includes/I18n.php', -
pdc-pod/tags/1.2.0/vendor/composer/autoload_static.php
r3472718 r3490633 38 38 'PdcPod\\Admin\\PrintDotCom\\Product' => __DIR__ . '/../..' . '/admin/PrintDotCom/Product.php', 39 39 'PdcPod\\Front\\FrontCore' => __DIR__ . '/../..' . '/front/FrontCore.php', 40 'PdcPod\\Includes\\Compatibility\\PrintApp' => __DIR__ . '/../..' . '/includes/Compatibility/PrintApp.php', 40 41 'PdcPod\\Includes\\Core' => __DIR__ . '/../..' . '/includes/Core.php', 41 42 'PdcPod\\Includes\\I18n' => __DIR__ . '/../..' . '/includes/I18n.php', -
pdc-pod/tags/1.2.0/vendor/composer/installed.php
r3475432 r3490633 2 2 'root' => array( 3 3 'name' => 'printdotcom/pdc-pod', 4 'pretty_version' => '1. 1.1',5 'version' => '1. 1.1.0',6 'reference' => ' 66f6e76e4750741cb37de30d3be866453c2729c6',4 'pretty_version' => '1.2.0', 5 'version' => '1.2.0.0', 6 'reference' => '1af50197044eafa9656e1e4b310d14b3415737eb', 7 7 'type' => 'project', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'printdotcom/pdc-pod' => array( 14 'pretty_version' => '1. 1.1',15 'version' => '1. 1.1.0',16 'reference' => ' 66f6e76e4750741cb37de30d3be866453c2729c6',14 'pretty_version' => '1.2.0', 15 'version' => '1.2.0.0', 16 'reference' => '1af50197044eafa9656e1e4b310d14b3415737eb', 17 17 'type' => 'project', 18 18 'install_path' => __DIR__ . '/../../', -
pdc-pod/trunk/CHANGELOG.md
r3475432 r3490633 5 5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), 6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 8 ## [1.2.0] 9 10 ### Added 11 12 - added filter to override the pdf url on an order 13 - compatibility layer for other plugins 7 14 8 15 ## [1.1.1] -
pdc-pod/trunk/README.txt
r3475432 r3490633 5 5 Requires at least: 3.4 6 6 Tested up to: 6.9 7 Stable tag: 1. 1.17 Stable tag: 1.2.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 41 41 == Changelog == 42 42 43 = 1.2.0 = 44 45 * feat: added filter to override the pdf url on an order 46 * feat: added compatibility with [Print.app](https://wordpress.org/plugins/printapp/) 47 43 48 = 1.1.1 = 44 49 -
pdc-pod/trunk/admin/AdminCore.php
r3472718 r3490633 44 44 * Initialize the class and set its properties. 45 45 * 46 * @param APIClient $pdc_api_client 46 * @param APIClient $pdc_api_client The api client. 47 47 * @since 1.0.0 48 48 */ … … 240 240 $order = wc_get_order( $post->get_ID() ); 241 241 include plugin_dir_path( __FILE__ ) . 'partials/' . PDC_POD_NAME . '-html-order-metabox.php'; 242 } 243 244 /** 245 * Retrieves the PDF URL for a specific order item. 246 * 247 * This method checks for a PDF URL in the order item metadata. 248 * It also provides a filter to allow external overrides of the URL. 249 * 250 * @since 1.2.0 251 * @param int $pdc_pod_order_item_id The WooCommerce order item ID. 252 * @return string|bool The PDF URL if found, or false. 253 */ 254 private function get_pdf_url_by_order_item_id( $pdc_pod_order_item_id ) { 255 $pdf_url = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'pdf_url' ), true ); 256 257 /** 258 * Filter the PDF URL for an order item. 259 * 260 * This allows developers to override the PDF URL retrieval logic 261 * for specific order items. 262 * 263 * @since 1.2.0 264 * @param string|bool $pdf_url The PDF URL, or false if not found. 265 * @param int $order_item_id The WooCommerce order item ID. 266 */ 267 return apply_filters( 'pdc_pod_order_item_pdf_url', $pdf_url, $pdc_pod_order_item_id ); 242 268 } 243 269 … … 680 706 } 681 707 708 $order_item = new \WC_Order_Item_Product( $order_item_id ); 709 $order_id = wc_get_order_id_by_order_item_id( $order_item_id ); 710 $order = wc_get_order( $order_id ); 711 712 $pdc_pod_preset_id = wc_get_order_item_meta( $order_item_id, $this->get_meta_key( 'preset_id' ), true ); 713 $pdc_pod_preset_url = $this->get_pdf_url_by_order_item_id( $order_item_id ); 714 682 715 $pdc_product_config = get_option( PDC_POD_NAME . '-product' ); 683 716 684 $result = $this->pdc_client->purchase_order_item( $order _item_id, $pdc_product_config );717 $result = $this->pdc_client->purchase_order_item( $order, $order_item, $pdc_pod_preset_url, $pdc_pod_preset_id, $pdc_product_config ); 685 718 if ( is_wp_error( $result ) ) { 686 719 $status = absint( $result->get_error_code() ); … … 702 735 $pdc_order_item = $pdc_order->items[0]; 703 736 $pdc_order_item_shipment = $pdc_order_item->shipments[0]; 704 $order_item = new \WC_Order_Item_Product( $order_item_id );705 737 706 738 $order_item->update_meta_data( $this->get_meta_key( 'order' ), $pdc_order ); … … 722 754 $order_item->save(); 723 755 724 $order_id = wc_get_order_id_by_order_item_id( $order_item_id );725 $order = wc_get_order( $order_id );726 727 756 $note = sprintf( 728 757 // translators: placeholder is the order number. -
pdc-pod/trunk/admin/PrintDotCom/APIClient.php
r3475432 r3490633 273 273 * @since 1.0.0 274 274 * 275 * @param int $order_item_id The WooCommerce order item ID to purchase. 276 * @param array $args { 275 * @param \WC_Order $order The WooCommerce order. 276 * @param \WC_Order_Item_Product $order_item The WooCommerce order item. 277 * @param string $pdc_pod_preset_url The PDF URL for the print item. 278 * @param string $pdc_pod_preset_id The Print.com preset ID. 279 * @param array $args { 277 280 * Optional. Arguments for customizing the purchase behavior. 278 281 * … … 281 284 * } 282 285 * 283 * @return object| WP_Error Returns the Print.com order response object on success,284 * or WP_Error on failure with error details.286 * @return object|\WP_Error Returns the Print.com order response object on success, 287 * or \WP_Error on failure with error details. 285 288 * 286 289 * @phpcsSuppress WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid 287 290 */ 288 public function purchase_order_item( $order_item_id, $args ) { 289 $order_item = new \WC_Order_Item_Product( $order_item_id ); 290 $order_id = wc_get_order_id_by_order_item_id( $order_item_id ); 291 $order = wc_get_order( $order_id ); 291 public function purchase_order_item( $order, $order_item, $pdc_pod_preset_url, $pdc_pod_preset_id, $args = array() ) { 292 292 $shipping_address = $order->get_address( 'shipping' ); 293 293 … … 296 296 } 297 297 298 $pdc_preset_id = wc_get_order_item_meta( $order_item_id, Core::get_meta_key( 'preset_id' ), true ); 299 $pdc_pdf_url = wc_get_order_item_meta( $order_item_id, Core::get_meta_key( 'pdf_url' ), true ); 300 301 $result = $this->perform_authenticated_request( 'GET', '/customerpresets/' . rawurlencode( $pdc_preset_id ), null ); 298 $result = $this->perform_authenticated_request( 'GET', '/customerpresets/' . rawurlencode( $pdc_pod_preset_id ), null ); 302 299 if ( is_wp_error( $result ) ) { 303 300 if ( $result->get_error_message() === '[404] Preset not found.' ) { … … 306 303 'Preset does not exist.', 307 304 array( 308 'preset_id' => $pdc_p reset_id,305 'preset_id' => $pdc_pod_preset_id, 309 306 'environment' => $this->pdc_pod_api_base_url, 310 307 ) … … 318 315 'Preset does not exist.', 319 316 array( 320 'preset_id' => $pdc_p reset_id,317 'preset_id' => $pdc_pod_preset_id, 321 318 'environment' => $this->pdc_pod_api_base_url, 322 319 ) … … 336 333 unset( $item_options->deliveryPromise ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 337 334 338 $restapi_url = esc_url_raw( rest_url() ); 335 $order_item_id = $order_item->get_id(); 336 $order_id = $order->get_id(); 337 338 $webhook_url = add_query_arg( 339 array( 340 'order_item_id' => $order_item_id, 341 'order_id' => $order_id, 342 ), 343 rest_url( 'pdc/v1/orders/webhook' ) 344 ); 345 339 346 $order_request = array( 340 347 'customerReference' => $order->get_order_number() . '-' . $order_item_id, 341 'webhookUrl' => $restapi_url . 'pdc/v1/orders/webhook?order_item_id=' . $order_item_id . '&order_id=' . $order_id,348 'webhookUrl' => esc_url_raw( $webhook_url ), 342 349 'items' => array( 343 350 array( 344 351 'sku' => $preset->sku, 345 'fileUrl' => $pdc_p df_url,352 'fileUrl' => $pdc_pod_preset_url, 346 353 'options' => $item_options, 347 354 'approveDesign' => true, -
pdc-pod/trunk/admin/partials/pdc-pod-admin-producttab.php
r3472718 r3490633 33 33 id="js-pdc-product-selector" 34 34 data-testid="pdc-product-sku" 35 data-product_id="<?php echo $post->ID; ?>"35 data-product_id="<?php echo esc_attr( $post->ID ); ?>" 36 36 name="<?php echo esc_attr( $this->get_meta_key( 'product_sku' ) ); ?>" 37 37 value="<?php echo esc_attr( (string) $pdc_pod_sku ); ?>"> -
pdc-pod/trunk/admin/partials/pdc-pod-admin-variation-data.php
r3472718 r3490633 40 40 <select 41 41 class="js-pdc-product-selector" 42 data-product_id="<?php echo $pdc_pod_variation_id; ?>"42 data-product_id="<?php echo esc_attr( $pdc_pod_variation_id ); ?>" 43 43 id="js-pdc-variant-product-<?php echo esc_attr( $pdc_pod_variation_id ); ?>" 44 data-testid="<?php echo esc_attr( 'variation_sku_' .$pdc_pod_variation_id ); ?>"44 data-testid="<?php echo 'variation_sku_' . esc_attr( $pdc_pod_variation_id ); ?>" 45 45 name="<?php echo esc_attr( $pdc_pod_sku_input_name ); ?>" 46 46 value="<?php echo esc_attr( (string) $pdc_pod_sku ); ?>"> … … 48 48 <?php 49 49 foreach ( $pdc_pod_products as $pdc_pod ) { 50 $ title = isset( $pdc_pod->title ) ? $pdc_pod->title : '';51 $ sku = isset( $pdc_pod->sku ) ? $pdc_pod->sku : '';50 $pdc_pod_product_title = isset( $pdc_pod->title ) ? $pdc_pod->title : ''; 51 $pdc_pod_product_sku = isset( $pdc_pod->sku ) ? $pdc_pod->sku : ''; 52 52 ?> 53 <option value="<?php echo esc_attr( $ sku ); ?>" <?php selected( $sku, $pdc_pod_sku ); ?>><?php echo esc_attr( $title ); ?></option>53 <option value="<?php echo esc_attr( $pdc_pod_product_sku ); ?>" <?php selected( $pdc_pod_product_sku, $pdc_pod_sku ); ?>><?php echo esc_html( $pdc_pod_product_title ); ?></option> 54 54 <?php } ?> 55 55 </select> -
pdc-pod/trunk/admin/partials/pdc-pod-html-order-metabox.php
r3421416 r3490633 36 36 $pdc_pod_purchase_date = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'purchase_date' ), true ); 37 37 $pdc_pod_image_url = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'image_url' ), true ); 38 $pdc_pod_pdf_url = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'pdf_url' ), true);38 $pdc_pod_pdf_url = $this->get_pdf_url_by_order_item_id( $pdc_pod_order_item_id ); 39 39 $pdc_pod_order_item_status = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'order_item_status' ), true ); 40 40 $pdc_pod_tnt_url = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'order_item_tnt_url' ), true ); -
pdc-pod/trunk/includes/Core.php
r3472718 r3490633 70 70 $this->define_admin_hooks(); 71 71 $this->define_public_hooks(); 72 $this->define_compatibility_hooks(); 72 73 } 73 74 … … 95 96 /** 96 97 * Load the required dependencies for this plugin. 97 *98 * Include the following files that make up the plugin:99 *100 * - Pdc_Pod_Loader. Orchestrates the hooks of the plugin.101 * - Pdc_Pod_I18n. Defines internationalization functionality.102 * - Pdc_Pod_Admin. Defines all hooks for the admin area.103 * - Pdc_Pod_Public. Defines all hooks for the public side of the site.104 98 * 105 99 * Create an instance of the loader which will be used to register the hooks … … 172 166 173 167 /** 168 * Register all of the hooks related to compatibility functionality. 169 * 170 * @since 1.2.0 171 * @access private 172 */ 173 private function define_compatibility_hooks() { 174 $print_app = new Compatibility\PrintApp(); 175 176 $this->loader->add_filter( 'pdc_pod_order_item_pdf_url', $print_app, 'get_print_app_pdf_url', 10, 2 ); 177 } 178 179 /** 174 180 * Run the loader to execute all of the hooks with WordPress. 175 181 * -
pdc-pod/trunk/pdc-pod.php
r3475432 r3490633 25 25 * Plugin URI: https://github.com/printdotcom/pdc-pod 26 26 * Description: Allows customers to configure, edit and purchase products via the Print.com API. 27 * Version: 1. 1.127 * Version: 1.2.0 28 28 * Author: Print.com 29 29 * Author URI: https://print.com … … 55 55 * @var string PDC_POD_VERSION Plugin version. 56 56 */ 57 define( 'PDC_POD_VERSION', '1. 1.1' );57 define( 'PDC_POD_VERSION', '1.2.0' ); 58 58 59 59 /** -
pdc-pod/trunk/vendor/composer/autoload_classmap.php
r3465930 r3490633 13 13 'PdcPod\\Admin\\PrintDotCom\\Product' => $baseDir . '/admin/PrintDotCom/Product.php', 14 14 'PdcPod\\Front\\FrontCore' => $baseDir . '/front/FrontCore.php', 15 'PdcPod\\Includes\\Compatibility\\PrintApp' => $baseDir . '/includes/Compatibility/PrintApp.php', 15 16 'PdcPod\\Includes\\Core' => $baseDir . '/includes/Core.php', 16 17 'PdcPod\\Includes\\I18n' => $baseDir . '/includes/I18n.php', -
pdc-pod/trunk/vendor/composer/autoload_static.php
r3472718 r3490633 38 38 'PdcPod\\Admin\\PrintDotCom\\Product' => __DIR__ . '/../..' . '/admin/PrintDotCom/Product.php', 39 39 'PdcPod\\Front\\FrontCore' => __DIR__ . '/../..' . '/front/FrontCore.php', 40 'PdcPod\\Includes\\Compatibility\\PrintApp' => __DIR__ . '/../..' . '/includes/Compatibility/PrintApp.php', 40 41 'PdcPod\\Includes\\Core' => __DIR__ . '/../..' . '/includes/Core.php', 41 42 'PdcPod\\Includes\\I18n' => __DIR__ . '/../..' . '/includes/I18n.php', -
pdc-pod/trunk/vendor/composer/installed.php
r3475432 r3490633 2 2 'root' => array( 3 3 'name' => 'printdotcom/pdc-pod', 4 'pretty_version' => '1. 1.1',5 'version' => '1. 1.1.0',6 'reference' => ' 66f6e76e4750741cb37de30d3be866453c2729c6',4 'pretty_version' => '1.2.0', 5 'version' => '1.2.0.0', 6 'reference' => '1af50197044eafa9656e1e4b310d14b3415737eb', 7 7 'type' => 'project', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'printdotcom/pdc-pod' => array( 14 'pretty_version' => '1. 1.1',15 'version' => '1. 1.1.0',16 'reference' => ' 66f6e76e4750741cb37de30d3be866453c2729c6',14 'pretty_version' => '1.2.0', 15 'version' => '1.2.0.0', 16 'reference' => '1af50197044eafa9656e1e4b310d14b3415737eb', 17 17 'type' => 'project', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.