Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sts Mega Power Pack


mig7

Recommended Posts

Work-around for BonkersDynamenu

 

When Install is finished and you go to view the catalog, you will likely get this:

 

LayersMenu Error: setImgdir: /Program Files/Apache Group/Apache2/htdocs/shop/images/ is not a directory.

Halted.

 

it will only work if your catalog folder is called 'shop', however...

 

with a little editing to catalog/includes/boxes/dm_header and dm_treemenu you can use configured variables in place of the existing hard coded path values. heres how:

 

open catalog/includes/configure.php and insert this (p.s. amend to your server path as apropriate)

 

define('DM_MYDIRPATH', '/Program Files/Apache Group/Apache2/htdocs/');

 

under this:

 

define('DM_INCLUDES_FUNCTIONS', 'includes/functions/');

 

like so:

 

define('DM_INCLUDES_FUNCTIONS', 'includes/functions/');

define('DM_MYDIRPATH', '/Program Files/Apache Group/Apache2/htdocs/');

 

NOTE: WINDOWS PATHS MUST START WITH '/' NOT 'C:/' BECAUSE PHPLAYERSMENU AKA DYNAMENU WILL NOT ACCEPT THE 'C:' PART. STRANGE QUIRK - DONT ASK!

 

now in the boxes/dm_ files mentioned above amend to the following:

 

// set paths

 

$myDirPath = DM_MYDIRPATH;

$myWwwPath = '/';

 

note: remove single quotes around the defined variable DM_MYDIRPATH

 

now scroll down to:

 

$mid->setImgdir($myDirPath . 'shop/images/');

$mid->setImgwww($myWwwPath . 'shop/images/');

 

$mid->setIcondir($myDirPath . 'shop/images/');

$mid->setIconwww($myWwwPath . 'shop/images/');

 

change to this:

 

$mid->setImgdir($myDirPath . CATALOG_DIR_NAME . '/images/');

$mid->setImgwww($myWwwPath . CATALOG_DIR_NAME . '/images/');

 

$mid->setIcondir($myDirPath . CATALOG_DIR_NAME . '/images/');

$mid->setIconwww($myWwwPath . CATALOG_DIR_NAME . '/images/');

 

this will sort out that problem. ;o)

 

i will make amends to the install_step7 file soon....

 

external template files will still need manual editing though.

Link to comment
Share on other sites

  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

Hi again - another cool tip for dynamenu

 

have you got loads of catagories in your menu that do not have products in them yet? why show them? I found a contrib called 'empty catagories' but this only works for the stock osc boxes/catagories.php that displays the simple list,

 

have a look:

http://www.oscommerce.com/community/contributions,5270

 

any way, ive now adapted it to work with dynamenu gone nuts bonkers, here goes:

 

do the edits below to the file boxes/dm_header.php

they are the edits clearly shown surrounded with 'shift8' stars.

 

<! ================================================================================

===========================================

 

Dynamenu gone Nuts Bonkers.

 

DM_HEADER.php --- sts use $dm_head.

 

Matthew John Ritchie

www.BlueGreenTechnologies.com

 

Thanks goto Nate for his origional code which was used to get the catagories working here.

 

The majority of the code below comes from the phplayersmenu download

using the horizontal & vertical menus example.

 

Ofcourse this is open source, you have the freedom to make the choice of whatever

licence you wish to use as long as it remains open. ;o)

 

p.s. I have removed the boxes. My personal choice. Replace them if you wish.

But backup and test. It shouldn't matter though.

 

================================================================================

=========================================== >

<?php

 

// allow subcatagories to flyout or dropdown.

 

$show_full_tree = true;

 

// set paths

 

$myDirPath = DM_MYDIRPATH;

$myWwwPath = '/';

 

// include the template class

 

require_once (DIR_WS_FUNCTIONS . 'dynamenu/lib/PHPLIB.php');

require_once (DIR_WS_FUNCTIONS . 'dynamenu/lib/layersmenu-common.inc.php');

