Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

affiliate_branding


bobvin

Recommended Posts

This mod extends the osC-Affiliate module by giving each affiliate their own, separately branded storefront with their own customizable subset of the main inventory.

 

UI changes:

 

[*]When an affiliate registers, there are a couple of extra fill-in fields asking for a header image and homepage.

[*]When a customer clicks on an affiliate banner, the default osCommerce logo will be replaced by the header image, and clicking on the header image will send the customer to that affiliate's homepage.

[*]After an affiliate logs in, there is an extra button labeled "Products".

[*]After clicking on this button, the affiliate may browse through the master inventory and select or deselect products for their store by clicking on the green/red "lights," respectively.

 

SQL changes:

 

[*]A new table, called affiliate_products, is added.

[*]Two fields are added to the affiliate_affiliate table.

[*]Nearly all the SQL select statements in the

catalog area are changed to link in the new table.

IMPORTANT

 

This mod requires the osC-Affiliate mod.

 

Before installing this mod, you need to install the latest available versions of both osCommerce and osC-Affiliate.

 

Please do NOT try to install this mod on top of an already-working store. If you do, you're on your own and I will NOT help you. You have been warned.

The web is like usenet, but the elephants are untrained.

Link to comment
Share on other sites

  • Replies 80
  • Created
  • Last Reply

Top Posters In This Topic

:idea: I have a idea, when i sign up as a affiliate and type in the path to the "Header Image"....... well i was hopeing you could have it so they can upload a image to the server and use that image as the Header Image, and "I" can specify the Maximum File Size for the image, so someone won't try to upload a LARGE file and bog down the server.

 

 

 

Let me know if this can be done.

 

Thanks.

Link to comment
Share on other sites

OKAY

 

I have successfully installed the affiliate_branding contrib with 1 exception -

 

After I have signed up as an affiliate and I click on the product button - it is calling to DIR_WS_ADMINaffiliate_products.php - now if I simply change the url to admin/ I am directed correctly and everything works fine -

 

where is this calling to? I obviously missed something but I need some help figuring out what.....

 

so bottom line

 

which files defines where the products button in the affiliate section calls from in order to get to the admin area of products to activate?

 

Thanks!!!

Link to comment
Share on other sites

After I have signed up as an affiliate and I click on the product button - it is calling to DIR_WS_ADMINaffiliate_products.php - now if I simply change the url to admin/ I am directed correctly and everything works fine

 

 

this same thing happend to me, here is what to do:

 

in catalog/affiliate_summary.php

FIND:



<td align="right" colspan="4"><?php echo '<a href="' . DIR_WS_ADMIN . FILENAME_AFFILIATE_PRODUCTS . '">' . tep_image_button('button_affiliate_products.gif', IMAGE_PRODUCTS) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS, '') . '">' . tep_image_button('button_affiliate_banners.gif', IMAGE_BANNERS) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '') . '">' . tep_image_button('button_affiliate_clickthroughs.gif', IMAGE_CLICKTHROUGHS) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '','SSL') . '">' . tep_image_button('button_affiliate_sales.gif', IMAGE_SALES) . '</a>'; ?></td>





and change it to read:



<td align="right" colspan="4"><?php echo '<a href="admin/affiliate_products.php"><IMG SRC="' . DIR_WS_LANGUAGES . $language . '/images/buttons/button_affiliate_products.gif" ALT=' . IMAGE_BANNERS . ' BORDER=0></a> <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS, '') . '">' . tep_image_button('button_affiliate_banners.gif', IMAGE_BANNERS) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '') . '">' . tep_image_button('button_affiliate_clickthroughs.gif', IMAGE_CLICKTHROUGHS) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '','SSL') . '">' . tep_image_button('button_affiliate_sales.gif', IMAGE_SALES) . '</a>'; ?></td>

 

and that should only be one (1) Line. the Board is not long enough to fit it all on one line. :lol: :shock:

 

I know it is not a verry good way of arranging the code,

