Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Thema Options 1.0 (5 different themas)


Recommended Posts

CC, you need to sign up for the free store in order to change and test the themes. ;)

 

 

MultiServis.Net ?

 

Nice ? I really like this idea! Have you thought about making it so that the visitor can change the theme?

 

I am also curious how and if this would work if you had multiple shops that use the same admin ?

 

Thanks for all the hard work :)

Link to comment
Share on other sites

Just installed this on a Loaded Snapshot. Ok, so the example templates are pretty much just css changes, but the whole thing works very well.

 

Only one suggestion. Make the admin selection a drop down and allow themes to have a name.

 

I remember doing something similar for 2.1 (without the admin) and had thought about upgrading the code to 2.2, but you've saved me a job.

 

Now all we need is people to start contributing their own themas.

Trust me, I'm an Accountant.

Link to comment
Share on other sites

Agreed Ian

 

this could be something fantastic!

 

The first step to a new look OSC.

I would suggest people install this juts to see what the potential is and see if we can use our imaginations and put together some ideas.

 

I am gonna have a play with making a Theme and will come back and report we I have something.

 

CC.

 

I do believe this is very similar to what Kenny has implemented at www.pcbuzzard.de

Or www.theme-shop.com as his project was once known.

Could you confirm Kenny, and maybe help us out with some ideas??

Link to comment
Share on other sites

You got it!

 

:D

 

Anyone else wanna join in and make this a little project?

I know Kenny has done a lot in this area, that is why I want him to reply on here and help us out.

 

CC.

Link to comment
Share on other sites

Hi all,

 

How about having the themes change by the customers/surfers depending on what he/she is looking at?

 

Or

 

just a drop down menu on a box just like languages and be able to change colours/themes.

 

Salvo

Link to comment
Share on other sites

I have never been keen on this idea.

I like to know I am in control of my site.

 

Plus if you are runnging a business you want people to know your company colours, so you dont want them changing them.

 

So I would have to say I dontwant that function.

But that is just MHO.

Others may disagree.

 

CC.

Link to comment
Share on other sites

