Jump to content

Recommended Posts

On 19/04/2017 at 1:59 AM, LeeFoster said:

@@bonbec,

 

Change line 46 in cm_nb_store_search from 

 

$script .= '<script src="' . tep_href_link('ext/modules/content/header/store_search/content_searches.min.js', null, $request_type) . '"></script>';

 

to 

 

$script .= '<script src="' . tep_href_link('ext/modules/content/navbar/store_search/content_searches.min.js', null, $request_type) . '"></script>';

Hi @LeeFoster

I am still experiencing issues with this Add On. For feedback, I think there are a number of remaining coding issues with it, including:

1. The content_search.min.js  in the ext /modules /content /navbar/store_search directory points to a  "header" location for content_search.php, not the file included with this Add On, therefore requiring that the original header search on which this version was based is installed. Pointing it to the right file breaks it for some reason. So it does not seem to work without the header version of the content_search.php file from the original contribution.

2. The navbar content_search.php file above requires the header add on version of the language file, not the language file included with this Add On.

3. The defined terms in the content_search.php file all reference MODULE_CONTENT_HEADER_...  not what appears in the language file with this Add On.

I think this Add On has great potential. But it needs some work. The search function itself works fine.

Peter

Edited by peterpil19

Full-time I am the COO of a large retail company in Australia.

In my spare time (what little I have), I enjoy buying, selling, and trading ancient coins and antiquities as a hobby: https://www.ancientcointraders.com.

I am enjoying learning about web-design.

 

osCommerce responsive is the best version of osCommerce.

Download it here: https://github.com/gburton/Responsive-osCommerce

Please donate so the team can continue their work on that project: https://pledgie.com/campaigns/31724

Share this post


Link to post
Share on other sites

@peterpil19

If you are trying to convert this add-on from a Header module to a Navbar module, see my post here:

And, more importantly, the post right below it.

HTH

Malcolm


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

@ArtcoInc

Thanks,

LeeFoster's is an existing Add On which is supposed to do exactly that: https://apps.oscommerce.com/dS9oo&modular-navbar-search-w-images-bootstr

I tried your Add On (the second attachment with the missing file) but it would not function for some reason - I got a white screen below the navbar! Not having luck with this image search add on.  Even the original header one would not work with images showing when I installed it!

Peter


Full-time I am the COO of a large retail company in Australia.

In my spare time (what little I have), I enjoy buying, selling, and trading ancient coins and antiquities as a hobby: https://www.ancientcointraders.com.

I am enjoying learning about web-design.

 

osCommerce responsive is the best version of osCommerce.

Download it here: https://github.com/gburton/Responsive-osCommerce

Please donate so the team can continue their work on that project: https://pledgie.com/campaigns/31724

Share this post


Link to post
Share on other sites

Hi Malcom,

Modified:)

I haven't tried it yet on a clean install. If I get a chance to do so I will let you know if there are any issues.

Peter


Full-time I am the COO of a large retail company in Australia.

In my spare time (what little I have), I enjoy buying, selling, and trading ancient coins and antiquities as a hobby: https://www.ancientcointraders.com.

I am enjoying learning about web-design.

 

osCommerce responsive is the best version of osCommerce.

Download it here: https://github.com/gburton/Responsive-osCommerce

Please donate so the team can continue their work on that project: https://pledgie.com/campaigns/31724

Share this post


Link to post
Share on other sites

@peterpil19

 

On 10/16/2017 at 5:09 PM, peterpil19 said:

Hi Malcom,

Modified:)

I haven't tried it yet on a clean install. If I get a chance to do so I will let you know if there are any issues.

Peter

Have you had a chance to test this in a clean install?

Malcolm

Edited by ArtcoInc

Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

Hi Malcom,

Not yet.

I got the other add on working by making some changes,  but even then, without the photos working.  I am under the pump at the moment but plan to test it when I get a chance. When I get time I might actually just put together a simple search box in navbar contribution as I do not believe one exists. I do not think it is a difficult task to put one together.

Peter 


Full-time I am the COO of a large retail company in Australia.

In my spare time (what little I have), I enjoy buying, selling, and trading ancient coins and antiquities as a hobby: https://www.ancientcointraders.com.

I am enjoying learning about web-design.

 

osCommerce responsive is the best version of osCommerce.

Download it here: https://github.com/gburton/Responsive-osCommerce

Please donate so the team can continue their work on that project: https://pledgie.com/campaigns/31724

Share this post


Link to post
Share on other sites

Thanks for the add-on!

I have something odd happening, the search appears to work, I see a listing of the products being populated when I type.

However, when I click on the item I want to visit, I get a HTTP Forbidden error returned.

I assume it may be something in my .htaccess ?

I have cross site scripting disabled maybe that is doing it?  I'm really not sure what would cause the forbidden.  The URL looks correct.

