Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010
    Posts
    45
    Plugin Contributions
    0

    help question Pre-fill from Customer to Product Attribs?

    I'm new to Zen Cart, but we have a fresh install of v1.3.8a running, looking the way we want it to, and transactions are flowing smoothly.

    In my setup work I did use the FAQs and forums extensively and found all the answers I needed, up to this point where I don't have enough background in this stuff. I would appreciate the help of folks on this forum. There was one thread on the issue, but it did not show details of the solution.

    Our running club holds races throughout the year, and we need to capture some basic demographics about the entrant. I have our race "product" set up to capture stuff such as name, address, etc. and that is working fine (sometimes the people on the site are registering a spouse, etc, so we can't just assume it is the account owner).

    But to enhance the signup process, I would like to pre-fill the product demographic fields with the account details from the customers, address_book, countries, and zones tables, placing the values into the corresponding entry fields when the product details are displayed. I understand this should be done in the attrib.php file, but I am a little lost when it comes to variable names, do I need to execute some sql, etc.

    Is anyone able to give me a hand with this?

    Thanks in advance!

    Steve

  2. #2
    Join Date
    Feb 2010
    Posts
    45
    Plugin Contributions
    0

    Default Re: Pre-fill from Customer to Product Attribs?

    Okay, I've figured this out for myself after a bit of trial and error. The action takes place in the attributes.php file.

    First, retrieve the customer fields you will be using for your pre-fill using sql, etc. Then around line 400 or so, the code cycles through the array of attributes, and has sections for text, checkboxes, etc.

    You will need to insert some code under the text processing, in the section before the comment "calculate word charges" to identify when an attribute you want pre-filled is being processed, so you can insert the appropriate value into the "value=" part of the $tmp_html being built.

    If someone needs more detail, just get in touch.

 

 

Similar Threads

  1. v150 Pre-fill edit address & edit shipping forms
    By webguy262 in forum General Questions
    Replies: 1
    Last Post: 29 Jul 2013, 05:03 PM
  2. v139h Product columns fill from right to left! How to change?
    By mydogisfat in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 26 Jun 2012, 09:29 PM
  3. Removing new customer login option for pre-approved customer list
    By Acemeister in forum Managing Customers and Orders
    Replies: 3
    Last Post: 21 Sep 2010, 04:51 AM
  4. Excluding categories from certain attribs
    By tatiana77 in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 26 Sep 2007, 08:50 PM
  5. Pre fill text attribute
    By Phil020782 in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 30 Jul 2007, 10:37 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