require_once (DIR_WS_FUNCTIONS . 'dynamenu/lib/layersmenu.inc.php');

 

// instantiate the LayersMenu class:

 

$mid = new LayersMenu();

 

$mid->setDirroot(DM_SETDIRROOT);

 

$mid->setLibjsdir(DM_INCLUDES_FUNCTIONS . 'dynamenu/libjs/');

 

$mid->setTpldir(DM_INCLUDES_FUNCTIONS . '/dynamenu/templates/');

 

$mid->setImgdir($myDirPath . CATALOG_DIR_NAME.'/images/');

$mid->setImgwww($myWwwPath . CATALOG_DIR_NAME.'/images/');

 

$mid->setIcondir($myDirPath . CATALOG_DIR_NAME.'/images/');

$mid->setIconwww($myWwwPath . CATALOG_DIR_NAME.'/images/');

 

 

$mid->setIconsize(16, 16);

 

$mid->setHorizontalMenuTpl('layersmenu-horizontal_menu.ihtml');

$mid->setSubMenuTpl('layersmenu-horiz_sub_menu.ihtml');

 

$mid->setVerticalMenuTpl('layersmenu-vertical_menu.ihtml');

$mid->setSubMenuTpl('layersmenu-vert_sub_menu.ihtml');

 

$mid->setDownArrowImg('down-arrow.png');

$mid->setForwardArrowImg('forward-arrow.png');

 

// NAVIGATION MENU

 

// line below removed because file does not support sessions compatability.

// $mid->setMenuStructureFile(DIR_WS_FUNCTIONS . 'dynamenu/layersmenu-horizontal-1.txt.php');

 

$navmenu =

 

".|Index|" . tep_href_link(FILENAME_HOME_INDEX, '', 'EXT') . "|Index\n".

".|Home|" . tep_href_link(FILENAME_HOME, '', 'EXT') . "|Home\n".

".|Company|" . tep_href_link(FILENAME_ABOUT_US, '', 'EXT') . "|About Us\n".

"..|About Us|" . tep_href_link(FILENAME_ABOUT_US, '', 'EXT') . "|About Us\n".

"..|Contact Us|" . tep_href_link(FILENAME_CONTACT, '', 'EXT') . "|Contact Us\n".

"..|Technical Info|" . tep_href_link(FILENAME_TECH_INFO, '', 'EXT') . "|Technical Info\n".

"..|Downloads|" . tep_href_link(FILENAME_DOWNLOADS, '', 'EXT') . "|Downloads\n".

".|Biomass|" . tep_href_link(FILENAME_BIOMASS, '', 'EXT') . "|Biomass\n".

".|Wind Power|" . tep_href_link(FILENAME_WIND_POWER, '', 'EXT') . "|Wind Power\n".

".|Solar|" . tep_href_link(FILENAME_SOLAR, '', 'EXT') . "|Solar Power\n".

"..|Solar PV|" . tep_href_link(FILENAME_SOLAR_PV, '', 'EXT') . "|Solar Photovoltaics\n".

"..|Solar Thermal|" . tep_href_link(FILENAME_SOLAR_THERMAL, '', 'EXT') . "|Solar Thermal\n".

".|Hydro Electric|" . tep_href_link(FILENAME_HYDRO, '', 'EXT') . "|Hydro Electric\n".

"..|Hydro Electric|" . tep_href_link(FILENAME_HYDRO, '', 'EXT') . "|Hydro Electric\n".

"..|Water Harvesting|" . tep_href_link(FILENAME_WATER_HARVEST, '', 'EXT') . "|Water Harvesting\n";

 

$mid->setMenuStructureString($navmenu);

$mid->parseStructureForMenu('hormenu1');

$mid->newHorizontalMenu('hormenu1');

 

// CATAGORIES MENU

 

$VERT_categories_menu = tep_make_cat_dmlist();

$mid->setMenuStructureString($VERT_categories_menu);

