[Pro] Sharing OpenCart search box with Freeway content

Hi all,

I have a site which is mixed with Freeway designed content and database searchable content set up in OpenCart. I have had a request from the client to now have a search box on every single page of the website, which of course is a big issue as the OpenCart content and the Freeway content are two completely different animals. The client didn’t originally want this facility, otherwise I would have had to set the whole site up in OpenCart.

I know where the search box code snippet is within OpenCart, but I was just wondering if there was a way of using that code as mark-up within the Freeway section, and should somebody carry out a search on those static Freeway pages, somehow point the search to the OpenCart database, and then load the results as part of the normal OpenCart page content.

Thanks in advance.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you look at your OpenCart page in a browser and view source, you can find the HTML that draws the search form and its search box. Look for something that looks somewhat like this:

<form action="/results.php" method="get">
	<input type="text" name="q" />
	<input type="submit" value="Search" />
</form>

There will probably be a lot more code around it than that, and I’m not sure at all of the names of the fields, but that’s the bare bones of it. You can attack integrating this into your Freeway pages a couple of different ways once you have found it.

The simplest (but least WYSIWYG) would be to just copy this code, place a Markup Item where you want the form to appear, and paste the code into the Markup Item’s dialog box. You won’t see anything on your design page except an empty box with a little < H > in the corner. But when you publish the page and view on the Web, you will see a (hopefully working) search form. If you do this, you cannot have any other form elements on the same page, unless you also use the Multiple Forms Action to un-nest the forms. (Freeway always wraps the entire page in a form if any form elements are drawn on the page, and form tags cannot be nested inside one another.)

The other way to handle this is to use Freeway’s native form tools to design your form, and the Page / Form Setup dialog to enter the action attribute (/results.php in my example above) to match the code you found in your PHP pages. You’ll have to be sure to set the Method to GET (if that’s what you found in the source) and to name the search field precisely, using the third tab from the left in the Inspector while the search field is selected. The benefit to this is that you will have a WYSIWYG view of the page in Freeway’s design view, but the downside will be that you will need to repeat these steps for each page where you place the search fields, versus copy and paste of the Markup Item.

Walter

On Aug 20, 2012, at 4:44 AM, Jonathan Riddle wrote:

Hi all,

I have a site which is mixed with Freeway designed content and database searchable content set up in OpenCart. I have had a request from the client to now have a search box on every single page of the website, which of course is a big issue as the OpenCart content and the Freeway content are two completely different animals. The client didn’t originally want this facility, otherwise I would have had to set the whole site up in OpenCart.

I know where the search box code snippet is within OpenCart, but I was just wondering if there was a way of using that code as mark-up within the Freeway section, and should somebody carry out a search on those static Freeway pages, somehow point the search to the OpenCart database, and then load the results as part of the normal OpenCart page content.

Thanks in advance.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walter.

It is feasible at least? I have no problem with using mark-up - the site in question is full of it. What is stumping me is how does the form know to look into the database and return the OpenCart results page?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Can you post a link to one of the pages in the Open Cart? One that already has a search form on it? I could isolate the actual HTML that creates the search form for you.

The way that any search engine works is as follows: there is a Web form, and it has an action attribute. This action is a URL to the server process that will interpret the form contents and return a list of results. In my example, I made this URL results.php – but I just made this up. Within the form is a search field (which I named q, since that’s what Google calls theirs, and most search engines copy that precedent). When the form is submitted to results.php, it carries along whatever was entered in the search field as part of the GET request for results.php, so you would see the URL results.php?q=some+search+terms+here when you get the results page. When results.php loads, it reads

q => 'some search terms here' 

out of the request, and does stuff with that value to come up with the items it will display in the browser.

So the way that the server figures all of this out is from the form setup. Every search field on every page sends its requests to one URL on the server, and the script that answers those requests knows what to do with it.

Walter

On Aug 20, 2012, at 11:09 AM, Jonathan Riddle wrote:

Thanks Walter.

It is feasible at least? I have no problem with using mark-up - the site in question is full of it. What is stumping me is how does the form know to look into the database and return the OpenCart results page?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter,

