Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2006
    Posts
    121
    Plugin Contributions
    0

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

  2. #2
    Join Date
    Apr 2006
    Posts
    121
    Plugin Contributions
    0

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

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

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

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

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

    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: v1.5.5]
    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!

 

 

Similar Threads

  1. v151 Showing custom Specials Price on product listing
    By jimmie in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 30 Jul 2015, 09:25 PM
  2. Replies: 16
    Last Post: 13 Jan 2013, 06:10 PM
  3. Adding a custom field to a product
    By icywindow in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 9 Nov 2009, 01:53 AM
  4. Adding Additional Attributes to Product Listing from Custom Product Type
    By Bigman in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 12 Aug 2008, 04:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR