ProfitEasy · By Sophie Calder · Updated 4 Nov 2026 · 9 min read

ProfitEasy: Command Line, Tips and Troubleshooting

The ProfitEasy command-line reference, best practices, and answers to common profit reporting problems.



This page is part of the ProfitEasy guide. Start there for what the extension does, installation and the frequently asked questions.

CLI Reference

ProfitEasy includes command-line tools for automated administration, reporting, and integration workflows. The seven newer actions (costs:list, costs:show, costs:set, sources:list, sources:show, sources:set, order:show-costs) support both table and JSON output formats; the legacy actions (config:check, product:show-profit, recalculate, populate-costs) do not accept --format and always print human-readable text.

Get help

# List available actions
php bin/magento moogento:profiteasy:help

# Detailed help for all options
php bin/magento help moogento:profiteasy

Configuration check

php bin/magento moogento:profiteasy --action=config:check

Shows whether ProfitEasy is enabled and which license plan is currently active.

Product profit reporting

# Show profit % for a product by ID or SKU
php bin/magento moogento:profiteasy --action=product:show-profit --product_id=42
php bin/magento moogento:profiteasy --action=product:show-profit --product_id=24-UG06

Product cost population

When you need to backfill product costs without knowing supplier pricing, use this to set costs based on a target profit margin:

# Default: 30% margin, prices exclude tax
php bin/magento moogento:profiteasy --action=populate-costs

# Custom margin
php bin/magento moogento:profiteasy --action=populate-costs --margin=40

# Prices include tax
php bin/magento moogento:profiteasy --action=populate-costs --margin=25 --tax=included

# Specific SKUs only
php bin/magento moogento:profiteasy --action=populate-costs --skus=SKU1,SKU2

Cost = price * (1 - margin / 100). Only sets costs on products that don't already have one. Skips configurable, bundle, and grouped parents.

Order profit recalculation

Recalculates profit for paid orders based on current cost rules:

# Recalculate last 15 unprofitable or uncalculated orders (default)
php bin/magento moogento:profiteasy --action=recalculate

# Custom limit
php bin/magento moogento:profiteasy --action=recalculate --limit=100

# Date range (newest first)
php bin/magento moogento:profiteasy --action=recalculate --from="2026-06-10 00:00:00" --to="2026-06-11 23:59:59"

# Force recalculate all eligible orders in range
php bin/magento moogento:profiteasy --action=recalculate --force --limit=100

# Single order by increment ID or entity ID
php bin/magento moogento:profiteasy --action=recalculate --increment_id=100000123
php bin/magento moogento:profiteasy --action=recalculate --order_id=456

Excludes canceled, closed, and held orders unless targeting a specific order.

Cost rules management

List, inspect, and modify cost rules from the CLI:

# List all cost rules
php bin/magento moogento:profiteasy --action=costs:list

# Filter to enabled rules only
php bin/magento moogento:profiteasy --action=costs:list --enabled_only

# Filter by charge type (per_order, per_item, per_payment, currency, time_period)
php bin/magento moogento:profiteasy --action=costs:list --charge_type=per_item

# Machine-readable output
php bin/magento moogento:profiteasy --action=costs:list --format=json | jq .

# Show a specific rule
php bin/magento moogento:profiteasy --action=costs:show --cost_id=7

# Update an existing rule (only specified fields change)
php bin/magento moogento:profiteasy --action=costs:set --cost_id=7 --enable=1 --cost=2.50

# Create a new fixed-cost rule
php bin/magento moogento:profiteasy --action=costs:set --label="Pick fee" \
  --charge_type=per_item --calculation_type=fixed --cost=0.35 --enable=1

# Create a percentage cost rule for a specific payment method
php bin/magento moogento:profiteasy --action=costs:set --label="Payment gateway fee" \
  --charge_type=per_payment --payment=paypal_express --calculation_type=percent --cost=2.9 --enable=1

