close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Changing "product list" text to category name

Thread began 3/21/2010 7:52 am by rmcadams351257 | Last modified 3/25/2010 7:42 pm by Eric Mittman | 1106 views | 6 replies |

rmcadams351257

Changing "product list" text to category name

Hi
I would like to have the category name show up at the top of the page insted of the words "product list".
I have seen how to do this with power store 2, changing Product List<br /> to

<?php if ($totalRows_categories > 0) { // Show if recordset not empty ?><?php echo $row_categories['CategoryName']; ?><br/>
<?php }else{ ?>Product List<br />
<?php } ?>

and making a recordset on the product results page.
But when I try that with Power store 3 it will not work. :(
can anyone help with this ?

Thanks
Ron

Sign in to reply to this post

Jon CunninghamBeta Tester

Same Problem

Hi, I have followed the procedure found under thread showthread.php?t=3699 and I am unable to get this working with Powerstore 3.

Please can anyone shed some light in this.

Kind regards

Jonathon

Sign in to reply to this post

Eric Mittman

This is not a supported feature of PowerStore 3 but if you alter the products query slightly you can get it to display the category of the first item in the recordset by making these changes.

1) on line 84 of Products_Results.php update the code from this:

php:
$WADbSearch1->whereClause .= "ProductID



to this

php:
$WADbSearch1->whereClause .= "ps3_products.ProductID



2) on line 136 update the query to look like this:

php:
$query_WADAProducts = "SELECT * , coalesce((select ps3_productoptions.GroupingID from ps3_productoptions WHERE ps3_productoptions.ProductID = ps3_products.ProductID limit 1),ps3_products.ProductID) AS GroupingID FROM ps3_products JOIN ps3_productcategories ON ps3_products.ProductID = ps3_productcategories.ProductID JOIN ps3_categories ON ps3_productcategories.CategoryID = ps3_categories.CategoryID WHERE ProductLive = 1 GROUP BY GroupingID ORDER BY ProductName";



3) you can then display the category name with this php code near line 426

php:
<?php echo $row_WADAProducts["CategoryName"]; ?>



Keep in mind though that this will only display the category for the first item in the recordset, and this will only display if there are items returned from the recordset. So if you do a search for a particular category it will work just fine, but if you view the results without any filtering then then you will see the category for the first item in the list.

It might be a better idea to make these changes then display the category name inside of the item display next to it's name.

Sign in to reply to this post

rmcadams351257

Not sure?

Thanks Eric

I think I understand what you mean by "will only display the category for the first item in the recordset"......Well maybe I don't.

What I was trying to do was, if you clicked let's say Shoes in the left menu then the products results page whould display Shoe at the top of the page somewhere. This maybe what you're trying to explane to me, but I'm not sure. I know this is a short coming on my part. You have helped me before and did a grate job. Is there a way to have the category show up at the top of the products results page. It is fairly straight forward in Power store 2. So I thought it whould be close to the same in Power store3.

Again please excuse me for being a newbe PHP,Databases & the like.
Ron

Sign in to reply to this post

Eric Mittman

If you make the changes to your pages and click on the shoes from the left menu you would see shoes at the top of the listing.

What I really meant by saying it will only display the category for the first item is that if you do a search or view all of the items and there are more than one category of item listed it will display the category for the first item, if any of the other items belong to a different category this could be confusing.

The only way that I could think of to get around this would be to do a check of the categories in the recordset by looping over them and seeing if any of them differ. If they are all the same then display the category, or else display an alternate message.

Sign in to reply to this post

rmcadams351257

I got it now

Hi: Eric

That answered my question. (very good explation) I now see what you where saying.
Your the best. I will try that and see if with my products it gets to confusing. A lot of them are closely related so it might not be to bad. If it is i'll just change it back. You guys at WebAssist always seem to come through. :)


Thanks
Ron

P.S. maybe something like this in Powerstore3 update or Powerstore4

Sign in to reply to this post

Eric Mittman

I think this is an excellent feature request, I have logged it for PowerStore.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...