Community Forums › Forums › Archived Forums › Design Tips and Tricks › Edit header file for ecommerce functionality
Tagged: ecommerce
- This topic has 4 replies, 2 voices, and was last updated 7 years, 3 months ago by Victor Font.
-
AuthorPosts
-
January 2, 2017 at 3:07 pm #198642bpikeMember
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,
BrianJanuary 2, 2017 at 3:55 pm #198644Victor FontModeratorYou 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 #198645bpikeMemberThanks 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,
BrianJanuary 2, 2017 at 4:36 pm #198649bpikeMemberI 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 #198656Victor FontModeratorYou 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? -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.