Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Displaying "Free Shipping" before price.


Guest

Recommended Posts

Hi,

 

Since I offer free shipping on all items in my store, I'd like to have "Free Shipping" displayed with every product listing. Right now it's hard coded into every item via the admin panel and doesn't look that great for bestsellers or when a customer puts an item in their cart. I'm sure this is very simple to do, but I just can't find where to do it.

 

Here's an example of what I'm talking about: My Webpage

 

I like how all of the products are displayed with free shipping in bold, but I don't want it displayed in the best sellers list.

 

Any help would be appreciated.

 

swb03

Link to comment
Share on other sites

If you go to my site My Webpage, then click on any of the categories (ie. Bean Bags, Foof Chairs, etc.), you'll see 3 rows x 3 columns of product for that category. That's where I want it displayed. It's there now, but I added it to the description of every product via the admin console. I don't want it displayed in product_info.php, bestsellers or specials.

 

Hope that clarified things.

 

Thanks for the response.

 

Sean

Link to comment
Share on other sites

It looks to me like you only want it in the product listing, and no where else (not on shopping cart, packing slips, invoices, etc, right?)

 

I think the easiest thing would be to remove it from the products themselves and add it to the product_listing. That way it automatically displays and you don't need to have it in the products name.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Line 95-102 of includes/modules/product_listing.php:

 

 case 'PRODUCT_LIST_NAME':
		$lc_align = '';
		if (isset($HTTP_GET_VARS['manufacturers_id'])) {
		  $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
		} else {
		  $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';
		}
		break;

 

Change it to something like:

 

 case 'PRODUCT_LIST_NAME':
		$lc_align = '';
		if (isset($HTTP_GET_VARS['manufacturers_id'])) {
		  $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a><br><b>Free Shipping</b>';
		} else {
		  $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a><br><b>Free Shipping</b> ';
		}
		break;

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

That's exactly what I was looking for. Now I just need to go through every product and remove it from the description.... :(

 

Thank you very much for your help.

 

Sean

Link to comment
Share on other sites

You should be able to do something like this:

 

<?php
include('includes/application_top.php');

$query = tep_db_query("select products_id, language_id, products_name from products_description");
while( $row = tep_db_fetch_array($query) ) {
 $products_name = str_replace( '<br><b>Free Shipping</b>', '', $row['products_name'] );
 $update = tep_db_query("update products_description set products_name='".$products_name.'" where products_id='".$row['products_id']."' and language_id='".$row['language_id']."'");
 echo 'updated '.$row['products_name'].' to '.$products_name.'<br>';
}
?>

 

Save it in your admin directory and run it. You will want to make a backup of your database before you do this, since it will change all product names. You also need to make sure that the part you're searching for the replace (in my example '<br><b>Free Shipping</b>') is the text you use to create that Free Shipping part.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...