I need to be a bit careful with posting links as we are getting a huge amount of stick because we haven’t been able to fulfil this request, and I know these forums are searchable, so I will post the url in code! Obviously remove the spaces.

www . the wo od bo ok . hav wo ods . co . uk

Sorry about that.

To clarify, the OpenCart sections are on sub-domains of www hav wo ods co uk and clicking the home button on the OpenCart link above will take you to the Freeway static content where I want the search box to go.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Jonathan,
The following example Freeway file should do what you need;
http://www.freewayactions.com/test/Havwoods-search-example.zip

Simply copy and paste the form item to your document and style to suit the rest of your site. The trick is to target the form at the processor page and include the variables the form needs for the search as hidden fields.
Regards,
Tim.

On 20 Aug 2012, at 17:10, Jonathan Riddle wrote:

To clarify, the OpenCart sections are on sub-domains of www hav wo ods co uk and clicking the home button on the OpenCart link above will take you to the Freeway static content where I want the search box to go.


Experienced Freeway designer for hire - http://www.freewayactions.com


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, I just can’t thank you both enough for the help with this.

Walter sent me a couple of emails pointing me in the exact sime direction as you have done with that example, Tim. (Done via email because I need to hide the actual client name and urls from public consumption).

It all works and this will go a long way to calming the waters a little bit. Invaluable stuff.

Thanks again. If only I could ever return the favour…


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’m glad it helped Jonathan.

Walter, I hate to add to your overcrowded list of things to do but could you add a suggestion to your list for FreewayTalk to add a Markdown code (or similar) that would hide URLs from all but registered users - I’m primarily thinking here of search engines.
Thanks,
Tim.

On 21 Aug 2012, at 09:34, Jonathan Riddle wrote:

Walter sent me a couple of emails pointing me in the exact sime direction as you have done with that example, Tim. (Done via email because I need to hide the actual client name and urls from public consumption).


Experienced Freeway designer for hire - http://www.freewayactions.com


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That’s an interesting idea, Tim. So we would filter the message body, spot anything that’s URL-shaped, and replace it with [REDACTED] in the non-authenticated public view?

This brings up a recurring question for the list, then: should be do the same for e-mail addresses? Right now, if you post a live e-mail address to the list, it gets filtered out entirely from the Web view, replaced with email@hidden in all views, public and authenticated. If I go through this exercise with URLs, I could do the same for emails – authenticated visitors would see everything in the clear.

So, how do you all feel about this?

Walter

On Aug 21, 2012, at 5:08 AM, Tim Plumb wrote:

could you add a suggestion to your list for FreewayTalk to add a Markdown code (or similar) that would hide URLs from all but registered users - I’m primarily thinking here of search engines.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It sounds good to me, Walter. I am always wary of placing clients names and url’s when I ask for help, and of course it can be a nightmare for those trying to give the help if the actual problem can’t be seen first-hand.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter,

On 21 Aug 2012, at 13:50, Walter Lee Davis wrote:

That’s an interesting idea, Tim. So we would filter the message body, spot anything that’s URL-shaped, and replace it with [REDACTED] in the non-authenticated public view?

