Jump to content

De Dokta

Members
  • Content count

    329
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by De Dokta

  1. Hi I have long been looking for a way to integrate the categories menu with multiple sub categories into the header navbar, but I always failed to embed the appropriate code into the category_tree.php. :( With the help of the code gadlol has recently posted, some JS and CSS I have now found a way without changing the category_tree.php. Looks like this: How it works: In includes/functions/html_output.php add a new function: function tep_show_tree($root_id = 0,$mainUlClass='dropdown-menu',$submenuUlClass='dropdown-menu sub-menu'){ global $languages_id,$cPath_array; $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); $items = array(); while ($categories = tep_db_fetch_array($categories_query)) { $items[$categories['categories_id']] = array('name' => $categories['categories_name'], 'parent_id' => $categories['parent_id'], 'id' => $categories['categories_id']); } $citems=count($items); if($citems<=0) return ''; elseif($citems==1) $children[] = $items; //in case we have one category item without subcategories, rare but possible else foreach( $items as $item ) $children[$item['parent_id']][] = $item; $loop = !empty( $children[$root_id] ); $parent = $root_id; $parent_stack = array(); $html=array();//store html code $stack=array();//helper array so to know the current level $pic=''; //products_in_category string $html[]='<ul class="'.$mainUlClass.'">'; while ( $loop && ( ( $option = each( $children[$parent] ) ) || ( $parent > $root_id ) ) ){ if ( $option === false ){ $parent = array_pop( $parent_stack ); $html[] = '</ul>'; $html[] = '</li>'; array_pop( $stack ); }elseif ( !empty( $children[$option['value']['id']] ) ){ $stack[]=$option['value']['id']; $rt=$root_id>0 ? $root_id.'_' : ''; $cpath_new=count($stack)<=0 ? 'cPath='.$rt.$option['value']['id'] : 'cPath='.$rt.implode('_',$stack); $html[]= '<li><a class="trigger right-caret" href="'.tep_href_link(FILENAME_DEFAULT, $cpath_new).'">'; if (SHOW_COUNTS == 'true') { $products_in_category = tep_count_products_in_category($option['value']['id']); if ($products_in_category > 0) { $pic=' (' . $products_in_category . ')'; } } $sm=0; if((isset($cPath_array) && in_array($option['value']['id'], $cPath_array))){ $sm=1; $html[]='<strong>'.stripslashes($option['value']['name']).$pic.'</strong>'; }else{ $html[]=stripslashes($option['value']['name']) . $pic; } $html[]='</a>'; $html[] = '<ul class="'.$submenuUlClass.'">'; $parent_stack[]=$option['value']['parent_id']; $parent = $option['value']['id']; }else{ $rt=$root_id>0 ? $root_id.'_' : ''; $cpath_new= count($stack)<=0 ? 'cPath='.$rt.$option['value']['id'] : 'cPath='.$rt.implode('_',$stack).'_'.$option['value']['id']; $html[]= '<li><a href="'.tep_href_link(FILENAME_DEFAULT, $cpath_new).'" >'; if (SHOW_COUNTS == 'true') { $products_in_category = tep_count_products_in_category($option['value']['id']); if ($products_in_category > 0) { $pic=' (' . $products_in_category . ')'; } } if (isset($cPath_array) && in_array($option['value']['id'], $cPath_array)) { $html[]='<strong>'.stripslashes($option['value']['name']).$pic.'</strong>'; }else{ $html[]=stripslashes($option['value']['name']).$pic; } $html[]='</a>'; } } $html[]='</ul>'; $data = '<li class="dropdown">' . '<a class="dropdown-toggle" data-toggle="dropdown">' . HEADER_CATS . '</a>' . implode($html) . '</li>'; return $data; } includes/footer.php add: <script type="text/javascript"> $(function(){ $(".dropdown-menu > li > a.trigger").one("click",function(e){ e.preventDefault(); var current=$(this).next(); var grandparent=$(this).parent().parent(); if($(this).hasClass('left-caret')||$(this).hasClass('right-caret')) $(this).toggleClass('right-caret left-caret'); grandparent.find('.left-caret').not(this).toggleClass('right-caret left-caret'); grandparent.find(".sub-menu:visible").not(current).hide(); current.toggle(); e.stopPropagation(); }); $(".dropdown-menu > li > a:not(.trigger)").one("click",function(){ var root=$(this).closest('.dropdown'); root.find('.left-caret').toggleClass('right-caret left-caret'); root.find('.sub-menu:visible').hide(); }); })(jQuery); </script> user.css add: .dropdown-menu>li /* To prevent selection of text */ { position:relative; padding-left: 5px; -webkit-user-select: none; /* Chrome/Safari */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE10+ */ /* Rules below not implemented in browsers yet */ -o-user-select: none; user-select: none; cursor:pointer; } .dropdown-menu .sub-menu { left: 100%; position: absolute; top: 0; display:none; margin-top: -1px; box-shadow:none; } .right-caret:after,.left-caret:after { content:""; border: 5px solid transparent; border-top: 5px solid transparent; display: inline-block; height: 0; vertical-align: middle; width: 0; margin-left:15px; } .right-caret:after { border-left: 5px solid #ffaf46; } .left-caret:after { border-right: 5px solid #ffaf46; } in includes/header.php after: <?php echo '<li><a class="store-brand" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . HEADER_HOME . '</a></li>'; ?> add: <?php echo '<li>' . tep_show_tree() . '</li>'; ?> or somewhere else where you like it! includes/languages/english.php add: define('HEADER_CATS', '<i class="glyphicon glyphicon-cog"></i><span class="hidden-sm"> Categories</span> <span class="caret"></span>'); or any other glyphicon. I tested it with Mozilla 30. IE 8, Chrome and Opera - seems to work properly in full and collapsed size. Hope you enjoy it! J.J.
  2. Support Thread for the new content module Modal Info Popup Layer for osCommerce 2.3.4BS Note: This content Module is for the bootstrap version of oscommerce 2.3.4 only! Download Link: http://addons.oscommerce.com/info/9204 If you want your customers to take note of certain informations, there is one way to make them aware by using a popup window or a layer. This contrib uses a bootstrap modal for this purpose. When a customer enters the shop the first time, a info popup layer is once laid over the page - regardless on which site the customer enters the shop. The individual messages can be created via a pop-up manager as plain text, html-text and/or graphics in the admin area.There you can also specify a start and an expiration date for the display of messages. The add-on is designed as content module, which means that no changes to core files (in the frontend) are neccessary. Only in the admin area two files (admin\includes\boxes\tools.php and admin\includes\languages\english.php) must be changed to add a new entry to the tools box. Tested with bootstrap-gold and FF 35, Google Chrome 37.0.2062.124, Opera 26.0 and IE 8. Please report any problems here. J.J.
  3. Hi I made a new version of my Latest News Multilingual Addon (http://addons.oscommerce.com/info/9147) as content module for BS-Gold. It displays news in a sliding or fading carousel which you can install on the index page or in the header area. With the exception of the index.php, which by default has (still) no hook, no core files must be changed. Download here: http://addons.oscommerce.com/info/9314 Demo here: http://www.video-stuff.de/demo/bootstrap Pls. report any problems, bugs etc. here. J.J.
  4. Hi Is it possible to change the article images with the selection of options? I have found several addons, tested them, but could not get to work one of them. So, I tried myself to find a simple solution: I added a new column 'options_values_image' to table 'products_attributes', an ajax script to product_info.php and wrote a new file to select the appropriate image for each option. Work half done: In the frontend, apart from some minor (cosmetic) issues the image change works as intended - with a single product image the change is really easy (demo: http://www.video-stuff.de/demo/bootstrap/matrox-g200-p-1.html- option: Model), with a set of images it was a bit more complicated but also possible (demo: http://www.video-stuff.de/demo/bootstrap/samsung-galaxy-p-28.html - option:case). And the colorbox also works. But where I currently really stuck, is the question how to get the options images into the database in the admin area? It's surely possible to add something for that to the products_attributes menu. But is the products_attributes really worth the effort? You can use it if you have a handful of products with some attributes - but with hundreds of articles with a lot of different options using this menu is really a nightmare! Integrating the image upload into the Ajax AttributesManager (which I really like) would be perhaps a better solution, but not all store owners have this tool in use. Or would it a better idea to create a separate file for that purpose? I'm not sure! Any ideas? J.J.
  5. I'm not sure if I understand what you want to achieve. Where do you want the categories box to be displayed?
  6. @@vampirehunter 1. be careful with the brackets: if((($PHP_SELF == 'index.php') and ($category_depth == 'top')) || ($PHP_SELF == 'shopping_cart.php')) also possible: if(($PHP_SELF == 'index.php' and $category_depth == 'top') || ($PHP_SELF == 'shopping_cart.php')) You just have to make sure that the program can "distinguish" which elements belong to one and which to the other condition. 2. you can't use ($category_depth == 'top') in that case because there are no different levels in the shopping cart as in the categories. ;) With ($category_depth == 'top') the condition can never be true and therefore on the cart page the box will never disappear. J.J.
  7. @@gvv Try this: In application_top.php in - case 'add_to_wishlist' - replace: tep_redirect(tep_href_link('wishlist.php', tep_get_all_get_params($parameters))); break; /* /Wish List End */ with: if(WISHLIST_REDIRECT == 'Yes') tep_redirect(tep_href_link('wishlist.php', tep_get_all_get_params($parameters))); break; /* /Wish List End */
  8. @@gvv Yes! For includes/modules/new_products.php e.g. it should be something like this: $new_prods_content .= tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', tep_href_link('wishlist.php', tep_get_all_get_params(array('action')) . 'action=add_to_wishlist&products_id=' . $new_products['products_id']), NULL, NULL, 'btn-default btn-sm'); Add it where you want the wishlist button to appear. And in other modules similar.... J.J.
  9. De Dokta

    Invoice Editor 1.0

    @@ce7 1. No idea what went wrong. If you save the message and then generate a new pdf or html invoice/packingslip in the invoice editor the message should be displayed on your new invoice/packingslip. It does not work if you generate an invoice/packingslip in orders.php. 2. This has nothing to do with the invoice Editor, but that you have saved your logo with the "Interlaced" option. FPDF supports no "Interlaced" and for today's high-speed Internet connections, this option is also unnecessary!
  10. Hi 1. Definitions which you don't find in the Sqls you find in the appropriate language files - in this case admin/includes/your language/invoice.php and packingslip.php. 2. Have you entered the tables in admin/includes/database_tables.php? 3. Depends on what you want to change. But in principle correct! J.J.
  11. @@Patty Ok, the version I use is a little bit different: // If all is well, make the changes to the database if ($pass == 1) { tep_db_query("update customers set customers_password='" . tep_encrypt_password ($new_password) . "' where customers_id='" . (int)$customer_id . "'"); // Get the customer's information for the success message $customer_name_query = tep_db_query("select customers_firstname, customers_lastname, customers_guest from customers where customers_id='" . (int)$customer_id . "' and customers_guest = '0'"); $customer_name = tep_db_fetch_array($customer_name_query); tep_mail($customer_name['customers_firstname'] . " " . $customer_name['customers_lastname'], $customer_name['customers_email_address'], EMAIL_PASSWORD_REMINDER_SUBJECT, nl2br(sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password)), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } } // End POST section And this part: define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - New Password'); define('EMAIL_PASSWORD_REMINDER_BODY', 'A new password was requested for your account at ' . STORE_NAME . '.' . "\n\n" . 'Your new password to \'' . STORE_NAME . '\' is:' . "\n\n" . ' %s' . "\n\n"); is moved to admin/includes/languages/Your_language/change_password.php - where it belongs to! J.J.
  12. @@ce7 Hi, it's German. :D If you don't understand the meaning of any definition in the files look into invoice_en.sql where you'll find these definitions and their meaning in English. J.J.
  13. Go to Admin -> Configuration -> My Store and enter there under "Store Name" the name of your store.
  14. @@ArtcoInc Hi Malcolm Yes I know that the email validation is a problem: Originally I had it completly taken out from account_pwa.php. Then I got a mail where someone complained, that when a customer logs in as a guest, but does not complete the checkout process (so the data are not deleted), and later wants to register as a customer, an error message comes that the email already exists. So I put back the email validation. Now the same problem appears if a guest leaves before the checkout process is completed: If he comes back later again and wants again to purchase as a guest he gets the same error message that the email already exists. I have thought to build in a routine which checks the DB regularly for guest entries older than e.g. 24 hours and deletes them automatically. It's not that complicated, but at the moment I just don't have time, to do this and especially to test thoroughly. J.J.
  15. De Dokta

    Latest News Rotator Multilingual 1.0 BS

    Anyone can do with addons what he thinks to be good or properly. For me your changes make no sense: The average user expects when he reads the note "read more", that a click on this note leads him somewhere. No one would think to click on the headline in that case!
  16. @@element3 You were searching in the wrong file for reason for this error. Your code snippets are from catalog/checkout_process, while the error message tells you that there's a mistake in catalog/includes/languages/english/checkout_process.php. There you should find something like: define('EMAIL_WARNING', 'NOTE: This email address has been submitted by a visitor to our online-shop. If you were not this visitor, please send a message to: ' . STORE_OWNER_EMAIL_ADDRESS . 'Thank you for your purchase and have a nice day.'); J.J.
  17. Uhh why is it not possible to edit a post? :x Ok what I wanted to say: It seems that a continuous scrolling is not possible with the carousel script used in whats_new and specials scroller. I searched in vain a solution for that and finally cut the text to the required length....
  18. http://addons.oscommerce.com/info/9314
  19. De Dokta

    Latest News Rotator Multilingual 1.0 BS

    Hi This is indeed a problem: the news rotator has already a built in link <a href> because I wanted to link from the displayed news in the rotator (which may be truncated) to the respective (complete) news in the news module. If you want to use the rotator for something different e.g. to display some new products with a link to the respective product page, you should remove this built in link ( $wrapper_slides .= '<a href="' . tep_href_link('latest_news.php', 'news_id=' . $latest_news['news_id'], $request_type) . '">'; and $wrapper_slides .= '</a>';) from the module! J.J.
  20. De Dokta

    Latest News Rotator Multilingual 1.0 BS

    If I look at your site it seems that you forgot to add the css settings to your user.css.
  21. De Dokta

    Latest News Rotator Multilingual 1.0 BS

    What bug? That has nothing to do with Latest news but with ckeditor. May be you use another version of ckeditor than me?! J.J.
  22. De Dokta

    Latest News Rotator Multilingual 1.0 BS

    @@rubberfashion Thanks for your feedback. You are right! These are bugs! :x I've uploaded a new package where these bugs are fixed. In your case pls. replace \includes\modules\content\index\cm_news_carousel.php and admin\latest_news.php with the files from the new package. J.J.
  23. Thanks a lot for that! Of all the proposals made here, this is the first that actually works for me. Another question regarding css files for cm_ modules: where to put them? Into the catalog directory? The template directory? Create a new folder includes/modules/content/name/css? Any suggestions? J.J.
  24. Latest News Rotator Multilingual 1.0 BS Displays a news carousel on the index page (or in the header area) Add-on: http://addons.oscommerce.com/info/9314 Support: http://forums.oscommerce.com/topic/407714-latest-news-rotator-multilingual-10-bs/
  25. De Dokta

    State Selector for BS

    Hi remove the line: require('includes/form_check.js.php'); form_check.js.php is not longer needed in BS J.J.
×