# Preview changes without writing to database
php bin/magento moogento:profiteasy --action=costs:set --cost_id=7 --cost=2.50 --dry_run

Valid charge types: per_order, per_item, per_payment, currency, time_period
Calculation types: fixed, percent
Tax handling: nothing, default (uses global tax rate), custom (requires --taxed_custom=<rate>)

Creating or modifying a cost rule flags affected orders for profit recalculation so profit figures stay current.

Traffic source rules management

Define and modify traffic source attribution rules without using the admin UI:

# List all source rules
php bin/magento moogento:profiteasy --action=sources:list

# Enabled rules only
php bin/magento moogento:profiteasy --action=sources:list --enabled_only --format=json

# Show details of a specific rule by ID
php bin/magento moogento:profiteasy --action=sources:show --source_id=3

# Show all rules matching an identifier
php bin/magento moogento:profiteasy --action=sources:show --identifier=smartcart

# Show usage count since a specific date (scans last 100K order rows)
php bin/magento moogento:profiteasy --action=sources:show --identifier=smartcart \
  --count-since="2026-07-01 00:00:00"

# Update an existing rule
php bin/magento moogento:profiteasy --action=sources:set --source_id=3 --enable=1 --priority=5

# Create a new UTM-based source rule
php bin/magento moogento:profiteasy --action=sources:set --create \
  --identifier=newsletter --label="Newsletter" \
  --utm_source=newsletter --utm_medium=email --enable=1

# Disambiguate with --source_id when multiple rows match
php bin/magento moogento:profiteasy --action=sources:set --source_id=5 --priority=10

An --identifier may match multiple database rows (one for each UTM-specific variant). --source_id is required to update a specific row when matches are ambiguous.

Order cost breakdown (read-only reporting)

Show the detailed cost breakdown that drives order profit, without recalculating or modifying anything:

# Single order by increment ID
php bin/magento moogento:profiteasy --action=order:show-costs --increment_id=100000123

# Single order by entity ID
php bin/magento moogento:profiteasy --action=order:show-costs --order_id=456

# Date range (newest first, default 15 orders, max 100)
php bin/magento moogento:profiteasy --action=order:show-costs \
  --from="2026-07-01 00:00:00" --to="2026-07-31 23:59:59" --limit=50

# Machine-readable output
php bin/magento moogento:profiteasy --action=order:show-costs --order_id=456 --format=json

This command displays both the live-calculated profit and the stored profit value side-by-side, flagging mismatches caused by cost-rule changes. Includes the cost breakdown per order for audit and troubleshooting. No customer names, emails, or addresses are emitted - output is privacy-safe by design.


Tips & best practices

  • Configure your cost rules before you expect meaningful profit numbers - revenue minus zero costs equals revenue, not profit.
  • Set a realistic Default: Shipping cost for Free Shipping immediately after install. Orders with free shipping are common and will otherwise show inflated profit until you enter an actual fulfilment cost.
  • Shorten the Source: Validity period if you run frequent campaigns and want attribution to reset sooner. The default of 31 days means a customer who clicked a January Google Ad and returned in February is still attributed to that ad.
  • Use the orders grid device column to spot mobile conversion problems: if desktop orders dominate while mobile traffic is high, your mobile checkout may have friction.
  • Grant profit-viewing ACL access selectively. The dashboard and customer profile widgets can be hidden per user role - useful when finance data is restricted to certain team members.
  • Wait for the next 10-minute cron cycle after a bulk cost-rule change before comparing profit figures on orders.

Troubleshooting

Profit figures are not appearing on orders

Profit values are blank or missing in the orders grid after enabling the module.

  • Cause: The profit calculation cron has not yet run, or order-processing queue consumers are stalled.
  • Check: Look at var/log/moogento_profiteasy.log for recent activity. Run php bin/magento cron:run manually to trigger an immediate calculation cycle. Verify that Magento queue consumers are running (bin/magento queue:consumers:list).
  • Resolution: Ensure Magento cron is configured and running (*/10 * * * * is the minimum frequency ProfitEasy needs). If queue consumers have stopped, restart them or add them to your server's process supervisor.

