gerard Posted February 26, 2006 Posted February 26, 2006 I would like to add the "whatsnew.php" infobox to another web site, as a rotating advertisment. Has this been done befroe. eg. os is installed in shop.johndoe.com and I would like to advertise "whats new" on a page in www.johndoe.com they would both be on the same server but with different domain?
gerard Posted February 26, 2006 Author Posted February 26, 2006 there is one here @ http://www.oscommerce.com/community/contri...ons,1075/page,6 I would like to alter its size and not inherit its properties form application_top will post if I suceed.
gerard Posted February 26, 2006 Author Posted February 26, 2006 Here is my hack solution?It is a hack but works copy whats_new.php and rename to advert.php rename the line in the new code above to now point to advert.php comment out the price information as below, and remove the small_image_size and small_image_width. I still am getting the arrow and the corner_left_right.gif appearing above but will remove that. heres the new code. <?php /* $Id: whats_new.php,v 1.31 2003/02/10 22:31:09 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) { ?> <!-- whats_new //--> <tr> <td> <?php $random_product['products_name'] = tep_get_products_name($random_product['products_id']); $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']); $info_box_contents = array(); $info_box_contents[] = array(); new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW)); if (tep_not_null($random_product['specials_new_products_price'])) { $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>'; $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; } else { // $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); } $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name']) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $whats_new_price); new infoBox($info_box_contents); ?> </td> </tr> <!-- whats_new_eof //--> <?php } ?>
maniac101 Posted February 26, 2006 Posted February 26, 2006 Also - try external info box contrib. I use this in conjunction with the 'featured products with admin' contribution to show a random featured product set on another website i.e i control which products are shown from a list fo featured products rather then just 'whats new'. It uses javascript include on the remote site rather then php so its less of a feed and isnt Search engine friendly but it minimises impact on other site. I must admit i couldnt get the external style sheet reference link working so i ended up hard-coding style info on the remote site too, but it works well. Mark Regards Mark Brindle
gerard Posted February 28, 2006 Author Posted February 28, 2006 thanks for that what I am trying to do but failing at the moment is add an info box like "infobox anywhere" that selects a random image and link for only one catergory?? and is not time limited to whats new?? I guess a rotating advert for that catergory. ANy help would be appreciated.
maniac101 Posted February 28, 2006 Posted February 28, 2006 Hi, you could try the 'featured products' contrib like we do - this allows you to make a list of 'your best products' from any catagory or just one if you want. You dont have to display it on the site - just use it for your remote links. As an example of it working see www.eyeball-surfcheck.co.uk (look on left bar on main entry page). We have an add for Genesis surf shop that shows one product at random from our featured list. The contrib lets you setup the product list in admin. We use this contrib on the website instead of whatsnew as i got fed up seeing only the last x products i'd uploaded on the front page. This is coupled with an external infobox contrib to make it visible on the remote site. If thats the sort of thing you want i can be a bit more explicit in details.. Regards Mark Brindle
gerard Posted February 28, 2006 Author Posted February 28, 2006 Thanks again, thats pretty much exactly what I want to acheive. And I am happy set up a featured products contrib, how did you acheive this?? Thanks again G
maniac101 Posted February 28, 2006 Posted February 28, 2006 ok, first install the featured products contrib. Get that working properly and try replacing your 'whats new' box with it - or add it before or after the whatsnew box if you want both. Info is all in the contrib for doing that. see featured products contrib 651 Also install the external link contrib You will need to hack it a bit but its only one file. I will dig out my copy of this and see what changes i made - i think i just adjusted the number of product displayed to 1 instead of 6 or whatever - its basically an infobox on a remote site that could link to 'any' infobox really - as its embedded as a javascript link. You will need to play about with getting the look and feel of it right - its supposed to be able to use a style sheet but i found i couldnt get that to work directly and had to embed style info into the other site. I think i made a duplicate of the featured products file (and renamed it) so i could use featured on the main shop site and a modified version on the external site. Mark Regards Mark Brindle
gerard Posted March 1, 2006 Author Posted March 1, 2006 Thanks I did have this instaled but was unsucsessful with reducing the number of images to one, could I see your featured.php code?? What I did is not alter the english to featured and kept to whats new and then used featured from infobox anywhere, it worked but for the 6 links instead of one. G
maniac101 Posted March 1, 2006 Posted March 1, 2006 Hi Gerard, featured products count is set in admin - not hard coded. (look under configuration - featured). The default is 6 so if you set to 1 then it should work ok if you dont use featured on the site itself. I hard coded the number in the featured (copy) that i use for external so i could stick with 6 on the site itself. Regards Mark Brindle
gerard Posted March 1, 2006 Author Posted March 1, 2006 Hi Gerard,featured products count is set in admin - not hard coded. (look under configuration - featured). The default is 6 so if you set to 1 then it should work ok if you dont use featured on the site itself. I hard coded the number in the featured (copy) that i use for external so i could stick with 6 on the site itself. I am using version. 1.5.4 and I don't have that, In catalog I have featured and I can only add or delete products, I do not have anything in configuration to set the number?? thanks again for repling regards gerard
gerard Posted March 1, 2006 Author Posted March 1, 2006 after some digging around for some reason I did not have INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) values ('39','Featured', 'Featured Products Display', '339', '1' ); INSERT into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) values ('Display Featured Products', 'FEATURED_PRODUCTS_DISPLAY', 'true', 'Set to true or false in order to display featured.', '39', '1', now(), now() ); INSERT into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) values ('Maximum Display of Featured', 'MAX_DISPLAY_FEATURED_PRODUCTS', '6', 'This is the maximum amount of items to display on the front page.', '39', '2', now(), now() ); in my db, so have entered it now and I am getting the options, thanks again
gerard Posted March 1, 2006 Author Posted March 1, 2006 next question maniac101 Have got it to work fine, even with the style sheet, but how did you stop it including the catalog/images/infobox/cornerleft.gif and corner_right_left.gif I see you even added your own logos???? Thanks gerard
maniac101 Posted March 2, 2006 Posted March 2, 2006 Hi Gerard, have a look at the \includes\modules\featured.php - make sure this is what you are including as your oputput to the box being generated. I edited my (copy) of this to customise it for my needs - including adding logos etc. example of this around line 24 now: if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) { $info_box_contents[] = array('align' => 'left', 'text' => '<a class="infoBoxHeading" title="Genesis Surf shop Ilfracombe for Roxy Balin Quiksilver and more top brands" target="genesis" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . ' Genesis Online' . '</a>'); and also from my line 54 showing the ending of the infobox: $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a target="genesis" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], 110, SMALL_IMAGE_HEIGHT) . '</a><br><a class="infoBoxtext" target="genesis" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br><s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br><font color="red">' . $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</font><br><img src="images/genesis-eyeball.jpg" width="110" height="27" border="0" alt="Genesis Surf shop Ilfracombe for Black Salamander Animal Billabong Arnette and more top brands">'); } else { $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a target="genesis" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], 110, SMALL_IMAGE_HEIGHT) . '</a><br><a class="infoBoxtext" target="genesis" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '<br><img src="images/genesis-eyeball.jpg" width="110" height="27" border="0" alt="Genesis Surf shop Ilfracombe for Roxy Balin Quiksilver and more top brands">'); } You should be able to just customise the output in a similar way to change teh styles used, colours, links and tags and logos etc. Hope that helps finish this for you. mark Regards Mark Brindle
Recommended Posts
Archived
This topic is now archived and is closed to further replies.