JustJoy Posted December 10, 2007 Posted December 10, 2007 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 Quote
germ Posted December 10, 2007 Posted December 10, 2007 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: Quote 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 >
JustJoy Posted December 10, 2007 Author Posted December 10, 2007 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! Quote
germ Posted December 10, 2007 Posted December 10, 2007 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 = ' '; Quote 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 >
Recommended Posts
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.