First of all we have insert a line into configuration

 

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Site Thema Options', 'SITE_THEMA', '1', 'You can change site thema form here.', '1', '19', 'tep_cfg_select_option(array('1', '2', '3', '4', '5'), ', now());

We gave name to themas as 1,2,3,4,5

tep_cfg_select_option(array('1', '2', '3', '4', '5')

but we can give name blue,red,holiday..

tep_cfg_select_option(array('blue', 'red', 'holiday', 'newyear', 'fantasy')

so that we need to change

catalog/includes/classes/thema/1 and catalog/images/infobox/thema/1

to catalog/includes/classes/thema/blue catalog/images/infobox/thema/blue

and repeat same works for others thema categories.

 

Then we add belows line to application_top.php and firstly we delete

//Site thema configuration

 $configuration_query = tep_db_query("select  configuration_key as themaKey, configuration_value as themaValue from " . TABLE_CONFIGURATION . " where configuration_key = 'SITE_THEMA'");

 $configuration = tep_db_fetch_array($configuration_query);

 define($configuration['themaKey'], $configuration['themaValue']);

 if($configuration['themaKey']==""){

 define(THEMA_STYLE, "stylesheet.css");

 // infobox

 require(DIR_WS_CLASSES . 'boxes.php'); }

 else{

 // Thema_infobox

 require(DIR_WS_CLASSES . 'thema_boxes.php');

 define(THEMA_STYLE, DIR_WS_CLASSES . "thema/" . SITE_THEMA . "/stylesheet.css");

 }

 

First of all we are looking for SITE_THEMA and fetching its value,

$configuration_query = tep_db_query("select  configuration_key as themaKey, configuration_value as themaValue from " . TABLE_CONFIGURATION . " where configuration_key = 'SITE_THEMA'");

$configuration = tep_db_fetch_array($configuration_query);

define($configuration['themaKey'], $configuration['themaValue']);

Then we are checking value

 

if($configuration['themaKey']==""){

 define(THEMA_STYLE, "stylesheet.css");

 // infobox

 require(DIR_WS_CLASSES . 'boxes.php'); }

 else{

 // Thema_infobox

 require(DIR_WS_CLASSES . 'thema_boxes.php');

 define(THEMA_STYLE, DIR_WS_CLASSES . "thema/" . SITE_THEMA . "/stylesheet.css");

Above we are checking the SITE_THEMA by looking

$configuration['themaKey']

if SITE_THEMA is empty it means that you didn't insert

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Site Thema Options', 'SITE_THEMA', '1', 'You can change site thema form here.', '1', '19', 'tep_cfg_select_option(array('1', '2', '3', '4', '5'), ', now());

Then code turn it's oreginal to use stylesheet.css. So if you make wrong Thema installation nothing happen to oreginal OSC. And calling

// infobox

 require(DIR_WS_CLASSES . 'boxes.php');

 define(THEMA_STYLE, "stylesheet.css");  

If you install it correctly, code will use below line.

require(DIR_WS_CLASSES . 'thema_boxes.php');

define(THEMA_STYLE, DIR_WS_CLASSES . "thema/" . SITE_THEMA . "/stylesheet.css");

 

And we made some modification on boxes.php and renamed to thema_boxes.php.

Modifications are;

 

Open catalog/includes/classes/boxes.php and find (line 102)

$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif');

and replace with

$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_left.gif');

find (line 104)

$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif');

and replace with

$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_right_left.gif');

find (line 107)

$right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';

replace with

$right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';

find (line 112)

$right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif');

replace with

$right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_right.gif');

find (line 147)

$info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif')),

replace with

$info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_left.gif')),

find (line 149)

array('params' => 'height="14" class="infoBoxHeading"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif')));

replace with

array('params' => 'height="14" class="infoBoxHeading"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_right_left.gif')));

 

Last step change all

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

line with

<link rel="stylesheet" type="text/css" href="<? echo THEMA_STYLE;?>">

 

Open all files under catalog directory

 

+catalog/account.php

+catalog/account_edit.php

+catalog/account_edit_process.php

+catalog/account_history.php

+catalog/account_history_info.php

+catalog/address_book.php

+catalog/address_book_process.php

+catalog/advanced_search.php

+catalog/advanced_search_result.php

+catalog/checkout_confirmation.php

+catalog/checkout_payment.php

+catalog/checkout_payment_address.php

+catalog/checkout_shipping.php

+catalog/checkout_shipping_address.php

+catalog/checkout_success.php

+catalog/conditions.php

+catalog/contact_us.php

+catalog/create_account.php

+catalog/create_account_process.php

+catalog/create_account_success.php

+catalog/default.php

+catalog/info_shopping_cart.php

+catalog/login.php

+catalog/password_forgotten.php

+catalog/popup_search_help.php

+catalog/privacy.php

+catalog/product_info.php

+catalog/product_notifications.php

+catalog/product_reviews.php

+catalog/product_reviews_info.php

+catalog/product_reviews_write.php

+catalog/products_new.php

+catalog/reviews.php

+catalog/shipping.php

+catalog/shopping_cart.php

+catalog/specials.php

+catalog/stylesheet.css

+catalog/tell_a_friend.php

 

find line

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

replace with

<link rel="stylesheet" type="text/css" href="<? echo THEMA_STYLE;?>">

 

We will update the Thema contribution weekly.So we need your modifcations and special thema addings.

Thank you. [/code]

Link to comment
Share on other sites

If your updating, then you need to add the sylesheet entries for the new checkout system.

 

I'm hoping I'll get time to create a theme or two this weekend. If I do I'll forward them for inclusion.

Trust me, I'm an Accountant.

Link to comment
Share on other sites

I guess I don't get it what is the fuss about different themes. If I'm running an e-commerce shop why whould I want to changes themes on it every so often?

1. Throws the customers off.

2. I don't think it's for real businesses, more like for home pages.

Link to comment
Share on other sites

Dynamok:

I guess I don't get it what is the fuss about different themes. If I'm running an e-commerce shop why whould I want to changes themes on it every so often?

1. Throws the customers off.

2. I don't think it's for real businesses, more like for home pages.

 

MultiServis.Net

For example when

New Year

Valance Days

....

 

And some special weeks or days you want to change site aspect. For example site can change it's aspect when customers birthday.

 

Exactly!

If ou want a succeeding E-Commerce business at this time, then you have to have, as always, and Edge! One that your competitiors look at and think Wow! How did they do that?

 

This also has possibilties for all those that wish to decide upon a look for their store.

If 5 people who are developing the site wish to try all of their ideas then they can chose each one as they please via admin, and see the final result. With the thema contribution from Ferhat, you can change images, colours schemes, designs, boxes, backgrounds etc all very easily.

 

Which means if you are a developer you can allow your customer to try them by entering the admin alone, after you have ftp'ed the new theme.

You dont have to rely on your customer ftp-ing anything themselves.

Or you can sell extra themes to customers at a later date if they decide the site needs a facelift...

 

The opportunities are endless, but you have to look further than just the fact it changes some colours in admin.

 

This could be a fantastic thing for OSC.

 

There will no doubt be Theme creators for OSC, which will help all those that need a certain colour scheme before they get started to have it without the need to go through making their own.

 

I for one will be a person that offers as much as possible in this area.

 

Anyway, I am going on too much now!

I'll shut up. :wink:

 

CC.

 

P.S. Ian, make sure you show us what you got on Monday. hehe.

Link to comment
Share on other sites

I have to agree with CC on this one, if you look at allt hte big name sites now, in the leed upto christmas, all their deisgn and styles have changed, gets people in the mood to spend money...

Instant idiot......Just add mud !!

Link to comment
Share on other sites

I've another suggestion. At the moment the code uses one generic thema_boxes.php

 

If the require for this also used the thema directory, we could have a different box drawing class for each theme. This opens up the possibility of completely changing the look of a box, much more than just changing the corner images and box colours.

Trust me, I'm an Accountant.

Link to comment
Share on other sites

What about looking at some cms systems for inspiration. I have used phpnuke and postnuke in teh past, and they have a seperat directory, where all the themes are stored, including, stylesheets, images, etc.

 

This would make it easier to group all relevant images, code, styles together, and keep them in one place :?:

Instant idiot......Just add mud !!

Link to comment
Share on other sites

Copy /classes/thema_boxes.php to each of the theme directories then simply change the require in application_top.php to

 

require(DIR_WS_CLASSES . "thema/" . SITE_THEMA . '/thema_boxes.php');

 

I haven't got a system to hand, to check this but should be ok.

Trust me, I'm an Accountant.

Link to comment
Share on other sites

Hi,

 

After all the talk about Kenny's theme shop et al I downladed it and used a free sample theme. The structure you are talking about is exactly what Kenny has already done.

 

Each file points to the sperate css held in a theme directory and in this directory si held all the graphics etc for the theme. It is very simply then a case of ftp'ing the new theme into the directory and its live.

 

Going down this road would certainly be a great solution and if Kenny was involved then I am sure he could save development time as he has already done a lot of this.

 

Just my thoughtsbut I think it is fantastic that this much needed project is now starting. If I had more of the relevant skills then I would live to help develop themes.

 

Grumster

Link to comment
Share on other sites

  • 4 weeks later...

Given the work elbavaro is doing on button sets, I thought it would be neat if the 'thema' contribution could also switch button sets when it switched themes.

 

I'm going to play around with this today and I'll let you all know the outcome.

Trust me, I'm an Accountant.

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