Jump to content
Sign in to follow this  
Rezolles_Net

OSC-Affiliate add-on authorized products

Recommended Posts

This is official thread for : OSC-Affiliate add-on authorized products

 

 

 

Dear contributer,

 

There is some weakness within this contribution.When "we" disable some products in admin,affiliaters can "build the link" by clicking at the product section (product_info.php).Can someone make the button hidden when the item is not allowed?

 

 

Thx :blush:

Share this post


Link to post
Share on other sites
This is official thread for : OSC-Affiliate add-on authorized products

Dear contributer,

 

There is some weakness within this contribution.When "we" disable some products in admin,affiliaters can "build the link" by clicking at the product section (product_info.php).Can someone make the button hidden when the item is not allowed?

Thx :blush:

 

I Have Same Probs. But I Can Not Hide It, Please Help Some One.

Share this post


Link to post
Share on other sites

i thought it was the finder that was suppose to fix it and post a new version :P try this

 

look for

 

  } else {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

then add " and p.affiliate_allow_product = 1" to is so it looks like the following

 

  } else {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'  and p.affiliate_allow_product = 1");

 

Then find this as installed by the affilliate contrib:

 

//affiliate build a link begin
	if (tep_session_is_registered('affiliate_id')) {

 

Add " && ((int)$product_info['affiliate_allow_product'] == 1)" to it so that it looks like the following:

 

//affiliate build a link begin
	if (tep_session_is_registered('affiliate_id') && ((int)$product_info['affiliate_allow_product'] == 1)) {

 

hope that helps, it's not tested. please post you result for others.

Share this post


Link to post
Share on other sites

sorry, revised:

 

look for in product_info.php

 

  } else {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

then add ", p.affiliate_allow_product" to is so it looks like the following

 

  } else {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.affiliate_allow_product from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

Then find this as installed by the affilliate contrib:

 

//affiliate build a link begin
	if (tep_session_is_registered('affiliate_id')) {

 

Add " && ((int)$product_info['affiliate_allow_product'] == 1)" to it so that it looks like the following:

 

//affiliate build a link begin
	if (tep_session_is_registered('affiliate_id') && ((int)$product_info['affiliate_allow_product'] == 1)) {

 

hope that helps, it's not tested. please post you result for others.

Share this post


Link to post
Share on other sites

Got this error in my site, can anyone tell me what happen?

 

1054 - Unknown column 'p.affiliate_allow_product' in 'field list'

Share this post


Link to post
Share on other sites
Got this error in my site, can anyone tell me what happen?

 

1054 - Unknown column 'p.affiliate_allow_product' in 'field list'

Nvm, i found out the solution, lol

Share this post


Link to post
Share on other sites
Nvm, i found out the solution, lol

 

Insert in your products table this from a tool like MyPHPAdmin at your host:

 

ALTER TABLE `products` ADD `affiliate_allow_product` TINYINT(1) DEFAULT "1" NOT NULL

 

Should be fine..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×