Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Payment module to selected customers


Guest

Recommended Posts

I like to offer selected customers the option to use a payment module INVOICE.

By adding a column customers_invoice in TABLE_CUSTOMERS I can select customers who are alowed to pay by invoice.

 

if I change the selection function in the payment module to

 

function selection() {

 

$invoice = tep_db_query("select customers_invoice from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");

$invoice = tep_db_fetch_array($invoice);

 

if ($invoice == '0') {

$this->enabled = false;

return false;}

 

else

{

return array('id' => $this->code,

'module' => $this->title);

}

}

 

 

if I change the if statement to if ($invoice == '1') than the module is shown.

So it looks like the value of $invoice = 0 always even if I change the customers value to 1.

 

Obviously the value of $invoice isn't the value of customers_invoice of the selected customer.

 

How do I change the query to make it selecting the current customer?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...