Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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_footer_wishlist {
- var $code;
- var $group;
- var $title;
- var $description;
- var $sort_order;
- var $enabled = false;
- function cm_footer_wishlist() {
- $this->code = get_class($this);
- $this->group = basename(dirname(__FILE__));
- $this->title = MODULE_CONTENT_FOOTER_WISHLIST_TITLE;
- $this->description = MODULE_CONTENT_FOOTER_WISHLIST_DESCRIPTION;
- if ( defined('MODULE_CONTENT_FOOTER_WISHLIST_STATUS') ) {
- $this->sort_order = MODULE_CONTENT_FOOTER_WISHLIST_SORT_ORDER;
- $this->enabled = (MODULE_CONTENT_FOOTER_WISHLIST_STATUS == 'True');
- }
- }
- function execute() {
- global $wishList, $currencies, $languages_id, $oscTemplate;
- $content_width = (int)MODULE_CONTENT_FOOTER_WISHLIST_CONTENT_WIDTH;
- $counter = $wishList->count_contents();
- if ($counter > 0) {
- $wishlist_content = '';
- $wish_products = $wishList->get_wishlist_products();
- $n=sizeof($wish_products);
- if ($n <= MAX_DISPLAY_WISHLIST_BOX) {
- for ($i=0; $i<$n; $i++) {
- $wishlist_content .= '<li>';
- $wishlist_content .= $wish_products[$i]['quantity'] . ' x ';
- $wishlist_content .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wish_products[$i]['id']) . '">';
- $wishlist_content .= $wish_products[$i]['name'];
- $wishlist_content .= '</a></li>';
- }
- $wishlist_content .= '<li><span class="col-xs-6 col-xs-offset-6" style="border-bottom:solid 1px;"> </span></li>';
- $wishlist_content .= '<li class="text-right">' . TEXT_WISHLIST_TOTAL . $currencies->format($wishList->show_total()) . '</li>';
- }
- $wishlist_content .= '<a href="' . tep_href_link(FILENAME_WISHLIST) . '">' . sprintf(TEXT_FOOTER_WISHLIST_COUNT, $counter) . '</a>';
- } else {
- $wishlist_content = '<p>' . MODULE_CONTENT_FOOTER_WISHLIST_EMPTY . '</p>';
- }
- ob_start();
- include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/wishlist.php');
- $template = ob_get_clean();
- $oscTemplate->addContent($template, $this->group);
- }
- function isEnabled() {
- return $this->enabled;
- }
- function check() {
- return defined('MODULE_CONTENT_FOOTER_WISHLIST_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 Account Footer Module', 'MODULE_CONTENT_FOOTER_WISHLIST_STATUS', 'True', 'Do you want to enable the Wishlist content module?', '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 Width', 'MODULE_CONTENT_FOOTER_WISHLIST_CONTENT_WIDTH', '3', 'What width container should the content be shown in? (12 = full width, 6 = half width).', '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 " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_FOOTER_WISHLIST_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_CONTENT_FOOTER_WISHLIST_STATUS', 'MODULE_CONTENT_FOOTER_WISHLIST_CONTENT_WIDTH', 'MODULE_CONTENT_FOOTER_WISHLIST_SORT_ORDER');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement