Jump to content

Dirty Butter

Moderator
  • Posts

    6,630
  • Joined

  • Last visited

  • Days Won

    139

Everything posted by Dirty Butter

  1. I have a test site that has 100% stock code. But I have behavior that Al cannot replicate. I need to be sure I haven't missed some query change in the database tables. Any suggestions?
  2. Bsmither - I'm in the process of double checking all my edited areas and comparing to stock 6.2+ files. I noticed there is another place in catalogue.class.php that you had me change with the edited Search code in use with 6.1.15 - // STOCK if($search_mode == 'fulltext') { $max_word_len = $GLOBALS['db']->getSearchWordLen(); $words = explode(' ', $search_data['keywords']); if (is_array($words)) { $search_str_len = 0; foreach ($words as $word) { $search_str_len = ($search_str_len < strlen($word)) ? strlen($word) : $search_str_len; } } else { $search_str_len = strlen($search_data['keywords']); // STOCK } Is this why I wasn't getting any results, even when it did not crash?
  3. Interesting! I didn't keep testing for any other issues caused by 7.2.0 once I found this one that is very important to our site. I'll kick the tires today on the 6.2+ CC test sites with php 7.2 installed in earnest and see if that's the only problem.
  4. Very odd indeed. Based on your GitHub report about php 7.1+ it sounded to me like LOTS of files would be effected in CC, not just this edited search. https://github.com/cubecart/v6/issues/2049 I have test sites on the latest commit of 6.2.1. If you want to pursue this search situation, I'd like to test on those, not 6.1.15 plushcatalog, if possible. If this coding style is throughout CC, I probably just need to ignore the WP notice until CC is ready for 7.1+.
  5. Same situation - not crashing, but not finding: File: [catalogue.class.php] Line: [1949] "SELECT I.* 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 (() OR () OR () OR ()) ORDER BY `stock_level` DESC LIMIT 12 OFFSET 0 " - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR () OR () OR ()) ORDER BY `stock_level` DESC LIMIT 12 OFFSET 0' at line 1 I'm getting off for the night - I appreciate your efforts, but I'll go back to 7.0 for now and be fresh to work on it hopefully when you have the time.
  6. This new edit does not crash. It works on 7.0. But on 7.2.5 it gives no results for the search. SORRY - IT DOES NOT FIND RESULTS ON 7.0. Error message : File: [catalogue.class.php] Line: [1949] "SELECT I.* 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 () ORDER BY `stock_level` DESC LIMIT 12 OFFSET 0 " - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY `stock_level` DESC LIMIT 12 OFFSET 0' at line 1 Can I test this on a 6.2.1 test site instead of my live store? I'm swapping back and forth each time to keep plushcatalog as usable as possible.
  7. Most are going to be google cookies more than likely. But they are part of the site if you have anything like Adwords enabled. Maybe recaptcha too??? I was hoping someone would chime in far more knowledgeable than I am!
  8. I stopped manually creating orders when the ability to login as a customer was provided. I just login and pretend to be the customer and take it all the way to payment - which leaves it as Pending. Have you tried it that way to see if it's any different?
  9. With changes 7.0 does not crash on search, but it does not find anything or give any notice to the customer. Error message: File: [catalogue.class.php] Line: [1950] "SELECT I.* 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 ((Array AND Array) OR (Array AND Array) OR (Array AND Array) OR (Array AND Array)) " - Unknown column 'Array' in 'where clause' Changing php to 7.2.5 - still crashes search results page with same error message: [Exception] /home/butter01/public_html/plushcatalog/classes/catalogue.class.php:1941 - Cannot use string offset as an array These changes were made and then cache was emptied each time. Just to be sure, since I'm bad about not correctly following directions: /* NEW BSMITHER SEARCH */ $this->_sort_by_relevance = false; $rlike = ''; if (!empty($search_data['keywords'])) { $searchwords = preg_split( '/[\s,]+/', $GLOBALS['db']->sqlSafe($search_data['keywords'])); foreach ($searchwords as $word) { if(empty($word) && !is_numeric($word)) continue; if ((strtoupper($word) != 'AND') && (strtoupper($word) != 'OR')) $searchArray[] = [$word]; } $regexp = ''; $columnsToSearch = array( 'I.name', 'I.description', 'I.product_code', 'I.seo_meta_keywords', ); foreach($columnsToSearch as $col) { for ($i=0, $noKeys=count($searchArray); $i<$noKeys; ++$i) { $regexp[$col][] = [$col." RLIKE '[[:<:]]".$searchArray[$i]."[[:>:]]'"]; } $regexp[$col] = '(' . implode(' AND ', $regexp[$col]) . ')'; } $rlike = " AND (" . implode(' OR ', $regexp) . ")"; } $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; $query = $q2.' '.$order_string.' '.$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; } } } } else { /* END OF BSMITHER SEARCH */
  10. Take a look at this one: https://github.com/cubecart/v6/issues/2038
  11. Sorry, I realized you needed to know that and had already added it to the end of the post. I miss the old forum code that showed the line numbers!
  12. You suggested edits in two places: /** * Search product catalog * * @param string $search_data * @param int $page * @param int $per_page * @param string $search_mode * @return bool */ // ORIGINAL B4 BSMITHER SEARCH CHANGE TO LIKE INSTEAD OF FULLTEXT public function searchCatalogue($search_data = null, $page = 1, $per_page = 10, $search_mode = 'fulltext') { public function searchCatalogue($search_data = null, $page = 1, $per_page = 10, $search_mode = 'rlike') { And the main section: /* BSMITHER SEARCH */ $this->_sort_by_relevance = false; $rlike = ''; if (!empty($search_data['keywords'])) { $searchwords = preg_split( '/[\s,]+/', $GLOBALS['db']->sqlSafe($search_data['keywords'])); foreach ($searchwords as $word) { if(empty($word) && !is_numeric($word)) continue; if ((strtoupper($word) != 'AND') && (strtoupper($word) != 'OR')) $searchArray[] = $word; } $regexp = ''; $columnsToSearch = array( 'I.name', 'I.description', 'I.product_code', 'I.seo_meta_keywords', ); foreach($columnsToSearch as $col) { for ($i=0, $noKeys=count($searchArray); $i<$noKeys; ++$i) { $regexp[$col][] = $col." RLIKE '[[:<:]]".$searchArray[$i]."[[:>:]]'"; } $regexp[$col] = '(' . implode(' AND ', $regexp[$col]) . ')'; } $rlike = " AND (" . implode(' OR ', $regexp) . ")"; } $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; $query = $q2.' '.$order_string.' '.$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; } } } } else { /* END OF BSMITHER SEARCH */ if (is_numeric($search_data)) { if (($category = $this->getCategoryData((int)$search_data)) !== false) { if (($products = $this->getCategoryProducts((int)$search_data, $page, $per_page)) !== false) { $this->_category_products = $products; return true; } } The line 1941 mentioned in the error message is $regexp[$col][] = $col." RLIKE '[[:<:]]".$searchArray[$i]."[[:>:]]'";
  13. There seem to be several GitHub reports that involve Billing Address/Delivery Address in some way. I'm having this problem with the latest commit of 6.2.1 - of course that's not released yet.
  14. I'm not sure - sorry. I do know you can see what cookies are in use with FireFox by clicking on the i in the circle to the left of the padlock in the url. Follow the arrow on the right to show connection details. Click on More Information and there will the list of all cookies. Test it with cookies enabled, close out all sessions and cache, and try again with cookies disabled. Maybe you can tell which cookies are disabled when the customer blocks. You should be able to then Google for those disabled cookies and see what they go with. Hopefully then you would have some way of seeing past and present use of that plugin, service, etc. in some kind of report from that service. There's probably some very easy way to do all that, but that's all I know how to do.
  15. My Wordpress installs on the same domain with our stores has a notice that I should upgrade to php 7.2.5. Will I have any issues with CC 6.1.15 or 6.2.0 if I upgrade to php 7.2.5? The only issue I found when testing 7.2.5 was a problem with the search edits that Bsmither had provided in catalogue.class.php: Is there any way to improve customer SEARCH experience? - Page 3 - Technical Support - CubeCart Forums While on 7.2.5 an attempt to search using the edits crashed the page. The error message: [28-May-2018 13:38:55 America/Chicago] PHP Warning: Illegal string offset 'I.name' in /home/butter01/public_html/plushcatalog/classes/catalogue.class.php on line 1941 I reverted to php 7.0 and the edited search worked again. There may be other problems while using 7.5.2, but unless Bsmither or someone else can provide a patch to his Search edits, it looks like I'll have to stay on php 7.0 and let the WP sites complain.
  16. AddThis cookies would be non-essential. Maybe a large number of people are opting out of Cookies? Can you check something else that is non-essential and see if there is a comparable drop?
  17. I thought I'd start working on this with our Wordpress sites. One has no comments, pages only all written by me. So that one is a no brainer. One has comments, so I'm using a GDPR plugin to get an appropriate Privacy page. I tweaked the wording just a bit to fit the site. I've sent a policy update email to all of the commenters. But the third site is a doozy. It was created many years ago, has over 16k comments and over 2,600 members. It got too big for me to handle alone a few years ago. So I shut down all comments, access to accounts, etc., and moved to Facebook. I notified all 2,600 plus at the time about what I was doing. Because there is so much valuable information not available anywhere else on the internet among the many posts and comments - I have kept the site open and up to date security wise. NOW I needed to provide ex-members a way to ask for deletion of all personal data. Luckily I found a WP plugin that made it somewhat easy to delete. I downloaded all members name and email address. I ended up using the free email sites online - MailChimp and BenchMark - to upload parts of the membership list and send out an email about how to have their personal data deleted. I'm now in the process of deleting said data for those who requested it. But the crazy part is - about all I had was name and email address for anyone. So, with their website data "deleted", I then had a databased list of all the names and addresses of the deleted names and addresses!! How crazy is THAT! I decided that for this situation it made more sense to delete the databased list of those who requested deletion and also delete all email correspondence we had concerning the posts, etc. That may not be the "legal" way to do it, but it was silly done any other way. Thank goodness the GDPR rules make it clear that data that needs to be retained for financial, etc., purposes is OK . Our CC mailing list was always optional, so that shouldn't be an issue for us on CC sites. To deal with your 50k+ list you will probably have to do something similar on a larger scale - creating a list and throttling sending them a chance to opt-out and/or delete non-essential data. WP made this easier by having an easy way to create and download the customer list. And then the WP plugin made it easier to confirm their request for deletion and then the actual deletion of data (not perfect). Good luck with whatever you decide to do!
  18. Well obviously you're "online" but busy on much more important tasks at the moment. :)
  19. OH!!! Congratulations to both of you!! I was hoping you were offline because your baby had come!
  20. 6.2.0 has a way to temporarily stop ALL plugins and snippets from running - a Safe Mode. It means going to your global.inc, changing your permissions and changing the Safe Mode setting from false to true. Then run your site again. Once you've changed your settings appropriately - change Safe Mode back to false and the permissions back to strict. Hopefully that will give you what you need. BTW, if I remember correctly, the Safe Mode setting was Bsmither's suggestion in GitHub.
  21. Well, I've replaced all the files with stock AGAIN and run setup AGAIN. I STILL can't get this to work with today's 6.2.1 commit - with or without reverting the js file. I am at a total loss how to proceed. The only thing that still has anything from previous versions is the database, which is basically a copy of our live store that I upgraded to the commit.
  22. That is very puzzling indeed. Add item to basket, click Checkout, add in all required info, billing the same as delivery is already checked by default, check T&C box, left shipping choice as shown, clicked checkout button. Then get a very long load of next page - /index.php?_a=addressbook&action=add&redir=confirm See screenshot https://dirtybutter.com/billingdeliveryaddressissue.png Using FF tools, the long wait is a 302 POST to index.php?_a=confirm that takes 3719 ms to complete.
  23. On your commit as of today (except for the button color change) WITH the reverted js file - sorry to say it still did not work. But since it's a js change, I'm going to do some major manual Windows cache cleaning and cache cleaning of CC and try again.
  24. Testing it now - will report. BTW - I do not allow guest checkouts, so that is normally a hidden line of code in my own edited version.
  25. I think I've found my problem. I still had admin cache disabled, as I've been doing lots of editing. I DID have cache cleared out before testing purchasing on the front end, but with cache disabled the front end evidently can't "hold" the choice to use billing the same as delivery. Once I enabled cache within Admin, I was able to get a proper purchase sequence. I'll test some more, but I think this is resolved.
×
×
  • Create New...