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/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;
<?php
add_filter('fluent_cart/product/buy_now_button_text', function($text, $data){
$text = 'Purchase Now';
return $text;
}, 10, 2);
add_filter('fluent_cart/product/add_to_cart_text', function($text, $data){
$text = 'Add to your shopping';
return $text;
}, 10, 2);
@aimahdi
aimahdi / custom_column_product.php
Created November 13, 2025 10:17
How to add custom column on product table (admin view)
<?php
add_filter('fluent_cart/products_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 || "--"}}
<el-button type="primary">Primary</el-button>
<?php
add_filter('fluent_cart/widgets/single_product_page', function ($widgets, $product) {
$product = \FluentCart\App\Models\Product::find($product['product_id']);
$value = $product->getMeta('_affiliate_form');
@aimahdi
aimahdi / Login_redirect.php
Created November 10, 2025 05:41
Redirect to FluentCart Dashaboard after login
<?php
function redirect_to_fluentcart_account( $redirect_to, $request, $user ) {
$redirect_to = home_url( '/account/' );
return $redirect_to;
}
add_filter( 'login_redirect', 'redirect_to_fluentcart_account', 10, 3 );
<?
add_action('init', function () {
\FluentCart\Api\FluentCartGeneralApi::getInstance()->addCustomerDashboardEndpoint(
'support', [
'title' => __('Support Ticket', 'fluent-cart-pro'),
// 'render_callback' => function () {
// echo 'Put your text';
// },
'page_id' => 178,
@aimahdi
aimahdi / FluentCartCustomFieldHooks.php
Created November 5, 2025 09:40
Add custom field on FluentCart Checkout
<?php
add_action('fluent_cart/before_payment_methods', function($args) {
// Add your field here.....
// Example Field
$termsText = 'Yes, I\'d like to receive emails with exclusive offers and updates.';
?>
<?
add_filter('fluent_cart/shop_query', function ($query, $params) {
if (is_admin()) {
return $query;
}
// Term IDs to exclude (product-categories)
$excluded_ids = [11];
$query->whereDoesntHave('wp_terms', function ($rel) use ($excluded_ids) {
@aimahdi
aimahdi / check_translatable_strings.php
Created October 24, 2025 10:55
Check whether a string is translatable or not. This will return yap with all translatable text.
add_filter('gettext', function ($text) {
return $text.' (yap)';
});