• 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

How can I pass the list to the component variable in Laravel?

Prestashop webservice API creating cart rules

Add customer email and phone in "Order" column to admin orders list on Woocommerce

How to validate Envato Purchase Code in PHP

How do I call Validator from a namespace with an already existing Validator class

How to install php_imagick on wamp64

Google Calendar API batch request PHP

Make certain characters of a word from string bold

PHP drop down list using array's and foreach (else and for) code

How to Make Laravel Eloquent "IN" Query?

Don't show recurring price for WooCommerce subscriptions worth 0$

Filter WooCommerce products with post__in and additional meta queries

Dropzone: Submit both form data and dropzone at once

Unable to guess the mime type as no guessers are available Laravel 5.2

mysql_result is defined but mysql_free_result warns it expected a resource

About Contact Privacy policy Terms and conditions