Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Anyone using ThumbAds contribution?


guanche

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.

Link to comment
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 ;)

Link to comment
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?

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
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.

Link to comment
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!

Link to comment
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;

}

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

  • 1 month later...
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.

Link to comment
Share on other sites

  • 3 weeks later...

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?

Link to comment
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.

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.
Note: Your post will require moderator approval before it will be visible.

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