close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

how to display only specific categories - warning, old ecart legacy site

Thread began 4/03/2017 4:16 pm by bjp | Last modified 4/04/2017 9:43 am by Ray Borduin | 1218 views | 6 replies |

bjp

how to display only specific categories - warning, old ecart legacy site

old website, original designer no longer available, site has been revamped for appearance but still uses very old ecart code. it still works, so owner has been reluctant to change. while we work on that, would like to modify the existing cart to display categories in separate pages. I think this ought to be easy, but do not know enough to do so. would like to specify category by id and make different pages each showing only selected categories.

here's the code that is still working fine, displays all active categories.

http://www.miltonsbells.com/index-test1.php

and page attached.

Sign in to reply to this post

Ray BorduinWebAssist

It looks like that is controlled in the page:

include/database.php

Can I see a copy of that page?

Sign in to reply to this post
Did this help? Tips are appreciated...

bjp

Sure thing... thanks for looking.

Sign in to reply to this post

Ray BorduinWebAssist

I think the easiest solution is to make a copy of that page for each category that you want. Then update line 19 from:

php:
$rsCats = $database->getCategoriesActive();


to:

php:
$rsCats = mysql_query("SELECT * FROM products_categories WHERE CategoryID = 4", $database->connection);


and then just change the ID to whichever you want displayed on the page.

Sign in to reply to this post
Did this help? Tips are appreciated...

bjp

That was the line I spotted, just didn't know how to modify.

Tried your suggestion, getting an error.

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/miltons0/public_html/index-test2.php on line 576

http://www.miltonsbells.com/index-test2.php

attaching to make sure I didn't do anything dumb.

Sign in to reply to this post

Ray BorduinWebAssist

I probably guessed the CategoryID column name wrong. It might be just id or category_id.

try:
$rsCats = mysql_query("SELECT * FROM products_categories WHERE id = 8", $database->connection);

Sign in to reply to this post
Did this help? Tips are appreciated...

bjp

That did it! Thank you so much!

http://www.miltonsbells.com/index-test2.php

Really appreciate it!

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