mushindo Posted October 12, 2002 Posted October 12, 2002 Hello, I am still a bit of a newbie to PHP, but am currently working on a template for conditions of usage that I plan to use as a contribution once complete. Basically what I am trying to do is this: 1. Using a basic e-commerce conditions of usage text information. 2. Pulling company name variable as stored in database, and seen in admin configuration page. 3. Pulling default email address as stored in database, and seen in admin configuration page. The first part is done, the basic text, but being new to PHp I have no clue how to go about automatically pulling the company name and default email address into my conditions text dynamically. I was looking for a quick fix on some of these sections so I don't have to retype everything, etc, for each customer I have. Any help is greatly appreciated and I will be sure to send you a copy once complete! Thanks in advance! :P Sincerely, Bruce 19 contributions submitted
zzfritz Posted October 12, 2002 Posted October 12, 2002 The user variables you need, such as the store name, owner and address, are kept in the database table named configuration. Browse it and find what you want by the field configuration_key, then construct sql queries to plug in your script.
mushindo Posted October 13, 2002 Author Posted October 13, 2002 Now a SQL query I can handle...not much different from coldfusion that I am used to...but as for displaying the results..no clue. I know this may be elementary for most, but I'm still picking it up myself for PHP. Any suggestions anyone? :P Sincerely, Bruce 19 contributions submitted
mushindo Posted October 13, 2002 Author Posted October 13, 2002 Well so far I have come up with the following possible SQl query for pulling the information of Company Name and Email. I got this sample from the /catalog/admin/configuration.php file. <?php $configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_group_id = '1' order by sort_order"); } ?> Could someone who knows PHp and SQl queries fairly well please look this over and tell me the following: 1. How would I tweak this query to include all information from that table so I can more easily reuse this query in other pages like conditions.php, policies.php etc? 2. Using the following as a sample, what code would I then use to pull the specific information into my template: "Conditions of Usage: companyname is dedicated to serving you and" You get the idea. Any help is greatly appreciated! Thanks in advance! :P Sincerely, Bruce 19 contributions submitted
mushindo Posted October 13, 2002 Author Posted October 13, 2002 okay so far we have this query: <?php $configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_group_id = '1' order by sort_order"); } ?> And i was able to determine the following additional information: Table name: configuration table columns to pull: STORE_NAME configuration_id =1 STORE_OWNER_EMAIL_ADDRESS configuration_id =3 STORE_NAME_ADDRESS configuration_id =15 Any ideas? Need help badly on this one! Thanks! :roll: Sincerely, Bruce 19 contributions submitted
burt Posted October 14, 2002 Posted October 14, 2002 forget all that. define('TEXT_INFORMATION', '<p>Welcome to the ' . STORE_NAME . ' online store! Our Company and its associates provide their services to you subject to the following conditions. If you visit or shop within this website, you accept these conditions. Please read them carefully.</p> repeat ' . STORE_NAME . ' as necessary throughout the scripts. hth
mushindo Posted October 14, 2002 Author Posted October 14, 2002 forget all that. define('TEXT_INFORMATION', '<p>Welcome to the ' . STORE_NAME . ' online store! Our Company and its associates provide their services to you subject to the following conditions. If you visit or shop within this website, you accept these conditions. Please read them carefully.</p> repeat ' . STORE_NAME . ' as necessary throughout the scripts. hth Wow...thanks Gary. It was so simple with these basic ideas, that I totally missed it! I have completed the new version of this contribution and posted here: http://www.oscommerce.com/downloads.php/co...ions,571/type,3 Send me any feedback! Thanks! :P Sincerely, Bruce 19 contributions submitted
Recommended Posts
Archived
This topic is now archived and is closed to further replies.