Kryptronic Software Support Forum

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.

#1 08-02-2004 11:38:09

zharl
Member
Registered: 07-25-2004
Posts: 12

Urgent Help Needed On Categories

No matter how i try, I cant get it to work. Is it possible at all for different categories to have completely different designs?

Right now one template ste_cat is used for all cats and subcats.

I really dont wish to hard code to categories pages to achieve the look and feel that I need. I really appreciate any input!

Zharl  :-( 

Offline

 

#2 08-02-2004 11:41:52

EagleWolf
Member
From: Daytona Beach, FL
Registered: 07-27-2003
Posts: 979

Re: Urgent Help Needed On Categories

No, there is only one file which controls the look of the entire store. I think V6 will have that ability.


Chris
<a href='mailto:webmaster@equivity.com'>webmaster@equivity.com</a>
-

Offline

 

#3 08-02-2004 14:37:42

zharl
Member
Registered: 07-25-2004
Posts: 12

Re: Urgent Help Needed On Categories

Thanks very much for clearing that up for me. I was so hopeful! I used frames as a short term measure. Let's hope 6 is good and robust. I still find the scripts a tad slow. even with mySQL and statistics minimised.

smile

Offline

 

#4 08-02-2004 14:41:01

EagleWolf
Member
From: Daytona Beach, FL
Registered: 07-27-2003
Posts: 979

Re: Urgent Help Needed On Categories

If your cart is slow then you need to consider that it is your hosting company, and how they might or might not have optimized mysql. Also your ISP.


Chris
<a href='mailto:webmaster@equivity.com'>webmaster@equivity.com</a>
-

Offline

 

#5 08-02-2004 16:18:39

prescott
Member
Registered: 03-26-2004
Posts: 94

Re: Urgent Help Needed On Categories

No, there is only one file which controls the look of the entire store. I think V6 will have that ability.

Yes, but you can add more layout pages -- I currently have 4 different layouts, depending on what page type you are on. One for the home page, category page, checkout, etc.

You can add on to the bit of code in ste_exec.pl., like this:

Code:

#########
######### Display the site layout.  This is done for both regular
######### pages and forms.
#########

$element_id = "$page_id";

if ($page_id =~ /^ste_nolay_/) {

&display_print($page_id);

} elsif ($fd_pg =~ /checkout/) {

&display_print('ste_chkout_layout');

} elsif ($fd_pg =~ /storepolicies/) {

&display_print('ste_layout');

} elsif ($fd_pg =~ /store/) {

&display_print('ste_store_layout');

} else {

&display_print('ste_layout');

} ######### End of if statement.

I wonder if it would work if you replace "$fd_pg" with "$fd_ref" and put the category id in there -- i.e., "elsif ($fd_ref =~ /books/)".  I don't have time to test this, but you might give it a whirl.


My little attempt with CCP:

Offline

 

#6 08-04-2004 14:47:55

zharl
Member
Registered: 07-25-2004
Posts: 12

Re: Urgent Help Needed On Categories

You know what? You ARE ABSOLUTELY brilliant. I am playing around more with it. Will post any new findings or limitations. So far everything is perfect.

Zharl 

Offline

 

#7 08-04-2004 16:09:01

prescott
Member
Registered: 03-26-2004
Posts: 94

Re: Urgent Help Needed On Categories

zharl,08/04/2004 02:47:55 PM wrote:

You know what? You ARE ABSOLUTELY brilliant. I am playing around more with it. Will post any new findings or limitations. So far everything is perfect.

Zharl

Aw, shucks. I've gotten a lot of great tips from this forum, so I try to give back with the limited ability I have. And Nick actually is the one that spelled out the different layout for different pages, I just extrapolated a bit -- don't want to take any unwarranted credit, LOL!

I do see one limitation to the above solution, however -- the if statement would look for a category containing that string. So "$fd_ref =~ /books/" would cover "books" and "comicbooks".  For pages, this was done because sometimes the pages are listed as "ste_prod", sometimes as "prod". I think with categories you could get away with changing the statement to $fd_ref = "books", if you run into any problems.


My little attempt with CCP:

Offline

 

#8 08-30-2005 05:24:20

sleeper
Member
Registered: 10-29-2004
Posts: 332

Re: Urgent Help Needed On Categories

Great litle mod...

Im wondering though..

Lets say that we have a different colured template for each category - "category a" is pink and "category b" is red.
If viewing "category a" it will use the "category a" template, however, when you then click on a product "item detail" it will then revert back to the default template colour.

How can it be set up so that if a user is viewing a product from "category a", it displays the "category a" template and not the default template ?


- Steve


Specialists in ClickCartPro Design

Offline

 

#9 08-30-2005 11:40:57

funkyx
Member
Registered: 08-12-2005
Posts: 18

Re: Urgent Help Needed On Categories

I have exactly the same questions and think it is a very good one and I can't wait for a reply. I have played with so many different settings but to no avail.

I have found one  in which  and  touch upon how to do it but I can't get scoutch's way to work with catagories and products.

My current ste_exec.pl entry look like this;

Code:

#########
######### Display the site layout. This is done for both regular
######### pages and forms.
#########

$element_id = "$page_id";

if ($page_id =~ /^ste_nolay_/) {

&display_print($page_id);

} else {

if ($fd_ref eq "MobilePhones") {

$my_layout = "2";

} elsif ($fd_ref eq "3g Phones") {

$my_layout = "2";

} elsif ($fd_ref eq "ServicePlans") {

$my_layout = "2";

} elsif ($fd_ref eq "TalkText") {

$my_layout = "2";

} elsif ($fd_ref eq "VideoTalk") {

$my_layout = "2";

} elsif ($fd_ref eq "Accessories") {

$my_layout = "3";

} elsif ($fd_ref eq "Software") {

$my_layout = "4";

} elsif ($fd_pg eq "ste_cart") {

$my_layout = "5";

} elsif ($fd_pg eq "ste_privacy") {

$my_layout = "1";

} elsif ($fd_pg eq "ste_contact") {

$my_layout = "1";

} else {

$my_layout = "1";

}

if ($my_layout eq "2") {

&display_print('ste_layout2');

} elsif ($my_layout eq "3") {

&display_print('ste_layout3');

} elsif ($my_layout eq "4") {

&display_print('ste_layout4');

} elsif ($my_layout eq "5") {

&display_print('ste_layout5');

} elsif ($my_layout eq "1") {

&display_print('ste_layout1');

} else {

&display_print('ste_layout');

}

} ######### End of if statement.

I am using 5 different layout files depending on the catogory and this works fine with each catagory changing based on the layout. What I am hoping for is to have the products in those catagories to use the same layout as the catagory. Is this possible?

scoutch suggests in his post to add this piece of code as well to make it work for products but I have tried it and can't seem to get it to work.


Althought, here's what you forgot to mention. For people who'd like to use different skins for their categories and products, here's what you must add as well :

if ($fd_pg eq "ste_prod") {

$my_layout = "2";

} elsif ($fd+pg = "ste_cat") {

$my_layout = "2";

} ######## End of if statement.

if ($my_layout eq "2") {

&display_print('ste_layout2');

Can anyone suggest how this last piece of code would fit in with my code on top.


It is harsh to come this far and not be able to make it work. Any help from anyone would be greatly appreciated.

P.S. I am not a PERL programmer. Please be kind.

Offline

 

#10 08-31-2005 04:26:23

funkyx
Member
Registered: 08-12-2005
Posts: 18

Re: Urgent Help Needed On Categories

Anyone want to have a stab at this? 

Offline

 

#11 09-01-2005 05:16:10

funkyx
Member
Registered: 08-12-2005
Posts: 18

Re: Urgent Help Needed On Categories

Sorry to bump this again but I would really like some help on this. Anyone care to have a look?

Offline

 

#12 09-13-2005 10:55:28

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Urgent Help Needed On Categories

Above:

Code:


$element_id = "$page_id";

Add:

Code:


if ($fd_ref eq "") {$fd_ref = $q->param('ref');}

Also, you may want to change your if/else statements to include:

Code:


if ($fd_pg eq "SOMEPAGE" && $fd_ref eq "SOMEREF") {


Nick Hendler

Offline

 

#13 09-14-2005 02:27:44

sleeper
Member
Registered: 10-29-2004
Posts: 332

Re: Urgent Help Needed On Categories

Hi Nick,

Thank's for that..

I'll give this a go on our development site and post a link so you can see it in action.

Im quite excited about this one..


- Steve


Specialists in ClickCartPro Design

Offline

 

#14 11-10-2005 10:16:02

sleeper
Member
Registered: 10-29-2004
Posts: 332

Re: Urgent Help Needed On Categories

Nick,

I can't for the life of me get this to work...

Just so i know we are on the same track, what i need it to do is use a different layout for a selected group of categories and items displayed within that category.
Any 'Item Detail' Displays within the selected group should also use the second layout.

I have tried all of the suggestions here and cannot get this to work. Here's what i have so far..

Code:

if ($fd_ref eq "") {$fd_ref = $q->param('ref');}

$element_id = "$page_id";

if ($page_id =~ /^ste_nolay_/) {

&display_print($page_id);

} elsif ($fd_ref eq "SOMECAT") {

&display_print('ste_elec_layout');

} elsif ($fd_ref eq "SOMECAT") {

&display_print('ste_elec_layout');

} elsif ($fd_ref eq "SOMECAT") {

&display_print('ste_elec_layout');

} elsif ($fd_ref eq "SOMECAT") {

&display_print('ste_elec_layout');

} elsif ($fd_ref eq "SOMECAT") {

&display_print('ste_elec_layout');

} else {

&display_print('ste_layout');

} ######### End of if statement.

Now what happens is that all the categories specified in the list all use the new layout. But once we click into the item detail of any item within the specified categories it reverts back to the stock layout.

Any ideas before i pull  my hair out..


- Steve


Specialists in ClickCartPro Design

Offline

 

#15 11-10-2005 11:10:49

dtwg
Member
From: California
Registered: 11-15-2004
Posts: 1339
Website

Re: Urgent Help Needed On Categories

If your categories are only one-level (no sub-categories) then this might work. (It should still work for sub-cats, but you'd have to test for them all).

Not fully tested, so beat on it before using. SOMECAT would of course be the category reference string (category_id).

HTH,

Dave

Code:

if ($fd_ref eq "") {
$fd_ref = $q->param('ref');
}

if ($fd_cat eq "") {
$fd_cat = $q->param('cat');
}

$element_id = "$page_id";

if ($page_id =~ /^ste_nolay_/) {

&display_print($page_id);

} elsif (($fd_pg eq "ste_cat" && $fd_ref eq "SOMECAT") || ($fd_pg eq "ste_prod" && $fd_cat eq "SOMECAT")) {
     
&display_print('ste_layout2');

} else {

&display_print('ste_layout');

}

Offline

 

#16 11-10-2005 13:11:26

dtwg
Member
From: California
Registered: 11-15-2004
Posts: 1339
Website

Re: Urgent Help Needed On Categories

I have further modified the above so that it works for Product Detail Pages that were entered from the Search Results. With search results the products returned could be from any category, so it would be impossible to pick a layout based on that here. Unfortunately, when you then select a product in the search results, since you are not entering out of a category page, the system does not already know what category that product is in. So I just did a quick and dirty database lookup. Seems to work, but you know my standard disclaimer -- use at own risk and test it until you are satisfied it works properly for you...

Dave

Code:

if ($fd_ref eq "") {
$fd_ref = $q->param('ref');
}

if ($fd_cat eq "") {
$fd_cat = $q->param('cat');

if (($fd_cat eq "") && (fd_ref ne "") && ($fd_pg eq "ste_prod")) {  ##### Begin Category Database Lookup

$dbins_product_id = database_quote('product',$fd_ref);

$sql_statement = "

SELECT product_xcat
FROM product WHERE product_id = $dbins_product_id

";

@product_cats = database_call('product','SELECT',$sql_statement);

foreach $row(@product_cats) {

($fd_cat) = @$row;  # Just get the first cat if more than one

}

} ##### End Category Database Lookup

}

$element_id = "$page_id";

if ($page_id =~ /^ste_nolay_/) {

&display_print($page_id);

} elsif (($fd_pg eq "ste_cat" && $fd_ref eq "MONITOR") || ($fd_pg eq "ste_prod" && $fd_cat eq "MONITOR")) {
     
&display_print('ste_layout2');

} else {

&display_print('ste_layout');

}

Offline

 

#17 11-11-2005 04:25:08

sleeper
Member
Registered: 10-29-2004
Posts: 332

Re: Urgent Help Needed On Categories

Hi Dave,

Unfortunately this does not work, we get script execution errors. Here's details of the error message and error log..

Code:

Script Execution Error
The following error was just encountered:

Search pattern not terminated at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 760.

and the error log for that page request..in all it's entirety..

Code:

[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 760, near "print ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 758, near "" && $html_page_justification eq "CENTER"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 758, near "2" && $html_page_justification eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Number found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 758, near "} elsif ($location eq "2"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 758, near "} elsif ($location eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 756, near "print ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 754, near "" && $html_page_justification eq "CENTER"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 754, near "1" && $html_page_justification eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Number found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 754, near "if ($location eq "1"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 754, near "if ($location eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 725, near "if ($store_use_order_tracking eq "Y"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 725, near "if ($store_use_order_tracking eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Scalar found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 701, near "" && (-e "$server_media_path"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 701, near "Y" && (-e ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 701, near "if ($page_usetitleimg eq "Y"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 701, near "if ($page_usetitleimg eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Scalar found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 674, near "$banner_ad_image = "$banner_image"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 674, near "$banner_ad_image = ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Scalar found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 673, near "$banner_ad_url = "$banner_url"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 673, near "$banner_ad_url = ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Scalar found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 671, near "" && (-e "$server_media_path"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 671, near "$banner_ad_count" && (-e ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Scalar found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 671, near "if ($retval eq "$banner_ad_count"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 671, near "if ($retval eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Number found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 663, near "$banner_ad_count = "0"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 663, near "$banner_ad_count = ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Scalar found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 659, near "$retval = "$banner_ad_count"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 659, near "$retval = ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Number found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 657, near "if ($retval eq "0"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 657, near "if ($retval eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 655, near ".0f"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 655, near "my $retval = sprintf(""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Semicolon seems to be missing at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 637.
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 636, near "$sql_statement = ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Scalar found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 630, near "" && $location eq "$site_banner_ad_location"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 630, near "Y" && $location eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 630, near "if ($site_banner_ad_use eq "Y"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 630, near "if ($site_banner_ad_use eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Number found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 628, near "my $banner_ad_count = "0"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 628, near "my $banner_ad_count = ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 627, near "my $row = ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Scalar found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 598, near "" && (-e "$server_media_path"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 598, near "Y" && (-e ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 598, near "if ($html_site_bground_image_use eq "Y"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 598, near "if ($html_site_bground_image_use eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 566, near "if ($fd_pg eq "ste_form"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 566, near "if ($fd_pg eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 521, near "" && $fd_cat eq "outdoor"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 521, near "ste_prod" && $fd_cat eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 521, near "") || ($fd_pg eq "ste_prod"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 521, near "outdoor") || ($fd_pg eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 521, near "" && $fd_ref eq "outdoor"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 521, near "ste_cat" && $fd_ref eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 521, near "} elsif (($fd_pg eq "ste_cat"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 521, near "} elsif (($fd_pg eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 517, near "" && $fd_cat eq "fitness"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 517, near "ste_prod" && $fd_cat eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 517, near "") || ($fd_pg eq "ste_prod"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 517, near "fitness") || ($fd_pg eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 517, near "" && $fd_ref eq "fitness"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 517, near "ste_cat" && $fd_ref eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 517, near "} elsif (($fd_pg eq "ste_cat"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 517, near "} elsif (($fd_pg eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 513, near "" && $fd_cat eq "personalcdmp3"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 513, near "ste_prod" && $fd_cat eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 513, near "") || ($fd_pg eq "ste_prod"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 513, near "personalcdmp3") || ($fd_pg eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 513, near "" && $fd_ref eq "personalcdmp3"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 513, near "ste_cat" && $fd_ref eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 513, near "} elsif (($fd_pg eq "ste_cat"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 513, near "} elsif (($fd_pg eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 509, near "" && $fd_cat eq "lcdplasmascreens"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 509, near "ste_prod" && $fd_cat eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 509, near "") || ($fd_pg eq "ste_prod"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 509, near "lcdplasmascreens") || ($fd_pg eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 509, near "" && $fd_ref eq "lcdplasmascreens"
[Fri Nov 11 09:02:12 2005] cp-app.cgi: String found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 509, near "ste_cat" && $fd_ref eq ""
[Fri Nov 11 09:02:12 2005] cp-app.cgi: Bareword found where operator expected at /home/dejason/public_html/store/cgi-bin/library/modules/ste_exec.pl line 509, near "} elsif (($fd_pg eq "ste_cat"

Does that make any sense to you Dave !?


- Steve


Specialists in ClickCartPro Design

Offline

 

#18 11-11-2005 07:39:27

dtwg
Member
From: California
Registered: 11-15-2004
Posts: 1339
Website

Re: Urgent Help Needed On Categories

I'm running the mod on my test site (exactly as posted -- I double checked) and it is working great. PM me if you'd like to see for yourself. Unfortunately, the errors you see are often not helpful in determining exactly what the problem is. I suspect that something got messed up when you copied my code into your ste_exec.pl

If you can, start with a clean ste_exec.pl file and then make sure that you only replace the following section of code with the code I posted:

Code:

$element_id = "$page_id";

if ($page_id =~ /^ste_nolay_/) {

&display_print($page_id);

} else {

&display_print('ste_layout');

} ######### End of if statement.

Don't know what else to say. Maybe try the previous version without the database call and see if that works...

Dave

Offline

 

#19 11-11-2005 08:12:20

sleeper
Member
Registered: 10-29-2004
Posts: 332

Re: Urgent Help Needed On Categories

Thanks Dave,

After some testing and crawling through the code we found we had missed a ' ' from the end of one of the category reference names and it's now fixed.

Your mod works brilliantly Dave - thanks.

I wonder...can this same method be applied to the store head images also.
i.e. if the user is viewing any one of the specified categories or product detail within the specified categories it displays the alternative store head images also; 'head_cat.gif', 'head_catprod.gif' etc. etc.

Any guidance greatly appreciated Dave..

Dave to the rescue....again...


- Steve


Specialists in ClickCartPro Design

Offline

 

#20 11-11-2005 08:52:22

dtwg
Member
From: California
Registered: 11-15-2004
Posts: 1339
Website

Re: Urgent Help Needed On Categories

...can this same method be applied to the store head images also.

Hmm. I can see why you would want this. I'm honestly not sure how big of a project this would be. It seems like it should be fairly simple, but sometimes you never know.

Rather than hard-coding it all into ste_prod.pl and ste_cat.pl, maybe you could add a custom column or two to the category table with the appropriate custom heading element names, and then add code to pull the appropriate head elements based on the category? Otherwise, every time you change something, you have to go in and mess with code (with the inherent risk of breaking something every time you touch it). You might be able to incorporate a similar mod into ste_exec.pl as well and define the layout element in a custom column in the product db. A little more admin work when entering products and categories, I guess, but seems like a better solution.

Just my "off the top of my head" thoughts...

Dave

ps: Glad you got the mod working. Debugging can be frustrating!

Offline

 

#21 11-11-2005 11:03:45

sleeper
Member
Registered: 10-29-2004
Posts: 332

Re: Urgent Help Needed On Categories

I agree, this mod is a lot bigger than it first seems. In it's simplest form as suggested by Prescot it's simple and works really well with some page displays (new, bestsellers, specials) but i think we (when i say 'we' i mean 'Dave') have reached the limits of this category specific incarnation without completely re-writing the category and product display routines.

Perhaps something that can be incorporated into v6.0 ?!


- Steve


Specialists in ClickCartPro Design

Offline

 

#22 03-23-2006 20:21:38

carasmo
Member
From: Florida
Registered: 10-07-2002
Posts: 147
Website

Re: Urgent Help Needed On Categories

How much would someone charge to add this to my script?

Then I assume, I'd add in the category id.

I want a different layout for each category, whether or not it's the same on the search results is not that big of a deal, that can use the main ste_layout.txt

Thanks!

Offline

 

#23 03-24-2006 00:14:40

carasmo
Member
From: Florida
Registered: 10-07-2002
Posts: 147
Website

Re: Urgent Help Needed On Categories

Never mind. It's working great!!!!!!!!!!!!!!!! smile 

Offline

 

#24 10-31-2006 20:51:52

Laits
Member
From: Winchester, United Kingdom
Registered: 06-17-2005
Posts: 41

Re: Urgent Help Needed On Categories

Hello Dave,

I have a slight problem in the fact that if a product has 2 categories assigned to it, I can't get my custom layout to work with product_detail.

I can understand that it may confuse things by having both categories, but let me explain what i'm trying to do.

I have four main categories Men, Woman, Baby and Home, all with their own layout. ( i've done this to provide easier navigation of each category)

Under Home, I have a menu in the layout navigating to  Cushions, Throws, Blankets etc, each a category.

There is a collection called 'evoke' of which there is a cushion, throw, blanket etc, so i guessed i'd have a category called evoke and add it as a secondary category to each item in the evoke range.

Soon as i put evoke into the prod_xcat the my 'ste_home_layout' disappears from that product.

Does this make sense?

I'm wondering if this portion of code has anything to do with it:

@product_cats = database_call('product','SELECT',$sql_statement);

foreach $row(@product_cats) {

($fd_cat) = @$row;  # Just get the first cat if more than one

Any help would be really appricieated

Rich

Offline

 

#25 11-06-2006 08:36:01

sleeper
Member
Registered: 10-29-2004
Posts: 332

Re: Urgent Help Needed On Categories

dtwg wrote:

I have further modified the above so that it works for Product Detail Pages that were entered from the Search Results. With search results the products returned could be from any category, so it would be impossible to pick a layout based on that here. Unfortunately, when you then select a product in the search results, since you are not entering out of a category page, the system does not already know what category that product is in. So I just did a quick and dirty database lookup. Seems to work, but you know my standard disclaimer -- use at own risk and test it until you are satisfied it works properly for you...

Dave

Code:

if ($fd_ref eq "") {
$fd_ref = $q->param('ref');
}

if ($fd_cat eq "") {
$fd_cat = $q->param('cat');

if (($fd_cat eq "") && (fd_ref ne "") && ($fd_pg eq "ste_prod")) {  ##### Begin Category Database Lookup

$dbins_product_id = database_quote('product',$fd_ref);

$sql_statement = "

SELECT product_xcat
FROM product WHERE product_id = $dbins_product_id

";

@product_cats = database_call('product','SELECT',$sql_statement);

foreach $row(@product_cats) {

($fd_cat) = @$row;  # Just get the first cat if more than one

}

} ##### End Category Database Lookup

}

$element_id = "$page_id";

if ($page_id =~ /^ste_nolay_/) {

&display_print($page_id);

} elsif (($fd_pg eq "ste_cat" && $fd_ref eq "MONITOR") || ($fd_pg eq "ste_prod" && $fd_cat eq "MONITOR")) {
     
&display_print('ste_layout2');

} else {

&display_print('ste_layout');

}

Hey Batman,

It's been a while since we have discussed this mod, but implementing it now, and i've come across a minor flaw, but one im wondering if you have a way of fixing?

The mod works really well...not only can you have different layout files from search results, but because it searches the database it works from splash page and related products click through's also...fantastic.
However if you assign more than once category to the product it breaks down, as in the database search no longer works (although the rest of the mod works once you have a reference name in the url).

The categories in question are both exclusive to the product (I.e. this category does not share two different layout files, they both use the same layout file)

Any ideas big guy ?


- Steve


Specialists in ClickCartPro Design

Offline

 

Board footer