Plugin Directory

Changeset 3332675


Ignore:
Timestamp:
07/23/2025 07:42:31 AM (7 months ago)
Author:
printess
Message:
  • Added option to order line items to reproduce single items
Location:
printess-editor/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • printess-editor/trunk/printess.php

    r3332044 r3332675  
    55 * Plugin URI: https://printess.com/kb/integrations/woo-commerce/index.html
    66 * Developer: Bastian Kröger ([email protected]); Alexander Oser ([email protected])
    7  * Version: 1.6.50
     7 * Version: 1.6.51
    88 * Author: Printess
    99 * Author URI: https://printess.com
     
    1414 * Tested up to: 6.8
    1515 *
    16  * Woo: 10000:924009dfsfhsf8429842385wdff234sfd
     16 * Woo: 10000:924010dfsfhsf8429842385wdff234sfd
    1717 * WC requires at least: 5.8
    1818 * WC tested up to: 9.8.2
     
    605605        foreach($values as $x => $y) {
    606606            foreach($y as $key => $value) {
     607                if(is_string($value)) {
     608                    break;
     609                }
     610
    607611                $label = $value["display_label"];
    608612
     
    616620                    $ret[$label] = $value["display_value"];
    617621                }
     622
    618623                break;
    619624            }
     
    20212026        }
    20222027
    2023 
    2024         echo ' <div>' . esc_html__( 'Line item id:', 'printess-editor' ) . "&nbsp;" . $item->get_id() . '</div>';
    2025 
    20262028        if ( printess_do_render_edit_link( $item ) ) {
    20272029            echo ' <a target=_blank href="' . esc_url( $url ) . '">' . esc_html__( 'Edit Customer Design', 'printess-editor' ) . '</a>';
    20282030        }
     2031
     2032        if (null !== $printess_job_id && !empty( $printess_job_id ) ) {
     2033            $url = add_query_arg(
     2034                array(
     2035                    'action'   => 'printess_reproduce_order_line_item',
     2036                    'order_id' => $order_id,
     2037                    'item_id'  => $item_id,
     2038                    'pst'      => $printess_save_token,
     2039                    'nonce'    => wp_create_nonce( 'printess_reproduce_order_line_item' ),
     2040                ),
     2041                home_url()
     2042            );
     2043
     2044            echo '<div><a href="' . esc_url( $url ) . '">' . esc_attr__( 'Reproduce item', 'printess-editor' ) . '</a></div>';
     2045        }
     2046
     2047        echo ' <div>' . esc_html__( 'Line item id:', 'printess-editor' ) . "&nbsp;" . $item->get_id() . '</div>';
    20292048    }
    20302049
     
    28382857    $nonce  = filter_input( INPUT_GET, 'nonce' );
    28392858
    2840     if ( isset( $action ) && isset( $nonce ) && 'printess_approve_order_line_item' === $action && wp_verify_nonce( $nonce, 'printess_approve_order_line_item' ) ) {
     2859    if ( isset( $action ) && isset( $nonce ) && (('printess_approve_order_line_item' === $action && wp_verify_nonce( $nonce, 'printess_approve_order_line_item' )) || ('printess_reproduce_order_line_item' === $action && wp_verify_nonce( $nonce, 'printess_reproduce_order_line_item' ))) ) {
    28412860                                    $order_id            = filter_input( INPUT_GET, 'order_id', FILTER_SANITIZE_NUMBER_INT );
    28422861                                    $line_item_id        = filter_input( INPUT_GET, 'item_id', FILTER_SANITIZE_NUMBER_INT );
     
    28442863                                    $order               = new WC_Order( $order_id );
    28452864                                    $item                = $order->get_item( $line_item_id );
     2865
     2866                                    $job_id = $item->get_meta( '_printess-job-id', true );
     2867
     2868                                    if(null !== $job_id && !empty($job_id)) {
     2869                                        $item->delete_meta_data( '_printess-job-id');
     2870                                    }
    28462871
    28472872                                    $order_items = array( $line_item_id => $item );
  • printess-editor/trunk/readme.txt

    r3332044 r3332675  
    287287= 1.6.50 =
    288288- Fixed issues with "Personalized product without personalization was added to the cart" warning that appeared on some products that have not been configured as printess items.
     289
     290= 1.6.51 =
     291- Added option to order line items to reproduce single items
Note: See TracChangeset for help on using the changeset viewer.