Jump to content

De Dokta

Members
  • Content count

    329
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by De Dokta

  1. De Dokta

    Latest News Multilingual

    Hi In 2.3.4BS it's a little bit different: Insert ' <li><a href="' . tep_href_link(FILENAME_LATEST_NEWS) . '">' . MODULE_BOXES_INFORMATION_BOX_NEWS . '</a></li>' . into includes\modules\boxes\templates\information.php. J.J.
  2. Hi In index.php look for: <h1><?php echo $catname; ?></h1> Change it to something like: <?php echo tep_image(DIR_WS_IMAGES .$image['categories_image'], $image['categories_image'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT); ?> <h1><?php echo $catname; ?></h1> and you will see the subcategories image, if the subcategory is selected. J.J.
  3. Hi, not really! I discussed the issue with Tsimi and we found that PP Express returns the user to checkout_confirmation, while PP Standard returns him to checkout_success: So PP Express can be used with PWA, PP Standard does not work with the add-on. Actually I have no idea how to solve the problem......... J.J.
  4. De Dokta

    State Selector for BS

    Artisan Foundry, on 12 May 2015 - 21:20, said: There's a <div class="form-group"> in address_book_details.php. Change it to <div class="form-group has-feedback"> and the asterix will be in the right place. J.J.
  5. @@raiwa Thanks for your advice. :) Just working on some improvements (I hope) on different of my add-ons - among them also the PWA addon. I'll add the changes you proposed to the next release. J.J.
  6. @@Tsimi Yes, you are right! :- The only way to add a wishlist button to the product_listing seems to be to define a new case 'add_to_wishlist' in application_top: Right before: case 'notify' : if (tep_session_is_registered('customer_id')) { insert: /*Wish List */ case 'add_to_wishlist' : if (isset($_GET['products_id'])) { if (tep_has_product_attributes($_GET['products_id'])) { tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_GET['products_id'])); } else { $wishList->add_wishList($_GET['products_id'], $wishList->get_quantity($_GET['products_id'])+1); } } tep_redirect(tep_href_link('wishlist.php', tep_get_all_get_params($parameters))); break; /* /Wish List End */ And then in product_listing add something like: $prod_list_contents .= ' <div class="col-xs-6">' . tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_to_wishlist&products_id=' . $listing['products_id']), NULL, NULL, 'btn-default btn-sm') . '</div>'; Works for me on bs-gold........ J.J.
  7. Hi yes it's possible with a little trick! :rolleyes: In includes/modules/product_listing.php somewhere around the buttons area add (depends on where you want to have the wishlist button): $prod_list_contents .= ' <div class="col-xs-6">' . tep_draw_form('cart_quantity', tep_href_link('product_info.php', tep_get_all_get_params(array('action')) . 'action=add_product')) . tep_draw_hidden_field('products_id', $listing['products_id']) . tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', null, 'primary', array('params' => 'name="wishlist" value="wishlist"')) . '</form ></div>'; J.J.
  8. Hi Rainer pls. do what ever you want with the code snippets. :) J.J.
  9. And in another scenario where the module doesn't create a new table but alters an exitisting table by adding a new column, you can check if this column already exists (and avoid an error message) with: if (tep_db_num_rows(tep_db_query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='". DB_DATABASE . "' AND TABLE_NAME='customers' AND COLUMN_NAME LIKE 'customers_guest'")) != 1 ) { tep_db_query("alter table customers add column `customers_guest` INT(1) NOT NULL DEFAULT '0' AFTER `customers_newsletter`"); }
  10. If you want to remove the add-to-cart button but use the wishlist function, keep the hidden field intact. <div class="col-xs-6 text-right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'glyphicon glyphicon-shopping-cart', null, 'primary', null, 'btn-success'); ?></div>
  11. @@gvv For single products you can try this: function isEnabled() { if (strpos($_SERVER['REQUEST_URI'],'products_id=28') !== false) { $this->enabled = false; }else{ return $this->enabled; } } That means: If the URL contains the substring "products_id=28", the module is disabled. J.J.
  12. # http://www.lalala.eu= RewriteBase / is wrong. Instead use: RewriteBase /
  13. De Dokta

    Latest News Multilingual

    The "important" field is to decide, whether you want to display a news message on the main page module or not. You may not want to display any news which is enabled on the index page but only the really important. In the admin tool you find for that a field "Display on main page?"
  14. @@Tsimi Hi Lambros Read the code! if(!tep_session_is_registered('customer_is_guest')) means: if NOT a session "customer_is_guest" is registered - no? A guest get no link to an order history, a regular customer get one........ J.J.
  15. @@grandpaj Try this: echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO) . '?products_id=' . ($products[$i]['id']) . '">' . ($products[$i]['name']) . '</a>'; @@ArtcoInc Is there any reason to calculate the price with: $number = (($products[$i]['quantity']) * ($products[$i]['price'])); echo '$' . (number_format($number, 2,'.', ',')); ? Why not use: echo $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']); ???? J.J.
  16. @@raiwa You are right, hspace and vspace are obsolete. I've overseen that. Regarding the equal height tag I'm not sure what the best way is. As far as I know none of the modules on product info uses by default the equal height script. So there would be no conflict. But on the index page at least the new products module uses the script and the result looked very strange, when I added it also to the recently_viewed module. For that I added a setting in the user.css. Perhaps it would be possible to add a height setting to your module(s)? BTW: Chris' (ringo667) problem had nothing to do with your add-on. He uses the master/slave addon and for that reason the $listing_sql in recently_viewed.php simply needed an additional "p.products_master, p.products_master_status" :- . We have resolved that in the German forum....... J.J.
  17. @@raiwa Hi Just tested your BS version on BS gold - works really great! :rolleyes: Two small issues: It would be helpful, to add SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT to content\product_info\cm_pi_recently_viewed.php and to modules\content\index\cm_recently_viewed.php to prevent problems with images of different sizes. $recently_viewed_content .= tep_image (DIR_WS_IMAGES . $products_data[$products_id]['image'], $products_data[$products_id]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT . 'hspace="2" vspace="3"'); It also would be useful to add the equal-height tag to modules\content\product_info\cm_pi_recently_viewed.php: $recently_viewed_content .= ' <div class="thumbnail equal-height">'; J.J.
  18. Hi Chris, your shop is based on an earlier version of bootstrap, not on bootstrap-gold. To get raiwas addon into your product_info you must add the appropriate hook to that file: <div class="row"> <?php echo $oscTemplate->getContent('product_info'); ?> </div> J.J.
  19. @@greasemonkey No time for it - if you want to release it as addon, just do it.... :) J.J.
  20. @@grandpaj If you want to avoid that "margin", make sure that the sum of your col- is always12. E.g. <div class="col-sm-3"> + <div class="col-sm-9"> or <div class="col-sm-4"> + <div class="col-sm-4"> + <div class="col-sm-4"> etc. J.J.
  21. @@greasemonkey @@multimixer Yes I did and I did it a little different, but I don't remember if and/or where I posted it :- includes\modules\header_tags\ht_back_to_top_btn.php: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2015 osCommerce Released under the GNU General Public License */ class ht_back_to_top_btn { var $code = 'ht_back_to_top_btn'; var $group = 'footer_scripts'; var $title; var $description; var $sort_order; var $enabled = false; function ht_back_to_top_btn() { $this->title = MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_TITLE; $this->description = MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_DESCRIPTION; if ( defined('MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_STATUS') ) { $this->sort_order = MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_SORT_ORDER; $this->enabled = (MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_STATUS == 'True'); } } function execute() { global $oscTemplate; $vertical_position = MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_VERTICAL_POSITION; $speed = MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_SCROLL_SPEED; $output = <<<EOD <script> $(document).ready(function(){ $('body').append('<div id="toTop" class="btn btn-lg btn-info"><span class="glyphicon glyphicon-chevron-up"></span></div>'); $(window).scroll(function () { if ($(this).scrollTop() > $vertical_position) { $('#toTop').fadeIn(); } else { $('#toTop').fadeOut(); } }); $('#toTop').click(function(){ $("html, body").animate({ scrollTop: 0 }, $speed); return false; }); }); </script> EOD; $oscTemplate->addBlock($output, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_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 ('Back to Top Module', 'MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_STATUS', 'True', 'Do you want to enable the Back to top module?', '6', '', '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, date_added) values ('Sort Order', 'MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_SORT_ORDER', '1500', 'Sort order of display. Lowest is displayed first.', '6', '', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Vertical Position', 'MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_VERTICAL_POSITION', '150', 'Defines where, when scrolling down, the button is displayed. Default 150.', '6', '', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Scroll Speed ', 'MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_SCROLL_SPEED', '500', 'Defines the scrolling up speed in ms. Low value = fast - high value =slow. Default 500.', '6', '', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_STATUS', 'MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_SORT_ORDER', 'MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_VERTICAL_POSITION', 'MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_SCROLL_SPEED'); } } ?> user.css: /* Back-to-Top-Button*/ #toTop {cursor: pointer; position: fixed; bottom: 30px; right:15px; z-index: 2; display:none; border: 1px solid #000; color: #ffffff; border-color: #357ebd; background-color: #0489FB; background-image: -webkit-gradient(linear, left 0%, left 100%, from(#B5DCFD), to(#0489FB)); background-image: -webkit-linear-gradient(top, #B5DCFD, 0%, #0489FB, 100%); background-image: -moz-linear-gradient(top, #B5DCFD 0%, #0489FB 100%); background-image: linear-gradient(to bottom, #B5DCFD 0%, #0489FB 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#B5DCFD', endColorstr='#0489FB', GradientType=0);} #toTop:hover, #toTop:focus {background-color:#fff;} You don't need the color settings or may change them to your needs. language file: define('MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_TITLE', 'Add a Back To Top Button to your pages.'); define('MODULE_HEADER_TAGS_BACK_TO_TOP_BTN_DESCRIPTION', 'Add a Back To Top Button to your pages.'); J.J.
  22. Hi Put it in rows: <div class="row"> <div class="col-sm-4"> <-- Code image --> </div> <div class="col-sm-8"> <-- Code description --> </div> </div> J.J.
  23. Since I found the state selection - like some others - extremely frustrating and annoying I tried different solutions for that, among others DHTML State Selection for 2.3.1. I got it to work somehow, but it was very arkward, much too complicated and in some cases I got very interesting results :x. OK, I thought this must be to make it even easier! And yes, it is: 1. ) I recommend to change e.g. in create_account.php the order from state - country to country - state. This is not necessary, but to me it seems more logical. 2. ) In create_account.php find: echo tep_get_country_list('country', NULL, 'required aria-required="true" id="inputCountry"'); change it to: echo tep_get_country_list('country', NULL, 'onChange="getState(this.value)" required aria-required="true" id="inputCountry"'); 3. ) In create_account.php find: <?php if (ACCOUNT_STATE == 'true') { ?> <div class="form-group has-feedback"> <label for="inputState" class="control-label col-sm-3"><?php echo ENTRY_STATE; ?></label> <div class="col-sm-9"> <?php if ($process == true) { if ($entry_state_has_zones == true) { $zones_array = array(); $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name"); while ($zones_values = tep_db_fetch_array($zones_query)) { $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']); } echo tep_draw_pull_down_menu('state', $zones_array, 0, 'id="inputState"'); echo FORM_REQUIRED_INPUT; } else { echo tep_draw_input_field('state', NULL, 'id="inputState" placeholder="' . ENTRY_STATE . '"'); echo FORM_REQUIRED_INPUT; } } else { echo tep_draw_input_field('state', NULL, 'id="inputState" placeholder="' . ENTRY_STATE . '"'); echo FORM_REQUIRED_INPUT; } if (tep_not_null(ENTRY_STATE_TEXT)) echo '<span class="help-block">' . ENTRY_STATE_TEXT . '</span>'; ?> </div> </div> <?php } ?> change it to: <?php if (ACCOUNT_STATE == 'true') { ?> <div class="form-group has-feedback"> <label for="inputState" class="control-label col-sm-3"><?php echo ENTRY_STATE; ?></label> <div class="col-sm-9"> <?php echo '<span id="results">'; echo tep_draw_input_field('state', NULL, 'id="inputState" placeholder="' . ENTRY_STATE . '"'); echo '</span>'; echo FORM_REQUIRED_INPUT; if (tep_not_null(ENTRY_STATE_TEXT)) echo '<span class="help-block">' . ENTRY_STATE_TEXT . '</span>'; ?> </div> </div> <?php } ?> 4. ) Add to footer.php (maybe it would also work if you add it to template_bottom.php - I didn't test it!) <script> function getState(str){ var xhr = false; if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } if (xhr) { xhr.onreadystatechange = function () { if (xhr.readyState == 4 && xhr.status == 200) { document.getElementById("results").innerHTML = xhr.responseText; } } xhr.open("GET", "get_states.php?st="+str, true); xhr.send(null); } } </script> 5. ) Create a new file catalog/get_states.php: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2015 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $state = ($_GET['st']); $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$state . "'"); $check = tep_db_fetch_array($check_query); $entry_state_has_zones = ($check['total'] > 0); if ($entry_state_has_zones == true) { $zones_array = array(); $zones_array[0] = array('id' => '0', 'text' => PULL_DOWN_DEFAULT); $zones_query = tep_db_query("select zone_name from zones where zone_country_id = '" . (int)$state . "' order by zone_name"); while ($zones_values = tep_db_fetch_array($zones_query)) { $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']); } echo tep_draw_pull_down_menu('state', $zones_array, '', 'id="inputState"'); } else { echo tep_draw_input_field('state', NULL, 'id="inputState" placeholder="' . ENTRY_STATE . '"'); } ?> There are a few other files, such as includes/modules/checkout_new_address.php or includes/modules/address_book_details.php, in which the states pulldown is used. There the same changes as in the create_account must be carried out. I know that this feature requires changes to core files. But sometimes this simply can not be avoided..... Tested with BS-gold! J.J.
  24. If I may make some wishes! - A better handling for images on product_info. It should be possible to configure width and/or height of images somewhere in the admin. - An end to the nightmare with special chars in oscommerce. Apart from English, almost all other languages have any special chars. For each new installation e.g. in Germany you must fix problems with special characters in dozens of files. The German forum is full of threads on this topic! - A better search function. The current search is a bad joke! If you have a typo or not exactly the right word, you will find nothing. Not every user knows the right spelling of the article, he is looking for. Go to Amazon, enter Galaxi - you will find (among others) "Samsung Galaxy". Go to Osc, enter Galaxi, you will find - nothing! - If the devs of Osc find it necessary to add an attributes/options menu to the core (one could debate whether this is really necessary) then it should be also reasonable to use. I find it almost unusable in its current form. (Yes I know there's the Ajax Attribute Manager which I use when I need an attributes tool). - I agree with Moxamint that the state selection is frustrating........ - What's about an Admin Paging with sorting functions in the Categories/Products menu? If you have 10 articles in a category, it's no problem. But if you have hundreds in each category, it would be nice to split the results in several pages with the option to sort by name, last added .................
×