vidmarc Posted August 11, 2018 Share Posted August 11, 2018 I've been asked to add a link that will list every product on the site, descending from date added. Is this possible Link to comment Share on other sites More sharing options...
bsmither Posted August 11, 2018 Share Posted August 11, 2018 My first thought would be to create a sitemap, then add a Document with an external target which points to the sitemap. Link to comment Share on other sites More sharing options...
Noodleman Posted August 12, 2018 Share Posted August 12, 2018 Try this: https://www.cubecart.com/extensions/plugins/price-list-plugin Link to comment Share on other sites More sharing options...
vidmarc Posted August 14, 2018 Author Share Posted August 14, 2018 Is there a way to do this with a custom URL search query? Link to comment Share on other sites More sharing options...
bsmither Posted August 14, 2018 Share Posted August 14, 2018 Try: /search.html?search[keywords]=*&_a=category Link to comment Share on other sites More sharing options...
vidmarc Posted August 21, 2018 Author Share Posted August 21, 2018 Thanks, that seems to work. Now if only I could get "Your Search Returned X amount of Products"... Link to comment Share on other sites More sharing options...
bsmither Posted August 22, 2018 Share Posted August 22, 2018 Initially, we are at /classes/cubecart.class.php, in the private function _category() where the call to search the catalogue is made. This statement: $GLOBALS['catalogue']->setCategory('cat_name', sprintf($GLOBALS['language']->catalogue['notify_product_search'], $_REQUEST['search']['keywords'])); gives us the Products found matching 'words' phrase. We can execute a similar statement immediately after the above with what we want to display. Immediately after that statement, add: $GLOBALS['catalogue']->setCategory('cat_name', "Your Search Returned ".$Catalogue->_category_count." Products."); But here is another problem-- this '_category_count' property of Catalogue is private. Catalogue includes this value as a parameter when making calls to other places, but other places cannot ask Catalogue for this value. Not without a specific function of Catalogue to answer such requests. (Note: there is the Category public function getCategoryData(), but this function first loads '_category_data' with fresh data from the database category table. This is not what we want. This function should maybe actually be called loadCategoryData().) We will need to use a function of Catalogue, while we are in Catalogue, to incorporate the '_category_count' into a variable that we can later ask for outside Catalogue. In the Catalogue class file, public function searchCatalogue(), starting at the bottom of the function, look for: $this->_category_count = (int)count($count); There will be three instances of this statement. On a new blank line after each occurance, add: $this->setCategory('category_count', $this->_category_count); Next, we now need the function to allow an outside place to ask for this value. In the Catalogue class file: Find: //=====[ Private ]======================================= On a new blank line just ABOVE it, add: /** * Get category property * * @param string $id * @return mixed */ public function getCategory($id) { return $this->_categoryData[$id]; } Finally, we now have a good statement to add in the CubeCart class file -- the first edit made: $GLOBALS['catalogue']->setCategory('cat_name', "Your Search Returned ".$GLOBALS['catalogue']->getCategory('category_count')." Products."); Link to comment Share on other sites More sharing options...
vidmarc Posted August 22, 2018 Author Share Posted August 22, 2018 Would a plugin be able to do this? Or perhaps make it an option in future versions of Cubecart? Link to comment Share on other sites More sharing options...
bsmither Posted August 22, 2018 Share Posted August 22, 2018 I was watching for that as I was working this out. All I can say is -- maybe. Link to comment Share on other sites More sharing options...
vidmarc Posted April 4, 2019 Author Share Posted April 4, 2019 The only way I can get this to work (simply) is to add a new top category called "Store", and then add each product menu item as a sub-category of "Store". Unless there's any other way of doing this since I was last here? Here are the menu items/categories I have so far. https://www.mondo-macabro.com/ Link to comment Share on other sites More sharing options...
vidmarc Posted April 4, 2019 Author Share Posted April 4, 2019 If I add all theese categories as a sub category of "Store", they are no longer displayed as main menu items and instead are "Store" sub-menu items. Is there a way around this? Link to comment Share on other sites More sharing options...
vidmarc Posted April 4, 2019 Author Share Posted April 4, 2019 On 8/14/2018 at 2:40 PM, bsmither said: Try: /search.html?search[keywords]=*&_a=category This seems like a good option - but can I modify the link to list only in-stock items from all categories? Link to comment Share on other sites More sharing options...
bsmither Posted April 4, 2019 Share Posted April 4, 2019 By asking this question, we can assume you choose to show out-of-stock items everywhere else? Otherwise, in admin, Store Settings, Stock tab, set the "Hide out-of-stock product" setting to checked. (To verify its operation, log out of admin, or use a different browser.) Link to comment Share on other sites More sharing options...
vidmarc Posted April 4, 2019 Author Share Posted April 4, 2019 I need to list out of stock / out of print items in a different menu, so I will need a custom search term for this. Link to comment Share on other sites More sharing options...
bsmither Posted April 4, 2019 Share Posted April 4, 2019 If the above URL worked for you, try this: /search.html?search[keywords]=*&_a=category&inStock=1 Maybe not. Checking... Link to comment Share on other sites More sharing options...
bsmither Posted April 4, 2019 Share Posted April 4, 2019 There is a bug in CC624 that is thwarting my attempts to create a URL that will show only in-stock items. /search.html?search[keywords]=*&_a=category&search[inStock]=1 The above is the URL I am working with. Link to comment Share on other sites More sharing options...
vidmarc Posted April 5, 2019 Author Share Posted April 5, 2019 Thanks for your help with this - I'm sure it is possible, somehow... It must be possible to generate a valid search query via the advanced search form: /search.html It has an "in stock" option. But I can't find the best way to list all items. The asterisk doesn't work. Perhaps the advanced search form needs expanding to allow more search terms, for example a wild card and "category". Link to comment Share on other sites More sharing options...
bsmither Posted April 5, 2019 Share Posted April 5, 2019 The asterisk is meant to cause the search to "find" all items using an RLIKE syntax. Still working on what it may take to avoid pagination. Link to comment Share on other sites More sharing options...
Antonw.com Posted April 5, 2019 Share Posted April 5, 2019 I would also really like to have my store showing "View All Products" and pagination 1,2,3 so if this thread turns out to a plugin please let me know Link to comment Share on other sites More sharing options...
bsmither Posted April 5, 2019 Share Posted April 5, 2019 Depending on your skin, there may be a All link at the end of pagination. The URL we are experimenting with, where one can place this link on any other site or any other location in your store, would be: search.html?search[keywords]=*&_a=category&page=all Hopefully, you have a sane amount of products to be showing all of them at one time. (I think there may be a limit in the code for 100 items.) Or your hosting site has given you a dedicated server and database. Link to comment Share on other sites More sharing options...
vidmarc Posted April 6, 2019 Author Share Posted April 6, 2019 Hopefully there would be a way of adding "Your search produced XXX results" Link to comment Share on other sites More sharing options...
bsmither Posted April 6, 2019 Share Posted April 6, 2019 Try this: In the template content.category.php, find: <h2>{$category.cat_name}</h2> Change to: {if $VAL_SELF|strpos:'search.html'}<h2>Your search produced {$TOTAL_RESULTS} results...</h2>{/if} <h2>{$category.cat_name}</h2> Link to comment Share on other sites More sharing options...
vidmarc Posted May 1, 2019 Author Share Posted May 1, 2019 Ws wondering if anybody had found a way of hiding out of stock/sold out products, except in a separate "archive" section? Link to comment Share on other sites More sharing options...
bsmither Posted May 1, 2019 Share Posted May 1, 2019 This conversation may be of interest: https://forums.cubecart.com/topic/52765-out-of-stock-items-not-hidden/ Link to comment Share on other sites More sharing options...
vidmarc Posted June 13, 2019 Author Share Posted June 13, 2019 Now I'm more confused Will this hide OOP items from the main search, yet still allow them to be displayed in the "archive" section of our site? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.