• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Updating and Synchronizing Woocommerce Subscriptions to Custom Date

phpwordpresswoocommercewoocommerce-subscriptions


PHP Snippet 1:

function push_subscriptions_to_next_week($subscription, $order, $recurring_cart) {
    // The new date calculation of +7 days is just an example
    $new_dates = array(
        'start' => date('Y-m-d H:i:s', strtotime('+7 days', time())),
        'next_payment' => date('Y-m-d H:i:s', strtotime('+7 days', time()))
    );

    $subscription->update_dates($new_dates, 'site');
}

add_action( 'woocommerce_checkout_subscription_created', 'push_subscriptions_to_next_week', 10, 3);

Related Snippets

Laravel Blade checkbox not checked

WHERE IN array binding in DB::raw laravel 5.4

How to debug in WooCommerce 3+

Sagepay Error The Vendor failed to provide a RedirectionURL

How do I loop through an MS SQL database with VB.NET?

Custom API and cunsuming in php?

Login if user is active using Laravel Breeze

Get number of working days between two dates in PHP [duplicate]

Call to a member function fetch_field() on a non-object MySQLiDB

(Cache::lock()) -> get() -- Under what conditions does it return false?

Laravel Livewire: jQuery not working in child component loaded via @if statement

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

PHPUnit (Phar) Fatal Error Only When Test Fails

PHP/HTML: Creating A SubMenu

PHP contact form configuration [duplicate]

About Contact Privacy policy Terms and conditions