woocommerce-subscriptions

Detecting if the current user has an active subscription

╄→尐↘猪︶ㄣ 提交于 2019-12-04 04:28:56
I'm developing a website in WordPress with WooCommerce. I'm using additionally WC Paid Listings and WooCommerce Subscriptions plugins to handle my work. The problem is when a user with "subscriber" role with an active subscription login and try to post a content every time he / she has to choose a package even he has an active subscription. Is there anyone with an idea of how to detect if user has an active subscription , if it returns true then the step choosing package skipped? Thanks. Updated (2019) New conditional function using WooCommerce Subscriptions wcs_user_has_subscription() . New

Display shipping cost on product page - WooCommerce

人盡茶涼 提交于 2019-12-03 17:29:17
I'm trying to make a custom page on Wordpress that display 2 subscription types in a form with 3 variations each (monthly, 6 month, 12 month). Each variation gets a radio button and I have a total price that is live updated when user clicks on the radio buttons. This part is working. But now, I want to add 3 other radio buttons to choose the shipment method. (When user select one, it'll live update the total price too). I've been searching a long time how to get shipping cost for a product but nothing has worked. Anyone knows :) ? This question is too broad. So I can answer partially as you

WooCommerce Subscriptions - Get related orders Ids for a specific subscription

荒凉一梦 提交于 2019-12-01 16:12:14
Is there woocommerce function that will return me all related orders (at least the order ID) for the specific subscription that user has bough? I have found in this official documentation Subscription Function & Property Reference : WC_Subscription::get_related_orders( $return_fields, $order_type ); But this does not seem to be for specific subscription? When ever I try to run it I get a fatal error no mater what I pass in: Fatal error: Uncaught Error: Using $this when not in object context in C:\xampp\htdocs\mysite.com\wp-content\plugins\woocommerce-subscriptions\includes\class-wc

Reorder menu items in Woocommerce My Account section

耗尽温柔 提交于 2019-12-01 12:50:55
I want to move the "Langgan" menu label (for subscriptions key) on top of "Dashboard" and bold the "Langgan". Currently I'm using the code below for "Langgan" part inside my theme function.php file: add_filter( 'woocommerce_account_menu_items', 'rename_my_account_menu_items', 0, 15 ); function rename_my_account_menu_items( $items ) { // HERE set your new label name for subscriptions $items['subscriptions'] = __( 'Custom label', 'woocommerce' ); return $items; } To set a custom label for 'subscriptions' key and reorder menu items to get it at the beginning, try this instead (this will replace

Reorder menu items in Woocommerce My Account section

北战南征 提交于 2019-12-01 10:38:04
问题 I want to move the "Langgan" menu label (for subscriptions key) on top of "Dashboard" and bold the "Langgan". Currently I'm using the code below for "Langgan" part inside my theme function.php file: add_filter( 'woocommerce_account_menu_items', 'rename_my_account_menu_items', 0, 15 ); function rename_my_account_menu_items( $items ) { // HERE set your new label name for subscriptions $items['subscriptions'] = __( 'Custom label', 'woocommerce' ); return $items; } 回答1: To set a custom label for

Display shipping cost on product page - WooCommerce

喜你入骨 提交于 2019-11-30 16:12:49
问题 I'm trying to make a custom page on Wordpress that display 2 subscription types in a form with 3 variations each (monthly, 6 month, 12 month). Each variation gets a radio button and I have a total price that is live updated when user clicks on the radio buttons. This part is working. But now, I want to add 3 other radio buttons to choose the shipment method. (When user select one, it'll live update the total price too). I've been searching a long time how to get shipping cost for a product

WooCommerce - Get active subscriptions in a list between start / end date

怎甘沉沦 提交于 2019-11-30 16:05:36
I am using WooCommerce subscriptions. How can I get all subscriptions (with start date and end date) in a lists from one specific date to another date? Example 01/09/2016 to 15/09/2016 Thanks Here is an example of a function that will display a list of all active subscriptions from one date to another, in a formatted html table. In this example, you will get for each subscription: the subscription ID, the date, the customer ID and the customer name (You can customize the code to get what you want). So this function has 2 date parameters. For usage and specifications see the section at the end.

WooCommerce - Get active subscriptions in a list between start / end date

陌路散爱 提交于 2019-11-29 23:08:20
问题 I am using WooCommerce subscriptions. How can I get all subscriptions (with start date and end date) in a lists from one specific date to another date? Example 01/09/2016 to 15/09/2016 Thanks 回答1: Here is an example of a function that will display a list of all active subscriptions from one date to another, in a formatted html table. In this example, you will get for each subscription: the subscription ID, the date, the customer ID and the customer name (You can customize the code to get what