Skip to content

Instantly share code, notes, and snippets.

View aimahdi's full-sized avatar
🛋️
Working on something bigger

Amimul Ihsan aimahdi

🛋️
Working on something bigger
View GitHub Profile
<?php
add_filter('fluent_community/can_view_members_page', function ($canView, $pageStatus) {
if (!is_user_logged_in()) {
return false;
}
if (!class_exists('\FluentCart\App\Models\Order')) {
return false;
<?php
add_filter( 'taxonomy_labels_product-categories', function( $labels ) {
$labels->name = 'FluentCartProduct Categories';
$labels->singular_name = 'FluentCartProduct Category';
$labels->menu_name = 'FluentCartProduct Categories';
$labels->all_items = 'All FluentCartProduct Categories';
$labels->edit_item = 'Edit FluentCartProduct Category';
$labels->add_new_item = 'Add New FluentCartProduct Category';
return $labels;
<?php
add_filter('fluent_cart/widgets/single_product_page', function ($widgets, $customer) {
// 1️⃣ Affiliate form widget (unchanged)
$widgets[] = [
'title' => __('Fluent Affiliate', 'fluent-affiliate'),
'sub_title' => __('Select Affiliate you want to add to cart', 'fluent-affiliate'),
'type' => 'form',
'form_name' => 'fa_affiliate_form',
<?php
add_filter('fluent_cart/global_customer_menu_items', function ($items, $context) {
unset($items['downloads']);
return $items;
}, 10, 2);
add_action('template_redirect', function () {
if (is_admin()) {
return;
<?php
add_filter( 'wp_new_user_notification_email', function ( $email, $user, $blogname ) {
$reset_link = wp_lostpassword_url();
$email['subject'] = sprintf(
'Welcome to %s – Set your password',
$blogname
);

Enable Subscription order creation using snippet

add_filter('fluent_cart/order/is_subscription_allowed_in_manual_order', function(){
    return true;
});

API Endpoint: /wp-json/fluent-cart/v2/orders

<?php
add_filter('fluent_cart/single_product/variation_view_type', function ($viewType, $data) {
$textOnlyProducts = [];
$imageOnlyProducts = [];
$bothOnlyProducts = [];
$productId = $data['product']->ID;
if(in_array($productId, $textOnlyProducts)) {
return 'text';
<?php
add_filter('fluent_cart/orders_table_columns', function($columns){
$columns['title_1'] =[
'label' => 'The Custom',
'accessor' => 'iam_custom',
'render_template' => true,
'template' => '<div class="flex gap-2">
{{data.order?.invoice_no || "--"}}
<?php
add_filter('fluent_community/template_slug', function ($templateSlug) {
if (is_singular(['fluent-products'])) {
return 'fluent-community-frame.php';
}else return $templateSlug;
});
<?php
add_action('template_redirect', function() {
if (is_singular('fluent-products')) {
global $wp_query;
$wp_query->set_404();
status_header(404);
nocache_headers();
include( get_404_template() );
exit;