Skip to content

Commit d29a9ef

Browse files
committed
release v2.2.0
1 parent 3ad7fca commit d29a9ef

File tree

9 files changed

+82
-17
lines changed

9 files changed

+82
-17
lines changed

functions/admin/actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function actions() {
1717

1818
function admin_page() {
1919
if (!class_exists('WooCommerce')) {
20-
echo ('<h3>This plugin depends on WooCommerce plugin. Kindly install <a target="_blank" href="https://wordpress.org/plugins/woocommerce/">WooCommerce here!</a></h3>');
20+
echo ('<h3>This plugin requires the WooCommerce plugin. Kindly install <a target="_blank" href="https://wordpress.org/plugins/woocommerce/">WooCommerce here!</a></h3>');
2121
exit();
2222
}
2323
settings_errors();

functions/admin/settings.php

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,34 @@ function print_app_create_settings() {
77
}
88

99
function settings_api_init() {
10-
add_settings_section('print_app_settings_section', 'PrintApp Settings', 'printapp\\functions\\admin\\print_app_create_settings', 'print_app');
11-
add_settings_field('print_app_domain_key', 'Domain Key:', 'printapp\\functions\\admin\\print_app_domain_key', 'print_app', 'print_app_settings_section', array());
12-
add_settings_field('print_app_secret_key', 'Auth Key:', 'printapp\\functions\\admin\\print_app_secret_key', 'print_app', 'print_app_settings_section', array());
13-
add_settings_field('print_app_cust_download_link', 'Include PDF Link in Customer Email:', 'printapp\\functions\\admin\\print_app_cust_download_link', 'print_app', 'print_app_settings_section', array());
10+
add_settings_section(
11+
'print_app_settings_section',
12+
__('PrintApp Settings', 'printapp'),
13+
'printapp\\functions\\admin\\print_app_create_settings',
14+
'print_app'
15+
);
16+
add_settings_field(
17+
'print_app_domain_key',
18+
__('Domain Key:', 'printapp'),
19+
'printapp\\functions\\admin\\print_app_domain_key',
20+
'print_app',
21+
'print_app_settings_section'
22+
);
23+
add_settings_field(
24+
'print_app_secret_key',
25+
__('Auth Key:', 'printapp'),
26+
'printapp\\functions\\admin\\print_app_secret_key',
27+
'print_app',
28+
'print_app_settings_section'
29+
);
30+
add_settings_field(
31+
'print_app_cust_download_link',
32+
__('Include PDF Link in Customer Email:', 'printapp'),
33+
'printapp\\functions\\admin\\print_app_cust_download_link',
34+
'print_app',
35+
'print_app_settings_section'
36+
);
37+
1438
register_setting('print_app', 'print_app_domain_key');
1539
register_setting('print_app', 'print_app_secret_key');
1640
register_setting('print_app', 'print_app_cust_download_link');

functions/front/accounts.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace printapp\functions\front;
4+
5+
function my_recent_order() {
6+
7+
$user_id = get_current_user_id();
8+
if ($user_id === 0) return;
9+
10+
// load the client-class script...
11+
$lang_code = substr(get_bloginfo('language'), 0, 2);
12+
if (!$lang_code) $lang_code = 'en';
13+
$run_url = PRINT_APP_RUN_BASE_URL . $printapp_domain_key . '/user_' . $user_id . '/wp?lang=' . $lang_code;
14+
wp_enqueue_script('print_app_class', $run_url);
15+
16+
echo '<div id="print-app-user-projects" class="print-app-user-projects"></div>';
17+
}
18+

functions/front/carts.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ function add_cart_item_data($cart_item_data, $product_id, $variation_id, $qty) {
1010

1111
if (isset($value) && $value !== FALSE) {
1212
$cart_item_data[PRINT_APP_CUSTOMIZATION_KEY] = $value;
13-
General\delete_customization_data($product_id);
13+
14+
// Don't delete during cart simulation or validation checks
15+
$is_simulation = isset($_GET['wc-ajax']) && $_GET['wc-ajax'] === 'ppc-simulate-cart';
16+
17+
if (!$is_simulation) {
18+
General\delete_customization_data($product_id);
19+
}
1420
}
1521

1622
return $cart_item_data;

functions/front/customize_button.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
use printapp\functions\general as General;
66

77
function customize_button() {
8+
// Guard against duplicate execution
9+
static $already_run = false;
10+
if ($already_run) return;
11+
$already_run = true;
12+
813
global $post;
914
$printapp_domain_key = get_option('print_app_domain_key');
1015

functions/general/emails.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ function order_email($order, $sent_to_admin, $plain_text, $email) {
1111
$print_app_customization = $item->get_meta(PRINT_APP_CUSTOMIZATION_KEY, true);
1212
if (empty($print_app_customization)) continue;
1313

14+
$count = 0;
15+
1416
foreach ($print_app_customization['previews'] as $preview) {
17+
if ($count >= 3) break;
1518
echo '<tr><td colspan="2" style="text-align:left; padding: 10px 0;"><img src="' . $preview['url'] . '" width="180px; margin-right:10px;"/></td></tr>';
19+
$count++;
1620
}
1721

1822
$include_download_link = get_option('print_app_cust_download_link') == 'on';

functions/general/init_hooks.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ function init_hooks() {
4242

4343
// add the customization data to the order item
4444
add_filter('woocommerce_checkout_create_order_line_item', 'printapp\\functions\\front\\add_order_item_meta', 70, 2);
45+
46+
// my recent order page..
47+
add_action('woocommerce_before_my_account', 'printapp\\functions\\front\\my_recent_order');
4548

4649
}
4750

@@ -51,7 +54,7 @@ function init_hooks() {
5154
add_action('wp_ajax_nopriv_print_app_reset_project', 'printapp\\functions\\front\\reset_project_sess');
5255
add_action('wp_ajax_print_app_reset_project', 'printapp\\functions\\front\\reset_project_sess');
5356

54-
add_action('woocommerce_new_order', 'printapp\\functions\\admin\\handle_new_order',10,2);
57+
add_action('woocommerce_new_order', 'printapp\\functions\\admin\\handle_new_order', 10, 2);
5558

5659
// add the customization info to the order email
5760
add_action('woocommerce_email_order_details', 'printapp\\functions\\general\\order_email', 10, 4);

printapp.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22
/**
3-
* Plugin Name: Print.App
4-
* Plugin URI: https://print.app
5-
* Description: Empower your customers to personalize products like Business Cards, Photo Prints, T-Shirts, Mugs, Banners, Canvases, etc. on your store before purchase
6-
* Version: 2.1.6
7-
* Requires at least: 3.8
8-
* Requires PHP: 7.4
9-
* Author: Print.App ApS
10-
* Author URI: https://print.app
11-
* Tested up to: 6.8
3+
* Plugin Name: Print.App
4+
* Plugin URI: https://print.app
5+
* Description: Empower your customers to personalize products like Business Cards, Photo Prints, T-Shirts, Mugs, Banners, Canvases, etc. on your store before purchase
6+
* Version: 2.2.0
7+
* Requires at least: 3.8
8+
* Requires PHP: 7.4
9+
* Author: Print.App ApS
10+
* Author URI: https://print.app
11+
* Tested up to: 6.8
1212
* WC requires at least: 4.0
1313
* WC tested up to: 9.4
1414
*
@@ -45,7 +45,7 @@ class PrintApp {
4545
* PrintApp version.
4646
* @var string
4747
*/
48-
public $version = '2.1.6';
48+
public $version = '2.2.0';
4949

5050
/**
5151
* The single instance of the class.

readme.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ Check out our [website for more details](https://print.app)
101101

102102
== Changelog ==
103103

104+
= 2.2.0 =
105+
Implemented Save for Later
106+
Limited preview images in emails to the first 3 pages
107+
Minor bug fixes related to session management
108+
104109
= 2.1.6 =
105110
Minor fix for displaying links in emails
106111

0 commit comments

Comments
 (0)