lukejapanwalker Posted October 10, 2015 Share Posted October 10, 2015 I want to add a search results to the bottom of the product page, using the title of the product as the keywords.I know it's a bit of a crude method to add related items but I feel it should do what I need it to.I have found "searchCatalogue" and think I just need to call this at the end of the product php, any ideas?ThanksLuke Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 10, 2015 Share Posted October 10, 2015 It's do-able, but is there a reason why SemperFi's "Related Products" plugin does not meet your needs? Quote Link to comment Share on other sites More sharing options...
lukejapanwalker Posted October 10, 2015 Author Share Posted October 10, 2015 Hey bsmither,Thanks for your reply.I just checked out SemperFi's "Related Products".I'd rather have the related products shown automatically from the title name of the product, as it would be terribly time consuming to assign related products to each product.Also I'm all for purchasing extensions if they do exactly what I need, but if I can just make use of the search function I'd rather do that.If I can't find a good way I will probably just add an iframe to the description as a last resort, but I'm sure you'd agree that is not ideal. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 10, 2015 Share Posted October 10, 2015 The way I see this working is that you will call (not accurate statements, but rather the idea):$search_data = array( 'keywords' => $product['name'], 'featured' => 1, // otherwise, do not include this line 'inStock' => 1, // otherwise, do not include this line ); Catalogue->searchCatalogue($search_data); Use the 'class.cubecart.display_product' hook in the Catalogue->displayProduct() function.Get the result from Catalogue->_category_products.Send each product, if desired, through Catalogue->getProductPrice() and Catalogue->productAssign().Then assign it all to a template variable and code the template to show it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.