Yo don’t properly call the callback function.
If you want to code on oriented object programmation, you have to create your class, and construct function with add_action…
Here more informations about it :
https://wordpress.stackexchange.com/a/48094/9716
or you do something like this (its no POO but its working as well).
add_action( 'woocommerce_subscription_status_active', 'add_subscription_course_access' ) );
function add_subscription_course_access( $order )
{
$products = $order->get_items();
$customer_id = $order->get_customer_id();
$courses_id = get_field('user-programs', 'user_'. $customer_id);
$courses_id = str_replace("[","",$courses_id);
$courses_id = str_replace("]","",$courses_id);
$courses_id = explode(",",$courses_id);
foreach ( $courses_id as $course_id ) {
ld_update_course_access( $customer_id, $course_id );
}
}
Related Posts:
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- Product queue for my subscription box
- Automatic recurring payment using YITH subscription and Dokan Stripe
- best way to handle subscriptions with a licence?
- Create Custom Coupon Type
- Woocommerce Shop page variation product button replace with add to cart button
- How can I insert thousands of Woocommerce products by batch with PHP? [closed]
- WooCommerce search products between price range using WP_Query
- Redirect to another page using contact form 7? [closed]
- How to use add_submenu_page() for editors?
- PHP Error When a plugin is active
- woocommerce with custom post type
- Is there a way to get plugins and themes not built for multisite to work on a network subsite?
- Exact Hook to payment methods
- Restrict content based on buy woocommerce product
- How to get a list of bundled products using wp_query in woocommerce
- Adding Static Image to WooCommerce Content-Single-Product template
- Hide a Menu Item on Login
- Product count in archive page Title in WooCommerce [closed]
- Add item to the woocommerce dashboard menu from a plugin
- WooCommerce – set session with new cart item meta when updating cart item quantity [closed]
- How to get the particular product quantity in orders in Woocommerce [closed]
- Get Every Key & Value from Array then Display All in New Line
- Woocommerce Coupon Menu and Marketing Menu missing After “Coupons can now be managed from Marketing > Coupons.” [closed]
- Get orders of a specific customer woocommerce
- WooCommerce: Force coupon for existing/registered customers [closed]
- Add_rewrite_endpoint doesn’t work with post name permalink structure
- wc_get_template new template does not showing up
- Show icons or badges under title on product archives/category pages
- Conditional Shipping Options if Certain Products are in Cart WooCommerce
- WordPress Stock Update Programatically
- Woocommerce Backend Search by Title and SKU
- WooCommerce Shopping Cart Not Initially Showing Products [closed]
- How can I concatenate variables to search results title? [closed]
- WooCommerce: after install hook
- How to add a new column with text fields to WooCommerce Cart List?
- Add a “View all” button on WooCommerce product archives pages
- I am trying to make a field show and save from quickedit screen
- Woocommerce: limit user to see only the products he created
- Woocommerce singe product custom gallery output works just on the first slide
- How to include a custom field in the woocommerce email?
- woocommerce search by sku and title ajax
- Woocomerce add info after order email prouct item
- Remove Pagination for Product Category Pages WooCommerce
- add seperate suffix for low price and high price in woocommerce
- Get products list by url key in WordPress Woocommerce [closed]
- Cross Sells are not being shown in Cart Page. Please Help!
- How to display registered customer list as dropdown in WooCommerce checkout?
- How do I get the Payzone WooCommerce payment gateway plugin to show up in the settings? [closed]
- Error with get_price (and others) in self-written plugin to show price
- How to change WooCommece variation data programmtically [closed]
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- .php file for woocommerce edit category? [closed]
- Woocommerce – WordPress Roles & Capabilities
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- Sending customer an email with link to stripe to make payment
- Override a Plugin Function
- Update Post Status On Woocommerce Payment Complete
- Custom template for all woo commerce categories
- How to remove products-links after the product title using remove_action
- Search users with custom meta data
- WordPress Multi-Step Product Search
- Is it possible to instantiate a new WC_Cart?
- Woocommerce Free shipping method [closed]
- how get curent URL slug from archive page [closed]
- dynamically create callback functions inside a for loop
- Sell access to form [closed]
- get_term_meta returns false in widget
- Add key and value to an array in another file
- Custom search search does not work?
- WordPress custom plugin that uses woocommerce enabled payment gateway for payment [closed]
- Disable variations on woo commerce if out of stock
- How to change layout of shop page in wordpress? [closed]
- I want to filter my products with attributes [closed]
- How to add category and subcategory in WordPress custom code?
- Customizing $product->get_title() function
- Woocommerce – Change Variable Product Add to Cart to behave like external product using Custom Field (link) [closed]
- Make 2 different WooCommerce checkout pages?
- How to return a specific attribute
- Woocommerce checkout page broken when set as a checkout in woocommerce settings [closed]
- How to get custom minimum price in Woocommerce
- apply_filters(woocommerce_get_item_data, …) Causing errors when adding to cart
- Woocommerce Export and import Orders
- Edit all $wp_scripts at once to $in_footer = false
- Edit all $wp_scripts at once to $in_footer = false
- WordPress Phone Field Check (use numbers, spaces and pluses)
- Can export gallery but can’t import it Wp all import
- Restrict posts to customers with complete WooCommerce orders only
- WooCommerce – I want to add functionality of one plugin to another plugin — best approach?
- Change Dashboard URL from wp-admin to wp-admin/index.php
- Get product categories and add them to a custom taxonomy
- How to make WooCommerce payment method field optional?
- How to Get Category Name When Export Products
- How To Use do_shortcode with WooCommerce One Page Checkout
- Cannot read properties of undefined (reading ‘firstChild’) using photoswipe in product page
- woocommerce remove coupon link does not work
- WordPress – Ultimate Auction for WooCommerce
- How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?
- Plugins to generate reflinks in WordPress
- Working on a product group in wordpress, where user choose how many children, wife and husband