Share this post


Link to post
Share on other sites
4 hours ago, ArtcoInc said:

@phi148

Is this on a live site? If so, do you have a link?

M

It is on a live site, so I disabled it until I can find out why I'm getting the 403 forbidden errors.

Share this post


Link to post
Share on other sites
[Sat Jul 21 20:35:39.370816 2018] [:error] [pid 14534:tid 139761074984704] [client xx.xx.xx.xx:62135] client denied by server configuration: /home/xxx/public_html/ext/modules/content/header/store_search/content_searches.php, referer: https://www.mysite.com/

I get the above error in my server logs. When I click on the item that appears in the search box.

Share this post


Link to post
Share on other sites

I found the problem.  "Mod_Evasive" must be turned off in the apache settings.  However, this is a bad thing, as mod_evasive helps to prevent DDOS attacks!

Share this post


Link to post
Share on other sites

I really like this search feature, except for 1 thing.  It auto-selects the first item in the search results that appear below the search window.  I'd rather not have any of them autoselected, so if the user just clicks "enter" it will automatically do an advanced_search rather than always picking the first item below the search box.

Any idea how to change the code to do that?

Share this post


Link to post
Share on other sites

@tgely

Is there any chance that you will be updating this to BootStrap v4, to be used in the latest Phoenix release of osC?

In this add-on, you have a file called bootstrap3-typeahead.min.js. I have concerns of how this will work under the new Bootstrap v4.

TIA

Malcolm


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

@ArtcoInc

Its not possible in near furure. I am working on v2.4 core but there is hard coded BS3. Language search functionality is more close to v2.4 than v2.3 codebase. When v2.4 core will be totaly separated into 2 parts (core and template) then will be a chance to use different template systems. We are in a sack street at this moment.


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites
18 hours ago, ArtcoInc said:

In this add-on, you have a file called bootstrap3-typeahead.min.js. I have concerns of how this will work under the new Bootstrap v4.

No change to this file,

" The Bootstrap 3 Typeahead will also work with Bootstrap 4. The look and feel of Bootstrap 4 will differ from Bootstrap 3 and so does the drop down menu. In Bootstrap 4 the typeahead dropdown menu will look like that "

All you need to do is update for Phoenix, replace tables small change for fa and a few small file name fixes and it works ok, you may need a little css to fix layout.

Working on custom test site. Never used in anger but look fine so far.

image.png.af25a49562c023320caf87060224d320.png


 

Share this post


Link to post
Share on other sites

@JcMagpie

I tried installing the add-on into Phoenix, and while it does create the drop-down, I am having issues ...

After a clean page refresh, when I first click into the search box, the cursor does not blink at the beginning of the search field. If I move my mouse pointer over the magnifying glass, the blinking cursor appears. When I move the mouse pointer off of the magnifying glass, the blinking cursor disappears.

If I click on another tab in my browser (Firefox), then click back on the tab with the Phoenix page, the blinking cursor appears.

When I start typing in the search box, IF the blinking cursor is NOT blinking, the letters I type do not show up (initially). The drop-down box DOES drop down, and the suggestions are shown.

Now, this may just be an issue with the WAMP server I am testing this on. I don't know ... <shrug>


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites
Posted (edited)

I'm no expert in this add-on I only used it for a short time but it looks to work fine on new install of Phoenix 1.0.1.0 with php 7.3 running.

try using it on the custom website  custom site and see if you have the same problem, if it looks ok I'll pm you my updated files and you can try.

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites

@JcMagpie

Thank you for the offer. I had converted the original search add-on to a NavBar module, instead of a Header module. That's what I'm trying to work with.

M


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

@tgely

As @JcMagpie pointed out, this does indeed work in Phoenix under BootStrap v4. The issues I am having seem to have to do with the changes I made when I converted it from a Header module to a NavBar module. I'm still working on those. In the mean time, I do have a question ...

In your module, you have the option to "Enable Extended Store Search Functions", where it can search the product Description. The only two places in your code where I see the product Descriptions referenced are

1) In /ext/content/modules/header/store_search/content_searches.php, where you have this ...

      if ($r > 5) {
        $array[] = array('icon'  => "plus-circle",
                         'title' => MODULE_CONTENT_HEADER_STORE_SEARCH_MORE_PRODUCT,
                         'href'  => tep_href_link('advanced_search_result.php', 'keywords=' . urlencode(str_replace(' ', '+', $query)) . '&search_in_description=' . (MODULE_CONTENT_HEADER_STORE_SEARCH_FUNCTIONS == 'Descriptions' ? 1 : 0), $request_type),
                         'price' =>null);
        break;
      } else {

 

2) And in /includes/modules/content/header/cm_header_store_search.php, where you have this ...

    if (tep_not_null($description) && ($description === true)) {
      $search_link .= tep_draw_hidden_field('search_in_description', '1');
    }

