Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
1000 characters truncation for product description
Browse files Browse the repository at this point in the history
  • Loading branch information
Miika Arponen committed May 16, 2019
1 parent 613cfad commit a13f7e9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.1-beta] - 2019-05-16

### Added
- A feature that truncates the product description to a maximum of 1000 characaters when sending it to the Checkout Finland API.

## [1.1.0-beta] - 2019-04-24

### Added
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Checkout Finland WooCommerce Payment Gateway
Plugin URI: https://github.com/CheckoutFinland/plugin-woocommerce
Description: WooCommerce extension for supporting Checkout Finland payment methods
Version: 1.1.0-beta
Version: 1.1.1-beta
Author: Checkout Finland
Author URI: http://www.checkout.fi/
Copyright: Checkout Finland
Expand Down
4 changes: 4 additions & 0 deletions src/Gateway.php
Expand Up @@ -1111,6 +1111,10 @@ protected function get_item_description( WC_Order_Item $item ) : string {
$description = $item->get_name();
break;
}

// Ensure the description is maximum of 1000 characters long.
$description = substr( $description, 0, 1000 );

return apply_filters( 'checkout_finland_item_description', $description, $item );
}

Expand Down

0 comments on commit a13f7e9

Please sign in to comment.