Skip to content

Instantly share code, notes, and snippets.

View amirhmoradi's full-sized avatar
🛥️
Working from boat

Amir Moradi amirhmoradi

🛥️
Working from boat
View GitHub Profile
@amirhmoradi
amirhmoradi / wordpress_themes_mysaas_child_theme_functions.php
Created April 26, 2022 14:51
Wordpress Woocommerce Force custom page/post ID as Terms and Conditions page
/**
* This allows you to use a custom page (custom post type) as your WooCommerce "Terms and Conditions" page.
* Once set, you wont need to select the page in Woocommerce settings.
**/
function amirhmoradi_force_terms_page_to_wc($page_id)
{
return 207;
}
add_filter('woocommerce_get_terms_page_id', 'amirhmoradi_force_terms_page_to_wc', 10, 2);
@amirhmoradi
amirhmoradi / wordpress_themes_mysaas_child_theme_functions.php
Last active October 24, 2022 19:33
Wordpress Woocommerce Orders API add License (licensemanager.at Free Plugin) and Subscription (SUMO Subscriptions Paid Plugin) info to each purchased product info and to the global order object too. Read the code :)
/**
* This code helps you start selling software products (subscriptions) with generated license codes on Wordpress with Woocommerce
* using 2 plugins:
*
* [FREE] Wordpress <- Obviously :)
* [FREE] Woocommerce <- Complete e-commerce stack for wordpress
*
* [FREE] License Manager for Woocommerce : https://wordpress.org/plugins/license-manager-for-woocommerce/
* [49$] SUMO Subscriptions: https://codecanyon.net/item/sumo-subscriptions-woocommerce-subscription-system/16486054
*