Skip to content

Commit 9eff817

Browse files
committed
truncating product descriptions 😩
1 parent d71743d commit 9eff817

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

includes/API/Product_Variations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function product_response( WP_REST_Response $response, WC_Data $product,
4747
$data['barcode'] = $this->get_barcode( $product );
4848

4949
// Truncate the product description and short_description
50-
$data['description'] = $this->truncate_text( $data['description'] );
50+
// $data['description'] = $this->truncate_text( $data['description'] );
5151

5252
/**
5353
* Make sure we parse the meta data before returning the response

includes/API/Products.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ public function product_response( WP_REST_Response $response, WC_Product $produc
149149
$data['barcode'] = $this->get_barcode( $product );
150150

151151
// Truncate the product description and short_description
152-
$data['description'] = $this->truncate_text( $data['description'] );
153-
$data['short_description'] = $this->truncate_text( $data['short_description'] );
152+
// $data['description'] = $this->truncate_text( $data['description'] );
153+
// $data['short_description'] = $this->truncate_text( $data['short_description'] );
154154

155155
/**
156156
* If product is variable, add the max and min prices and add them to the meta data

includes/API/Traits/Product_Helpers.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ private function get_barcode( $object ) {
8282
* @param string $text
8383
* @return string
8484
*/
85-
private function truncate_text( string $text ): string {
86-
$max_length = 100;
87-
$result = wp_strip_all_tags( $text, true );
88-
if ( strlen( $result ) > $max_length ) {
89-
$result = substr( $result, 0, $max_length - 3 ) . '...';
90-
}
91-
return $result;
92-
}
85+
// private function truncate_text( string $text ): string {
86+
// $max_length = 100;
87+
// $result = wp_strip_all_tags( $text, true );
88+
// if ( strlen( $result ) > $max_length ) {
89+
// $result = substr( $result, 0, $max_length - 3 ) . '...';
90+
// }
91+
// return $result;
92+
// }
9393

9494
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wcpos/woocommerce-pos",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"description": "A simple front-end for taking WooCommerce orders at the Point of Sale.",
55
"main": "index.js",
66
"workspaces": {

readme.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: kilbot
33
Tags: cart, e-commerce, ecommerce, inventory, point-of-sale, pos, sales, sell, shop, shopify, store, vend, woocommerce, wordpress-ecommerce
44
Requires at least: 5.6 & WooCommerce 5.3
55
Tested up to: 6.3
6-
Stable tag: 1.3.3
6+
Stable tag: 1.3.4
77
License: GPL-3.0
88
License URI: http://www.gnu.org/licenses/gpl-3.0.html
99

@@ -63,8 +63,11 @@ There is more information on our website at [https://wcpos.com](https://wcpos.co
6363

6464
== Changelog ==
6565

66+
= 1.3.4 - 2023/07/29 =
67+
* Urgent Fix: product descriptions being truncated to 100 characters
68+
6669
= 1.3.3 - 2023/07/28 =
67-
* Fix: "Nonce value cannot be verified" when dequeue-ing scripts and styles onPOS checkout modal
70+
* Fix: "Nonce value cannot be verified" when dequeue-ing scripts and styles in POS checkout modal
6871

6972
= 1.3.2 - 2023/07/27 =
7073
* Urgent Fix for variations not downloading for some users

woocommerce-pos.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WooCommerce POS
44
* Plugin URI: https://wordpress.org/plugins/woocommerce-pos/
55
* Description: A simple front-end for taking WooCommerce orders at the Point of Sale. Requires <a href="http://wordpress.org/plugins/woocommerce/">WooCommerce</a>.
6-
* Version: 1.3.3
6+
* Version: 1.3.4
77
* Author: kilbot
88
* Author URI: http://wcpos.com
99
* Text Domain: woocommerce-pos
@@ -24,7 +24,7 @@
2424
use function define;
2525

2626
// Define plugin constants.
27-
const VERSION = '1.3.3';
27+
const VERSION = '1.3.4';
2828
const PLUGIN_NAME = 'woocommerce-pos';
2929
const SHORT_NAME = 'wcpos';
3030
define( __NAMESPACE__ . '\PLUGIN_FILE', plugin_basename( __FILE__ ) ); // 'woocommerce-pos/woocommerce-pos.php'

0 commit comments

Comments
 (0)