$mid->parseStructureForMenu('vermenu1');

$mid->newVerticalMenu('vermenu1');

 

$mid->printHeader();

// ****

 

$GLOBALS['dmfooter'] = $mid->getFooter();

 

// ================================================================================

===========================================

// ================================================================================

===========================================

 

function tep_make_cat_dmlist($rootcatid = 0, $maxlevel = 0){

 

global $cPath_array, $show_full_tree, $languages_id;

 

global $idname_for_menu, $cPath_array, $show_full_tree, $languages_id;

 

// Modify category query if not fetching all categories (limit to root cats and selected subcat tree)

 

if (!$show_full_tree) {

 

$parent_query = 'AND (c.parent_id = "0"';

 

if (isset($cPath_array)) {

 

$cPath_array_temp = $cPath_array;

 

foreach($cPath_array_temp AS $key => $value) {

 

$parent_query .= ' OR c.parent_id = "'.$value.'"';

 

}

 

unset($cPath_array_temp);

}

 

$parent_query .= ')';

 

} else {

 

$parent_query = '';

 

}

 

$result = tep_db_query('select c.categories_id, cd.categories_name, c.parent_id from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd where c.categories_id = cd.categories_id and cd.language_id="' . (int)$languages_id .'" '.$parent_query.'order by sort_order, cd.categories_name');

 

while ($row = tep_db_fetch_array($result)) {

 

$table[$row['parent_id']][$row['categories_id']] = $row['categories_name'];

 

}

 

$output .= tep_make_cat_dmbranch($rootcatid, $table, 0, $maxlevel);

 

return $output;

 

}

 

// ================================================================================

===========================================

// ================================================================================

===========================================

 

function tep_make_cat_dmbranch($parcat, $table, $level, $maxlevel) {

 

global $cPath_array, $menu_use_titles, $menu_icon_file, $divide_subcats, $divide_subcats_text;

 

$lvl_adjust = 1;

 

$list = $table[$parcat];

 

// Build data for menu

 

while(list($key,$val) = each($list)){

 

if (isset($cPath_array) && in_array($key, $cPath_array)) {

 

$this_expanded = '1';

$this_selected = 'dmselected';

 

} else {

 

$this_expanded = '';

$this_selected = '';

 

}

 

if (!$level) {

 

unset($GLOBALS['cPath_set']);

$GLOBALS['cPath_set'][0] = $key;

$cPath_new = 'cPath=' . $key;

 

} else {

 

$GLOBALS['cPath_set'][$level] = $key;

$cPath_new = 'cPath=' . implode("_", array_slice($GLOBALS['cPath_set'], 0, ($level+1)));

$this_subcat_count++;

}

 

// *************************************************************

// Matthew John Ritchie www.BlueGreenTechnologies.com

// *************************************************************

// this shows only the catagories with products like contrib 'empty catagories'.

 

$products_in_category = tep_count_products_in_category($key);

if ($products_in_category > 0) {

 

// *************************************************************

 

if ($menu_use_titles) {

 

$this_title = $val;

 

} else {

 

$this_title = '';

 

}

 

if (SHOW_COUNTS == 'true') {

 

$products_in_category = tep_count_products_in_category($key);

 

if ($products_in_category > 0) {

 

$val .= ' (' . $products_in_category . ')';

 

}

}

 

if ($this_subcat_count > $divide_subcats && $divide_subcats) {

 

$output .= str_repeat(".", $level+$lvl_adjust).'|'.$divide_subcats_text.'||'.$this_title.'|'.$menu_icon_file.'|'.$this_selected.'|'.$this_expanded."\n";

$this_subcat_count = 1;

$lvl_adjust ++;

}

 

$output .= str_repeat(".", $level+$lvl_adjust).'|'.$val.'|'.tep_href_link(FILENAME_DEFAULT, $cPath_new).'|'.$this_title.'|'.$menu_icon_file.'|'.$this_selected.'|'.$this_expanded."\n";

 

 

if ((isset($table[$key])) AND (($maxlevel > $level + 1) OR ($maxlevel == '0'))) {

 

$output .= tep_make_cat_dmbranch($key,$table,$level + $lvl_adjust,$maxlevel);

 

}

 

 

// *************************************************************

// Matthew John Ritchie www.BlueGreenTechnologies.com

// *************************************************************

 

} // end products_in_catagory if statement

 

// *************************************************************

 

} // End while loop

 

return $output;

}

 

