Latest News: (loading..)

Search the Community

Showing results for tags 'header plugin'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News and Announcements
    • News and Announcements
    • Partner Announcements
    • Ambassadors
  • Commercial Support
    • Developer Feedback
  • osCommerce Online Merchant v2.x
    • General Support
    • Installation and Configuration
    • Upgrading from Earlier Versions (v2.x to v2.x)
    • Add-Ons
    • Tips and Tricks
    • Security
  • Development
    • osCommerce Online Merchant v2.4
    • osCommerce Online Merchant Community Bootstrap Edition
    • osCommerce Online Merchant v3.x
    • Development Proposals
  • General
    • OSCOMMERCE.TV
    • Next Steps / Optimizations / Marketing
    • Live Shop Reviews
    • E-Commerce Laws
    • General Discussions
    • PHP / SQL / Web Design

Found 1 result

  1. I have made a quick easy addon for anyone interested. Please test it and leave any feedback if anything seems incorrect or wrongly coded. It simply adds a small bar with the current Shopping cart totals into the Header bar. You can resize it in Admin so it can sit nicely with the Shop Logo and the Search Bar (if you have those turned on). It resizes nicely in XS mobile view. Testing welcome, and any tips to improve is welcome. Instructions 1.) Copy and paste code below into a file called "cm_headercart.php" and place file into this location: "includes/modules/content/header/" <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ class cm_headercart { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function cm_headercart() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_CONTENT_HEADERCART_TITLE; $this->description = MODULE_CONTENT_HEADERCART_DESCRIPTION; if ( defined('MODULE_CONTENT_HEADERCART_STATUS') ) { $this->sort_order = MODULE_CONTENT_HEADERCART_SORT_ORDER; $this->enabled = (MODULE_CONTENT_HEADERCART_STATUS == 'True'); } } function execute() { global $PHP_SELF, $cart, $lng, $language, $currencies, $HTTP_GET_VARS, $request_type, $currency, $oscTemplate; $content_width = MODULE_CONTENT_HEADERCART_CONTENT_WIDTH; ob_start(); include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/headercart.php'); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_CONTENT_HEADERCART_STATUS'); } function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Header Cart Module', 'MODULE_CONTENT_HEADERCART_STATUS', 'True', 'Do you want to enable the Header Cart content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_HEADERCART_CONTENT_WIDTH', '4', 'What width container should the content be shown in?', '6', '1', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_HEADERCART_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_CONTENT_HEADERCART_STATUS', 'MODULE_CONTENT_HEADERCART_CONTENT_WIDTH', 'MODULE_CONTENT_HEADERCART_SORT_ORDER'); } } 2.) Copy and paste code below into a file called "headercart.php" and place file into this location: "includes/languages/english/modules/content/header/templates/" Feel free to change the div classes or layout to your preference. With this code, the cart total bar resizes nicely in XS View. <div class="col-sm-<?php echo $content_width; ?>"> <!-- Shopping Cart Starts --> <div class="searchbox-margin"> <div class="hidden-xs text-center-xs"> <a role="button" class="btn btn-info btn-block" href="<?php echo tep_href_link(FILENAME_SHOPPING_CART)?>"><i class="glyphicon glyphicon-shopping-cart"></i> <?php echo HEADERCART_TEXT . $cart->count_contents() . ' ' . HEADERCART_ITEMS . ' - ' . $currencies->format($cart->show_total()); ?></a> </div> </div> <div class="visible-xs text-center-xs"> <a role="button" class="btn btn-info btn-block" href="<?php echo tep_href_link(FILENAME_SHOPPING_CART)?>"><i class="glyphicon glyphicon-shopping-cart"></i> <?php echo $cart->count_contents() . ' ' . HEADERCART_ITEMS . ' - ' . $currencies->format($cart->show_total()); ?></a> </div> <div class="clearfix"></div> <br> <!-- Shopping Cart Ends --> </div> 3.) Copy and paste code below into a file called "cm_headercart.php" and place file into this location: "includes/languages/english/modules/content/header/" <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ define('MODULE_CONTENT_HEADERCART_TITLE', 'Header Cart'); define('MODULE_CONTENT_HEADERCART_DESCRIPTION', 'Adds Shopping Cart into the Header Area of your site.'); define('HEADERCART_TEXT', 'Cart: '); define('HEADERCART_ITEMS', 'Item(s) '); 4.) Add to "user.css" file. I put this to move the bar slightly down so it centers with the shop logo and also used this same class and outer div on the searchbox module template so they line up nicely. You can remove or change these if you are doing your own layout. .searchbox-margin { margin-top: 10px; margin-bottom: 10px; }