Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I'm using this contribution called Products_Sold, what it does is allows you to choose sold or not sold as product status and still display the item in the catalog. However once you get to product description you can use a button that says "sold" and the original buy now button goes away.

 

What i'd like to modify is the location that the Sold button appears in the category table. Here is a link to show you what i'm talking about :

 

http://www.joysvintagejewels.com/store/index.php?cPath=22

 

In the Product Category table the word Sold appears directly next to the picture under the image column, i'd like to put it instead under the Buy Now Column...the very last one. I think it will look better there.

 

I don't know how to change this, i'm thinking (and mind you I know very little php i'm guessing and mucking my way through at the moment.) that it has to be some new "else if statement" that would apply to that column and allow the sold.gif file to appear there.

 

If someone could help me figure this one out i'd be greatful, I also would like to add it to update the contribution.

 

Here is the code in the catalog / includes / modules / product_listing.php that I changed

 

// BOF Products_Sold v1.0
	  case 'PRODUCT_LIST_IMAGE':
		$lc_align = 'center';
		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']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
			if ($listing['products_sold'] == '1')	{
		$lc_text .= ' ' . tep_image (DIR_WS_LANGUAGES . $language . '/'  . DIR_WS_IMAGES . 'sold.gif', '',  SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=ABSMIDDLE');
	}
		} else {
		  $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
	if ($listing['products_sold'])	{
		$lc_text .= ' ' . tep_image (DIR_WS_LANGUAGES . $language . '/'  . DIR_WS_IMAGES . 'sold.gif', '',  SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=ABSMIDDLE');
	}
		}
		break;
	  case 'PRODUCT_LIST_BUY_NOW':
	if ($listing['products_sold'] == '1')	{
				$lc_align = 'center';
				$lc_text = ' ';
	} else {
		$lc_align = 'center';
				$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';						
			}
		  break;
 // EOF Products_Sold v1.0

Posted

BEFORE MAKING ANY EDITS, BACKUP YOUR EXISTING FILE!!!

 

Maybe this:

 

// BOF Products_Sold v1.0
	  case 'PRODUCT_LIST_IMAGE':
		$lc_align = 'center';
		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']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
			if ($listing['products_sold'] == '1')	{
		$lc_text .= ' ' . tep_image (DIR_WS_LANGUAGES . $language . '/'  . DIR_WS_IMAGES . 'sold.gif', '',  SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=ABSMIDDLE');
	}
		} else {
		  $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
	if ($listing['products_sold'])	{
//
// I moved the code for the image from here.......
//
	}
		}
		break;
	  case 'PRODUCT_LIST_BUY_NOW':
	if ($listing['products_sold'] == '1')	{
//
// ..... to here
//
		$lc_text .= ' ' . tep_image (DIR_WS_LANGUAGES . $language . '/'  . DIR_WS_IMAGES . 'sold.gif', '',  SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align=ABSMIDDLE');
	} else {
		$lc_align = 'center';
				$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';						
			}
		  break;
 // EOF Products_Sold v1.0

Although. the image you're using may be too large for the column you're trying to fit it into...

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Well that worked! Thank you!! The image is just a quickie I can fix that :)

I like to get things laid out first. Only thing now is the price is repeated, I will play around and see if I can get rid of it.

 

Off to go toy with more stuff, thinking of buying a basic php book :) My background is in html and obsolete programming languages, so the code is starting to make sense but this is my first time working in this enviornment.

 

I am going to update the package in case anyone else wants it and give you credit for the correction :) Thanks again!

Posted

Maybe change this part:

 

//
// I moved the code for the image from here.......
//

to:

// I moved the code for the image from here.......
//
				$lc_align = 'center';
				$lc_text = ' ';

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

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