Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions helloextend-protection/helloextend-protection.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Plugin Name: Extend Protection For WooCommerce
* Plugin URI: https://docs.extend.com/docs/extend-protection-plugin-for-woocommerce
* Description: Extend Protection for Woocommerce. Allows WooCommerce merchants to offer product and shipping protection to their customers.
* Version: 1.2.0
* Version: 1.2.4
Comment thread
alexsmithext marked this conversation as resolved.
* Author: Extend, Inc.
* Author URI: https://extend.com/
* License: GPL-2.0+
Expand Down Expand Up @@ -44,7 +44,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define('HELLOEXTEND_PROTECTION_VERSION', '1.1.0');
define('HELLOEXTEND_PROTECTION_VERSION', '1.2.4');
define('HELLOEXTEND_PRODUCT_PROTECTION_SKU', 'helloextend-product-protection');
define('HELLOEXTEND_SHIPPING_PROTECTION_SKU', 'helloextend-shipping-protection');

Expand Down
18 changes: 10 additions & 8 deletions helloextend-protection/includes/class-helloextend-global.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function hooks()
add_action('woocommerce_checkout_create_order_line_item', [$this, 'order_item_meta'], 10, 3);

// update price for warranty items
add_action('woocommerce_before_calculate_totals', [$this, 'update_price']);
add_action('woocommerce_before_calculate_totals', [$this, 'update_price'], 99999);

// Initialize global ExtendWooCommerce
add_action('wp_head', [$this, 'helloextend_init_global']);
Expand Down Expand Up @@ -283,16 +283,18 @@ public static function helloextend_add_to_cart()

// update_price($cart_object)
// @param $cart_object : WC_Cart, represents current cart object
public function update_price($cart_object)
public function update_price($cart)
{
$cart_items = $cart_object->cart_contents;
if (is_admin() && !defined('DOING_AJAX')) return;

if (!empty($cart_items)) {
foreach ($cart->get_cart() as $cart_item_key => $cart_item) {
if (!empty($cart_item['extendData']) && (!empty($cart_item['extendData']['price']) || $cart_item['extendData']['price'] == (int) 0)) {

foreach ($cart_items as $key => $value) {
if (isset($value['extendData']) && !empty($value['extendData'])) {
$value['data']->set_price(round($value['extendData']['price'] / 100, 2));
}
$price = round(floatval($cart_item['extendData']['price']) / 100, 2);

$cart_item['data']->set_price($price);
$cart_item['data']->set_regular_price($price);
$cart_item['data']->set_sale_price('');
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ public function helloextend_get_plans_and_products($order, $fulfill_now = false)
'id' => $product->get_id(),
'title' => $product->get_name(),
'category' => $first_category,
'listPrice' => $this->get_price_in_cents($product->get_regular_price() * 100),
'purchasePrice' => $this->get_price_in_cents($product->get_price() * 100),
'listPrice' => $this->get_price_in_cents($product->get_regular_price()),
'purchasePrice' => $this->get_price_in_cents($product->get_price()),
'purchaseDate' => $order->get_data()['date_created']->getTimestamp() * 1000,
'imageUrl' => $image_url
),
Expand Down
9 changes: 8 additions & 1 deletion helloextend-protection/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Contributors: santiagoenciso33, jmbextend, alexsmithext, helloextend
Tags: extend, protection, tracking
Requires at least: 4.0
Tested up to: 6.8
Stable tag: 1.2.0
Stable tag: 1.2.4
Requires PHP: 7.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -79,6 +79,13 @@ For more information on our terms of service and privacy policy, visit the links

== Changelog ==

= 1.2.4 2026-05-08 =
* Fix - Increased priority for warranty price hook so that plan prices are properly set in more scenarios.
* Fix - Fixed a bug where product prices were incorrectly set when orders were sent to Extend.

= 1.2.3 2026-03-25 =
* Feature - Added support for cart offers in WooCommerce side cart

= 1.2.0 2025-09-09 =
* Feature - Customers now have the option to purchase a protection plan after their initial purchase. Contact Extend to learn more.
* Fix - Any protection plans on an order will be cancelled when the line items or entire order is refunded or cancelled
Expand Down
Loading