close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

MRT Server Behaviour with eCommerce db

Thread began 4/20/2010 1:27 pm by troyd | Last modified 4/27/2010 11:42 am by troyd | 1858 views | 4 replies |

troyd

MRT Server Behaviour with eCommerce db

I am building an admin for a future shopping cart. And it will contain products that will show up on more than one section.
Since the eCommerce database comes with a "productcategories" table I am using that for the main category. However there will be sub categories for each as well. I need this to be searchable.

Here's a fictional example of what I am trying to do;

Product #1 is a "Hammer"
Main Category would be "Tools"
Sub Categories would be "Hobby Tools" and "Professional Tools"

What I have so far is a drop down list in the insert form for the Categories that are populated by the "productcategories" table. This part works great.

Then I have a multi-select list for my Sub Categories. To which I then created two new tables. One is the "SubCategories" table and the second is the RelSubCategories" table that acts as the relational table for the MRT behavior.
The MRT writes the data into the new relational table including the ID from the "SubCategories" table and the ID from the "products" table just fine.

But how do I get the recordset for the products to include both tables for both a results list and a search form? Do I create a joins for this?
Or should the MRT be writing into a new column on the "products" table as well?

I'm very confused, so sorry if this made no sense.

For the record, I am trying to create something similar to the "Blue Sky Music" admin demo where it has both category and genre. But I wanted to use the newer eCommerce database instead since it seems to be ready for eCart.

Thanks,
TroyD

Sign in to reply to this post

troyd

By the way. This is the LEFT JOIN I am using to get all the data into a results page, repeating region and search. This seems to be working but I'm not sure it's the proper way.

SELECT *
FROM products
LEFT JOIN productcategories ON products.ProductCategoryID=productcategories.CategoryID
LEFT JOIN RelSubCategories ON products.ProductID=RelSubCategories.ProdSubProdID
ORDER BY products.ProductName


This joins the main "products" table, the "productscategories" table and the "RelSubCategories" table.

Basically it selects everything from the products table and then joins the CategoryName column in the productscategories table to the ProductCategoryID column in the products table in the first part. And the ProductID to the SubCategories in the the second part.
Is this at all correct?

In the case of the Sub Categories, there may be more than one for each record. So I still need to figure out how to display that. Right now it just shows two of the same record (If two subs are assigned) in the repeat region with the Sub Category ID being the only difference between the two.

One last questions. For the Update and Delete for this type of setup. Do I add a second delete behavior to remove the data for the relational table at the same time the deleted record is removed from the first table?

Thanks,
TroyD

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
login.php

Sign in to reply to this post

troyd

Jason,

Thanks. I was gone all day. I have made progress on this but I still have a couple of small issues.
Tomorrow I will update the ticket with my current status and provide contact information.

Thanks,
TroyD

Sign in to reply to this post

troyd

I thought I had things figured out, but then it all fell apart on me when I went to add a dynamic menu. No fault to any of the extensions. Just my misunderstanding of what I should have created in the beginning.

I will simplify my needs here and then add in details if something is missing. I know that part of this could be posted in the CSS Menu Writer forum, but I wanted to update this post as well. And it includes issues of tables, relational tables and JOINS.

Here are my tables as they relate to my current attempts.


#1 "tblProducts" table with ProductID, ProductName, Description, Price, Image, ProductCategoryID columns.

#2 "tblProductCategories" table with ProductCategoryID, ProductCategoryName columns.

#3 "tblSubCategories" table with SubCategoryID, SubCategoryName columns

#4 "rtblSub_Products" relational table with SubProdTableID, Parent_ProductID, Parent_SubCategoryID columns


These are my needs for these 4 tables.

(PAGE 1)-Public Products "Results" page with Dynamic Menu.

This menu will show the main categories and then the sub categories under each. With many of them repeating in use. And I will be using CSS Menu Writer for this so that the menu will be updated dynamically if the client adds a new sub category.
The links for the Categories will be "#" but the links for the Sub Categories will be something like

products.php?category=[ProductCategoryID]&subcategory=[SubCategoryID]
which will then filter the results by using a search behavior, I assume.

For example:

  • DOG

    • FOOD
    • TOYS
    • BOWLS
    • BEDDING



  • CAT

    • FOOD
    • TOYS
    • BOWLS
    • BEDDING



  • BIRD

    • FOOD
    • TOYS
    • BOWLS



  • RODENT

    • FOOD
    • TOYS
    • BOWLS
    • BEDDING



(PAGES 2-5)-All the Admin pages for Inserting, Deleting, Updating, Results w/ Search

The search on the Admin page will be Dropdowns where you can search for all "Food" or just "Food" for "Cats". OR all products for "Cats".

I have created JOINs that work for the results but then they don't work for the menus. Should I create a 5th table that relates the Categories with the Sub Categories? Or should I just have one table that includes both and give the Categories a Parent_ID of "0" as I have seen mentioned before?
I was thinking that because I will have Sub Categories repeated under different Categories, that this method won't work.

Relational Tables have to be the hardest thing I have ever tried to learn. I have read books, studied the example databases and drawn lots of diagrams. I know it's going to all pay off, but it's still confusing. For me, video tutorials work the best. Are their any good ones out there? I'll pay for them.

Thanks,
TroyD

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