![]() |
Quote:
are you sure 3.5.3 or 3.5.1 |
for 3.4.8
Has anyone tried the code for 3.4.8 that many people testify works for them?
I tried using it, and it works, except I found out recently that clicking "advanced search" and trying to do a price search yields the following error: Code:
INVALID SQL: 1064 : 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 '1 group by xcart_products.productid' at line 2 Help, anyone? |
modifying my .tpl to form a complex search query
The problem :: In the beads section of my store, I need to give users a way to easily find the beads they are looking for. I carry a lot of different kinds of beads, so using the plain old X-Cart category set-up will leave the customers swimming through pages and pages of beads they don't care about.
The solution? :: I have decided that the best way to do this is to add a set of 3 pull-down menus to the header bar .tpl: size, color, and material; accompanied by a "go" button. The user can then select, for example, "Small Blue Glass" beads and browse a nice specific set of results. Included in the menus will be selections for "All sizes", "All colors", and "All materials". ** Update: I have figured it out! Thanks to Tuner's search.php contribution, I was able to simply copy and slightly modify a few bits and make it work for me. Hopefully someone else will be in my situation one day, and for them i will post my code below: search.php: Code:
<? I then added the following to my advanced_search.tpl and the other templates where I wanted the user to be able to search the beads category: Code:
<table> Now i know that .tpl code is not a particularly smart way of going about things, but I don't know enough about smarty to get it to automatically list the param01, 02, and 03 values. I'm guessing that would be done with a {section} command, like the category menu uses in advanced_search.tpl... Anyone? - Jordan |
brand searching question
Hello again
I am trying to implement Tuner's brand searching modifications and I have everything working except the code in advanced_search.tpl that generates the Brand pull-down menu: Code:
<select name=search_brand> This code just creates a menu with the choices of "" and "None". When I create my own test menu with hard-coded option values, the brand search works fine, so I'm pretty sure this is where the problem lies. Is there one more bit of some other file I have to modify to get this going? I have been entering the values into the brand column of the products table by hand, through a MySQL DB editor program. Thanks |
You can place this code in the inv_update.php to add the brand field to update. This way you can bulk change your Brand field using a CSV list for all your products.
Code:
} elseif ($what == "brand") { To add an update for an extra field it would be something like this, Define the field name in the code: Code:
} elseif ($what == "name of extra field") { Then add these to the dropdown list in the inv_update.tpl Code:
<TD><SELECT name=what> |
THANK YOU for that information! I have been searching around for a way to add fields to the inventory update function for a while now.
However, I'm not sure if it addresses my problem above. The brand information is already in the xcart database Б─⌠ I put it there using a phpMyAdmin-style solution. I found this bit of code at the end of search.php which came from Tuner's mod. Code:
$brands = func_query("select brand from $sql_tbl[products] where brand <> '' GROUP BY brand"); Code:
<select name=search_brand> Thanks -Jordan |
Hi,
I have implemented a shop by brand feature, find below details. I am sure there will be some people more familiar with the software, php, smarty and mysql and might have used better code etc. but this works for me: Creating the initial database query and defining the array in for smarty. Code:
// database query Create a template page to populate a jump menu e.g. brands.tpl including the following code: Code:
<FORM name=brand action=search.php method=get hope this helps people :) N.B - the 'search.php' page will need to be modified in order to enable the filter of the database according to the 'brand' passed in the query string. |
I implemented this mod, but now searches return way too many results and the best result is frequently buried several result pages deep.
Anyone else find this? I am thinking to go back to the standard X-Cart Search php file. From an end user standpoint, if I go to a site and search for dinner forks, I want dinner forks to be in the top 5 results, not on page 3 of 100 results. |
you could change the line in the files that is:
Code:
if(empty($and))$and = "OR"; to Code:
if(empty($and))$and = "AND"; That will mean that both words have to be present to return the results and will work out far more accurate for your purposes. |
Thanks FD. Once again, you save the day.
|
All times are GMT -8. The time now is 10:35 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.