Category: Web development

  • Add Administration Panel Menu Items in CS-Cart

    I wrote this tutorial using CS-Cart v4.18.4.

    Template to Override

    Copy this file from its location in core.

    design/backend/templates/components/menu/get_primary_items.tpl

    Override Location

    Use a “my_changes” add-on as described in CS-Cart documentation to provide a custom version of the template.

    design/backend/templates/addons/my_changes/overrides/components/menu/get_primary_items.tpl

    Sample Code

    This template file creates the screenshot above.

    {capture name="get_items"}
        {$additional_items = [
    		upload => [
    			title => "Get Breakfast",
    			position => 100,
    			icon => 'icon-inbox',
    			href => "https://breakfastco.xyz/",
    			id_path => "upload",
    			active => true
    		]
    	]}
        {* Create main menu *}
        {$navigation_home = [
            home => [
                title => __("home"),
                position => 10,
                icon => "icon-home",
                href => "index.index",
                id_path => "home",
                active => ($runtime.controller === "index" && $runtime.mode === "index")
            ]
        ]}
    
        {* Get additional menu items: $additional_items *}
        {include file="components/menu/get_additional_items.tpl"}
    
        {if $smarty.const.BLOCK_MANAGER_MODE}
            {$items = $navigation.static.central}
        {else}
            {$items = $navigation_home|array_merge:
                ($navigation.static.central|default:[])|array_merge:
                $additional_items
            }
        {/if}
    
        {* Get block manager data for $items and $attrs_wrapper *}
        {include file="components/menu/get_block_manager_data.tpl"}
    
        {$primary_items = $items scope=parent}
        {$attrs_wrapper = $attrs_wrapper scope=parent}
        {$show_collapse_default = $show_collapse_default scope=parent}
        {$main_menu_primary_class = $main_menu_primary_class scope=parent}
    {/capture}

  • Configure InvoiceShelf to use MailHog

    I enjoy InvoiceShelf since I migrated to it in December 2024. InvoiceShelf is open-source invoicing software. I do not allow it to send emails, but I’m exploring the idea.

    How to prevent local web apps from sending emails

    I run MailHog. It’s an open-source email catcher that allows me to see what emails sites running on my computer have tried to send.

    Configure InvoiceShelf to use MailHog

    Go to Settings > Mail Configuration.

    • Mail Driver: smtp
    • Mail Host: 127.0.0.1
    • Mail Port: 1025
    • Mail Encryption: none

    Screenshot

    Here’s a screenshot of my Mail Configuration page.

    Screenshot that shows the Mail Configuration page inside InvoiceShelf.