Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I Learned PHP last night now I/m a Genius


myshipper

Recommended Posts

Just Kidding I did stay up last night and watched videos

 

I wanted to create a drop down menu on the create new products page (which I did)

 

I created a mysql data base table with my suppliers information

 

I created in languages define TEXT AND ENTRY entries

everytrhing displays correctly on the pages

 

Now I have a empty drop down menu in the new products page

and a entry on the orders page for the suppliers information

where the customers information is for their purchase.

 

I need to be walked through with the scripts and pages to enter and

populate the dropdown menu and after I update the information

the suppliers information will be displayed with the order

as we have people process orders and there are 2000 products

and I am always asked where do we get this item

 

If I can also add a feild to the quick stock price updates to add the

suppliers information so I don't mhave to add each one manually

that would be great

 

Should I select the manufacturers in my data base

or should I create a array

on the new products page and have it displayed in the a area on the orders page

 

I am on the computer now at 2:18 and would like to complete this

 

If you got the time lets work this out

 

this what I added to the admin/categories.php page and I will edit this post to show the orders.php next

 

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main"><?php echo TEXT_MANUFACTURERS_INFORMATION; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('manufacturers_information', $manufacturers_information_array, $pInfo->manufacturers_information); ?></td>

</td>

</tr>

 

 

And this is the admin/orders.php page

 

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>

</tr>

<tr>

<td class="main"><b><?php echo ENTRY_MANUFACTURERS_INFORMATION; ?></b></td>

<td class="main"><?php echo $order->customer['Supplier']; ?></td>

</tr>

Link to comment
Share on other sites

I Learned PHP last night now I/m a Genius

very funny as name for this topic.

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

A good way to learn is examine the existing code to see how things are done.

 

This little snippit is for a drop down:

 

$zones_array = array();

$zones_array[] = array('id' => PULL_DOWN_DEFAULT, 'text' => PULL_DOWN_DEFAULT);

$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)STORE_COUNTRY . "' order by zone_name");

while ($zones_values = tep_db_fetch_array($zones_query)) {

$zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);

}

echo tep_draw_pull_down_menu('state', $zones_array);

 

Good Luck

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

A good way to learn is examine the existing code to see how things are done.

 

This little snippit is for a drop down:

 

$zones_array = array();

$zones_array[] = array('id' => PULL_DOWN_DEFAULT, 'text' => PULL_DOWN_DEFAULT);

$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)STORE_COUNTRY . "' order by zone_name");

while ($zones_values = tep_db_fetch_array($zones_query)) {

$zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);

}

echo tep_draw_pull_down_menu('state', $zones_array);

 

Good Luck

 

I apologize Sam

 

I have the dropdown menu on the new products page where you list a new product

it shows a feild text in the menu box of --none-- but it don't default there when you load the page

and there are 7 blank feilds in the dropdown

now in my database there are 7 feilds with my suppliers information that I added

it just is not displaying them these are values i beleive there called

 

I need them populated in the mnu box

after they are populated in the dropdown box and a supplier is selected it will return

that result in the orders page with the customers details when a product is ordered

 

I am getting a lot of where do we get this product from when I am not around my processors

will know where to contact the supplier for that product

 

The code up top is a copy of the manufacturers box my supplier is now under that with a little

alterations and the other is a copy of a area of the telephone number in the orders page altered

to read supplier, I would like the results to return there

 

My data base table is called manufacturers_information the feilds are Supplier an id

id is the primary

 

If you or anyone can help dinner is on me

 

Charles

http://www.mydiscountwholesaler.com

Link to comment
Share on other sites

this is how the code is set up in the admin/categories.php under the manufacturers dropdown I have this code

in place and it shows the supplier information on the new product page

 

Now I need to have the results when the page is updated to display the results in the customers information page

So my order processors do not have to keep asking where do we order this product from and if I am not around the order

may not get processed

 

All help will be appreciated

 

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="main"><?php echo TEXT_MANUFACTURERS_INFORMATION; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('manufacturers_information', $manufacturers_information_array, $pInfo->manufacturers_information); ?></td>

</td>

</tr>

And in the same file under manufacturers down the page a little more I added this note these are almost duplicates of the exsisting code

 

$manufacturers_information_array = array(array('id' => '', 'text' => TEXT_NONE));

$manufacturers_information_query = tep_db_query("select Supplier, id from " . TABLE_MANUFACTURERS_INFORMATION . " order by Supplier");

while ($manufacturers_information = tep_db_fetch_array($manufacturers_information_query)) {

$manufacturers_information_array[] = array('id' => $manufacturers_information['id'],

'text' => $manufacturers_information['Supplier']);

 

And this is the admin/orders.php I added

 

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>

</tr>

<tr>

<td class="main"><b><?php echo ENTRY_MANUFACTURERS_INFORMATION; ?></b></td>

<td class="main"><?php echo $order->customer['Supplier']; ?></td>

</tr>

 

I need to have the results displayed HERE on the orders page with the customers results

Link to comment
Share on other sites

Do you mean what you say?

 

 

No just kidding around I don't know php and trying to learn been at this little piece of work for umpteen hours now

and if I did;nt add a little humor I would of gone mad :lol:

Link to comment
Share on other sites

Just to clarify, what you are trying to do? Can you post an example of the info you want in the drop downs.

 

Are you trying to record the manufacturer's name and then display it on the product page?

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Just to clarify, what you are trying to do? Can you post an example of the info you want in the drop downs.

 

Are you trying to record the manufacturer's name and then display it on the product page?

 

 

Almost I have the dropdown menu with the suppliers information extracted from the database in place on the new products page

 

I want to record the information selected for that product (WHEN A NEW ONE IS ADDED OR UPDATED)

 

Then display the results in the orders page I already just added a space between the model and the tax on the order page with the define statement in languages

 

now i need the results saved for any products and displayed between the model and tax

up top is most of the code I used

 

Appreciate any help

Link to comment
Share on other sites

Just trying to work out why you have created a new table to hold the supplier's information when there is already a table called manufacturers.

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Just trying to work out why you have created a new table to hold the supplier's information when there is already a table called manufacturers.

 

Because manufacturers are different from my suppliers I just used manufacturers_information it is just a name

 

I just vreated a table in orders_products if i am right there needs to be a feild to collect the information

 

you havr to understand I am self teaching

Link to comment
Share on other sites

Sorry should have said

 

Just trying to work out why you have created a new table to hold the manufacturer's information when there is already a table called manufacturers.

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Sorry should have said

 

Just trying to work out why you have created a new table to hold the manufacturer's information when there is already a table called manufacturers.

 

Its not olding the manufacturers information it is holding my suppliers information it is just called manufacturers information i should of

created a table called supplier information but i didn't

 

understand now it holds my suppliers web address and phone number

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...