• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Edit header file for ecommerce functionality

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Edit header file for ecommerce functionality

This topic is: not resolved

Tagged: ecommerce

  • This topic has 4 replies, 2 voices, and was last updated 9 years, 3 months ago by Victor Font.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • January 2, 2017 at 3:07 pm #198642
    bpike
    Member

    I am building a site and trying to integrate a third party ecommerce program called Ecommerce Templates (ECT). The instructions to configure the store pages require to add the PHP include lines that call the shopping cart software. This is done by editing the header.php file. Immediately after the <?php line add:

    session_cache_limiter('none');
    session_start();
    ob_start();
    include "vsadmin/db_conn_open.php";
    include "vsadmin/inc/languagefile.php";
    include "vsadmin/includes.php";
    include "vsadmin/inc/incfunctions.php";
    include "vsadmin/inc/metainfo.php";

    I am not sure where to add these lines of code. I tried the Simple Hooks plugin and can see my test products but get the error:

    Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /wp-content/themes/genesis/lib/structure/header.php:59) in /wp-content/plugins/genesis-simple-hooks/plugin.php(134) : eval()'d code on line 3

    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /wp-content/themes/genesis/lib/structure/header.php:59) in /wp-content/plugins/genesis-simple-hooks/plugin.php(134) : eval()'d code on line 3

    I have also tried to add the code to the Header Scripts section of the theme setting but get 'No incfunctions.php file'

    Not sure how to add to the functions file if that is where to put this code.

    Any thoughts on this?

    Thanks,
    Brian

    January 2, 2017 at 3:55 pm #198644
    Victor Font
    Moderator

    You could copy genesis/header.php into your child theme directory and add the code there or, as an alternative, you can create a function to load your files and add it as an action to genesis_doctype with a priority less than 10.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    January 2, 2017 at 3:59 pm #198645
    bpike
    Member

    Thanks Victor. If I copied the header.php file into my child theme directory, would I just add the code I need in it and let the rest of the header file be called through Genesis?

    I'm not sure how to create the function as you mentioned.

    Thanks,
    Brian

    January 2, 2017 at 4:36 pm #198649
    bpike
    Member

    I tried this but it did not work:

    //* Added action to the doctype to add ECT includes
    add_action( 'genesis_doctype', 'child_do_doctype' );

    function child_do_doctype() {
    ?>
    session_cache_limiter('none');
    session_start();
    ob_start();
    include "vsadmin/db_conn_open.php";
    include "vsadmin/inc/languagefile.php";
    include "vsadmin/includes.php";
    include "vsadmin/inc/incfunctions.php";
    include "vsadmin/inc/metainfo.php";
    <?php
    }

    January 2, 2017 at 9:29 pm #198656
    Victor Font
    Moderator

    You don't need the php tags in the function. You're already coding in php. You also didn't set a priority in the add_action.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble