imoyano
Forum Replies Created
-
cool… thanks heaps @thenbrent !
Wow mate, thanks for your reply, we are very close now.
Actually, what I need to do is to be able to change the subscription status from “cancelled” to “active”. One part is achieved using your code (in the view side):
function eg_add_status_filter( $post_type, $context, $post_object ) { add_filter( 'woocommerce_can_subscription_be_updated_to_active', '__return_true', 100 ); } add_action( 'do_meta_boxes', 'eg_add_status_filter', 0, 3 );
However, in the server side, I need to override the “update_status” function (class-wc-subscription.php), I need to make this simple change in line 305:
if ( ! $this->can_be_updated_to( $new_status ) ) {
to
if ( ! $this->can_be_updated_to( $new_status ) && !( $old_status == 'cancelled' && $new_status == 'active' ) ) {
Your suggested code has been so useful so far, so hope you can help me in the second part.
Thanks heaps!!
Thanks @mikejolley
Well, I thought there was a way to override the class or only that function. In this case I only changed a line from:
if ( ! $subscription->can_be_updated_to( $status ) && ! $subscription->has_status( str_replace( 'wc-', '', $status ) ) ) {
to
if ( $status != "wc-active" && ! $subscription->can_be_updated_to( $status ) && ! $subscription->has_status( str_replace( 'wc-', '', $status ) ) ) {
So I don’t want to create a custom version of the extension…. is there another option??
PS: Thanks @eljkmw I think in this case I can’t do that via CSS :/
Hey @mikejolley
So what’s the best way in this case? I’m also want to override the function “output” of the class:
woocommerce-subscriptions/includes/admin/meta-boxes/class-wcs-meta-box-subscription-data.php
because I’ve added a change in just one line and in this case I can’t solve it using CSS as @eljkmw
Please, share with us more information please!
Thanks heaps!Forum: Plugins
In reply to: [Zero Spam for WordPress] Gravity Forms Spinning WheelDoes someone here know what’s the function of this line:
die( __( $this->settings['spammer_msg_gf'], 'zerospam' ) );
Line 18 at …/public/wp-content/plugins/zero-spam/lib/ZeroSpam/GravityForms.php
Forum: Plugins
In reply to: [Zero Spam for WordPress] Gravity Forms Spinning WheelSame problem here… disabling zero-spam fixed it.
Please help!!
Forum: Plugins
In reply to: [Page Builder by SiteOrigin] is_active_widget not working after plugin updateHere the solution….
I was using this code to register my widget:
add_action( ‘widgets_init‘, function() {
register_widget( ‘mywidget’ );
});I’ve changed to this:
add_action( ‘init‘, function() {
register_widget( ‘mywidget’ );
});Forum: Plugins
In reply to: [Gravity Forms: Multiple Form Instances] GF ConditionalThanks Marin, I’ll be waiting for your help!