Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC-CSS Conversion


Guest

Recommended Posts

Hi

 

At your website, simplyscent.co.uk I see that you have this in the header:

 

<base href="http://www.simplyscent.co.uk/">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

 

This is the original stylesheet. You should have this:

 

<base href="http://www.simplyscent.co.uk/">
<link rel="stylesheet" type="text/css" href="templates/apple/stylesheet.css">

where 'apple' is the name of the template chosen. If you chose in the admin 'original' you would have:

 

<base href="http://www.simplyscent.co.uk/">
<link rel="stylesheet" type="text/css" href="templates/original/stylesheet.css">

 

Ok, I see that, but where do I change it? I thought that was application_top but the script in there is right. Is there somewhere else it needs to be added?

Sorry for seeming dumb, but I am learning as I go....:)

Link to comment
Share on other sites

In application_top.php do you have?:

 

$stylesheet='<link rel="stylesheet" type="text/css" href="stylesheet.css">';

 

If you do, for the templates to work you need to go back and do step 2, the whole step, on the one folder template instruction, ie this:

 

Step 2: Open includes/application_top.php

 

find:

// set the application parameters
$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
while ($configuration = tep_db_fetch_array($configuration_query)) {
define($configuration['cfgKey'], $configuration['cfgValue']);
} 

 

just beneath add:

//START TEMPLATES
$template_query = tep_db_query("select configuration_title from " . TABLE_CONFIGURATION . " where configuration_description ='template'");
$template_value = tep_db_fetch_array($template_query);
$template_name = $template_value['configuration_title'];
define('DIR_WS_TIMAGES', 'templates/'.$template_name.'/template_images/'); 
define('DIR_WS_BUTTONS', 'templates/'.$template_name.'/buttons/');
define('DIR_WS_PLUGINS', 'templates/'.$template_name.'/plugins/');
//END TEMPLATES 

--------------------------------------

 

find:

$stylesheet='<link rel="stylesheet" type="text/css" href="stylesheet.css">'; 

 

change to:

$stylesheet='<link rel="stylesheet" type="text/css" href="templates/'.$template_name.'/stylesheet.css">';

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

In application_top.php do you have?:

 

$stylesheet='<link rel="stylesheet" type="text/css" href="stylesheet.css">';

 

If you do, for the templates to work you need to go back and do step 2, the whole step, on the one folder template instruction, ie this:

 

Step 2: Open includes/application_top.php

 

find:

// set the application parameters
$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
while ($configuration = tep_db_fetch_array($configuration_query)) {
define($configuration['cfgKey'], $configuration['cfgValue']);
} 

 

just beneath add:

//START TEMPLATES
$template_query = tep_db_query("select configuration_title from " . TABLE_CONFIGURATION . " where configuration_description ='template'");
$template_value = tep_db_fetch_array($template_query);
$template_name = $template_value['configuration_title'];
define('DIR_WS_TIMAGES', 'templates/'.$template_name.'/template_images/'); 
define('DIR_WS_BUTTONS', 'templates/'.$template_name.'/buttons/');
define('DIR_WS_PLUGINS', 'templates/'.$template_name.'/plugins/');
//END TEMPLATES 

--------------------------------------

 

find:

$stylesheet='<link rel="stylesheet" type="text/css" href="stylesheet.css">'; 

 

change to:

$stylesheet='<link rel="stylesheet" type="text/css" href="templates/'.$template_name.'/stylesheet.css">';

 

 

In application_top.php I have:

 

  // Define Stylesheet(s) to be used.
$stylesheet='<link rel="stylesheet" type="text/css" href="templates/'.$template_name.'/stylesheet.css">';

 

and:

 

