The update to 2.4.4 has caused Affirm to no longer work as a payment option and does not show the Affirm monthly payment estimates on products. 2.4.2 was also removed from www.remarpro.com so I can’t easily roll back to it to resolve.
]]>In the multisite, if you active woocommerce plugin from Network instead from the subsite
The payment will not show in the payment method listing
The code below is root cause:
/**
* Loads Affirm.
*/
if (
in_array(
'woocommerce/woocommerce.php',
apply_filters( 'active_plugins', get_option( 'active_plugins' ) )
)
) {
$GLOBALS['wc_affirm_loader'] = affirm();
}
get_option( ‘active_plugins’ ) does not have woocommerce/woocommerce.php in the array
Please update on the next version, thanks
]]>There is currently a display bug for $0 priced products.
The script seems to interpret 0
as null
Our work-around was to add this:
.affirm-as-low-as:not([data-amount]) {
display:none;
}
]]>
Notice: Undefined index: NGN
plugins/woocommerce-gateway-affirm/includes/class-wc-gateway-affirm.php in WC_Gateway_Affirm::get_country_by_currency at line 2314
Our page has multiple currencies. When order is edited above mentioned notice is logged.
It is assumed in the code only two currencies are supported, there’s no sanity check for anything else but USD and CAD.
Function code:
public function get_country_by_currency( $currency_code ) {
$c_map = array(
'USD' => array( 'US', 'USA' ),
'CAD' => array( 'CA', 'CAN' ),
);
return $c_map[ $currency_code ];
}
This leads to one more notice:
PHP Notice: Trying to access array offset on value of type null in /plugins/woocommerce-gateway-affirm/class-woocommerce-gateway-affirm.php on line 1544
Fixing get_country_by_currency()
is helps further from occurring.
Temp patch I applied:
- return $c_map[ $currency_code ];
+ return $c_map[ $currency_code ] ?? [ '', '' ];
]]>
Our WooCommerce store supports multiple currencies. After installing Affirm we see following notice when order was made in different currency than USD or CAD:
Affirm: Affirm only supports USD or CAD for currency.
It is added in WC_Gateway_Affirm::adminNotices()
to the admin_notices
action.
This notice is unnecessary for us and confusing for some teammates. I’ve tried to remove it with
remove_action( 'admin_notices', array( affirm()->get_gateway(), 'adminNotices' ) );
function does return true
but notice persists. What I found out? New instances of WC_Gateway_Affirm
are created in 3 places:
WC_Affirm_Blocks_Checkout
WC_Affirm_Blocks_Cart
WooCommerce_Gateway_Affirm::get_gateway()
which is affirm()->get_gateway()
but this case only when I actually call get_gateway()
method. It’s not created earlier.Creating new instances of WC_Gateway_Affirm
in checkout and cart classes makes it register notices hook twice and impossible to remove as objects are stored in private properties.
I think plugin should use WooCommerce_Gateway_Affirm::get_gateway()
in these places instead.
Affirm: The force SSL option is disabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid SSL certificate – Affirm will only work in test mode.
I have checked SSL certificate for?https://www.ecosolarcool.com?and it is fine. Same as force https is enabled. I also confirmed this with my domain provider support team. Affirm is only working in test mode at the moment.
Yes, site meets all requirements. After multiple attempts and clearing caches, the error message about force SSL disabled is gone.
But now, I attempted 2 test transaction at checkout and it doesn’t redirect to affirm for the final checks and authorization. So there is something wrong with the plugin
]]>Hi,
I’m using Elementor to create my custom product page design. Is there a shortcode or some other methods I can use to show Affirm pricing info on the product page, in product listings, and in loops?
Thanks
]]>File: class-woocommerce-gateway-affirm.php
Method: woocommerce_single_product_summary
Check if ( ! $product->is_type( $supported_types ) )
doesn’t exclude types like “variable-subscription”. You need to find a better way to omit showing Affirm notes on subscription product pages.
These are just some of the lines added to the PHP error log.
PHP Deprecated: Creation of dynamic property WC_Gateway_Affirm::$public_key is deprecated in /bla-bla-bla/plugins/woocommerce-gateway-affirm/includes/class-wc-gateway-affirm.php on line 100
PHP Deprecated: Creation of dynamic property WC_Gateway_Affirm::$private_key is deprecated in /bla-bla-bla/plugins/woocommerce-gateway-affirm/includes/class-wc-gateway-affirm.php on line 101
PHP Deprecated: Creation of dynamic property WC_Gateway_Affirm::$public_key_ca is deprecated in /bla-bla-bla/plugins/woocommerce-gateway-affirm/includes/class-wc-gateway-affirm.php on line 102
The log file is growing very fast, so please fix it as soon as possible.
PHP 8.2.18
]]>