• Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About jasehead

  1. The current Font Awesome animation for making the shopping cart icon repeatedly pulse larger and smaller (if basket contains item) works for current Mac and Android versions of Safari, Chrome and Firefox. Untested on Windows Edge. The move to SVG animation will be part of a larger store upgrade, so will be a while before I have anything to show.
  2. Sorry, I still live in a WTF is Edge world. Try a webkit browser like Chrome or Safari.
  3. Try a different browser or a smartphone to see if the effect is different. This is just using the font-awesome-animate javascript library, so any limitations are either with that or with my IF $CONTENTS > 0 statement for the animation effect.
  4. "We Recommend" won't work in my case - I want to be able to make as many links to custom search results as I like (for instance, grouping three product designs together but only showing a specific size - sizes are separate products in my store so it's easy). If I want to search for a secret tag then I can just put that in <!--comments--> in the product description and my search will pick it up OK. Like I said, my custom search using AND, OR & NOT is working just fine in 6.0.12 with only a syntax error (an extra AND) but that doesn't cause it to fall over - just have to get it working for 6.1.5. My search is very specific and shows only the desired products without further items. If I check my search log and see that people are searching for particular words or phrases that clearly wouldn't return good results, then that's a cue to me to improve my copy text for SEO - which is probably good practice anyway.
  5. Searching for specific products... Basically, I wanted PRECISE search results that were restricted to only the items I wanted to show to customers so that I could send a link (or a shortened version via bit.ly). If I want to advertise five specific items then I can provide a link to search results for those specific items. Or, if a customer asks for help with choosing then I can provide a link to recommendations based on their requirements. I didn't want a trailing list of other "relevant" items in the search results, and I wanted to be able to use AND, OR and NOT to further refine search results. My current 6.0.12 attempt DOES work (despite filling the error log) and, for me, is an improvement on the original relevant search which didn't behave the way I wanted it to.
  6. Link here (current version using font-awesome animations) The icon changes to green and pulses if the shopping cart contains any items.
  7. @bmither - It's been 12 months and the default search code in CubeCart 6.1.5 is very different to what it was in 6.0.12. In 6.0.12, searching by relevance did not allow me to restrict a search to specific products - I haven't yet tested 6.1.5 to see how search has changed, but I expect the modifications discussed here will still need to be implemented in some way. Could you please check this modified 6.0.12 search code from catalogue.class.php and suggest how to implement it for 6.1.5? Around 1413: public function searchCatalogue($search_data = null, $page = 1, $per_page = 10, $search_mode = 'like' /* 'fulltext' */) { // search changed from fulltext to like And this is the lump of search code starting around 1604: /* START modified search } elseif ($search_mode == 'fulltext') { return $this->searchCatalogue($original_search_data, 1, $per_page, 'like'); END modified search */ } } else { $this->_sort_by_relevance = false; /* START modified search $rlike = ''; if (!empty($search_data['keywords'])) { $searchwords = preg_split( '/[\s,]+/', $GLOBALS['db']->sqlSafe($search_data['keywords'])); foreach ($searchwords as $word) { $searchArray[] = $word; } $noKeys = count($searchArray); $regexp = ''; for ($i=0; $i<$noKeys; ++$i) { $ucSearchTerm = strtoupper($searchArray[$i]); if (($ucSearchTerm != 'AND') && ($ucSearchTerm != 'OR')) { $regexp .= '[[:<:]]'.$searchArray[$i].'[[:>:]].*'; } } $regexp = substr($regexp, 0, strlen($regexp)-2); $rlike = " AND (I.name RLIKE '".$regexp."' OR I.description RLIKE '".$regexp."' OR I.product_code RLIKE '".$regexp."')"; } END modified search */ if (!empty($search_data['keywords'])) { $rlike = ' AND ( '; $searchwords = preg_split( '/[\s,]+/', $GLOBALS['db']->sqlSafe($search_data['keywords'])); foreach ($searchwords as $word) { $searchArray[] = $word; } $noKeys = count($searchArray); for ($i=0; $i<$noKeys; ++$i) { $ucSearchTerm = strtoupper($searchArray[$i]); if ( ($ucSearchTerm != 'AND') && ($ucSearchTerm != 'OR') && ($ucSearchTerm != 'NOT') && (strlen($ucSearchTerm) > 0) ) { $searchArray[$i] = str_replace(array('%','_'), array('\%','\_'), $searchArray[$i]); $regexp = '%'.$searchArray[$i].'%'; $rlike .= "(I.name LIKE '".$regexp."' OR I.description LIKE '".$regexp."' OR I.product_code LIKE '".$regexp."')"; // modified search - name, description, product code $rlike = str_replace(array(')(',') NOT ('), array(') AND (',') AND NOT ('), $rlike); // modified search - add AND between words and cope with NOT // if($i+1 < $noKeys){$rlike .= " AND ";} // modified search - add AND between words (line disabled) } else { if(strlen($ucSearchTerm) > 0){ $rlike .= " ".$ucSearchTerm." "; } else { $rlike .= " AND "; // THIS LINE IS NOT WORKING } continue; } } $rlike .= " )"; $rlike = str_replace(') AND )',')', $rlike); // modified search - added to fix trailing AND (still a problem) } // if(!$order_string){$order_string = 'ORDER BY stock_level DESC';} // modified search if(!$order_string){$order_string = 'ORDER BY stock_level DESC, IF (G.sale_price IS NULL, IF (I.sale_price = 0, I.price, I.sale_price), IF (G.sale_price = 0, G.price, G.sale_price)) DESC';} // modified search - order by stock first, then sale price $q2 = "SELECT I.* FROM ".$GLOBALS['config']->get('config', 'dbprefix')."CubeCart_inventory AS I LEFT JOIN (SELECT product_id, MAX(price) as price, MAX(sale_price) as sale_price FROM ".$GLOBALS['config']->get('config', 'dbprefix')."CubeCart_pricing_group $group_id GROUP BY product_id) as G ON G.product_id = I.product_id $joinString WHERE I.product_id IN (SELECT product_id FROM `".$GLOBALS['config']->get('config', 'dbprefix')."CubeCart_category_index` as CI INNER JOIN ".$GLOBALS['config']->get('config', 'dbprefix')."CubeCart_category as C where CI.cat_id = C.cat_id AND C.status = 1) AND I.status = 1 ".$whereString.$rlike." ".$order_string; // END modified search $query = $q2.' '.$limit; if (($search = $GLOBALS['db']->query($query)) !== false) { $count = $GLOBALS['db']->query($q2, false, 0); $this->_category_count = (int)count($count); $this->_category_products = $search; return true; // START modified search } elseif ($search_mode == 'like') { return $this->searchCatalogue($original_search_data, 1, $per_page, 'fulltext'); // END modified search You may notice that I'm still having issues with a trailing AND in the search string - it throws errors but the search works. The goal is to search for words or parts of words in name, description and product code. Operators like AND, OR, NOT all work OK (and in combination) and searching for a phrase like black ducks returns results for black AND ducks rather than "black ducks" as a strict phrase. Any constructive suggestions are welcome.
  8. Because CubeCart dropped font-awesome in favour of SVG - any CSS animation suggestions/libraries that will animate a pulsing shopping cart icon like this in box.basket.php? (For this to work, requires these CSS files and the following links in main.php) <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/font-awesome/css/font-awesome.min.css" rel="stylesheet"> <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/font-awesome/css/font-awesome-animation.min.css" rel="stylesheet"> These are my lines in box.basket.php (CubeCart 6.0.12) that change the colour and pulsate the font-awesome shopping cart icon if the cart contains something: <div class="text-right"><a href="#" id="basket-summary" class="button white small"><span style="{if isset($CONTENTS) && count($CONTENTS) > 0}color:green;font-size:1.10rem;{/if}"><i class="fa fa-shopping-cart{if isset($CONTENTS) && count($CONTENTS) > 0} faa-pulse animated{/if}"></i> {$CART_TOTAL}</span></a></div> and <div class="show-for-small-only"><a class="right-off-canvas-toggle button white tiny" href="#"><span style="{if isset($CONTENTS) && count($CONTENTS) > 0}color:green;{/if}"><i class="fa fa-shopping-cart fa-2x{if isset($CONTENTS) && count($CONTENTS) > 0} faa-pulse animated{/if}"></i></span></a></div>
  9. Also noticed bots in the Customer Access Log (Admin > Advanced > Staff Access Log then Customer Access) - easy to pick these bots because they try using a name rather than an e-mail address and have a big red X. I checked a lot of IP addresses to get a pattern, and so far I've blocked Russia, Ukraine, Israel and Slovenia plus a few individual IPs from countries where I have customers - seems to have made a big difference.
  10. Have the ability within CubeCart to allow or block countries by a simple checkbox. Ticking the checkbox would modify the .htaccess file with a DENY FROM list of IP addresses for that country. This could be useful for reducing exposure to hackers, spammers and nuisance phone calls. Online sellers have a feel for where most of their good customers are located, so blocking nuisance countries can save a lot of wasted time and worry. IP country lists can be found online, eg. http://www.ipdeny.com/ipblocks/ Some thought may have to be given to search engine spider IPs and content delivery networks. Maybe also consider performance issues if too many countries blocked using this method.
  11. I just exported a copy of my cubecart database prior to fiddling/upgrade and was browsing through when I noticed things like this in the CubeCart_search table: HTTP://SVZTGXEPMYEU.COM/ - or other random letter url always the same length (these were early on in the list so I expect they're old) SLEEP(3) - often as part of a longer string like '2015&#39;&AMP;&AMP;SLEEP(3)&AMP;&AMP;&#39;1' BENCHMARK(2999999 MD5(NOW())) &AMP;#1575;&AMP;#1604;&AMP;#1605;&AMP;#1610;&AMP;#1585;&AMP;#1594;&AMP;#1606;&AMP;#1610; - or part/similar \\&QUOT;X\\&QUOT;=\\&QUOT;X - or - &#39;X&#39;=&#39;Y - or similar KM;L&#39;/;M&#39;/ SIDIVYA;VIDEOXXX;X I'm not sure what they might be sniffing for, but the MD5 suggests they are looking for a password weakness in the HTML output - and I guess they're testing if the search function mines the page code and not just the displayed text.
  12. I didn't want to delete the "What's New" category, just empty it. Using phpMyAdmin to run the SQL would bypass CubeCart having any say about deleting the secondary links in the index - unless it growls at me later. CubeCart safeguards against deleting a category (using CubeCart admin > Categories) that contains primary products so that there are no orphaned products as a result, but if all products were secondary it should be allowed. I'd still suggest that subcategories be protected - products gone but subcats remain - so the category could only be successfully deleted if no subcats. Much easier to move a few categories than hundreds of products. I understand that deleting the "What's New" category and reconstructing it would be a quick fix, but I'd have to make sure I didn't make other errors reproducing it. Anyway, next time I want to clear it out I'll backup the database, run the DELETE query and report back. Thanks for your time on this ?
  13. The WYSIWYG CKeditor for CubeCart product descriptions tends to clean up a lot of code to comply with the DOM (it's a "feature"). I like to include some comments in the product description for my own use, like whether the postage weight is accurate or search terms so I can email links to customers that will return groups of products, eg. <!--JANUARY-SALE--> Under certain circumstances, like changing text to BOLD or even changing details in the General tab, a cleanup occurs and comment tags can be deleted. It didn't seem to happen as often if the first thing I did when editing a product was to go to the description and select source - but I wanted to guarantee that it would not happen. So I've made two changes to includes/ckeditor/config.js CKEDITOR.editorConfig = function( config ) { config.allowedContent = true; // was bottom line, now moved to top config.filebrowserBrowseUrl = document.location.pathname+'?_g=filemanager&mode=fck'; config.protectedSource.push(/{[\s\S]*?}/g); config.protectedSource.push(/<!--[\s\S]*?\>/g); // allow <comment> tag config.extraPlugins = 'showprotected'; config.filebrowserWindowHeight = 500; config.filebrowserWindowWidth = 650; }; I also noticed that where some comments HAD been deleted, the comments that remained untouched were inside <p></p> tags, so I now include comments inside paragraph tags rather than just floating by themselves. For anyone else with other kinds of code tags being deleted, try a search for config.protectedSource.push to find the regular expressions you need. If changing the CKeditor config doesn't fix the problem, try nesting your code inside tags that seem protected.
  14. My focus was at the product level - just trying to detach the secondary category from 80+ products (not delete the category). My best guess for secondary categories was the category index table. If my DELETE query won't leave a trail of severed limbs in CubeCart, great - I'll use it next time. If this has helped with other issues, also great.
  15. Not sure if you have already worked out a solution for this. I suggest using the Print Order Form payment gateway and customising that as your CASH payment option - if anyone wants to pay on pickup/delivery. PayPal Standard would allow you to process PayPal and CC for customers who prefer to pay when they place their order. I would use Store Collection for the shipping gateway and have text on your site about free home delivery for orders over $299. Not sure how you're going to be able to offer an automated discount for cash, though you could manually adjust the order through Cubecart Admin and print a new invoice to give to the customer at the pickup/delivery stage. PayPal says that you CAN charge a surcharge, but that it can not be more than what they charge you (so you would need to check PayPal's payment fee formula) https://www.paypal.com/au/webapps/mpp/ua/useragreement-full#int_11_Receiving_funds You may need to employ a CubeCart developer to tweak your checkout/gateway for the cash discount/PayPal surcharge. BEST OPTION - you could just guess your ratio of Cash vs PayPal, split the difference and raise all your prices by 2%. That way your cash payments help to subsidise your PayPal payments and the overall cost to customers is minimal - a $50 item becomes $51. As an extra thought, you might consider a mobile PayPal Here device for processing card payments in person if you don't already have a way to accept cards on site.