Skip to content

Commit

Permalink
Merge pull request #279 from alma/release/v5.6.0
Browse files Browse the repository at this point in the history
Release v5.6.0
  • Loading branch information
joyet-simon authored Sep 16, 2024
2 parents 0f166e9 + b8c7a7c commit 310d927
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 11 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## v5.6.0 - 2024-09-16

### Changes

### 🚀 New Features

- feat: compatibility woocommerce 9.2.3 wordpress 6.6.1 (#278)

### 🐛 Bug Fixes

- fix: force picture_url to string (#277)

#### Contributors

@Benjamin-Freoua-Alma, @Francois-Gomis, @alma-create-pr-with-team-review and @joyet-simon

## v5.5.0 - 2024-07-29

### Changes
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
- Tags: payments, payment gateway, woocommerce, ecommerce, e-commerce, sell, woo commerce, alma, monthly payments, split payments
- Requires at least Wordpress: 4.4
- Requires at least Woocommerce: 3.0.0
- Tested up to Wordpress: 6.5.5
- Tested up to Woocommerce: 9.0.2
- Tested up to Wordpress: 6.6.1
- Tested up to Woocommerce: 9.2.3
- Requires PHP: 5.6
- Stable tag: 5.5.0
- Stable tag: 5.6.0
- License: GPLv3
- License URI: https://www.gnu.org/licenses/gpl-3.0.html
- Support: [email protected]
Expand Down
18 changes: 17 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: payments, BNPL, woocommerce, ecommerce, e-commerce, payment gateway, sell,
Requires at least: 4.4
Tested up to: 6.3
Requires PHP: 5.6
Stable tag: 5.5.0
Stable tag: 5.6.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -51,6 +51,22 @@ You can find more documentation on our [website](https://docs.almapay.com/docs/w

== Changelog ==

## v5.6.0 - 2024-09-16

### Changes

### 🚀 New Features

- feat: compatibility woocommerce 9.2.3 wordpress 6.6.1 (#278)

### 🐛 Bug Fixes

- fix: force picture_url to string (#277)

#### Contributors

@Benjamin-Freoua-Alma, @Francois-Gomis, @alma-create-pr-with-team-review and @joyet-simon

## v5.5.0 - 2024-07-29

### Changes
Expand Down
8 changes: 4 additions & 4 deletions src/alma-gateway-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Alma - Pay in installments or later for WooCommerce
* Plugin URI: https://docs.almapay.com/docs/woocommerce
* Description: Install Alma and boost your sales! It's simple and guaranteed, your cash flow is secured. 0 commitment, 0 subscription, 0 risk.
* Version: 5.5.0
* Version: 5.6.0
* Author: Alma
* Author URI: https://almapay.com
* License: GNU General Public License v3.0
Expand All @@ -12,12 +12,12 @@
* Domain Path: /languages
* Requires at least: 4.4
* Requires PHP: 5.6
* Tested up to: 6.5.5
* Tested up to: 6.6.1
*
* @package Alma_Gateway_For_Woocommerce
*
* WC requires at least: 2.6
* WC tested up to: 9.0.2
* WC tested up to: 9.2.3
*
* Alma Payment Gateway for WooCommerce is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -38,7 +38,7 @@
}

if ( ! defined( 'ALMA_VERSION' ) ) {
define( 'ALMA_VERSION', '5.5.0' );
define( 'ALMA_VERSION', '5.6.0' );
}
if ( ! defined( 'ALMA_PLUGIN_FILE' ) ) {
define( 'ALMA_PLUGIN_FILE', __FILE__ );
Expand Down
2 changes: 1 addition & 1 deletion src/includes/Admin/Helpers/FormFieldsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ public function init_payment_upon_trigger_fields( $default_settings ) {
'title' => __( 'Trigger typology', 'alma-gateway-for-woocommerce' ),
'description' => __( 'Text that will appear in the payments schedule and in the customer\'s payment authorization email.', 'alma-gateway-for-woocommerce' ),
'default' => $default_settings['payment_upon_trigger_display_text'],
'options' => $this->internalionalization_helper->get_display_texts_keys_and_values(),
'options' => $this->internationalization_helper->get_display_texts_keys_and_values(),
),
'payment_upon_trigger_event' => array(
'type' => 'select',
Expand Down
13 changes: 11 additions & 2 deletions src/includes/Helpers/PaymentHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Alma\Woocommerce\AlmaLogger;
use Alma\Woocommerce\AlmaSettings;
use Alma\Woocommerce\Builders\Helpers\CartHelperBuilder;
use Alma\Woocommerce\Builders\Helpers\ProductHelperBuilder;
use Alma\Woocommerce\Builders\Helpers\ToolsHelperBuilder;
use Alma\Woocommerce\Exceptions\AlmaException;
use Alma\Woocommerce\Exceptions\AmountMismatchException;
Expand All @@ -38,7 +39,6 @@
*/
class PaymentHelper {


/**
* The logger.
*
Expand Down Expand Up @@ -82,6 +82,12 @@ class PaymentHelper {
*/
protected $cart_helper;

/**
* Product helper.
*
* @var ProductHelper
*/
protected $product_helper;

/**
* Contructor.
Expand All @@ -98,6 +104,9 @@ public function __construct() {
$this->cart_helper = $cart_helper_builder->get_instance();

$this->order_helper = new OrderHelper();

$product_helper_builder = new ProductHelperBuilder();
$this->product_helper = $product_helper_builder->get_instance();
}

/**
Expand Down Expand Up @@ -532,7 +541,7 @@ protected function add_product_data( $item ) {
'line_price' => $this->tool_helper->alma_price_to_cents( $item->get_total() ),
'categories' => $categories,
'url' => $product->get_permalink(),
'picture_url' => wp_get_attachment_url( $product->get_image_id() ),
'picture_url' => $this->product_helper->get_attachment_url( $product->get_image_id() ),
'requires_shipping' => $product->needs_shipping(),
);
}
Expand Down
10 changes: 10 additions & 0 deletions src/includes/Helpers/ProductHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,14 @@ public function is_product_excluded( $product_id ) {

return false;
}

/**
* Return attachment url or empty string
*
* @param int $attachment_id Attachment ID.
* @return string
*/
public function get_attachment_url( $attachment_id = 0 ) {
return wp_get_attachment_url( $attachment_id ) ? wp_get_attachment_url( $attachment_id ) : '';
}
}

0 comments on commit 310d927

Please sign in to comment.