// set the application parameters
define('TABLE_THEME_CONFIGURATION', 'theme_configuration');
 $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
 while ($configuration = tep_db_fetch_array($configuration_query)) {
   define($configuration['cfgKey'], $configuration['cfgValue']);
//START TEMPLATES
$template_query = tep_db_query("select configuration_title from " . TABLE_CONFIGURATION . " where configuration_description ='template'");
$template_value = tep_db_fetch_array($template_query);
$template_name = $template_value['configuration_title'];
define('DIR_WS_TIMAGES', 'templates/'.$template_name.'/template_images/'); 
define('DIR_WS_BUTTONS', 'templates/'.$template_name.'/buttons/');
define('DIR_WS_PLUGINS', 'templates/'.$template_name.'/plugins/');
//END TEMPLATES

Link to comment
Share on other sites

You still have

<link rel="stylesheet" type="text/css" href="stylesheet.css">

showing up when I view the source code of your website.

 

Be sure that in the header of index.php, in fact in all pages, that you have this in your header:

 

<?php echo $stylesheet; ?>

 

and not

 

<link rel="stylesheet" type="text/css" href="stylesheet.css">

.

 

In other words make sure that the stylesheet is not hardcoded in the header as it normally is in OSCommerce. Upthread Germ suggested that you:

'Yes you have to add the link to the stylesheet to all the main PHP files.' Good advice and correct, if you are using regular OSCommerce, but If you did that, if you have gone back and added:

 

<link rel="stylesheet" type="text/css" href="stylesheet.css">

to all the pages

 

then the template system will not work.

Edited by npn2531

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

You still have

<link rel="stylesheet" type="text/css" href="stylesheet.css">

showing up when I view the source code of your website.

 

Be sure that in the header of index.php, in fact in all pages, that you have this in your header:

 

<?php echo $stylesheet; ?>

 

and not

 

<link rel="stylesheet" type="text/css" href="stylesheet.css">

.

 

In other words make sure that the stylesheet is not hardcoded in the header as it normally is in OSCommerce. Upthread Germ suggested that you:

'Yes you have to add the link to the stylesheet to all the main PHP files.' Good advice and correct, if you are using regular OSCommerce, but If you did that, if you have gone back and added:

 

<link rel="stylesheet" type="text/css" href="stylesheet.css">

to all the pages

 

then the template system will not work.

 

I didn't realise that I had to have

<?php echo $stylesheet; ?>

in index.php, or any other file. But I've checked them, and changed the necessary and all seems to be working.

I'll have another go at that navbar now.

I can't thank you enough for your time and your help

:)

Link to comment
Share on other sites

Actually if you just recopy the catalog pages (catalog pages only - not the admin or pages in the includes folder) from the OSC to CSS contribution download, you be set and all will work. If you don't do that you have to go back and to the catalog pages you added:

<link rel="stylesheet" type="text/css" href="stylesheet.css">

 

to, re-replace with:

 

<?php echo $stylesheet; ?>

 

which is how it is originally in the OSC to CSS contribution.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

Yes, now you have it:

 

This is what I see in your index.php

 

<base href="http://www.simplyscent.co.uk/">

<link rel="stylesheet" type="text/css" href="templates/original/stylesheet.css">

 

Note you are correctly pulling the stylesheet from the templates/original folder.

Edited by npn2531

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

This is the same spot from my includes/application_top.php

 

$stylesheet='<link rel="stylesheet" type="text/css" href="templates/'.$template_name.'/stylesheet.css">
  <link rel="stylesheet" type="text/css" href="templates/'.$template_name.'/superfish.css">
   <link rel="stylesheet" type="text/css" href="templates/'.$template_name.'/superfish-navbar.css" />              
    <script type="text/javascript" src="includes/javascript/jquery.js"></script>		
    <script type="text/javascript" src="includes/javascript/cart-toggle.js"></script>
   <script type="text/javascript" src="includes/javascript/top-navbar.js"></script>
  <script type="text/javascript" src="includes/javascript/superfish.js"></script> 	
  '; 

 

Note you can stack references to all the stylesheets and javascript files you want. Just watch the php punctionation.

Edited by npn2531

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

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...