?>

 

<! ================================================================================

===========================================

 

Dynamenu gone Nuts Bonkers.

 

================================================================================

=========================================== >

 

<link rel="stylesheet" type="text/css" href="<?PHP ECHO dmSTYLESHEET; ?>">

 

<script language="JavaScript" type="text/javascript"><!--<?php require_once (DIR_WS_FUNCTIONS . 'dynamenu/libjs/layersmenu-browser_detection.js'); ?> // --></script>

<script language="JavaScript" type="text/javascript" src="<?php echo DIR_WS_FUNCTIONS; ?>dynamenu/libjs/layersmenu-library.js"></script>

<script language="JavaScript" type="text/javascript" src="<?php echo DIR_WS_FUNCTIONS; ?>dynamenu/libjs/layersmenu.js"></script>

<script language="JavaScript" type="text/javascript" src="<?php echo DIR_WS_FUNCTIONS; ?>dynamenu/libjs/layerstreemenu-cookies.js"></script>

 

<! ================================================================================

===========================================

================================================================================

=========================================== >

Link to comment
Share on other sites

slight problem with the above additions to dynamenu,

 

sessions sharing between osc and external pages breaks once you leave osc to browse over the external pages, this did not happen previously but i did notice that hitting the 'top' link in the breadcrums did reset the session to another id.

 

the problem with this is that once a visitor has inputed products into their cart, they are not retained when comming back to the cart.

 

it seems it is only a problem when testing on the remote live server and has no effect on the localhost server even though everything is exactly the same. perhaps the way forward is to use cookies....?

 

a problem once solved returns yet again! as homer simpson says !!!!!DOH!!!!!!

 

matt

 

just reverted to the old files but no change so there is a problem else where that i need to find....

 

just so you know, and perhaps you can provide a possible solution

Edited by MatthewRitchie
Link to comment
Share on other sites

slight problem with the above additions to dynamenu,

 

sessions sharing between osc and external pages breaks once you leave osc to browse over the external pages, this did not happen previously but i did notice that hitting the 'top' link in the breadcrums did reset the session to another id.

 

the problem with this is that once a visitor has inputed products into their cart, they are not retained when comming back to the cart.

 

it seems it is only a problem when testing on the remote live server and has no effect on the localhost server even though everything is exactly the same. perhaps the way forward is to use cookies....?

 

a problem once solved returns yet again! as homer simpson says !!!!!DOH!!!!!!

 

matt

 

just reverted to the old files but no change so there is a problem else where that i need to find....

 

just so you know, and perhaps you can provide a possible solution

 

WORKAROUND SOLUTION:

 

i didnt find a solution for keeping the session id in the address bar [i know this has its security issues with it] but has resolved to forcing cookie usage through admin=>configuration=>sessions.

 

all seems to work fine when in this state.

 

matt

 

demo (but live product shop at - see signature) will shortly have the dm_header.php empty catagories installed [give me five minutes] ;o)

Link to comment
Share on other sites

  • 2 weeks later...
Also, I can not vouch for the integrity of the STS version that is included in the mega pack since I have not had a chance to test it. If all you are wanting is STS and HTC to work together, then I would suggest that you install the latest STS/HTC bundle that I have available on the STS Power Pack site (a site that lists available STS add-ons and STS tips) or use my STS/HTC step by step install guide (see link in my signature below).

 

