Jump to content

bsmither

Member
  • Posts

    17,989
  • Joined

  • Last visited

  • Days Won

    603

Everything posted by bsmither

  1. There is rogue code at your lines 1809-1833 (and maybe one other line). The new code to use ElasticSearch does not belong here. It belongs, in fact, directly after the last line you posted above. Your line 1833 (one of the rogue lines of code) starts an else block of code. Therefore, there is probably a closing parenthesis further down the script that ends this block of code. That closing parenthesis would also be a line of rogue code. I recommend making a careful comparison of the searchCatalogue() function from your installation with what is posted here: https://github.com/cubecart/v6/blob/v6.5-master/classes/catalogue.class.php
  2. Did you retry the test having fixed the "debug code didn't take" at near lines 1783 and 1820? Oh, I see. You added more content. Show me a few lines of code above and below Catalogue::searchCatalogue, line (1796). The list shows that after line 1796, execution somehow gets sent back to line 1788.
  3. Keeping the same name and their location in the folders, I would make sure that wherever the new images are located, they have the desired names and being in the desired folders. Then FTP the lot and requesting the FTP transfer to overwrite existing files. Then, have CubeCart clear it's internal cache, which clears out all the pre-sized images derived from the source.
  4. Good. Somewhere between [0] and [1] that $page is getting damaged. In /classes/catalogue.class.php: Use this debug statement: $GLOBALS['debug']->debugMessage('At '.__METHOD__.', line ('.__LINE__.'), $page is '.$page.' and $per_page is '.$per_page); Near lines 1783-1785, find: public function searchCatalogue($search_data = null, $page = 1, $per_page = 10, $search_mode = 'elastic') { $per_page = (!is_numeric($per_page) || $per_page < 1) ? 10 : $per_page; Add the debug statement after the end of the THIRD line. Near lines 1820-1825, find: if (strtolower($page) != 'all') { $page = (is_numeric($page)) ? $page : 1; $limit = sprintf('LIMIT %d OFFSET %d', (int)$per_page, $per_page*($page-1)); } else { $limit = 'LIMIT 100'; } Add the debug statement after the end of the SIXTH line. In /classes/cubecart.class.php: Near line 890-893, make sure the statements are as follows: $GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->common['search'], 'index.php?_a=search'); $GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->navigation['search_results'], currentPage()); } else { $GLOBALS['catalogue']->searchCatalogue($_GET['cat_id'], $page, $catalogue_products_per_page);
  5. Just to confirm, you are asking for page 2 or higher? Does this still appear in the debug panel? 'After Sanitise:' => '_a' => category 'cat_id' => 3 'page' => 2
  6. In admin, at the bottom of the left-side navigation panel, click PHP Info. Near the bottom of the page is a table named PHP Variables. In that table, find $_SERVER['DOCUMENT_ROOT']. Note the path in the Value column. Make sure this is where you are looking for the /setup/ folder. When the setup folder is detected, a message is stored in your "session", but when giving the message to the skin template system (Smarty), the message is removed from your "session". There is nothing new about how this messaging works. So, for the message to not go away, or even be displayed, if there is, in fact, a /setup/ folder not to be found, is strange.
  7. I do not think so. (But we can explore this later.) In /classes/cubecart.class.php: Find near line 880-882: $page = (isset($_REQUEST['page']) && !empty($_REQUEST['page'])) ? $_REQUEST['page'] : 1; $catalogue_products_per_page = $GLOBALS['gui']->itemsPerPage(); After these lines, add: $GLOBALS['debug']->debugMessage('At '.__METHOD__.', line ('.__LINE__.'), $page is '.$page.' and $catalogue_products_per_page is '.$catalogue_products_per_page); This is looking at code that executes just one step ahead of the searchCatalogue() function. If the $page number does change to 2, then we've narrowed where the problem exists. I see above that you mentioned you changed the skin config.xml file to default the number per page to 48.
  8. Yes (line numbers are close enough to my experiments). This is page=1? Have you tried page=2? And $per_page is 48??? The query is using LIMIT 12. This suggests the fault is happening earlier in searchCatalogue(), or even before getting there. Gotta go for now.
  9. $GLOBALS['debug']->debugMessage('At '.__METHOD__.', line ('.__LINE__.'), $page is '.$page.' and $per_page is '.$per_page); In catalogue.class.php, near line 2110-2111, find: if (is_numeric($search_data)) { if (($category = $this->getCategoryData((int)$search_data)) !== false) { Add the debug statement immediately after the end of the SECOND statement above. In catalogue.class.php, near lines 798-800, find: foreach ($GLOBALS['hooks']->load('class.catalogue.category_product_list') as $hook) { include $hook; } Add the debug statement immediately after the end of the THIRD statement above. In catalogue.class.php, near lines 1106-1110, find: } else { $result = $GLOBALS['db']->select('CubeCart_inventory', false, $where, $order, $per_page, $page); } // Get product option specific data Add the debug statement immediately after the end of the FIRST statement above. At the bottom of the debug section (popup?) will be a set of Debug Messages.
  10. No. We need to trace the $page and $per_page variables. I will give you a debug statement and a list of several places in the code to add it.
  11. I see this in the query: ORDER BY `excel_name` Is this a capability added by a code snippet or plugin?
  12. Being on page 2, it is the OFFSET 0 that I do not like. In /classes/catalogue.class.php, near lines 1820-1825, verify that these lines exist as follows: if (strtolower($page) != 'all') { $page = (is_numeric($page)) ? $page : 1; $limit = sprintf('LIMIT %d OFFSET %d', (int)$per_page, $per_page*($page-1)); } else { $limit = 'LIMIT 100'; } When page=all, I expect the LIMIT to be 100 and no OFFSET. --- Scratch all the above. --- Looking elsewhere.
  13. Your question implies you are viewing a page of items in a category. Fetching a list of products in a category list uses the function, searchCatalogue(), but does not interfere with the $page number that a regular search does. (See issue #3066 in the Github.) Please enable CubeCart's debug mode. (The Foundation skin as of CC650+ now shows the debug panel as a popup. (And, if using Firefox, you need to close the popup in order to see the popup of the next page. Otherwise, the next page of debug data has been added to the bottom of the existing content, but the popup might not scroll to that new data.) Make sure that, GET: "After Sanitation", there are 'cat_id' and a 'page' keys. Further down, look for a SQL statement that looks like: Probably close to query #22: SELECT * FROM `CubeCart_inventory` WHERE (`product_id` IN (2,19,20,21)) AND CubeCart_inventory.status = '1' ORDER BY `updated` ASC LIMIT 12 OFFSET 12; -- where OFFSET 12 is a multiple of 12, -- and (2,19,20,21) is a coma separated list of products belonging to this category. As for the list of product_ids, how many values are in your list?
  14. CubeCart can try to use an un-salted password (like CubeCart v3), which will auto-update to a CC6 style password. But, in addition to encoding the password via md5, the database row must also have a blank salt value, and a zero for 'new_password'. You say things were fine until today. Please check if your hosting provider has upgraded your hosted environment (PHP version, etc).
  15. What we can try to do is a code snippet with a 'cron' trigger. So, at your other site, a simple form with method "get" (passes a querystring) will be processed by the snippet - which can be as lax as you need it to be. In admin, Manage Hooks, Code Snippets tab, click Add Snippet. Fill in the form that appears: Enabled: checked Unique ID: IngestSubscriberEmail@cc649+ Execution Order: 1 Description: Accepts and databases a subscriber's email address from outside CubeCart. Trigger: cron Version: 1.0.0 Author: https://forums.cubecart.com/topic/58293-access-mailing-list-from-offsite Code: <?php /** * Uses the 'cron' hook * Does not restrict based on 'double opt-in' settings. * Does not restrict based on 'reCaptcha' settings. */ if (isset($_GET['email'] && filter_var($_GET['email'], FILTER_VALIDATE_EMAIL)) { $email = strtolower($_GET['email']); $GLOBALS['db']->delete('CubeCart_newsletter_subscriber', array('email' => $email)); $record = array( 'status' => true, 'email' => $email, 'customer_id' => 0, 'ip_address' => get_ip_address(), 'date' => date('c'), 'imported' => true ); $GLOBALS['db']->insert('CubeCart_newsletter_subscriber', $record); } The form to submit the data items: Form attributes: action="www.mystore.com" method="get" Form payload: _g=cron _m=runSnippets [email protected] Test thoroughly!
  16. In CubeCart's primary documents (index.php and admin_HaShEd.php), a header named 'X-Frame-Options' is set to "SAMEORIGIN". (Your web server may also be configured to always add this header to responses.) As such, if the visitor's browser (if it supports this directive) cannot be convinced to invisibly override this directive in order to show sources from other origins, what the browser will actually do about it is something I am not at all able to give any advice. You can try removing that statement in index.php.
  17. Please post a PM with your email address and I will send a ZIP file having the "Previous Purchase" plugin.
  18. I am mapping out a solution for displaying a message should a customer view a product page that was previously purchased.
  19. There is no direct setting that will show prices, but prevent ghost customers from making purchases. However, by using Catalogue Mode plus a Code Snippet, a solution can be found. Catalogue Mode (admin, Store Settings, Features tab, Misc section, "Disable Checkout") removes the ability for anyone to actually make a purchase. The Code Snippet will switch off Catalogue Mode when a customer logs in for that logged-in customer. In admin, Manage Hooks, Code Snippet tab, click Add Snippet. A form will be presented: Enabled: checked Unique ID: NotCatMode4LoggedIn@cc640+ Execution Order: 99 Description: Switches off Catalogue Mode for that logged-in user. Trigger: class.user.load.user Version: 1.0 Author: https://forums.cubecart.com/topic/57901-registration-to-be-approved/ Code: <?php /* Uses the hook 'class.user.load.user' located in code that * runs when a user gets logged in. * In admin, enable Catalogue Mode. * These statements will disable catalogue mode and have * the templates resume normal behavior for this user. */ $GLOBALS['config']->merge('config', 'catalogue_mode', false); $GLOBALS['smarty']->assign('CATALOGUE_MODE', false);
  20. I believe this closed issue solves this problem: https://github.com/cubecart/v6/issues/3180
  21. Unfortunately, CubeCart employs a one-off (nonce) "Security Token" that is unique for each POST payload to the storefront (which is coupled to a cookie-based 'session'). The programming code that processes the command to add an email address to CubeCart's Newsletter Subscriber database is looking only for POSTed key/values in the payload - not anything in the querystring. Without a current security token, all GET and POST key/values are unset. What needs to happen is to fetch any page from CubeCart. That page will have a form element of type=hidden containing the security token. Then, the form on the external site will submit a form: Form: action="www.mystore.com/?_a=newsletter" method="post" Payload: [email protected] token=hashcode_from_prior_page_load Cubecart also employs an optional "double-opt-in" where an email is sent to the address submitted with a link to CubeCart to verify the subscription. And CubeCart also employs an optional reCaptcha that must be solved prior to proceeding with certain functions - 'subscribing' is one of them. Currently, there is no known after-market extension that would provide for CubeCart accepting subscription requests outside of itself.
  22. Interesting. I am sure it can be done. Do you allow non-account-holding customers (aka, Ghost customers) to make purchases? If so, that might throw a few obstacles into the mix as CubeCart won't know who the customer is until going through checkout (and submitting an email address).
×
×
  • Create New...