Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006
    Posts
    89
    Plugin Contributions
    0

    Default Custom fields - product specific

    Hi all,
    I've been attempting to come up with a good solution for a wee problem. Basically I need to create a membership form which is a product. This would be a simple task using attributes under normal circumstances but what I would like is to include a custom page with a bunch of text fields hard coded (and layed out), which is no problem using something like if(products_id == 1) inlude this template, reason being is that there are about 200 fields that need to be included.

    Layout would be a real problem with attributes and there are already several hundred options entered into attributes. I don't want to confuse the issue by adding another 200 options.

    My problem seems to be in the gathering of values for these custom fields. I have studied at length how attributes achieve this but I don't seem to be able to duplicate it. At what point are attribute values entered into the database? It seems they appear as soon as the buy now button is clicked as shopping_cart/header_php.php seems to grab all the selected/entered attribute values from a select statement and not $_POST or $_REQUEST.

    Anyone got any ideas? My brain hurts.
    TIA

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Custom fields - product specific

    Quote Originally Posted by slobadog View Post
    At what point are attribute values entered into the database? It seems they appear as soon as the buy now button is clicked
    That is correct.
    The extra_cart_actions folder may contain additional cart-action scripts, which are followed by the main_cart_actions.php scripts. These are essentially "drivers" to trigger the appropriate elements in the shopping_cart.php class.
    You could write your own extra_cart_actions script to do some sort of pre-processing, or you could extend the shopping cart class to do additional processing when it adds selected attributes to the products in the cart.

    Quote Originally Posted by slobadog View Post
    shopping_cart/header_php.php seems to grab all the selected/entered attribute values from a select statement and not $_POST or $_REQUEST
    The main_cart_actions.php and extra_cart_actions scripts read the $_POST data after it's been sanitized, and act accordingly. Once the submitted data is processed, then the shopping cart page is displayed (or customer is returned to another page, depending on admin settings on add-to-cart activities). The shopping_cart/header_php.php is only called when the shopping cart page is to be displayed, and only after all the add-to-cart or update-cart actions are completed.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2006
    Posts
    89
    Plugin Contributions
    0

    Default Re: Custom fields - product specific

    Thankyou Sensei, that's the direction I needed. I reckon I can solve my problem armed with that info.

    Rock on Zencart!

 

 

Similar Threads

  1. v154 Product Listing Custom Fields
    By chadlly2003 in forum General Questions
    Replies: 16
    Last Post: 12 Feb 2016, 12:51 PM
  2. Add custom fields to product
    By tkelley66 in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 11 May 2009, 07:28 PM
  3. Custom Product Fields
    By CheezyBreezy13 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 18 Sep 2008, 06:45 PM
  4. Custom product's fields on/off
    By janekbar5 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 4 Mar 2008, 11:20 PM
  5. show custom product fields on new and all product pages
    By crl in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 1 Oct 2007, 05:04 AM

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