The STS and Htc combo i have used to build this mega power pack is from bill's sts power pack. I have left most of it untouched apart from adding in register globals (not now needed with osc RC1), dynamenu and sts external template pages.

 

matt

Link to comment
Share on other sites

  • 2 months later...

hay matthew , well i think the contribution is great , but man im having errors every time i install it , and different one every time , the last install i get this error

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\xampp\htdocs\osc\catalog\includes\configure.php:151) in D:\xampp\htdocs\osc\catalog\includes\functions\sessions.php on line 98

1060 - Duplicate column name 'categories_htc_title_tag'

 

ALTER TABLE categories_description ADD categories_htc_title_tag VARCHAR(80) NULL;

 

[TEP STOP]

 

 

 

im working with the tutorial step by step , so i dont know whats going wrong

 

and if u can supply of oscommerce with contribution in it , ready for install , that would be great , so i know that the error is from my side , because i tried to install more than 20 times , on windows and linux , both has xampp or lampp

Link to comment
Share on other sites

Hi, hope someone can help

 

Have installed this contribution and everything seemed to be OK. However when I followed the instructions for the 'Header Tags' module there was a fault.

In admin\catalog\catagories & products - licking the edit button does not take me to the edit page. :'(

 

When adding a product I seem to only have half the form, down to description, there are no buttons to save or cancel etc. :'(

this only happened after installing this contribution.

 

other contributions used are: -

Catagories_box

FEC 3.2 Quicker Install v4

Ipn

All working as expected

 

Does anyone have a clue to which file may be at fault? and if so what may be wrong.

I am fairly new to this, but willing to hunt around to find the fault/resolve if pointed in the right direction.

 

Thanks in advance

Link to comment
Share on other sites

  • 1 month later...
hay matthew , well i think the contribution is great , but man im having errors every time i install it , and different one every time , the last install i get this error

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\xampp\htdocs\osc\catalog\includes\configure.php:151) in D:\xampp\htdocs\osc\catalog\includes\functions\sessions.php on line 98

1060 - Duplicate column name 'categories_htc_title_tag'

 

ALTER TABLE categories_description ADD categories_htc_title_tag VARCHAR(80) NULL;

 

[TEP STOP]

 

this problem seems very similar to the one above in this topic

link:

 

http://www.oscommerce.com/forums/index.php?s=&...t&p=1147688

 

have you checked your configure.php file?

Edited by MatthewRitchie
Link to comment
Share on other sites

Hi, hope someone can help

 

Have installed this contribution and everything seemed to be OK. However when I followed the instructions for the 'Header Tags' module there was a fault.

In admin\catalog\catagories & products - licking the edit button does not take me to the edit page. :'( . . . .

 

. . . . I am fairly new to this, but willing to hunt around to find the fault/resolve if pointed in the right direction.

 

Thanks in advance

 

It sounds like you missed some code somewhere best thing to do is retrace your steps and go throught it again.

 

Also make sure you follow the link in bkellum signature to install HTC with STS as it is the way to go.

Powered By osC 2.2RC2a STS 4.5.8 - HTC 2.6.3 - FP 1.5.9 - BCH 1.0.0

Link to comment
Share on other sites

Horizontal Categories Listing

 

Installed this - just perfect for what I need.

 

Problem, though - the links do not work.

 

From the Horizontal Category, the link is

 

<a href="http://localhost/catalog/index.php?osCsid=075cb8c189d4199bcf4c097b3e0f4be9?cPath=32">Kitchen</a>

 

and just doesn't go anywhere!

 

 

From the Categories infobox, this is the link

 

<a href="http://localhost/catalog/index.php?cPath=32&osCsid=075cb8c189d4199bcf4c097b3e0f4be9">Kitchen</a>

 

and it goes where I expect.

 

Any suggestions?

Link to comment
Share on other sites

Horizontal Categories Listing

 

Installed this - just perfect for what I need.

 

Problem, though - the links do not work.

 

From the Horizontal Category, the link is

 