Can you explain how this toggles the search function to include searching the descriptions or not?

 

@milerwan

You used the same code from above in your version of this module. When you added the option to search the Model or Key Words, you added the following check in your file /ext/modules/content/header/store_search/content_searches.php ...

//Add products_head_keywords_tag search option
    if (MODULE_CONTENT_HEADER_STORE_SEARCH_MODEL_OR_KEYWORDS == 'Model') {
      $like_statement_product .= " (pd.products_name LIKE '%" . tep_db_input($product) . "%' OR
                                     p.products_model LIKE '%" . tep_db_input($product) . "%') AND ";
    } else {
      $like_statement_product .= " (pd.products_name LIKE '%" . tep_db_input($product) . "%' OR
                                    pd.products_head_keywords_tag LIKE '%" . tep_db_input($product) . "%') AND ";
    }

 

In order to ensure that I was able to toggle the Description search on or off, what I ended up doing was changing the above to:
 

//Add products_head_keywords_tag search option
    if (MODULE_CONTENT_HEADER_STORE_SEARCH_MODEL_OR_KEYWORDS == 'Model') {

      if (MODULE_CONTENT_HEADER_STORE_SEARCH_FUNCTIONS == 'Descriptions') {

        $like_statement_product .= " (pd.products_name LIKE '%" . tep_db_input($product) . "%' OR
                                      pd.products_description LIKE '%" . tep_db_input($product) . "%' OR
                                       p.products_model LIKE '%" . tep_db_input($product) . "%') AND ";
      } else {

        $like_statement_product .= " (pd.products_name LIKE '%" . tep_db_input($product) . "%' OR
                                       p.products_model LIKE '%" . tep_db_input($product) . "%') AND ";
      }

    } else {

      if (MODULE_CONTENT_HEADER_STORE_SEARCH_FUNCTIONS == 'Descriptions') {

        $like_statement_product .= " (pd.products_name LIKE '%" . tep_db_input($product) . "%' OR
                                      pd.products_description LIKE '%" . tep_db_input($product) . "%' OR
                                      pd.products_head_keywords_tag LIKE '%" . tep_db_input($product) . "%') AND ";
      } else {

        $like_statement_product .= " (pd.products_name LIKE '%" . tep_db_input($product) . "%' OR
                                      pd.products_head_keywords_tag LIKE '%" . tep_db_input($product) . "%') AND ";
      }
    }

It's a bit messy, but it does ensure that the Search in the Description function is toggleable .

Malcolm


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

An option to search product from "Description" is unhappy because to many products will be concerned in that case and results will not be relevent.

Sorry to must say it is a very bad idea... 🙄

 


Osc v2.3.4 BS "custom"

Share this post


Link to post
Share on other sites

 

 

 

ff

On 7/21/2019 at 9:56 PM, ArtcoInc said:

@tgely

As @JcMagpie pointed out, this does indeed work in Phoenix under BootStrap v4. The issues I am having seem to have to do with the changes I made when I converted it from a Header module to a NavBar module. I'm still working on those. In the mean time, I do have a question ...

In your module, you have the option to "Enable Extended Store Search Functions", where it can search the product Description. The only two places in your code where I see the product Descriptions referenced are

1) In /ext/content/modules/header/store_search/content_searches.php, where you have this ...


      if ($r > 5) {
        $array[] = array('icon'  => "plus-circle",
                         'title' => MODULE_CONTENT_HEADER_STORE_SEARCH_MORE_PRODUCT,
                         'href'  => tep_href_link('advanced_search_result.php', 'keywords=' . urlencode(str_replace(' ', '+', $query)) . '&search_in_description=' . (MODULE_CONTENT_HEADER_STORE_SEARCH_FUNCTIONS == 'Descriptions' ? 1 : 0), $request_type),
                         'price' =>null);
        break;
      } else {

 

2) And in /includes/modules/content/header/cm_header_store_search.php, where you have this ...


    if (tep_not_null($description) && ($description === true)) {
      $search_link .= tep_draw_hidden_field('search_in_description', '1');
    }

Can you explain how this toggles the search function to include searching the descriptions or not?

The "search_in_description" field is for "classic" search with page of results when you click on "search icon" button.

Is that the information you're looking for ?
 


Osc v2.3.4 BS "custom"

Share this post


Link to post
Share on other sites

@ArtcoInc

If I understand well, probably you are missing GET forms with POST forms. All modul use parameters in href link. tep_draw_hidden_field() not means POST parameters in these cases because hidden field transformed in HTTP header as GET parameters.


If

search_in_description = 1

than this means search results from product_description while 0 not search in products_description.

Store search bar call direct ajax POST method header link with href="" parameters instead use hidden field in a search GET form.


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×