This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove the check for if a payment gateway supports "Date change" | |
*/ | |
remove_filter( 'wcs_view_subscription_actions', 'Javorszky\\Toolbox\\remove_actions', 20 ); | |
/** | |
* Allow date changes on subscriptions that are manual | |
* @param $subscription | |
* @return string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add the booking product and accommodation product type to the list on frontend of site. | |
*/ | |
function sp_add_post_types( $types ) { | |
$types['booking'] = __('Bookable product', 'woocommerce-bookings'); | |
$types['accommodation-booking'] = __('Accommodation product', 'woocommerce-accommodation-bookings'); | |
return $types; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Modify the intervals offered by Toolbox for WC Subscriptions. | |
* | |
* @param array $intervals | |
* @param WC_Subscription $subscription | |
* @return mixed | |
*/ | |
function sp_modify_intervals( $intervals, $subscription ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Show Cart | |
* Plugin URI: https://growdevelopment.com | |
* Description: Show the cart contents | |
* Version: 1.0.0 | |
* Author: Grow Development | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GET number of orders | |
select count(*)from wp_posts where post_type = 'shop_order'; | |
# DELETE ORDER DATA FROM POSTMETA TABLE | |
delete from wp_postmeta where post_id in (select ID from wp_posts where post_type = 'shop_order'); | |
# DELETE ORDER DATA FROM POSTS TABLE | |
delete from wp_posts where post_type = 'shop_order'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_payment_complete_order_status', 'growdev_order_payment_complete_order_status', 10, 2 ); | |
function growdev_order_payment_complete_order_status( $order_status, $order_id ) { | |
$order = wc_get_order( $order_id ); | |
if ( 'processing' == $order_status && | |
( 'pending' == $order->status ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function convertkit_page_template_redirect() | |
{ | |
if( is_page( 'elements-one' ) && ! is_user_logged_in() ) | |
{ | |
$location = get_site_url() . '/courses/login/?redirect=' . get_permalink( $post->ID ); | |
wp_redirect( $location ); | |
die; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hook in and do an action when a user starts a course. | |
* This works for WooCommerce purchased courses and free courses. | |
*/ | |
add_filter( 'sensei_user_course_start', 'convertkit_sensei_user_course_start', 10, 2 ); | |
function convertkit_sensei_user_course_start( $user_id, $course_id ) { | |
if ( $user_id ) { | |
$user = get_userdata( $user_id ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$options = get_option( '_wp_convertkit_settings' ); | |
$api_key = $options && array_key_exists( 'api_key', $options) ? $options['api_key'] : null; | |
$api_secret = $options && array_key_exists( 'api_secret', $ptions) ? $options['api_secret'] : null; | |
$debug = $options && array_key_exists( 'debug', $options) ? $options['debug'] : null; | |
$api = new ConvertKitAPI( $api_key,$api_secret,$debug ); | |
$form_id = '11111'; |