Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. looks as though there are some missing braces. Please confirm... if (isset($search_data['featured'])) { //<- here ... } else { $whereString .= $this->_where_live_from; // Adding the _where_live_from to the $whereString. } //<- and here With these changes, It appeaars to be working. NOTE to anyone else... copying and pasting this code made the double space between ANDs go away.
  2. If it's what I hit, it's the fact that the aliased name needs to be used instead of the CubeCart_inventory reference SELECT I.*, MATCH (I.product_code,I.description,I.name) AGAINST('criteria' IN BOOLEAN MODE) AS Relevance FROM CubeCart_inventory AS I LEFT JOIN ( SELECT product_id, MAX(price) as price, MAX(sale_price) as sale_price FROM CubeCart_pricing_group WHERE group_id = 0 GROUP BY product_id) as G ON G.product_id = I.product_id WHERE I.product_id IN ( SELECT product_id FROM `CubeCart_category_index` as CI INNER JOIN CubeCart_category as C where CI.cat_id = C.cat_id AND C.status = 1) AND I.status = 1 AND (MATCH (I.product_code,I.description,I.name) AGAINST('criteria' IN BOOLEAN MODE)) >= 0.5 AND `live_from` < UNIX_TIMESTAMP() AND ( -- switch to I alias below (I.stock_level > 0 AND I.use_stock_level = 1) OR I.use_stock_level = 0) AND `live_from` < UNIX_TIMESTAMP() ORDER BY `Relevance` DESC LIMIT 12 OFFSET 0; this works and returns results for me.
  3. Don't know if this helps, but until you can find a not-so-hacky fix.. I tweaked your code above like this // Only look for items that are in stock if (true || isset($search_data['inStock'])) { // Force in-stock-only (admin sees all) $where[] = str_replace("CubeCart_inventory","I",$this->outOfStockWhere()); // May cause problems in search - other edits probab le } appears the alias I is required in the where clause and I stripped out the extra AND when it's concatenated (super hacky) public function outOfStockWhere($original = false, $label = false, $force = false) { $def = $original ? str_replace('WHERE ', '', $GLOBALS['db']->where('CubeCart_inventory', $original, $label)) : ''; // Changed this //$def .= $this->_where_live_from; // to $def .= str_replace("AND","",$this->_where_live_from); Now it works! I get only in stock products when searching and I have hide out-of-stock checked! spoke too soon... it did fix that searching but broke category browsing... never mind
  4. Done! just as I suspected, I now get no results when search for keywords that definitely have stock.
  5. also I assume you mean catalog.class.php
  6. Ok, so I have to turn off hide in order to "hide" them in the search? DOH! Confirmed! Unchecking it makes the chechbox appear, but something is still not right. Checking the In Stock only results in nothing found. Using the sort by stock high-low without the in stock button returns dozens of in-stock results. Of course, searching by category now shows all the out-of-stock items. So my concern with a mod is that even if I force the In-stock only for all searches I will get no results regardless of whether or not I have the Hide out-of-stock set in admin.
  7. it would appear the $OUT_OF_STOCK value is not as expected... in content.search.php so it doesn't display {if !isset($OUT_OF_STOCK)} <div class="row"> <div class="small-8 columns"><input type="checkbox" name="search[inStock]" id="in_stock" value="1"><label for="in_stock">{$LANG.search.i$ </div> {/if}
  8. Interesting... I am using the same skin as demo. Could I have turned that off in admin somewhere?
  9. Ready yesterday! Bring it on! I was about to start digging... I am good with a hard-coded default of in-stock only results. By the way, I don't have an in-stock only check box in my advanced search... only the stock high-low/low-high dropdown option. Did I misunderstand?
  10. Thanks for the quick reply. Ugh... Our categories are also set several levels deep That would be a huge project. I could just query the database and fix it, but do you suppose there would be any benefit in recreating our entire hierarchy under an "unchecked" category so we don't loose the work we did putting them where they go? Or is there a better way you could suggest?
  11. Should Hide out-of-stock work when searching with search terms? We imported thousands of products that we may eventually carry at one point and just want to add stock when/if we get it. Otherwise we want it to appears we DO NOT have it (stock it). Hide seems to work when browsing by category, but if I search I get hundreds of out of stock listings. And yes, Hide is checked, and the Use Stock level is checked for both product default and options matrix. Do I misunderstand the feature. fyi.. just upgraded to 6.2.5 - same result.
  • Create New...