but i have the loaded 4 version, and i had to change around the code, because it was not showing the button "Products" at all. i spent over 2 hours trying to figure it out and this code was the best i could do

 

let me know if it works.

 

Thanks.

Link to comment
Share on other sites

Can someone help me configure the contribution "Featured Products" to work with "affiliate_branding"?

 

Here is the code that needs to be configured:

 

  if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) {

   $info_box_contents[] = array('align' => 'left', 'text' => '<a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>');

   $featured_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);

 } else {

   $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name));

   $featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);

 }

 

 

Can someone configure that code for me and post it back here?

 

Thanks.

Link to comment
Share on other sites

okay now I am having a problem with the admin and the affiliate info connecting.... I signed up as an affiliate twice and nothing shows in the affiliate area - also when I tried to edit my affiliate info in the affiliate login area, there was no information listed as all - is there supposed to be?

 

Thanks!

Link to comment
Share on other sites

okay now I am having a problem with the admin and the affiliate info connecting.... I signed up as an affiliate twice and nothing shows in the affiliate area - also when I tried to edit my affiliate info in the affiliate login area, there was no information listed as all - is there supposed to be?  

 

Can you be a little more specific on whats happening?

explane it more.

Link to comment
Share on other sites

sure thing

 

I have installed the contrib and all seems to be working except:

 

When I sign up as an affiliate from my site - I get a confirmation, including confirmation email, and am able to browse through the info provided to affiliates.

 

However if I go to the admin area to check out my affiliates, it shows that I have 0 affiilates.

 

Lastly, as an affiliate if I go back to my site and try to login, it tells me that there is no affiliate with my info.

 

 

 

so obviously there is something not connecting between the store and the admin or database....

Link to comment
Share on other sites

here is something else that i need to be configured:

 

Can someone help me configure the contribution "default specials" to work with "affiliate_branding"?

 

Here is the code that needs to be configured:

 

<!-- default_specials //-->



 <tr>

     </tr>

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

         <tr>

<?php

$info_box_contents = array();

 $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));

 new contentBoxHeading($info_box_contents);



   $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS);

   

$info_box_contents = array();

 $row = 0;

 $col = 0;

 while ($default_specials = tep_db_fetch_array($new)) {

   $default_specials['products_name'] = tep_get_products_name($default_specials['products_id']);

   $info_box_contents[$row][$col] = array('align' => 'center',

                                          'params' => 'class="smallText" width="33%" valign="top"',

                                          'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><s>' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])).'</span>'

);

   $col ++;

   if ($col > 2) {

     $col = 0;

     $row ++;

   }

 }

 new contentBox($info_box_contents);

?></table>



<!-- default_specials_eof //-->

 

Can someone configure this code for me also and post it back here?

 

Thanks.

Link to comment
Share on other sites

sure thing  

 

I have installed the contrib and all seems to be working except:  

 

When I sign up as an affiliate from my site - I get a confirmation, including confirmation email, and am able to browse through the info provided to affiliates.  

 

However if I go to the admin area to check out my affiliates, it shows that I have 0 affiilates.  

 

Lastly, as an affiliate if I go back to my site and try to login, it tells me that there is no affiliate with my info.  

 

 

 

so obviously there is something not connecting between the store and the admin or database....

 

 

It sounds like there is a problem with the script adding the affiliate to the database.

 

can you goto your database and look and see if the affiliate is in the database?

 

if not it must be a problem with the affiliate script in the catalog side, if it IS in there it must be a problum with the Affiliate script in the admin side.

 

 

look in to it and let me know if it is in there.

 

 

I got to go for the night, i'll talk to you all tomorrow.

 

Thanks for all the help.

 

Good Night everyone.

Link to comment
Share on other sites

:idea: I have a idea, when i sign up as a affiliate and type in the path to the "Header Image"....... well i was hopeing you could have it so they can upload a image to the server and use that image as the Header Image, and "I"

 

Probably could be done by changing the header image field from a text type to a file type and allowing the affiliate to upload a file right there.

 

Would have to change the enctype of the form and also change the .php file that processes the form but shouldn't be too hard.

The web is like usenet, but the elephants are untrained.

Link to comment
Share on other sites

here is something else that i need to be configured:

 

Can someone help me configure the contribution "default specials" to work with "affiliate_branding"?  

 

Can someone configure this code for me also and post it back here?  

 

Take a look at the catalog.diff file where it changes the select statements.

 

Notice that it replaces all instances of

select from ... TABLE_PRODUCTS . ' p, ' ... where ...

with

select from ... TABLE_AFFILIATE_PRODUCTS . " a, " . TABLE_PRODUCTS . " p, " ... where a.affiliate_id = '" . AFFILIATE_ID . "' and a.products_id = p.products_id and ...

 

So all you need to do is affect a similar change in your code above.

 

If you want me to do it for you, send me a private message and we'll discuss payment terms.

 

(Yes, I'm an evil guy; I'm in this for the money...)

The web is like usenet, but the elephants are untrained.

Link to comment
Share on other sites

I have installed the contrib and all seems to be working except:

 

When I sign up as an affiliate from my site - I get a confirmation, including confirmation email, and am able to browse through the info provided to affiliates.

 

However if I go to the admin area to check out my affiliates, it shows that I have 0 affiilates.

 

Lastly, as an affiliate if I go back to my site and try to login, it tells me that there is no affiliate with my info.

 

so obviously there is something not connecting between the store and the admin or database....

 

Sounds to me like the SQL statement that registers a new affiliate is failing to execute. Perhaps there is a syntax error in either the PHP or the SQL.

 

If the error is on the PHP end, it should generate error messages in your Apache error log. Have you checked your error log?

 

If the error is on the SQL end, it should generate errors in your MySQL error log. Have you checked that?

 

It is possible that, in your particular setup, neither PHP nor MySQL are configured to report errors.

 

To learn how to properly configure PHP, you should visit www.php.net. It's an invaluable resource.

 

To learn how to properly configure MySQL, of course, there is mysql.com.

 

Are there any errors in your Apache error log? If so, what do they say? Are there any errors in your MySQL error log? If so, what are they?

 

Have you previously gotten the osC-Affiliate module (without the affiliate_branding mod) working correctly?

 

The code you're having problems with is part of osC-Affiliate; it's not part of affiliate_branding.

The web is like usenet, but the elephants are untrained.

Link to comment
Share on other sites

here is something else that i need to be configured:

 

Can someone help me configure the contribution "default specials" to work with "affiliate_branding"?  

 

Can someone configure this code for me also and post it back here?  

 

Take a look at the catalog.diff file where it changes the select statements.

 

Notice that it replaces all instances of

select from ... TABLE_PRODUCTS . ' p, ' ... where ...

with

select from ... TABLE_AFFILIATE_PRODUCTS . " a, " . TABLE_PRODUCTS . " p, " ... where a.affiliate_id = '" . AFFILIATE_ID . "' and a.products_id = p.products_id and ...

 

So all you need to do is affect a similar change in your code above.

 

If you want me to do it for you, send me a private message and we'll discuss payment terms.

 

(Yes, I'm an evil guy; I'm in this for the money...)

 

 

 

One problem...... I DON'T HAVE ANY MONEY. :cry:

 

i only have about $45 in the Bank..... Thats it, i'm not kidding. so i realy can't afford to pay for this to be done, if i could afford it i would pay for it.

 

 

 

well if you can't do it for free, can anyone else?

Link to comment
Share on other sites

:idea: I have a idea, when i sign up as a affiliate and type in the path to the "Header Image"....... well i was hopeing you could have it so they can upload a image to the server and use that image as the Header Image, and "I"

 

Probably could be done by changing the header image field from a text type to a file type and allowing the affiliate to upload a file right there.

 

