Forums / Templates, Stylesheets, Page Layout / Adding custom field from specials table to product listing and product info

Adding custom field from specials table to product listing and product info

Locked

Started by davale on 9 Oct 2007, 9:58 AM · Views: 4,668

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
9 Oct 2007, 9:58 AM
#1
davale avatar

davale

Zen Follower

Join Date:
Apr 2006
Posts:
117
Plugin Contributions:
0

Adding custom field from specials table to product listing and product info

Is there a MySQL wizard out there willing to help me out with the following?

I added a custom field (specials_add_text) to the specials table and succeeded in editing the admin part to insert text in this field like 'Now with free blabla'. The blabla not being an actual product defined within ZC.
Edited the specials page by adding the field to the layout and it's displaying.

But adding this field to the product listing and product info pages is another thing. Since the specials page already does a call to the right table it was relatively simple to add another field but the product listing and product info pages probably need some more code the point them to the right table to add the field.

I would like to add this additional text just below the product description taking into account the start and end date applied to the special itself. So if it is a special and active display the special_add_text-field, if not don't display or insert a line break.
My own attempts to accomplish this have only led to PHP-errors on the pages so I turn to you for some help with this.

Another option I've explored is editing the functions_prices file to display the additional text just below or above the specials price within the price block also resulting in errors on the pages.

Could someone please tell me how I can do this? I'm not much of a coder myself but willing to learn.

11 Oct 2007, 10:23 AM
#2
davale avatar

davale

Zen Follower

Join Date:
Apr 2006
Posts:
117
Plugin Contributions:
0

Re: Adding custom field from specials table to product listing and product info

Anyone? Maybe point me to a file I can borrow from?

19 Oct 2007, 5:19 AM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding custom field from specials table to product listing and product info

Have the Tools ... Developers Tool Kit help you along ... :smile:

If you were to search for:
specials_new_products_price

You will find this field in the 3 filter files such as:
/includes/index_filters/default_filter.php

Searching that file, you would find the multiple SELECT statements that are built and can follow the bouncing ball to locate where to place your new field ...

For the search results:
/includes/modules/pages/advanced_search_result/header_php.php

there is some commented code that might clue you in on adding the LEFT join to the existing SELECT statements ...

Or you can make a function to look up the field and display as needed ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!