Customer CLV and AOV are not updating

The CLV and AOV values on customer profiles remain at zero or show stale data.

  • Cause: The nightly customer-data cron job is not running, or the orders have not been invoiced.
  • Check: Confirm UpdateCustomerData ran recently by searching var/log/moogento_profiteasy.log for [UpdateCustomerData. Also confirm the relevant orders have been invoiced - CLV only counts invoiced orders.
  • Resolution: Ensure cron is scheduled. CLV features require a Growth or Pro license - verify the license tier under Stores > Configuration > Moogento > License.

Traffic source attribution is showing "Direct" for all orders

Every order is attributed to Direct traffic even when you can see UTM parameters in your analytics tool.

  • Cause: The referrer cookie is not being captured, the source rules do not match the incoming UTM values, or the Source: Validity period has expired before the customer completed the order.
  • Check: Add ?moo_debug=1 to a storefront URL and review var/log/moogento_profiteasy.log to see what referrer data was captured. Review the Sources config group to confirm matching rules are active and have the correct patterns.
  • Resolution: Adjust source rule patterns to match your actual UTM structure. Increase the validity period if customers typically take longer than 31 days from first click to purchase. If organic or AI referrer rules are not matching visits that arrive without UTM parameters, check that UTMs optional is enabled on those rules - when disabled, a visit with no UTM parameters penalises the rule score and prevents a match. Source attribution requires a Growth or Pro license.

Dashboard profit widgets are missing

The profit or AOV tiles do not appear on the admin dashboard after enabling them in config.

  • Cause: Cache not cleared after config change, or the admin user does not have the required ACL role permission.
  • Check: Run php bin/magento cache:clean. Then go to System > User Roles and confirm the admin user's role includes access to the ProfitEasy dashboard resources.
  • Resolution: Clear cache and, if the widgets still do not appear, check the license tier - the AOV widget requires Pro.

Product profit column shows no data in the catalog grid

The Enable Product Profit % Column is set to Yes but the column shows empty values.

  • Cause: The nightly UpdateProfitPercentQueue cron has not yet run, or the store is not on a Pro plan.
  • Check: Verify the license tier under Stores > Configuration > Moogento > License. If the plan is Pro, check var/log/moogento_profiteasy.log for recent cron activity and run php bin/magento cron:run manually.
  • Resolution: Wait for the nightly cron at 01:00 AM, or trigger it manually. Upgrade to Pro if the store is currently on Seed or Growth.

The 30-day total appears lower than the 7-day total

The profit dashboard shows a 30-day total that is lower than or contradicts the 7-day figure.

  • Cause: Previously recorded profit rows for refunded orders were calculated without subtracting base_total_refunded, leaving inflated values in the older comparison window.
  • Check: Review var/log/moogento_profiteasy.log and confirm the ResetRefundedOrdersProfit data patch has been applied. Run php bin/magento setup:upgrade if you have recently updated the module.
  • Resolution: Run php bin/magento setup:upgrade to apply the data patch, which resets the calculated flag on all historically refunded orders. Wait for the next UpdateProfit cron cycle (every 10 minutes) to recompute the corrected figures.

Malware scanner flags Helper/Moo.php

  • Cause: Your host's malware scanner (often Imunify360 on cPanel hosting) heuristically flags the encoded license-check files that ship inside every paid Moogento extension. The files are genuine and unchanged - the encoding protects the license check from tampering.
  • Resolution: Add the files to the scanner's ignore list so the warnings stop, and restore any file the scanner already quarantined. Both steps, plus how to verify the files are byte-for-byte what we shipped, are covered in the license file protection guide.

Other pages in this guide