Jump to content
Latest News: (loading..)


  • Content count

  • Joined

  • Last visited

  • Days Won


Tsimi last won the day on April 24

Tsimi had the most liked content!

Profile Information

  • Real Name
  • Gender
  • Location

Recent Profile Visitors

36,740 profile views
  1. Module Header Tags > Category SEO help please

    If you type something and save is that entry stored inside the database? Or is it empty.
  2. This is the support thread for the App Keyword Highlighter. Available here: https://apps.oscommerce.com/DNn0b&keyword-highlighter Special thanks to @puggybelle for sponsoring this App and allowing it to be shared with others.
  3. @burt Is there anything, function or visual in BS4 that you think has significantly improved to its predecessor BS3?
  4. https://forums.oscommerce.com/topic/359350-change-the-text-new-products-for-month/?do=findComment&comment=1514519 Could be implemented into the products_new.php page?
  5. preg_replace to preg_replace_callback

    Just found this thread here. I need to get the following code up to date since it doesn't work in PHP 7 anymore. Getting this error message: I know that #se in the code below is the /e modifier and that's about it with my understanding. Most support solutions I found on stackoverflow talkj about simple preg_replace cases but the following is a bit harder I think. function tsimi ($text, $token, $class) { $text = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace('#\b(" . $token . ")\b#i', '<span class=\"" . $class . "\">\\\\1</span>', '\\0')", '>' . $text . '<'), 1, -1)); return $text; } Anyone out there can help getting this updated to a preg_replace_callback? Thanks
  6. Ah! Yes that is true it does show all products but splits them up in pages. I thought she meant 6000 on one page which would mean endless long scrolling. lol The MAX_ whatever limits only the products per page result and not the total amount of products. Wasn't that like that since... always. Even the old 2.2 days?
  7. Never mind my previous comment. What does it say for MAX_DISPLAY_SEARCH_RESULTS ?
  8. You say you imported your database from 2.2? The whole database structure or only certain tables? Could it be that you have the MAX_RANDOM_SELECT_NEW definition twice in there?
  9. [Contribution] Option Types v2

    @2skys One thing is sure you can't use the Option Types CUSTOMER_INPUT to do it. That is not a real value that can be calculated. You need a quantity input field of some sort. I got as far as creating 3 custom quantity input fields and then calculate the percentage of the attributes to those 3 input fields total. The main problem was once the item has been added to the cart you could not see the input fields separately listed so you as shop wouldn't know what length, width or any other dimension the customer would have chosen. That is why this is best done as attribute. You really should consider to contact multimixer and just ask how much he wants for that function he has shown in the paper printing shop. Asking is free so... Or maybe try to get a quote in the commercial support section. There again, asking is free.
  10. @puggybelle Close.... You cannot use $product_info[products_quantity] in the new_products modules. Two reasons why. 1. look at the code, all variables are like $new_products['products_id'] or $new_products['products_image'] use $new_products and not $product_info because well it is a new_products module. 2. the p.products_quantity check is not inside the new products database query so it cannot understand and check for it. Therefore we use the same function as we used in the product_listing file, tep_get_products_stock, which checks for the products_quantity. That combined with the right variable $new_products['products_id'] becomes if ( tep_get_products_stock($new_products['products_id']) >= 1) { If you want to know what the tep_get_products_stock does. Here the function code (inside general.php) //// // Return a product's stock // TABLES: products function tep_get_products_stock($products_id) { $products_id = tep_get_prid($products_id); $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $stock_values = tep_db_fetch_array($stock_query); return $stock_values['products_quantity']; }
  11. @valquiria23 It is not compatible with Edge or Frozen version. You'll have to hard code the FILENAME_ definitions replace all the HTTP_POST_VARS and HTTP_GET_VARS and all DIR_WS. I am sure you'll have to change some of the code to match it to the latest structure.
  12. @puggybelle Yeah, the new osC is more modular now meaning the main file contents has been reduced to a few lines of codes to call the so called content modules to build the page. Like for example the product_info.php file, the whole contents has been split into multiple modules which put together build the product info page. The advantage of such an approach is you can change most things without touching the core code of osC which hopefully will make updates in the future a bit easier. Here my approach for the product info and product listing page. And as Malcolm already mentioned the product listing file takes care of specials and what's new as well. english.php ADD define('IMAGE_BUTTON_SOLD_OUT', 'Sold Out'); tpl_cm_pi_buy_button.php (backup file first!) Replace the whole code with this <div class="col-xs-<?php echo $content_width; ?> text-right cm-pi-buy-button"> <?php if ($product_info['products_quantity'] >= 1) { echo tep_draw_button(MODULE_CONTENT_PI_BUY_BUTTON_TEXT, 'fa fa-shopping-cart', null, 'primary', array('params' => 'data-has-attributes="' . (($products_attributes['total'] > 0) ? '1' : '0') . '" data-in-stock="' . (int)$product_info['products_quantity'] . '" data-product-id="' . (int)$product_info['products_id'] . '"'), 'btn-success btn-product-info btn-buy'); echo tep_draw_hidden_field('products_id', (int)$product_info['products_id']); } else { echo tep_draw_button(IMAGE_BUTTON_SOLD_OUT, 'fas fa-ban', null, 'primary', array('params' => 'disabled="disabled"'), 'btn-danger'); } ?> </div> product_listing.php (takes care of specials and what's new too) FIND if (PRODUCT_LIST_BUY_NOW > 0) { $prod_list_contents .= ' <div class="col-xs-6 text-right">'; $prod_list_contents .= tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'fa fa-shopping-cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . (int)$listing['products_id']), NULL, array('params' => 'data-has-attributes="' . ((tep_has_product_attributes((int)$listing['products_id']) === true) ? '1' : '0') . '" data-in-stock="' . (int)$listing['in_stock'] . '" data-product-id="' . (int)$listing['products_id'] . '"'), 'btn-success btn-product-listing btn-buy'); $prod_list_contents .= ' </div>'; } REPLACE WITH if (PRODUCT_LIST_BUY_NOW > 0) { $prod_list_contents .= ' <div class="col-xs-6 text-right">'; if ( tep_get_products_stock($listing['products_id']) >= 1) { $prod_list_contents .= tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'fa fa-shopping-cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . (int)$listing['products_id']), NULL, array('params' => 'data-has-attributes="' . ((tep_has_product_attributes((int)$listing['products_id']) === true) ? '1' : '0') . '" data-in-stock="' . (int)$listing['in_stock'] . '" data-product-id="' . (int)$listing['products_id'] . '"'), 'btn-success btn-product-listing btn-buy'); } else { $prod_list_contents .= tep_draw_button(IMAGE_BUTTON_SOLD_OUT, 'fas fa-ban', null, 'primary', array('params' => 'disabled="disabled"'), 'btn-danger'); } $prod_list_contents .= ' </div>'; } In both cases we do a simple check. If products quantity is higher or equal to 1 then show normal buy button else show sold out button. Now what you can try is to do the new products modules inside the index (tpl_cm_i_new_products.php) and index_nested (tpl_cm_in_new_products.php) modules.
  13. @deepsonline What exactly are you looking for? Is there something particular you liked in this Bootstrap version?
  14. @puggybelle There are 2 ways of doing what you want. 1. Hard code it into every file that contains a buy button 2. Do it the way the first John showed in his example, creating a header_tags module and therefore you don't need to go change code in various files. The way to hard code it should not be much different than it was in the past. You basically check if the product has a quantity of 1 or more then show buy button else remove/deactivate button and show out of stock notification. I know redirecting you to another thread might not give you the answer right away but it will help you understand more of the code and its function. Here a thread with the same request as yours. https://forums.oscommerce.com/topic/408605-show-out-of-stock-button-in-place-of-buy-now-when-stock-is-less-than-1/#comment-1735993 Scroll down and read around Burts aswers. If you still should have a hard time getting it implemented report back and we see what we can do.