' . __( 'When you design a product, the images you upload, your texts and the finished design are transferred to Eazign (Metacom Solutions, Austria), our service provider for the product designer and the print files. They are stored with your order number and used only to produce your order. Designs that are not ordered are deleted after 90 days; designs of orders are deleted when your order data is erased.', 'eazign' ) . '

'; wp_add_privacy_policy_content( 'Eazign', wp_kses_post( $text ) ); } /** * Exporter registration. * * @param array $exporters Exporters. * @return array */ public static function register_exporter( $exporters ) { $exporters['eazign'] = array( 'exporter_friendly_name' => __( 'Product designs (Eazign)', 'eazign' ), 'callback' => array( __CLASS__, 'export' ), ); return $exporters; } /** * Eraser registration. * * @param array $erasers Erasers. * @return array */ public static function register_eraser( $erasers ) { $erasers['eazign'] = array( 'eraser_friendly_name' => __( 'Product designs (Eazign)', 'eazign' ), 'callback' => array( __CLASS__, 'erase' ), ); return $erasers; } /** * Orders of a customer e-mail address. * * @param string $email E-mail. * @return WC_Order[] */ private static function orders_of( $email ) { return wc_get_orders( array( 'billing_email' => $email, 'limit' => -1, ) ); } /** * Export: design previews of the customer's orders. * * @param string $email E-mail. * @return array */ public static function export( $email ) { $data = array(); foreach ( self::orders_of( $email ) as $order ) { foreach ( $order->get_items() as $item ) { $preview = $item->get_meta( '_eazign_preview' ); if ( ! $preview ) { continue; } $data[] = array( 'group_id' => 'eazign', 'group_label' => __( 'Product designs', 'eazign' ), 'item_id' => 'eazign-' . $item->get_id(), 'data' => array( array( 'name' => __( 'Order', 'eazign' ), 'value' => $order->get_order_number(), ), array( 'name' => __( 'Design preview', 'eazign' ), 'value' => $preview, ), ), ); } } return array( 'data' => $data, 'done' => true, ); } /** * Eraser: deletes designs, uploads and print files of the customer's orders. * * @param string $email E-mail. * @return array */ public static function erase( $email ) { // Same rule as WooCommerce for the orders themselves: designs of orders // are production data and are kept unless the shop erases order data. if ( 'yes' !== get_option( 'woocommerce_erasure_request_removes_order_data', 'no' ) ) { return array( 'items_removed' => false, 'items_retained' => true, 'messages' => array( __( 'Product designs of orders were kept (WooCommerce → Settings → Accounts & Privacy: personal data of orders is not removed on erasure requests).', 'eazign' ) ), 'done' => true, ); } $ids = array(); foreach ( self::orders_of( $email ) as $order ) { $ids[] = (string) $order->get_id(); } $result = $ids && Eazign_Client::is_connected() ? Eazign_Client::post( 'privacy/erase', array( 'orderIds' => $ids ) ) : null; return array( 'items_removed' => $ids && ! is_wp_error( $result ), 'items_retained' => false, 'messages' => is_wp_error( $result ) ? array( $result->get_error_message() ) : array(), 'done' => true, ); } /** * Order anonymised or deleted. * * @param WC_Order|int $order Order. */ public static function erase_order( $order ) { $order_id = $order instanceof WC_Order ? $order->get_id() : (int) $order; if ( $order_id && Eazign_Client::is_connected() ) { Eazign_Client::post( 'privacy/erase', array( 'orderIds' => array( (string) $order_id ) ) ); } } }