Skip to content

Conversation

DevWael
Copy link
Contributor

@DevWael DevWael commented Sep 24, 2025

📋 Summary

This PR adds the Free Shipping Progress Bar module to the Botiga-Merchant overlapping features modal system. When users try to activate the Merchant Free Shipping Progress Bar module while Botiga's version is active, they will see a conflict modal allowing them to choose between the two implementations.

�� What's Changed

Files Modified:

  • inc/plugins/merchant/class-merchant-overlaping-features-modal.php
  • inc/plugins/merchant/class-merchant-overlaping-features.php

Changes Made:

  1. Added Free Shipping Progress Bar to modal settings map (class-merchant-overlaping-features-modal.php):

    • Added 'free-shipping-progress-bar' entry to $disable_settings_map
    • Configured with 'has_module' => true and customizer section 'botiga_section_free_shipping_progress_bar'
  2. Added Free Shipping Progress Bar to overlapping modules (class-merchant-overlaping-features.php):

    • Added 'free-shipping-progress-bar' to $overlaping_modules array
    • Added mapping in $modules_map array

🔧 How It Works

When a user tries to activate the Merchant Free Shipping Progress Bar module:

  1. Conflict Detection: The system checks if Botiga's Free Shipping Progress Bar module is active
  2. Modal Display: If conflict is detected, a modal appears with two options:
    • Continue with Botiga: Redirects to Botiga's customizer section for free shipping progress bar settings
    • Switch to Merchant: Disables Botiga's module and activates Merchant's module
  3. User Choice: User can choose which implementation to use

🧪 Testing Steps

Prerequisites:

  • Botiga theme with Pro version (Free Shipping Progress Bar is a Pro feature)
  • Merchant plugin installed and activated
  • WooCommerce installed and configured

Test Scenarios:

Scenario 1: Botiga Free Shipping Progress Bar Active

  1. Setup:

    • Go to Botiga Dashboard → Modules
    • Activate the "Free Shipping Progress Bar" module
    • Configure it in Customizer → WooCommerce → Free Shipping Progress Bar
  2. Test Conflict Modal:

    • Go to Merchant Dashboard → Modules
    • Try to activate the "Free Shipping Progress Bar" module
    • Expected: Modal should appear with conflict warning
    • Expected: Two options should be available:
      • "Continue with Botiga" (redirects to Botiga customizer)
      • "Switch to Merchant" (disables Botiga module, activates Merchant module)
  3. Test "Continue with Botiga" Option:

    • Click "Continue with Botiga" button
    • Expected: Should redirect to Botiga customizer section
    • Expected: Merchant module should remain inactive
  4. Test "Switch to Merchant" Option:

    • Click "Switch to Merchant" button
    • Expected: Botiga module should be disabled
    • Expected: Merchant module should be activated
    • Expected: Should redirect to Merchant module settings page

Scenario 2: Botiga Free Shipping Progress Bar Inactive

  1. Setup:

    • Ensure Botiga's Free Shipping Progress Bar module is inactive
  2. Test Normal Activation:

    • Go to Merchant Dashboard → Modules
    • Try to activate the "Free Shipping Progress Bar" module
    • Expected: Should activate normally without modal
    • Expected: No conflict detection should occur

Scenario 3: Botiga Pro Not Available

  1. Setup:

    • Use Botiga free version (without Pro)
  2. Test Behavior:

    • Go to Merchant Dashboard → Modules
    • Try to activate the "Free Shipping Progress Bar" module
    • Expected: Should activate normally without modal
    • Expected: No conflict detection should occur

Visual Testing:

  • ✅ Modal appears with correct styling and branding
  • ✅ Modal content is properly formatted and readable
  • ✅ Buttons are clickable and functional
  • ✅ Modal can be closed with the X button
  • ✅ Redirects work correctly

Browser Testing:

  • ✅ Test in Chrome, Firefox, Safari, Edge
  • ✅ Test on mobile devices
  • ✅ Test with different screen sizes

🔍 Code Review Checklist

  • Code follows existing patterns in the codebase
  • No syntax errors or PHP warnings
  • Proper array formatting and indentation
  • Consistent with other module entries
  • No breaking changes to existing functionality

�� Notes

  • This feature only works when Botiga Pro is active (Free Shipping Progress Bar is a Pro feature)
  • The modal system is already well-established and tested for other modules
  • No additional CSS or JavaScript changes were needed
  • The implementation follows the same pattern as other overlapping modules like wishlist, product-swatches, etc.

🎯 Related Issues

See #409

@DevWael DevWael self-assigned this Sep 24, 2025
@DevWael DevWael added the enhancement New feature or request label Sep 24, 2025
@DevWael DevWael changed the base branch from main to develop September 24, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant