Jump to content
Sign in to follow this  
guanche

Anyone using ThumbAds contribution?

Recommended Posts

I am looking to add featured products in an infobox on the right column and believe the "ThumbAds" contribution should do this. Does anyone have the ThumbAds contribution working as an infobox?, I'd like to see a sample URL before I install it.

Share this post


Link to post
Share on other sites

the best way to adding mods is BACKUP, BACKUP, BACKUP, BACKUP & create a dev version on your own machine or so before you do something horrible in your life ;)


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites
the best way to adding mods is BACKUP, BACKUP, BACKUP, BACKUP & create a dev version on your own machine or so before you do something horrible in your life ;)

 

Agreed, I've installed many contributions...my question was any have a live URL where this can be seen?

Share this post


Link to post
Share on other sites

I have installed the mod - so far so good - the only thing I can't get to work is the center block - the right and left columns work with no problem.

 

Using MS1 release.

Share this post


Link to post
Share on other sites

I have got the ThumbAds in the center of my page. It was very easy to install.

 

I added a Header Image (in the same way you do for InfoBoxes) and called it "Our Featured Products" so that I don't have to keep specifying Featured Products in Admin.

 

see it here:

www.redinstead.com.au

 

Jen


I haven't lost my mind - I have it backed up on disk somewhere.

Share this post


Link to post
Share on other sites

By the way, here is the download URL:

http://www.oscommerce.com/community/contri...ns,1062/page,14

 

Just remembered a question I had about this mod.

 

Some of my products have long names and I find that if this mod pulls some of them up to display, then it throws the alignment out a little. ie. The three columns are no longer equally spaced.

 

Is there any way to force the columns to be say 33% width, and have the longer text wrap?

 

Jen


I haven't lost my mind - I have it backed up on disk somewhere.

Share this post


Link to post
Share on other sites

sorry... I didn't know there was anyone using this mod...

 

l'm using the standard boxes class that is part of osc.

 

If you want to force the size of your columns, try something like this....

 

in includes/modules/thumbads.php

find this line:

                    'params' => 'class="smallText" valign="top"',

 

and replace it with this:

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

 

This will pass your 33% width to the cell when the table is generated in boxes.php (or thema_boxes.php if you are using the Thema Packs mod).

 

Of course, this assumes that you are using 3 columns. If you want to make it more generic, you could try this:

  'params' => 'width="' . 100/THUMBADS_NUM_COLS .'%" class="smallText" valign="top"',

 

Good luck!

Share this post


Link to post
Share on other sites

Jen,

 

BTW... your site looks nice. I noticed that very often your thumbads don't have pictures associated. There are two ways you might correct this...

 

Change the sql query to only return products that have pictures associated...

  $sqlstring = "select products_id, products_image, products_price, products_tax_class_id from " . TABLE_PRODUCTS . " where products_price<'" . THUMBADS_MAX_PRICE . "' and products_price>'" . THUMBADS_MIN_PRICE . "' and products_image<>'' and products_status='1'";

 

or you can do something a little more flexible that I did on my website. Basically, I replaced the code that pulled the tep_image with a custom function that would return the manufacturer image if the product image was not available. I don't know if this would help in your case, but you might want to consider using this to return a default generic picture...

 

 

in includes/modules/thumbads.php (on my website), I have changed the code to look more like this:

$image_text = tep_get_product_image($random_product['products_id'],$random_product['products_image'],$random_product['products_name'],SMALL_IMAGE_WIDTH * THUMBADS_SCALE, SMALL_IMAGE_HEIGHT * THUMBADS_SCALE);



     $tempstring = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $image_text . '</a>';

 

if you compare, you will see that I changed the code to remove the call to tep_image and replaced it with my own custom function 'tep_get_product_image' (which I added to the includes/functions/html_output.php file):

//added JG Apodigm 3/16/03

function tep_get_product_image($pid,$img,$txt,$img_width,$img_height){

  if ($img != ''){

      $res = tep_image(DIR_WS_IMAGES . $img, $txt, $img_width, $img_height);

  } else {

     $manufacturer_img_query = tep_db_query("select m.manufacturers_image from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p  where p.products_id = '" . $pid . "' and p.manufacturers_id = m.manufacturers_id");

     if (tep_db_num_rows($manufacturer_img_query)) {

         $manufacturer = tep_db_fetch_array($manufacturer_img_query);

         $res =  tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $txt, $img_width);

      }

  }

 return $res;

}

Share this post


Link to post
Share on other sites

Also... for some more examples of the ThumbAds and ThumbBox mods... check here:

 

http://www.hipoparts.com/

 

The area called "Some Hot Items" is the thumbAds (which uses a "module" insert) and the area called "Quick Suggestions" uses the thumbBox. I originally intended the thumbBox to take up the space in the top left column area, but we replaced that with a featured_item box instead.

 

I have changed so much of my osCommerce code that I have a hard time remembering what is standard and what I have added, but I've tried to make a few contributions (like ThumbAds and menuBar) of the stuff that most people ask about.

 

JG

Share this post


Link to post
Share on other sites

Yes someone is using your contribution! It is a quiet achiever... :)

 

If you want to make it more generic, you could try this:

 

'params' => 'width="' . 100/THUMBADS_NUM_COLS .'%" class="smallText" valign="top"',

 

Perfect! Thanks.

 

About the images, I have been waiting to get photos of the products and they just came about 1/2 hour ago so I will have photos of everything soon. But thanks for the code suggestions anyhow - it will help someone else I'm sure.

 

thanks again

 

Jen


I haven't lost my mind - I have it backed up on disk somewhere.

Share this post


Link to post
Share on other sites

This works ok on my site except it does not display the tax inclusive price, can someone explain how to fix this so it does?

Share this post


Link to post
Share on other sites
This works ok on my site except it does not display the tax inclusive price, can someone explain how to fix this so it does?

 

I believe this is a setting defined in the admin console

Configuration Settings -> My Store -> Display prices with taxes

set it to true if you want the price displayed with the total amount after taxes.

 

This will be misleading sometimes. I've noticed that if a customer is not logged in, the system will assume that they are located in your home state (or zone) and apply taxes in that way. Once they create an account and specify a different location, it is very possible that thier total amount will change depending on the tax rules you specify for other locations.

Share this post


Link to post
Share on other sites

Is there any possible way of making Thumbads choose which category it grabs the random display of products from? i.e. instead of it pulling from every single category, it only pulls from a certain number of them that I desiginate?

Share this post


Link to post
Share on other sites

you could modify the SQL query to hard code a category id, or you could change it to use a category id that you specify in the configuration area.

 

in catalog/includes/modules/thumbads.php around line 42:

$sqlstring = "select products_id, products_image, products_price, products_tax_class_id from " . TABLE_PRODUCTS . " where products_price<'" . THUMBADS_MAX_PRICE . "' and products_price>'" . THUMBADS_MIN_PRICE . "' and products_status='1'";

 

change this sql query to match your desired category id.... something like this:

 

define('THUMBADS_DESIRED_CATEGORY_ID',1);

$sqlstring = "select p.products_id, p.products_image, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_price<'" . THUMBADS_MAX_PRICE . "' and p.products_price>'" . THUMBADS_MIN_PRICE . "' and p.products_status='1' and pc.products_id = p.products_id and pc.categories_id = '" . THUMBADS_DESIRED_CATEGORY_ID . "'";

 

If you want to make the selected category ID dynamic (instead of hard coded), you will need to remove the constant define statement and instead make the THUMBADS_DESIRED_CATEGORY_ID a configuration key.

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  

×