Jump to content

yeno

Members
  • Content count

    5
  • Joined

  • Last visited

Profile Information

  • Real Name
    Jan Prochazka

Recent Profile Visitors

1,657 profile views
  1. yeno

    Options as images

    Options as images GitHub Repository (since @Tsimi modular version 2.2) https://github.com/yenoyen/oscommerce-Options-as-images
  2. yeno

    Options as images

    @Tsimi some changes and improvements (Options_as_Images BS v2.2a) 1) Defined new constants (languages) Defined constants TEXT_SELECT_CATEGORY and TEXT_ENABLED_CATEGORIES catalog/admin/options_images.php changed lines 73-75, 194 catalog/admin/includes/languages/options_images.php added: define ('TEXT_SELECT_CATEGORY', 'Select an option category to edit: '); define ('TEXT_ENABLED_CATEGORIES', 'You currently have Options as Images enabled for the following options categories: '); 2) The full width thumbnails area (col-sm-12) This change makes the page shorter if there is a lot of thumbnails. catalog/includes/modules/content/product_info/ cm_pi_options_images.php (line 82) find: $options_images_output .= '<div class="col-sm-9">'; replace with: $options_images_output .= '<div class="col-sm-12">'; 3) CSS - separation of content and design Inline styles removed. Added to the installation instruction. catalog/includes/modules/content/product_info/templates/tpl_cm_pi_options_images.php 4) <h4> caption hidden if not used catalog/includes/modules/content/product_info/templates/tpl_cm_pi_options_images.php find: <h4 class="h3"><?php echo MODULE_CONTENT_PI_OI_HEADING_TITLE; ?></h4> <?php echo $options_images_output; ?> replace with: <?php if(defined(MODULE_CONTENT_PI_OI_HEADING_TITLE)) { echo' <h4 class="h3">' . MODULE_CONTENT_PI_OI_HEADING_TITLE .'</h4>'. PHP_EOL; } echo $options_images_output; ?> 5) Zoom Just CSS, other files are not affected. /* Options as images BOF */ /* Remove input from document flow */ label > input{ position: absolute; } /* IMAGE STYLES */ label > input + img { cursor: pointer; border: 2px solid transparent; } label > input + img:hover { -webkit-box-shadow: 1px 1px 5px 3px rgba(0,0,0,0.75); -moz-box-shadow: 1px 1px 5px 3px rgba(0,0,0,0.75); box-shadow: 1px 1px 5px 3px rgba(0,0,0,0.75); border: none; } /* (RADIO CHECKED) IMAGE STYLES */ label > input:checked + img { border: 2px solid #00d502; } /* ZOOM */ .cm-pi-options-images label:not(.control-label) { padding: 0px; transition: transform .33s; margin: 0 auto; max-width: 50vw; } .cm-pi-options-images label:not(.control-label):hover { z-index: 9; transform: scale(2.5); max-width: 100%; /* (Note: if the zoom is too large, it will go outside of the viewport) */ /* Maximum zoom scale should by 2.5 to be able to click the next thumbnail */ } /* Options as images block */ .cm-pi-options-images { margin-top: 0rem; margin-bottom: 5rem; } /* Options as images caption */ .cm-pi-options-images h4, .cm-pi-options-images h4.h3 { /* .h3 is not need but because of compatibility with older versions */ font-size: 110%; } /* Options labels */ .cm-pi-options-images .control-label { margin-top: 1rem; } /* Options as images EOF */ ToDo 1. Full width thumbnails without zoom for mobile devices 2. Bootstrap 4 form class="was-validated" to mark labels (products_options_name) of empty options which are required. May need to change the file catalog/product_info.php - add class to the form on line 46 (BS Frozen) Options_as_Images_BS_v2.2a.zip
  3. yeno

    Options as images

    Hi, @Tsimi the languages bug solved. catalog/admin/options_images.php fixed: (int)$languages_id instead of $language_id (lines 87, 122, 194) Deleted temporary line 12: $language_id = '1'; options_images.php
  4. Fatal error: Cannot redeclare class banktransfer in /path-to-your-dir/includes/modules/payment/banktransfer.php on line 13 The problem seems to be caused by the banktransfer module, the others work fine. This error has been included during the banktransfer module installation. @@Boldman's solution works in this case too: 1. before class banktransfer { add if (!class_exists('banktransfer')) { 2. before ?> in the end add } <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ if (!class_exists('banktransfer')) { // prevents "Cannot redeclare class banktransfer" issue class banktransfer { var $code, $title, $description, $enabled; // class constructor function banktransfer() { global $order; $this->code = 'banktransfer'; $this->title = MODULE_PAYMENT_BANKTRANSFER_TEXT_TITLE; $this->description = MODULE_PAYMENT_BANKTRANSFER_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_BANKTRANSFER_SORT_ORDER; $this->enabled = (( MODULE_PAYMENT_BANKTRANSFER_STATUS == 'True') ? true : false); if ((int)MODULE_PAYMENT_BANKTRANSFER_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_BANKTRANSFER_ORDER_STATUS_ID; } if (is_object($order)) $this->update_status(); $this->email_footer = MODULE_PAYMENT_BANKTRANSFER_TEXT_EMAIL_FOOTER; } // class methods function update_status() { global $order; if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_BANKTRANSFER_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_BANKTRANSFER_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $order->billing['zone_id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } } function javascript_validation() { return false; } function selection() { return array('id' => $this->code, 'module' => $this->title); } function pre_confirmation_check() { return false; } function confirmation() { return array('title' => MODULE_PAYMENT_BANKTRANSFER_TEXT_DESCRIPTION); } function process_button() { return false; } function before_process() { return false; } function after_process() { return false; } function output_error() { return false; } function check() { if (!isset($this->check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_BANKTRANSFER_STATUS'"); $this->check = tep_db_num_rows($check_query); } return $this->check; } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Allow Bank Transfer Payment', 'MODULE_PAYMENT_BANKTRANSFER_STATUS', 'True', 'Do you want to accept Bank Transfer Order payments?', '6', '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 ('Bank Sort Code', 'MODULE_PAYMENT_BANKTRANSFER_SORTCODE', '00-00-00', 'Bank sort code in the format 00-00-00', '6', '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 ('Bank Account No.', 'MODULE_PAYMENT_BANKTRANSFER_ACCNUM', '12345678', 'Bank Account No.', '6', '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 ('Bank Account Name', 'MODULE_PAYMENT_BANKTRANSFER_ACCNAM', 'Fred Bloggs', 'Bank account name', '6', '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 ('Bank Name', 'MODULE_PAYMENT_BANKTRANSFER_BANKNAM', 'The Bank', 'Bank Name', '6', '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 of display.', 'MODULE_PAYMENT_BANKTRANSFER_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, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_BANKTRANSFER_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('IBAN Number', 'MODULE_PAYMENT_BANKTRANSFER_IBAN', '00000000', 'IBAN number', '6', '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 ('SWIFT Number', 'MODULE_PAYMENT_BANKTRANSFER_SWIFT', '00000001', 'SWIFT number', '6', '1', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_BANKTRANSFER_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return $keys = array( 'MODULE_PAYMENT_BANKTRANSFER_STATUS', 'MODULE_PAYMENT_BANKTRANSFER_SORTCODE', 'MODULE_PAYMENT_BANKTRANSFER_ACCNUM', 'MODULE_PAYMENT_BANKTRANSFER_ACCNAM', 'MODULE_PAYMENT_BANKTRANSFER_BANKNAM', 'MODULE_PAYMENT_BANKTRANSFER_IBAN', 'MODULE_PAYMENT_BANKTRANSFER_SWIFT', 'MODULE_PAYMENT_BANKTRANSFER_SORT_ORDER', 'MODULE_PAYMENT_BANKTRANSFER_ZONE', 'MODULE_PAYMENT_BANKTRANSFER_ORDER_STATUS_ID'); } } } ?>
  5. I don't think this error is not caused by installs of older versions. I run @@gburton's Responsive-osCommerce 2.3.4 (master) and there is the same "banktransfer class" issue.
×