Plugin Directory

Changeset 3490633


Ignore:
Timestamp:
03/25/2026 08:04:50 AM (9 days ago)
Author:
printdotcom
Message:

Update to version 1.2.0 from GitHub

Location:
pdc-pod
Files:
4 added
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • pdc-pod/tags/1.2.0/CHANGELOG.md

    r3475432 r3490633  
    55The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
    66and 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
    714
    815## [1.1.1]
  • pdc-pod/tags/1.2.0/README.txt

    r3475432 r3490633  
    55Requires at least: 3.4
    66Tested up to: 6.9
    7 Stable tag: 1.1.1
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4141== Changelog ==
    4242
     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
    4348= 1.1.1 =
    4449
  • pdc-pod/tags/1.2.0/admin/AdminCore.php

    r3472718 r3490633  
    4444     * Initialize the class and set its properties.
    4545     *
    46      * @param APIClient $pdc_api_client
     46     * @param APIClient $pdc_api_client The api client.
    4747     * @since    1.0.0
    4848     */
     
    240240        $order = wc_get_order( $post->get_ID() );
    241241        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 );
    242268    }
    243269
     
    680706        }
    681707
     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
    682715        $pdc_product_config = get_option( PDC_POD_NAME . '-product' );
    683716
    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 );
    685718        if ( is_wp_error( $result ) ) {
    686719            $status = absint( $result->get_error_code() );
     
    702735        $pdc_order_item          = $pdc_order->items[0];
    703736        $pdc_order_item_shipment = $pdc_order_item->shipments[0];
    704         $order_item              = new \WC_Order_Item_Product( $order_item_id );
    705737
    706738        $order_item->update_meta_data( $this->get_meta_key( 'order' ), $pdc_order );
     
    722754        $order_item->save();
    723755
    724         $order_id = wc_get_order_id_by_order_item_id( $order_item_id );
    725         $order    = wc_get_order( $order_id );
    726 
    727756        $note = sprintf(
    728757            // translators: placeholder is the order number.
  • pdc-pod/tags/1.2.0/admin/PrintDotCom/APIClient.php

    r3475432 r3490633  
    273273     * @since 1.0.0
    274274     *
    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 {
    277280     *     Optional. Arguments for customizing the purchase behavior.
    278281     *
     
    281284     * }
    282285     *
    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.
    285288     *
    286289     * @phpcsSuppress WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    287290     */
    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() ) {
    292292        $shipping_address = $order->get_address( 'shipping' );
    293293
     
    296296        }
    297297
    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 );
    302299        if ( is_wp_error( $result ) ) {
    303300            if ( $result->get_error_message() === '[404] Preset not found.' ) {
     
    306303                    'Preset does not exist.',
    307304                    array(
    308                         'preset_id'   => $pdc_preset_id,
     305                        'preset_id'   => $pdc_pod_preset_id,
    309306                        'environment' => $this->pdc_pod_api_base_url,
    310307                    )
     
    318315                'Preset does not exist.',
    319316                array(
    320                     'preset_id'   => $pdc_preset_id,
     317                    'preset_id'   => $pdc_pod_preset_id,
    321318                    'environment' => $this->pdc_pod_api_base_url,
    322319                )
     
    336333        unset( $item_options->deliveryPromise ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
    337334
    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
    339346        $order_request = array(
    340347            '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 ),
    342349            'items'             => array(
    343350                array(
    344351                    'sku'           => $preset->sku,
    345                     'fileUrl'       => $pdc_pdf_url,
     352                    'fileUrl'       => $pdc_pod_preset_url,
    346353                    'options'       => $item_options,
    347354                    'approveDesign' => true,
  • pdc-pod/tags/1.2.0/admin/partials/pdc-pod-admin-producttab.php

    r3472718 r3490633  
    3333                id="js-pdc-product-selector"
    3434                data-testid="pdc-product-sku"
    35                 data-product_id="<?php echo $post->ID; ?>"
     35                data-product_id="<?php echo esc_attr( $post->ID ); ?>"
    3636                name="<?php echo esc_attr( $this->get_meta_key( 'product_sku' ) ); ?>"
    3737                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  
    4040            <select
    4141                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 ); ?>"
    4343                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 ); ?>"
    4545                name="<?php echo esc_attr( $pdc_pod_sku_input_name ); ?>"
    4646                value="<?php echo esc_attr( (string) $pdc_pod_sku ); ?>">
     
    4848                <?php
    4949                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 : '';
    5252                    ?>
    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>
    5454                <?php } ?>
    5555            </select>
  • pdc-pod/tags/1.2.0/admin/partials/pdc-pod-html-order-metabox.php

    r3421416 r3490633  
    3636            $pdc_pod_purchase_date          = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'purchase_date' ), true );
    3737            $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 );
    3939            $pdc_pod_order_item_status      = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'order_item_status' ), true );
    4040            $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  
    7070        $this->define_admin_hooks();
    7171        $this->define_public_hooks();
     72        $this->define_compatibility_hooks();
    7273    }
    7374
     
    9596    /**
    9697     * 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.
    10498     *
    10599     * Create an instance of the loader which will be used to register the hooks
     
    172166
    173167    /**
     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    /**
    174180     * Run the loader to execute all of the hooks with WordPress.
    175181     *
  • pdc-pod/tags/1.2.0/pdc-pod.php

    r3475432 r3490633  
    2525 * Plugin URI:        https://github.com/printdotcom/pdc-pod
    2626 * Description:       Allows customers to configure, edit and purchase products via the Print.com API.
    27  * Version:           1.1.1
     27 * Version:           1.2.0
    2828 * Author:            Print.com
    2929 * Author URI:        https://print.com
     
    5555 * @var string PDC_POD_VERSION Plugin version.
    5656 */
    57 define( 'PDC_POD_VERSION', '1.1.1' );
     57define( 'PDC_POD_VERSION', '1.2.0' );
    5858
    5959/**
  • pdc-pod/tags/1.2.0/vendor/composer/autoload_classmap.php

    r3465930 r3490633  
    1313    'PdcPod\\Admin\\PrintDotCom\\Product' => $baseDir . '/admin/PrintDotCom/Product.php',
    1414    'PdcPod\\Front\\FrontCore' => $baseDir . '/front/FrontCore.php',
     15    'PdcPod\\Includes\\Compatibility\\PrintApp' => $baseDir . '/includes/Compatibility/PrintApp.php',
    1516    'PdcPod\\Includes\\Core' => $baseDir . '/includes/Core.php',
    1617    'PdcPod\\Includes\\I18n' => $baseDir . '/includes/I18n.php',
  • pdc-pod/tags/1.2.0/vendor/composer/autoload_static.php

    r3472718 r3490633  
    3838        'PdcPod\\Admin\\PrintDotCom\\Product' => __DIR__ . '/../..' . '/admin/PrintDotCom/Product.php',
    3939        'PdcPod\\Front\\FrontCore' => __DIR__ . '/../..' . '/front/FrontCore.php',
     40        'PdcPod\\Includes\\Compatibility\\PrintApp' => __DIR__ . '/../..' . '/includes/Compatibility/PrintApp.php',
    4041        'PdcPod\\Includes\\Core' => __DIR__ . '/../..' . '/includes/Core.php',
    4142        'PdcPod\\Includes\\I18n' => __DIR__ . '/../..' . '/includes/I18n.php',
  • pdc-pod/tags/1.2.0/vendor/composer/installed.php

    r3475432 r3490633  
    22    'root' => array(
    33        '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',
    77        'type' => 'project',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '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',
    1717            'type' => 'project',
    1818            'install_path' => __DIR__ . '/../../',
  • pdc-pod/trunk/CHANGELOG.md

    r3475432 r3490633  
    55The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
    66and 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
    714
    815## [1.1.1]
  • pdc-pod/trunk/README.txt

    r3475432 r3490633  
    55Requires at least: 3.4
    66Tested up to: 6.9
    7 Stable tag: 1.1.1
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4141== Changelog ==
    4242
     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
    4348= 1.1.1 =
    4449
  • pdc-pod/trunk/admin/AdminCore.php

    r3472718 r3490633  
    4444     * Initialize the class and set its properties.
    4545     *
    46      * @param APIClient $pdc_api_client
     46     * @param APIClient $pdc_api_client The api client.
    4747     * @since    1.0.0
    4848     */
     
    240240        $order = wc_get_order( $post->get_ID() );
    241241        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 );
    242268    }
    243269
     
    680706        }
    681707
     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
    682715        $pdc_product_config = get_option( PDC_POD_NAME . '-product' );
    683716
    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 );
    685718        if ( is_wp_error( $result ) ) {
    686719            $status = absint( $result->get_error_code() );
     
    702735        $pdc_order_item          = $pdc_order->items[0];
    703736        $pdc_order_item_shipment = $pdc_order_item->shipments[0];
    704         $order_item              = new \WC_Order_Item_Product( $order_item_id );
    705737
    706738        $order_item->update_meta_data( $this->get_meta_key( 'order' ), $pdc_order );
     
    722754        $order_item->save();
    723755
    724         $order_id = wc_get_order_id_by_order_item_id( $order_item_id );
    725         $order    = wc_get_order( $order_id );
    726 
    727756        $note = sprintf(
    728757            // translators: placeholder is the order number.
  • pdc-pod/trunk/admin/PrintDotCom/APIClient.php

    r3475432 r3490633  
    273273     * @since 1.0.0
    274274     *
    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 {
    277280     *     Optional. Arguments for customizing the purchase behavior.
    278281     *
     
    281284     * }
    282285     *
    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.
    285288     *
    286289     * @phpcsSuppress WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
    287290     */
    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() ) {
    292292        $shipping_address = $order->get_address( 'shipping' );
    293293
     
    296296        }
    297297
    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 );
    302299        if ( is_wp_error( $result ) ) {
    303300            if ( $result->get_error_message() === '[404] Preset not found.' ) {
     
    306303                    'Preset does not exist.',
    307304                    array(
    308                         'preset_id'   => $pdc_preset_id,
     305                        'preset_id'   => $pdc_pod_preset_id,
    309306                        'environment' => $this->pdc_pod_api_base_url,
    310307                    )
     
    318315                'Preset does not exist.',
    319316                array(
    320                     'preset_id'   => $pdc_preset_id,
     317                    'preset_id'   => $pdc_pod_preset_id,
    321318                    'environment' => $this->pdc_pod_api_base_url,
    322319                )
     
    336333        unset( $item_options->deliveryPromise ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
    337334
    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
    339346        $order_request = array(
    340347            '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 ),
    342349            'items'             => array(
    343350                array(
    344351                    'sku'           => $preset->sku,
    345                     'fileUrl'       => $pdc_pdf_url,
     352                    'fileUrl'       => $pdc_pod_preset_url,
    346353                    'options'       => $item_options,
    347354                    'approveDesign' => true,
  • pdc-pod/trunk/admin/partials/pdc-pod-admin-producttab.php

    r3472718 r3490633  
    3333                id="js-pdc-product-selector"
    3434                data-testid="pdc-product-sku"
    35                 data-product_id="<?php echo $post->ID; ?>"
     35                data-product_id="<?php echo esc_attr( $post->ID ); ?>"
    3636                name="<?php echo esc_attr( $this->get_meta_key( 'product_sku' ) ); ?>"
    3737                value="<?php echo esc_attr( (string) $pdc_pod_sku ); ?>">
  • pdc-pod/trunk/admin/partials/pdc-pod-admin-variation-data.php

    r3472718 r3490633  
    4040            <select
    4141                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 ); ?>"
    4343                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 ); ?>"
    4545                name="<?php echo esc_attr( $pdc_pod_sku_input_name ); ?>"
    4646                value="<?php echo esc_attr( (string) $pdc_pod_sku ); ?>">
     
    4848                <?php
    4949                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 : '';
    5252                    ?>
    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>
    5454                <?php } ?>
    5555            </select>
  • pdc-pod/trunk/admin/partials/pdc-pod-html-order-metabox.php

    r3421416 r3490633  
    3636            $pdc_pod_purchase_date          = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'purchase_date' ), true );
    3737            $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 );
    3939            $pdc_pod_order_item_status      = wc_get_order_item_meta( $pdc_pod_order_item_id, $this->get_meta_key( 'order_item_status' ), true );
    4040            $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  
    7070        $this->define_admin_hooks();
    7171        $this->define_public_hooks();
     72        $this->define_compatibility_hooks();
    7273    }
    7374
     
    9596    /**
    9697     * 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.
    10498     *
    10599     * Create an instance of the loader which will be used to register the hooks
     
    172166
    173167    /**
     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    /**
    174180     * Run the loader to execute all of the hooks with WordPress.
    175181     *
  • pdc-pod/trunk/pdc-pod.php

    r3475432 r3490633  
    2525 * Plugin URI:        https://github.com/printdotcom/pdc-pod
    2626 * Description:       Allows customers to configure, edit and purchase products via the Print.com API.
    27  * Version:           1.1.1
     27 * Version:           1.2.0
    2828 * Author:            Print.com
    2929 * Author URI:        https://print.com
     
    5555 * @var string PDC_POD_VERSION Plugin version.
    5656 */
    57 define( 'PDC_POD_VERSION', '1.1.1' );
     57define( 'PDC_POD_VERSION', '1.2.0' );
    5858
    5959/**
  • pdc-pod/trunk/vendor/composer/autoload_classmap.php

    r3465930 r3490633  
    1313    'PdcPod\\Admin\\PrintDotCom\\Product' => $baseDir . '/admin/PrintDotCom/Product.php',
    1414    'PdcPod\\Front\\FrontCore' => $baseDir . '/front/FrontCore.php',
     15    'PdcPod\\Includes\\Compatibility\\PrintApp' => $baseDir . '/includes/Compatibility/PrintApp.php',
    1516    'PdcPod\\Includes\\Core' => $baseDir . '/includes/Core.php',
    1617    'PdcPod\\Includes\\I18n' => $baseDir . '/includes/I18n.php',
  • pdc-pod/trunk/vendor/composer/autoload_static.php

    r3472718 r3490633  
    3838        'PdcPod\\Admin\\PrintDotCom\\Product' => __DIR__ . '/../..' . '/admin/PrintDotCom/Product.php',
    3939        'PdcPod\\Front\\FrontCore' => __DIR__ . '/../..' . '/front/FrontCore.php',
     40        'PdcPod\\Includes\\Compatibility\\PrintApp' => __DIR__ . '/../..' . '/includes/Compatibility/PrintApp.php',
    4041        'PdcPod\\Includes\\Core' => __DIR__ . '/../..' . '/includes/Core.php',
    4142        'PdcPod\\Includes\\I18n' => __DIR__ . '/../..' . '/includes/I18n.php',
  • pdc-pod/trunk/vendor/composer/installed.php

    r3475432 r3490633  
    22    'root' => array(
    33        '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',
    77        'type' => 'project',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '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',
    1717            'type' => 'project',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.