Would have to change the enctype of the form and also change the .php file that processes the form but shouldn't be too hard.

 

 

Can someone do this for me too? hopefully free.

 

let me know.

Thanks.

Link to comment
Share on other sites

Can someone help me configure the contribution "Featured Products" to work with "affiliate_branding"?

 

Here is the code that needs to be configured:

 

  if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) {

   $info_box_contents[] = array('align' => 'left', 'text' => '<a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>');

   $featured_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);

 } else {

   $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name));

   $featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);

 }

 

 

Can someone configure that code for me and post it back here?

 

Thanks.

 

 

 

Can someone help me with this one, too? and for free?

 

 

yes i need two (2) of thease to be configured, they are: "default specials" and "featured products"

 

i tried to do it myself but i can't figure it out. :(

 

can someone please be nice enough to help me out and do this for me for free?

 

let me know... thanks.

Link to comment
Share on other sites

Hi Bob,

 

Finally I was able to configure the Affiliate branding with osC. But have few questions.

 

1) When some affiliate go to affiliate_products.php cant seems to find any place to come back to his affiliate page other then to use browser back button or to go to catalog back.

 

So is it possible to open a pop up window for an affiliate to go to affiliate_products page.

 

And is it possible to not to include the header with the same.

 

Just a thought!! :idea:

 

Any way thanks for your great contribution and help I am still testing the same and if find some thing will post here. I am not a programmer. And I think your instructions are great. A new change make things bit complicated for the beginner like us. As added diff. file and zip file tar.gz file and the original files too, that makes little confusing for the non programmers, as we are most of the time use to see one instruction files for contributions and then php file as per the osC folder structure. I am sure we will adopt this too very soon

 

We do get to learn a lots of tips and tricks from osC daily :wink:

Link to comment
Share on other sites

When some affiliate go to affiliate_products.php cant seems to find any place to come back to his affiliate page other then to use browser back button or to go to catalog back.

 

Yeah, that's a known problem.

 

I was lazy.

 

Needed the affiliate to be able to turn on/off products just like the admin does in the categories.php file.

 

But the affiliate logs in through the catalog section and the admin logs in through the admin section.

 

So instead of figuring out how to duplicate the functionality of the categories.php file within the (slightly different) environment of the catalog section, I performed an unwholesome hack. I jury-rigged things so that the affiliate can cross-over to the admin section just for that one function.

 

This is not the RIGHT WAY to do things. Probably introduces security vulnerabilities; I don't know. But it has the undeniable advantage that it works. :)

 

So is it possible to open a pop up window for an affiliate to go to affiliate_products page.

 

And is it possible to not to include the header with the same.

 

It's possible, but it would make a bad hack even worse.

 

Any way thanks for your great contribution ... I think your instructions are great...

 

Thanks for the support, but are you just buttering me up so I will help you? ;)

The web is like usenet, but the elephants are untrained.

Link to comment
Share on other sites

Sean Cherven was kind enough to point out an error I had made in one of the language-specific files, plus I had made the beginnings of a FAQ, so I uploaded a new version today.

 

Alas, as soon as I had uploaded, I noticed the additional change_header.zip file that Cherven had posted, which fixes the problem that Jaysin pointed out earlier.

 

I'll add change_header.zip into the next update; I don't want to do more than one a day.

 

Meanwhile, does anybody else have any fixes they want me to add in?

 

(I guess I should add a WISHLIST and TODO as well as a FAQ)

The web is like usenet, but the elephants are untrained.

Link to comment
Share on other sites

Bobvin Where is this file?

require('includes/application_top_affiliate_products.php');

 

That statment is in admin/affiliate_products.php

 

TY

Theo

 

Are you sure?

 

(checking...)

 

Well, it isn't in my copy.

 

(checking again...)

 

Nor in the last version I uploaded.

 

If I am not mistaken, that statement should be

require('includes/application_top.php');

The web is like usenet, but the elephants are untrained.

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