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_cart/hide_unnecessary_decimals', '__return_true');
<?php
add_action('fluent_cart/checkout/before_summary_total', function ($data) {
echo '<div>';
echo '<span style="font-weight: bold; color: red">Hinweis gemäß § 19 UStG:</span> <br>';
echo 'Gemäß § 19 Abs. 1 UStG wird keine Umsatzsteuer berechnet und daher auch nicht ausgewiesen (Kleinunternehmerregelung).';
echo '</div>';
});
<?php
add_filter('fluent_cart/shop_query', function($query, $params) {
// Change default sort to ID-based (instead of alphabetical)
// Only apply when sort_by is not explicitly set
if (!isset($params['filters']['sort_by'])) {
$query->orderBy('ID', 'DESC');
}
return $query;
}, 10, 2);
<a href="https://fluentcart.top/?fluent-cart=instant_checkout&item_id=66&quantity=1&coupons=OopsFounder" >
Buy Me</a>
<?php
add_filter('fluent_cart/payments/stripe_metadata_onetime', function($metadata, $context) {
$metadata['your_key'] = 'Your Value';
return $metadata;
}, 10, 2);
add_filter('fluent_cart/payments/stripe_metadata_subscription', function($metadata, $context) {
$metadata['your_key'] = 'Your Value';

Custom Checkout Fields & Stripe Processing Fee

This document describes how to add custom checkout fields (Purchase Order Reference & User Note) and a 2.7% credit card processing fee for Stripe payments in FluentCart.

Features

  • Purchase Order Reference Field: Optional text field on checkout
  • User Note Field: Optional textarea for order notes
  • Stripe Processing Fee: 2.7% fee automatically added to Stripe payments only
  • Email Shortcodes: Use {{order.purchase_order_reference}}, {{order.user_note}}, and {{order.processing_fee}} in email templates

Custom Add to Cart Button

This tutorial explains how to create a custom Add to Cart button using FluentCart and how to find the required IDs.


Step 1: Add the Button HTML

Add the following HTML code to any page where you want the button to appear:

<?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;