Zen Cart Logo
Forums / General Questions / Add data field to product listing

Add data field to product listing

Locked

Views: 728

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
27 Aug 2009, 8:01 AM
#1
fuzzball172 avatar

fuzzball172

New Zenner

Join Date:
May 2007
Posts:
30
Plugin Contributions:
0

Add data field to product listing

My customer wants to add a view video button for each product on the product listing screen, in addition to the product image and description.
I'm quite happy programming in PHP so just need a few pointers as to where I need to look.

The idea is that just below the buy now button, there will be a view video button that will use javascript to popup a new window and play the video. I have the button code in place and that works fine, but I need to pull the location of the video from the database. As the customer is never going to use the product URL that data field seems the obvious choice to store the location of the video file.
I'm guessing that the /includes/index_filters/default_filter.php is where the query is set up to pull data from the database, so adding pd.products_url to the end of the query will work ok.

What I need to know is where do I need to look to modify the code that parses the SQL query results into either variables or an array so that $products_url will be available to me in product_listing.php

I know that adding the button to the product info page, within the product description would be the easy option, but the customer thinks that this solution will work better and as he's paying the bills who am I to object.

Thanks in advance

27 Aug 2009, 2:16 PM
#2
fuzzball172 avatar

fuzzball172

New Zenner

Join Date:
May 2007
Posts:
30
Plugin Contributions:
0

Re: Add data field to product listing

I found that I added pd.products_url to the wrong SQL query. once it was in the right query, then the variable was available on the product_listing.php page.

Well I added it to all the queries to be honest, once I fine tune the code, I'll work out which of the queries it actually needs to be in and post it here in case anyone else needs to know how to do it.