<a href="http://localhost/catalog/index.php?osCsid=075cb8c189d4199bcf4c097b3e0f4be9?cPath=32">Kitchen</a>'>http://localhost/catalog/index.php?osCsid=075cb8c189d4199bcf4c097b3e0f4be9?cPath=32">Kitchen</a>

 

and just doesn't go anywhere!

 

 

From the Categories infobox, this is the link

 

<a href="http://localhost/catalog/index.php?cPath=32&osCsid=075cb8c189d4199bcf4c097b3e0f4be9">Kitchen</a>'>http://localhost/catalog/index.php?cPath=32&osCsid=075cb8c189d4199bcf4c097b3e0f4be9">Kitchen</a>

 

and it goes where I expect.

 

Any suggestions?

 

<a href="http://localhost/catalog/index.php?osCsid=075cb8c189d4199bcf4c097b3e0f4be9?cPath=32">Kitchen</a>'>http://localhost/catalog/index.php?osCsid=075cb8c189d4199bcf4c097b3e0f4be9?cPath=32">Kitchen</a>

 

If you break the link down into its parts you get this:

 

<a href="http://localhost/catalog/index.php

 

?osCsid=075cb8c189d4199bcf4c097b3e0f4be9

?cPath=32">Kitchen</a>

 

see at the beginning of the above two lines, the '?' signifies a $_GET array query string ammended to the href target file

 

now, query strings should be made up of only one '?' and then any further additions to the string are attached with an '&' ampersand.

 

this is as far as I can help without your web adress so I can see what may be happening.

 

from what i gather, you have the catagories reitterated in the horizontal navigation menu. The 'Dynamenu_gone_nuts_bonkers was written for the catagories to remain in a vertical flyout menu down the left hand side of the page. this is the overwhelming tradition of ecommerce shops. if you want to put catagories across the top of the page in the £dm_horiz then you will need to take a look in

 

includes/boxes/dm_header.php and wiggle the code for you needs.

 

note, you may have problems with having two category links tables on the same page, perhaps not though, ive not tested it.

 

Oh and you can hard code your category links like I have done in the above file too, but remember to leave out the sessions id, all you need is the cpath=xx where xx is the category number.

 

to hard code you need tep_href(), copy it from some other file. this function allows the sessions to follow a visitor arround the site and hence is very important.

 

hope that helps a little

 

matt

Link to comment
Share on other sites

  • 1 month later...

Hi

 

I want to be able to use the dynamenu for dropdown menus on pages outside of my catagories. I already have my site finished so i do not want to use the STS format.

 

My question is can i just use your dynamenu gone bonkers without using STS?

 

Thanks.

 

Del

Link to comment
Share on other sites

Hi

 

I want to be able to use the dynamenu for dropdown menus on pages outside of my catagories. I already have my site finished so i do not want to use the STS format.

 

My question is can i just use your dynamenu gone bonkers without using STS?

 

Thanks.

 

Del

 

Hi Del

 

I am quite sure you can use dynamenu without sts as this is how the dynm. contrib was first proposed. You might already have found the support pages by now.

 

anyway, dynamenu is built using "PHP Layers Menu" which is easily searched for. There are full instructions on its use hence how I managed to adapt it to my needs. May i suggest you start there as it is fairly easy once you have read through the instructions.

 

Matt

Link to comment
Share on other sites

  • 2 weeks later...
Hi Del

 

I am quite sure you can use dynamenu without sts as this is how the dynm. contrib was first proposed. You might already have found the support pages by now.

 

anyway, dynamenu is built using "PHP Layers Menu" which is easily searched for. There are full instructions on its use hence how I managed to adapt it to my needs. May i suggest you start there as it is fairly easy once you have read through the instructions.

 

Matt

 

Thanks Matt

 

I am going to play around with the whole contribution on a test site (just worked out how to do this). I have a client which I think the STS will work well for. Anyway thanks for the advice and now lets get to it and see what happens.

 

Del

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...