Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted (edited)

I installed this add on

http://addons.oscommerce.com/info/8162/v,23

and i really like it but i need to style it to look like my existing specials box

is this possible?

I was able to get the <div class="ui-widget-header infoBoxHeading"> to look like mine but was unsuccessful with the rest..

 

here is my existing bm_specials.php

 

 

<?php
/*
$Id$
Open Source E-Commerce Solutions
http://www.agvinyldesigns.com
Copyright (c) 2012
Released under the GNU General Public License
*/
class bm_specials {
var $code = 'bm_specials';
var $group = 'boxes';
var $title;
var $description;
var $sort_order;
var $enabled = false;
function bm_specials() {
 $this->title = MODULE_BOXES_SPECIALS_TITLE;
 $this->description = MODULE_BOXES_SPECIALS_DESCRIPTION;
 if ( defined('MODULE_BOXES_SPECIALS_STATUS') ) {
 $this->sort_order = MODULE_BOXES_SPECIALS_SORT_ORDER;
 $this->enabled = (MODULE_BOXES_SPECIALS_STATUS == 'True');
 $this->group = ((MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
 }
}
function execute() {

 global $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate;
 if (!isset($HTTP_GET_VARS['products_id'])) {
 if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {


	 $style = 'style="width:'.SMALL_IMAGE_WIDTH.'px;height:'.SMALL_IMAGE_HEIGHT.'px;"';


 $product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$random_product['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
 $product = tep_db_fetch_array($product_query);

$p_id = $random_product['products_id'];
//********************IF Free Ship*********//
 $freeship_str = '';
 if(tep_products_ship_free_check($p_id))
		 $freeship_str = '<br /><span class="smallText">(' . TEXT_PRODUCT_SHIPS_FREE . ')</span>';
 //*****************************************//
 $name_prod = '<span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='.$p_id) . '">' . $random_product['products_name'] . '</a></span>';
 $pic_prod = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='.$p_id) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], BOX_IMAGE_WIDTH, BOX_IMAGE_HEIGHT,'').'';
 $sp_price_1 = '<span class="productSpecialPrice fl_left">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])).'</span>';
 $sp_price_2 = '<del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del>';
 $sp_price =''.$sp_price_1.' '.$sp_price_2.$freeship_str .'';
 $p_desc = mb_substr(strip_tags($product['products_description']), 0, MAX_DESCR_BOX, 'UTF-8').'...';

 $p_details = '<a class="bg_button2" onmouseout="this.className=\'bg_button2\';" onmouseover="this.className=\'bg_button2-act\';" href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button('button_details.gif', '', ' class="btn1"').'</a>';
 $p_details_text = '<div class="bg_button2" onmouseout="this.className=\'bg_button2\';" onmouseover="this.className=\'bg_button2-act\';">' .tep_draw_button_top() . '<a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '" id="tdb1" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-priority-secondary" role="button"><span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-e"></span><span class="ui-button-text">'. IMAGE_BUTTON_DETAILS .'</span></a>' . tep_draw_button_bottom().'</div>';
 $p_buy_now = '<a class="bg_button22" onmouseout="this.id=\'bg_button22\';" onmouseover="this.id=\'bg_button22-act\';" href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">' .tep_draw_button_top() . ''. IMAGE_BUTTON_IN_CART .'' . tep_draw_button_bottom().'</a>';
 $p_buy_now_text = '<div class="bg_button22" onmouseout="this.className=\'bg_button22\';" onmouseover="this.className=\'bg_button22-act\';">' .tep_draw_button_top() . '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'" id="tdb1" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-priority-secondary" role="button"><span class="ui-button-icon-primary ui-icon ui-icon-cart"></span><span class="ui-button-text">'. IMAGE_BUTTON_IN_CART .'</span></a>' . tep_draw_button_bottom().'</div>';

	 $data = '<div class="ui-widget infoBoxWrapper">' . tep_draw_box_wrapper_top() .
			 ' <div class="infoBoxHeading">' . tep_draw_box_title_top() . '<a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . MODULE_BOXES_SPECIALS_BOX_TITLE . '</a>' . tep_draw_box_title_bottom() . '</div>' .
			 ' <div class="infoBoxContents prods_pic_bg">' . tep_draw_box_content_top() .

			 '
'.$pic_prod.'			
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 <tr><td class="name name_padd">'.$name_prod.'</td></tr>
 <tr><td class="price_padd">'.$sp_price.'</td></tr>
 <tr><td class="button__padd">'.$p_buy_now.'</td></tr>
</table>'. "\n".
			 '' . tep_draw_box_content_bottom() . '</div>'. "\n".
			 '' . tep_draw_box_wrapper_bottom() . '</div></a>';
	 $oscTemplate->addBlock($data, $this->group);
 }
 }
}
function isEnabled() {
 return $this->enabled;
}
function check() {
 return defined('MODULE_BOXES_SPECIALS_STATUS');
}
function install() {
 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Specials Module', 'MODULE_BOXES_SPECIALS_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");
 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_SPECIALS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
}
function remove() {
 tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function keys() {
 return array('MODULE_BOXES_SPECIALS_STATUS', 'MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT', 'MODULE_BOXES_SPECIALS_SORT_ORDER');
}
}
?>

 

 

and here is the bm_specials_scroll.php

 

 

<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2010 osCommerce
Released under the GNU General Public License
*/
class bm_specials_scroll {
var $code = 'bm_specials_scroll';
var $group = 'boxes';
var $hader_tag = 'header_tags';
var $title;
var $description;
var $sort_order;
var $enabled = false;
function bm_specials_scroll() {
 $this->title = MODULE_BOXES_SPECIALS_SCROLL_TITLE;
 $this->description = MODULE_BOXES_SPECIALS_SCROLL_DESCRIPTION;
 if ( defined('MODULE_BOXES_SPECIALS_SCROLL_STATUS') ) {
 $this->sort_order = MODULE_BOXES_SPECIALS_SCROLL_SORT_ORDER;
 $this->enabled = (MODULE_BOXES_SPECIALS_SCROLL_STATUS == 'True');
 $this->group = ((MODULE_BOXES_SPECIALS_SCROLL_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
 }
}
function execute() {
 global $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate;
 if ( MODULE_BOXES_SPECIALS_SCROLL == 'True' ) {
 $rp_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc");
 if (tep_db_num_rows($rp_query)) {
	 $i = 0;
	 while ($random_product = tep_db_fetch_array($rp_query)) {
	 $pausecontent[$i] = "<center><a href=\'" . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . "\'>" . tep_image(DIR_WS_IMAGES . $random_product['products_image'], tep_output_string($random_product['products_name'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>', '&' => '&')), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . "</a><br/><a href=\'" . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . "\'>" . tep_output_string($random_product['products_name'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>', '&' => '&')) . "</a><br/><s>" . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . "</s><br/><span class=\'productSpecialPrice\'>" . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id']))."</span></center><br/><br/>";
	 $i++;
	 }
 }
 $javascript = '';
 for ($i = 0, $size = sizeof($pausecontent); $i < $size; ++$i) {
	 $javascript .= "pausecontent[".$i."] = '".$pausecontent[$i]."';" . PHP_EOL;
 }
 $header_tag = '<script type="text/javascript" src="ext/jquery/specialsRotator/specialsRotator.js"></script>' . PHP_EOL .
 '<script type="text/javascript">' . PHP_EOL .
 '//<![CDATA[' . PHP_EOL .
 '/* merge server php and client javascript arrays */' . PHP_EOL .
 'var pausecontent=new Array();' . PHP_EOL .
 $javascript . PHP_EOL .
 '//]]>
 </script>';
 $oscTemplate->addBlock( $header_tag, $this->hader_tag );
 $scroller = "<script type='text/javascript'>new pausescroller(pausecontent, 'pscroller1', 'someclass', 2000);</script>";
 if (!isset($HTTP_GET_VARS['products_id'])) {
	 if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
	 $data = '<div class="ui-widget infoBoxContainer">' .
			 ' <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . MODULE_BOXES_SPECIALS_SCROLL_BOX_TITLE . '</a></div>' .
			 ' <div class="ui-widget-content infoBoxContents" style="text-align: center;">'.$scroller . '</span></div>' .
			 '</div>';
	 $oscTemplate->addBlock($data, $this->group);
	 }
 }
 } else {
 if (!isset($HTTP_GET_VARS['products_id'])) {
	 if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
	 $data = '<div class="ui-widget infoBoxContainer">' .
			 ' <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . MODULE_BOXES_SPECIALS_SCROLL_BOX_TITLE . '</a></div>' .
			 ' <div class="ui-widget-content infoBoxContents" style="text-align: center;"><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'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br /><del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br /><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span></div>' .
			 '</div>';
	 $oscTemplate->addBlock($data, $this->group);
	 }
 }
 }
}
function isEnabled() {
 return $this->enabled;
}
function check() {
 return defined('MODULE_BOXES_SPECIALS_SCROLL_STATUS');
}
function install() {
 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Specials Module', 'MODULE_BOXES_SPECIALS_SCROLL_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_SPECIALS_SCROLL_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");
 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_SPECIALS_SCROLL_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Specials Scroll', 'MODULE_BOXES_SPECIALS_SCROLL', 'True', 'Do you want to enable specials scroll in the module to your shop?', '6', '2', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
}
function remove() {
 $key = array('MODULE_BOXES_SPECIALS_SCROLL_STATUS', 'MODULE_BOXES_SPECIALS_SCROLL_CONTENT_PLACEMENT', 'MODULE_BOXES_SPECIALS_SCROLL_SORT_ORDER', 'MODULE_BOXES_SPECIALS_SCROLL');

 tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $key) . "')");
}
function keys() {
 return array('MODULE_BOXES_SPECIALS_SCROLL_STATUS', 'MODULE_BOXES_SPECIALS_SCROLL_CONTENT_PLACEMENT', 'MODULE_BOXES_SPECIALS_SCROLL_SORT_ORDER', 'MODULE_BOXES_SPECIALS_SCROLL', 'MAX_RANDOM_SELECT_SPECIALS');
}
}
?>

 

 

This is what it looks like stock

post-320196-0-49978700-1386450852_thumb.png

 

This is what im looking for

post-320196-0-16270100-1386450333_thumb.jpg

 

This is the best i could get.

post-320196-0-06480200-1386451104_thumb.png

Edited by VinylDesigns

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