Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

THIS IS DRIVING ME BONKERS !!


yesudo

Recommended Posts

THE SECOND FUNCTION BELOW IS NOT BEING RECOGNISED - error message function not defined - anyone know what I am doing wrong or if i need to edit another file? THANX.

 

BACKGROUND: I am adding a new field to the customer create account process asking them where they heard about us and they can choose from a list of options.

 

FIRST FUNCTION CALL: - file create_account.php

 

<?php echo tep_get_source_list('source') . ' ' . (tep_not_null(ENTRY_SOURCE_TEXT) ? '<span class="inputRequirement">' . ENTRY_SOURCE_TEXT . '</span>': ''); ?>

 

FIRST FUNCTION DEFINITION AND SECOND FUNCTION CALL: - file includes/functions/html_output.php

 

 

////

// Creates a pull-down list of customer_sources

function tep_get_source_list($name, $selected = '', $parameters = '') {

$sources_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

$sources = tep_get_sources();

 

for ($i=0, $n=sizeof($sources); $i<$n; $i++) {

$sources_array[] = array('id' => $sources[$i]['source_id'], 'text' => $sources[$i]['source_name']);

}

 

return tep_draw_pull_down_menu($name, $sources_array, $selected, $parameters);

}

 

SECOND FUNCTION DEFINITION:file includes/functions/general.php

 

 

////

// Returns an array with source

// TABLES: customer_source function tep_get_sources($source_id='')

{

 

$sources_array = array();

 

if (tep_not_null($source_id))

{

 

$sources = tep_db_query("select source_name from " . TABLE_CUSTOMER_SOURCE . " where source_id = '" . (int)$source_id . "'");

 

$sources = tep_db_fetch_array($sources);

$sources_array = array('source_name' => $sources_values['source_name']);

 

}

else

{

 

$sources = tep_db_query("select source_id, source_name from " . TABLE_CUSTOMER_SOURCE . " order by source_name");

 

while ($sources_values = tep_db_fetch_array($sources))

{

 

$sources_array[] = array('source_id' => $sources_values['source_id'],

 

'source_name' => $sources_values['source_name']);

 

}

 

}

 

 

return $sources_array;

 

}

Your online success is Paramount.

Link to comment
Share on other sites

Hello - apologies for bringing this up again but is there really no one who knows the answer to this?

 

It is bound to be something simple I am doing wrong but need a fresh pair of eyes/braincells :D to assist.

Your online success is Paramount.

Link to comment
Share on other sites

I am trying to do the same thing: my post

I hope someone can figure this out for the both of us. I know I have seen this request many times. Hopefully, the work we have already done will make it easier for the pros to give us feedback rather than them having to start from scratch.

 

I had the same function call errors which is why I took a different approach (out of sheer ignorance)

"Aliiiiive, it's alive, it's ALIIIIIIIIIIIIIVE!!!"

Link to comment
Share on other sites

You might try breaking the function off the same line as the Commented Tables:

From

////

// Returns an array with source

// TABLES: customer_source function tep_get_sources($source_id='')

{

 

To

 

////

// Returns an array with source

// TABLES: customer_source

function tep_get_sources($source_id='')

{

 

for starters

 

Mike

Link to comment
Share on other sites

You might try breaking the function off the same line as the Commented Tables:

From

////

// Returns an array with source

// TABLES: customer_source function tep_get_sources($source_id='')

{

 

To

 

////

// Returns an array with source

// TABLES: customer_source

function tep_get_sources($source_id='')

{

 

for starters

 

Mike

Mike......................IS A STAR.

Your online success is Paramount.

Link to comment
Share on other sites

Please, I am searching for this contribution for a long time.

 

is it possible that you post the things what to do to make it?

Can you post it to me also?

Link to comment
Share on other sites

Please, I am searching for this contribution for a long time.

 

is it possible that you post the things what to do to make it?

Can you post it to me also?

no probs - will be available tomorrow.

Your online success is Paramount.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...