|
@@ -3,7 +3,7 @@
|
|
|
* Plugin Name: QDR - Studiou WC Free Photo Product
|
|
* Plugin Name: QDR - Studiou WC Free Photo Product
|
|
|
* Plugin URI: https://www.quadarax.com/plugins/studiou-wc-free-photo-product
|
|
* Plugin URI: https://www.quadarax.com/plugins/studiou-wc-free-photo-product
|
|
|
* Description: Allows publishing special WooCommerce products with variants and custom raw image upload for photo printing
|
|
* Description: Allows publishing special WooCommerce products with variants and custom raw image upload for photo printing
|
|
|
- * Version: 1.5.12
|
|
|
|
|
|
|
+ * Version: 1.5.13
|
|
|
* Requires at least: 6.9.4
|
|
* Requires at least: 6.9.4
|
|
|
* Requires PHP: 8.2
|
|
* Requires PHP: 8.2
|
|
|
* Requires Plugins: woocommerce, product-variant-table-for-woocommerce
|
|
* Requires Plugins: woocommerce, product-variant-table-for-woocommerce
|
|
@@ -22,7 +22,7 @@ if (!defined('WPINC')) {
|
|
|
die;
|
|
die;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-if (!defined('STUDIOU_WCFPP_VERSION')) define('STUDIOU_WCFPP_VERSION', '1.5.12');
|
|
|
|
|
|
|
+if (!defined('STUDIOU_WCFPP_VERSION')) define('STUDIOU_WCFPP_VERSION', '1.5.13');
|
|
|
if (!defined('STUDIOU_WCFPP_PLUGIN_DIR')) define('STUDIOU_WCFPP_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
|
if (!defined('STUDIOU_WCFPP_PLUGIN_DIR')) define('STUDIOU_WCFPP_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
|
|
if (!defined('STUDIOU_WCFPP_PLUGIN_URL')) define('STUDIOU_WCFPP_PLUGIN_URL', plugin_dir_url(__FILE__));
|
|
if (!defined('STUDIOU_WCFPP_PLUGIN_URL')) define('STUDIOU_WCFPP_PLUGIN_URL', plugin_dir_url(__FILE__));
|
|
|
if (!defined('STUDIOU_WCFPP_PLUGIN_BASENAME')) define('STUDIOU_WCFPP_PLUGIN_BASENAME', plugin_basename(__FILE__));
|
|
if (!defined('STUDIOU_WCFPP_PLUGIN_BASENAME')) define('STUDIOU_WCFPP_PLUGIN_BASENAME', plugin_basename(__FILE__));
|
|
@@ -246,6 +246,21 @@ class Studiou_WC_Free_Photo_Product {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function register_frontend_assets() {
|
|
public function register_frontend_assets() {
|
|
|
|
|
+ // WC block cart ("Estimated total" etc.) is React-rendered and pulls its strings
|
|
|
|
|
+ // from wp.i18n in the browser — the PHP gettext_woocommerce filter never fires for
|
|
|
|
|
+ // those strings. Patch the translation on the JS side: after wp-i18n loads, and
|
|
|
|
|
+ // before the cart block renders, replace the 'Estimated total' → 'woocommerce'
|
|
|
|
|
+ // domain entry with our own wording. Translation source of truth stays in our .po.
|
|
|
|
|
+ $override_js = "( function() {";
|
|
|
|
|
+ $override_js .= " if ( ! window.wp || ! wp.i18n ) return;";
|
|
|
|
|
+ $override_js .= " var domain = 'woocommerce';";
|
|
|
|
|
+ $override_js .= " var txt = " . wp_json_encode(__('Total', 'studiou-wc-free-photo-product')) . ";";
|
|
|
|
|
+ $override_js .= " wp.i18n.setLocaleData( { 'Estimated total': [ txt ] }, domain );";
|
|
|
|
|
+ // Also remap other cart-page terminology variants so UI stays consistent.
|
|
|
|
|
+ $override_js .= " wp.i18n.setLocaleData( { 'Cart totals': [ txt ] }, domain );";
|
|
|
|
|
+ $override_js .= " } )();";
|
|
|
|
|
+ wp_add_inline_script('wp-i18n', $override_js, 'after');
|
|
|
|
|
+
|
|
|
wp_register_style(
|
|
wp_register_style(
|
|
|
'studiou-wcfpp-frontend',
|
|
'studiou-wcfpp-frontend',
|
|
|
STUDIOU_WCFPP_PLUGIN_URL . 'assets/css/frontend.css',
|
|
STUDIOU_WCFPP_PLUGIN_URL . 'assets/css/frontend.css',
|