You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PrestaShop 1.7.3支付插件后台正常但前端不显示问题咨询

Troubleshooting Your PrestaShop 1.7.3 Payment Module Not Showing Up

Hey there, let’s break down why your payment module works in the BackOffice but won’t appear in the enabled modules list or checkout flow—this is a super common gotcha with PrestaShop modules, so let’s walk through the most likely fixes step by step:

1. Double-Check Module Installation & Registration

First, confirm your module is properly set up in PrestaShop:

  • Class/Filename Match: Ensure your module’s folder name, main PHP file name, and class name are identical (case-sensitive!). For example, if your folder is mycustompayment, the file should be mycustompayment.php and the class should be MyCustomPayment.
  • Install Method Return Value: In your module’s install() method, make sure it returns true after running all setup steps (like registering hooks or creating config fields). If it returns false at any point, PrestaShop won’t mark it as installed.
  • Database Verification: Check your ps_module table (replace ps_ with your database prefix) for your module’s entry. Confirm active and installed are both set to 1. If not, try uninstalling and reinstalling the module via the BackOffice.

2. Meet Payment Module-Specific Requirements

PrestaShop has strict rules for payment modules to show up:

  • isAvailable() Method: Your module must implement this method and return true when conditions are met. If it’s missing or returns false, the module won’t appear in checkout. Here’s a basic working example:
    public function isAvailable($cart) {
        // Add custom conditions here (e.g., allowed countries, order amount)
        return parent::isAvailable($cart) && $this->active;
    }
    
  • Payment Zone Assignment: Go to your module’s settings in the BackOffice and make sure you’ve assigned it to at least one payment zone (under the "Payment Zones" tab). No zones = no visibility for any customers.
  • Active Toggle: Double-check the module is marked as "Enabled" in Modules > Payments. Sometimes installs succeed but leave the module inactive by default.

3. Validate Frontend Visibility Conditions

Even if active, the module might be hidden due to cart/customer rules:

  • Cart Criteria: Check if your module has minimum/maximum order limits or only supports specific currencies. Test with a cart that meets these requirements.
  • Customer Group Access: Ensure the module is allowed for the customer group you’re testing with (check module settings > "Customer Groups").
  • Hook Registration: Payment modules need hooks for displayPayment and displayPaymentReturn (at minimum). Verify these are registered in your install() method:
    $this->registerHook('displayPayment');
    $this->registerHook('displayPaymentReturn');
    

4. Clear Caches & Regenerate Assets

PrestaShop’s caching often hides changes:

  • Clear Smarty Cache: Go to Advanced > Performance in the BackOffice and click "Clear Cache".
  • Regenerate Module List: Uninstall and reinstall the module, or manually delete the var/cache folder via FTP to force a refresh.
  • Template Cache: If your module uses custom frontend templates, confirm they’re in modules/yourmodule/views/templates/front/ and clear template-specific cache.

5. Debug with Logs

If nothing else works, let’s dig into logs:

  • Enable Debug Mode: Turn on PrestaShop’s debug mode (Advanced > Performance > Debug Mode) to catch PHP errors that might block the module from loading.
  • Add Custom Logs: Insert logs in key methods to track what’s happening. For example:
    public function isAvailable($cart) {
        PrestaShopLogger::addLog('MyCustomPayment isAvailable called, active status: ' . $this->active, 1, null, 'Module', $this->id, true);
        return parent::isAvailable($cart) && $this->active;
    }
    
    Check the logs in Advanced > Logs to see if the method runs and what values it returns.

6. Check File Permissions

Ensure your module files have correct permissions (usually 644 for files, 755 for folders). Incorrect permissions can prevent PrestaShop from loading the module properly.

Start with these steps—most of the time, it’s one of these common issues. Let me know if you hit a specific snag!

内容的提问来源于stack exchange,提问作者Ouissal Wrb

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 07:26:52