You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Hi, I was wondering if it is possible to move the Terms of Use and the Privacy Information from the Main Menu to the Online Store Menu.
Thanks,
John
Offline
Is there any documentation available that would show me how to make this modification? Or is this something that you would not advise a beginner to try?
Offline
There is no documentation on this and has mods go it is quite easy, what it would require is for you to create a new column in the ccp0_storemenu (gbu0_storemenu for UK versions). Do this by going to Raw Database Admin and click on "Maintain" for the database then click on "Add Column: Add a new column to this database table." link and enter the information as fellows:
Column Name = ref
Display Name = Item Reference (or anything you like)
Column Type = Text (VARCHAR)
Column Numeric = 255
Not Null = 0
Column Section Name = Item Reference (or what ever you have in the display name)
Column Description = (any thing you like)
Once you have created the new column for that database you can create a new menu item that will show up in the Online Store menu by selecting "Browse" and either clone an existing one or by clicking on the "Insert: Add a new ro to this database table" link and enter the information as fellows:
id = (just give it a unique id or one that is not already in the list for this database)
name = (what you want displayed in the menu)
namespace = display (since you are wanting the Terms of Use in this case)
menuorder = (where you want it to be displayed in the menu list, if this number is the same as one that is already in the menu then it will be sorted alphabetically)
menudisp = 1
ref = termsofuse
Now that this is done the fun stuff starts, you will need to make an edit to you private_dir/apps/ccp0/ccp/ext/femenus.php (private_dir/apps/gbu0/gbu/ext/femenus.php for UK version) in function menustore where you will need to find this code:
$sql = "SELECT name, namespace FROM {$table} WHERE menudisp="; $sql .= $this->KHXC_DB->quote(1); $result = $this->KHXC_DB->sql_do(array('sql' => $sql, 'table' => $table, 'order' => array('menuorder' => 'ASC')));
and change it to (add ref to the list of columns pulled from the database)
$sql = "SELECT name, namespace, ref FROM {$table} WHERE menudisp="; $sql .= $this->KHXC_DB->quote(1); $result = $this->KHXC_DB->sql_do(array('sql' => $sql, 'table' => $table, 'order' => array('menuorder' => 'ASC')));
then find this
foreach ($result as $num => $row) { $menu_array[] = array('text' => $row['name'], 'app' => $this->app, 'namespace' => $row['namespace'], 'params' => array()); } // End of foreach statement.
and change it to
foreach ($result as $num => $row) { if (empty($row['ref'])) {$params = array();} else { $params = array('ref' => $row['ref']);} $menu_array[] = array('text' => $row['name'], 'app' => $this->app, 'namespace' => $row['namespace'], 'params' => $params); } // End of foreach statement.
and then you should have a functioning link in your Online Store menu that will take you the the terms of use html page, this will in-turn work for any other page in the site as long as you know the namespace and reference needed to get to it. Keep in mind that this edit could be overwritten in updates and you should make a backup of the file just in case you mess something up.
John
Last edited by dh783 (01-25-2009 16:27:10)
Offline
Thanks John, this is great and I managed the first part but I can't get to the fun part because I can't for the life of me find "private_dir/app/ccp0/ccp/ext/femenues.php". How can I get to this file?
Offline
Using your FTP client. That's the directory path to the file on your server. It isn't something that is available through the admin interface.
Offline
I think I'm missing something because using my Ftp client I can't find any directory called "app". I have /khxc-private/apps/gbu0/ but no ccp0 and in the /khxc there is no private_dir. I downloaded the whole site and a search for "femenues.php" brought up nothing. I'm using the UK version so is it possible that this file has a different name?
Offline
khxc-private/apps/gbu0/GBU/ext is the directory where it resides for the UK version and the file John referenced is named femenus.php in that directory. We use private_dir or {private} most of the time because the name of the private directory is up to you, the installer, and it may have any name desired.
Offline
Thank you, I got it and I'm almost there but need to ask you one more question. When I click on the new menu item that I added, the Url has this : "=display&ref=+termsofuse" and I think because there is an extra + sign, I get a page not found. Where in the code can I go and remove the + sign?
Offline
Errr, what exactly did you add? Or do you have a URL that shows the problem?
Offline
Sorry for the typoes in my last post, I have corrected them. I would check the entry you made for that link in the database for gbu0_storemenu and make sure there is no leading space in the field you created in front of termsofuse.
John
Offline
Thank you both, it worked perfectly. I removed the leading space and that fixed it. This was fun for me, hope it wasn't a pain for you.
Offline