I was initially thinking that a simple noindex, nofollow on the URL may be enough but that wouldn’t stop the search engines from picking up on the comments about the annoying clients etc! :slight_smile:
I think by default the URL would be shown but you can also add it in using a code ([masked]http://www.softpress.com) and the link would only be shown in emails and to registered users.
It is always going to be a tradeoff between the usefulness of seeing unencoded URLs compared to users posting a comment that could get back to a client.

This brings up a recurring question for the list, then: should be do the same for e-mail addresses? Right now, if you post a live e-mail address to the list, it gets filtered out entirely from the Web view, replaced with email@hidden in all views, public and authenticated. If I go through this exercise with URLs, I could do the same for emails – authenticated visitors would see everything in the clear.

So, how do you all feel about this?

I get 99% of FreewayTalk through email so everything works perfectly well for me. Showing the email addresses to logged in web users would certainly be a useful addition.
Regards,
Tim.

FreewayStyle.com - Free Freeway templates and parts to download, use and explore - http://www.freewaystyle.com


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, it occurs to me that if we did it the way we’re proposing for email addresses, it won’t make any functional difference for logged-in users. Would there be any benefit to allowing clear Web addresses to propagate through Google (the un-authenticated view) that we we are overlooking here? Maybe the email and web addresses that are hidden should be masked with a link to a tooltip or something like that:

Why am I seeing this?
+++++++++++++++++++++
Members of FreewayTalk can see links and 
e-mail addresses in all messages -- so you
should _subscribe today_!

Walter

On Aug 21, 2012, at 1:39 PM, Tim Plumb wrote:

It is always going to be a tradeoff between the usefulness of seeing unencoded URLs compared to users posting a comment that could get back to a client.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On reflection maybe not. It may also encourage casual web viewers to sign up and see the whole post as well.
Regards,
Tim.

On 21 Aug 2012, at 18:46, Walter Lee Davis wrote:

Would there be any benefit to allowing clear Web addresses to propagate through Google (the un-authenticated view) that we we are overlooking here?


FreewayStyle.com - Free Freeway templates and parts to download, use and explore - http://www.freewaystyle.com


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi

Just as a little extra on this. Can I use the actual CSS from how OpenCart styles the searchbox rather than the styling of how Freeway shows the searchbox? At the moment I will have slightly different looking search boxes.

Jonathan


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Just an update. I managed to extract all of the css for the Open Cart search box from the installed cart stylesheet.css (thanks Firebug!) and then inserted a mark-up item containing that styling into the Muliple-Forms element which I had copied into my Freeway document from the file kindly suppled by Tim.

Much trial and error but it works a treat.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hello all.

I have recently updated my site to FW6 and Opencart 1.5.6. They changed the way the static search code worked from my Freeway part of the site into Freeway, which was my original issue, but I managed to fix that (filter_name became search), but now it seems the searches are case sensitive in my OpenCart site.

The default installation of OC seems to be OK, recognising both all case searches, but something I have done seems to have made it case sensitive. Is there anything in the Freeway content, some of which I have added to the OpenCart site, which could be affecting things?

Also seen on MySQL and phpMyAdmin that the utf coding matters. The database is set to utf8_general_ci which could be the issue, but what to change to?

Thanks in advance.

Jonathan


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This is becoming a habit. I try for hours to get something sorted, and then finally ask for help - only to instantly fix it myself.

If anyone is interested, the database has a general setting of utf8_general_ci (the _ci stands for case insensitive!), but then tables within can be set independently of the master setting, and it turns out the ones that affected the general site search had changed to utf8_bin, which is case sensitive. So I changed them to utf8_general_ci and it worked.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hello all,

Raising an old thread and question here, but I have some sections of the website which will be generated in Wordpress soon, and I was just wondering if anyone knew whether the original solution for adding a search box to my Freeway layout which searched the OpenCart site could be applied to Wordpress at all, where I need to amend the search code in the Wordpress header to point the search at the same OpenCart database.

I have looked at the Wordpress header.php file but I can’t see anything similar.

Thanks in advance

Jonathan


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Can you post a link to an example page that shows the search form? If you do, we can extract the actual form action from the rendered HTML code (in the browser’s View Source). There’s not need to search through the Wordpress PHP for this, you’re going to be writing a simple HTML form in Freeway, the trick is to post that form to the same handler that Wordpress exposes in its pages. Then the search results will be calculated by WP and returned in the WP search results page.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hello Walter

I am afraid I don’t quite understand what you mean. I don’t have any pages yet as I am trying to establish if it is possible that I can search Opencart from Wordpress before going any further. The site is going to become a bit of a mish mash for a while and now the client wants to have separate search boxes for products (Opencart) and then a general search of the Wordpress site for news articles etc - and that needs to be possible from every page.

I will still want an Opencart search returned in Opencart and Wordpress search returned in Wordpress.

I hope that makes sense.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options