Hey @slewisma I was able to reproduce what you’re experiencing and agree it’s confusing to your customers. This is being treated as a high priority issue and we will fix and release this very soon. I’ll post back here when it has been fixed.
Hi @slewisma
While we are fixing that, you can use this code snippet to avoid showing this button:
add_filter(
'woocommerce_my_account_my_orders_actions',
function( $actions, $order ) {
if ( ! class_exists( 'StellarPay\Subscriptions\Models\Subscription' ) ) {
return $actions;
}
$subscription = StellarPay\Subscriptions\Models\Subscription::findByFirstOrderId( $order->get_id() );
if ( ! ( $subscription instanceof StellarPay\Subscriptions\Models\Subscription ) ) {
return $actions;
}
unset( $actions['pay'] );
unset( $actions['cancel'] );
return $actions;
},
50,
2
);
You can add this code snippet in the functions.php file or using a plugin like Code Snippets (https://wordpress.org/plugins/code-snippets/)
Hi Devin, good to hear from you.
Hi Ramon,
Does that code return without unsetting the buttons if there is no subscription involved? I’m seeing these buttons on regular products, not subscriptions, on the site where I discovered the issue.
@slewisma you are right. The previous code snippet applies only to subscription products.
If you want to hide the Pay button regardless the products are a subscription or not, you can use the code snippet below:
add_filter(
'woocommerce_my_account_my_orders_actions',
function( $actions, $order ) {
if ( 'stellarpay-stripe' !== $order->get_payment_method() ) {
return $actions;
}
unset( $actions['pay'] );
unset( $actions['cancel'] );
return $actions;
},
50,
2
);
Hi @slewisma we just released version 1.4.1 to address this issue. Thanks again for bringing this to our attention!