Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Hidden Products v1.0


Ajeh

Recommended Posts

doesnt need to be case sensitive :wink:

 

but would match a string as a whole world, for example

 

lets say

 

$VIPcompany="sunoco"

.....

 

if (substr($customer_company,'sunoco')).......

 

sunoco and Sunoco would match, but sunnooco would not

 

i only need it for one company right now, but it would be nice (in the future) to have an array that could be parsed for a match :wink:

 

understand what I mean?? :?

Link to comment
Share on other sites

You could add that to the create_account_process.php and when adding the record test the company name and update the field based on this entry.

 

It would be able to handle it providing it is spelled right ... :D

Link to comment
Share on other sites

OK, I know my eyes were poked out during the marathon debug on user_tracking and apparently my eye site (or my brain) have not started functioning properly since then :roll:

 

I am still trying to figure out an automated way to use Hidden Products/VIP instead of manually setting individuals based on their company name...

 

Based on the above conversation with Linda I have looked at doing 2 different ways:

 

1) do it when the user creates and account (create_account.php) - good if the user doesnt already have an account

2) do it when they login so existing users that would meet the criteria would get automatically set to customers_approved status

 

The problem I am having with trying to incorporate it into login.php is how do I create the sql squery to get the customer company name and then set the customers_approved field to true.

 

I have tried the following, but it generates errors:

 

// Check that password is good

if (!tep_validate_password($password, $check_customer['customers_password'])) {

$HTTP_GET_VARS['login'] = 'fail';

} else {

$check_country_query = tep_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $check_customer['customers_id'] . "' and address_book_id = '1'");

$check_country = tep_db_fetch_array($check_country_query);

 

//my mod

 

$xcomp=tep_db_query("select entry_company from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $check_customer['customers_id']. "'");

 

if (substr($xcomp,'companynamestocheck')) {

 

? $check_customer->customers_approved = 'true';

}

 

 

this is generating an error on the last line :shock:

 

any help appreciated

Link to comment
Share on other sites

you are correct Linda, it should be 1 or 0

 

here is the code I am working on and I am getting an SQL error, but don't know what the error is since it gives no error number:

 

I am using this in login.php:

 

$date_now = date('Ymd');

tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . $customer_id . "'");

 

//my mod

 

$xcomp=tep_db_query("select entry_company from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $check_customer['customers_id']. "'");

$xxcomp = tep_db_fetch_array($xcomp);

 

if (substr($xxcomp['entry_company'],'thecomanyname')) {

$check_customer['customers_approved']='1';

tep_db_query("update " . TABLE_CUSTOMERS . " set customers_approved? = 1 where customers_id = '" . $check_customer['customers_id'] . "'");

 

//echo $check_customer['customers_approved']. ' ';

//echo 'here i am' . $xxcomp['entry_company'];

//exit;

 

}

 

the error seems be the tep_db_query call... any ideas??

Link to comment
Share on other sites

  • 7 months later...

Hi

 

i use SECv2_2MS2GV.

I like to built in the Hidden Products v1.0.

 

Admin... OK no problem, it work fine :)

 

I need this extension for our Shop. The changes in the Admin run perfectly. I can provide user and products with the Atribut. In the Catalog I receive after the change general.php only of the error messages. Can this be connected with the fact that the version which I use already of webmakers is?

 

It is the SECv2_2MS2GV specified above, thus the MS2GV. The file default.php is called with us index.php. Can I build this change at all into our version?

 

Please help me. This text was translated with http://babelfish.altavista.com/babelfish/tr I can as well as none english. I could use German assistance well.

 

Thanks

 

Hallo zusammen.

 

ich brauche diese Erweiterung f?r unseren Shop. Die ?nderungen in der Admin laufen tadellos. Ich kann user und Produkte mit dem Atribut versehen.

 

Im Catalog erhalte ich nach der ?nderung der general.php nur Fehlermeldungen. Kann dies damit zusammenh?ngen, dass die Version die ich nutze bereits von webmakers ist? Es ist die oben genannte SECv2_2MS2GV, also die MS2GV.

 

Die Datei default.php heisst bei uns index.php. Kann ich diese ?nderung ?berhaupt in unsere Version einbauen?

 

Danke f?r die Hilfe.

 

Stephan

Link to comment
Share on other sites

  • 4 weeks later...

Quick question - I would like to install this, as it is exactly what I am looking for for my wholesale products.

 

But I also have allprods installed.

 

Would these hidden products show on allprods, as this basically shows all the products on the database with a status of 1. I would imagine there would have to be some changes made to the allprods mod, to have it look at the database and find out if a product is a hidden product or not.

 

Does anyone have this mod installed with allprods also and what changes did you have to make?

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...