Smart Search Joomla One Result - joomla

I just enabled the Smart Search plug-in, and everything were great!
I just wanted to know when the query have ONE result, I'd love Joomla! will direct the user to this page directly.:(
Anyone has this issue and solved it ?

In this file components\com_finder\views\search\view.html.php add the below line inside display function. After this line - $this->assignRef('pagination', $pagination);
if(count($results)==1){
$app->redirect($results[0]->path);
}
This is a core file change so please do if necessary.
let me know if it does not work.

Related

SCA SuiteScript query item to code

I need to add an non-inventory item by internal id to the cart in SCA, how would I go about pulling that item and then adding it? The code samples I find are for pulling data always refer to views, I am thinking I need to pull it as an item, as I need to add it as an item using methods in LiveOrder.Model
thanks for anyhelp you may give
Really depends on which version of SCA you are using.
The quick answer is to look in the ItemDetails.View.js file in the Modules directory and find the code for the addToCart method.
The longer answer is that SCA's architecture and performance leave much to be desired. If you have things like multiple add to or update cart I found that it was easier to write my own cart.ss service and then just forward to the cart or refresh the page on completion.
So I found out that the easiest way to do this is like this, the items are returns in a object array, so thanks for your help
$.get('/api/items?id=10779&fieldset=details', function(obj) {
}).done(function(obj) {
});

CS-Cart Create 2nd Invoice Template

I'm trying to create a second invoice template and add another print invoice link so I can print a standard invoice but also print a 'internal' invoice copy with an 'Official Use' table in which can be filled out by staff on the print out.
I've found the template invoice.tpl and print_invoice.tpl in /basic/mail/orders/
created two new files called invoice.dirty.tpl and print_invoice_dirty.tpl and pasted the content of the original files in the new ones, changed the path and added the table I wanted.
I've managed to locate the code for the 'Print Invoice' link and duplicated that changing the href by adding _dirty to the original 'orders.print_invoice?' but when I try the link it opens the popup ok but I get a 404 error, i've checked the permissions and changed them to full but still it won't play ball...
it seemed quite simple and I expected it to work but obviously i'm missing something, any guidance would be appreciated.
Check controllers that bring data to this files, maybe there is the main problem.
What cs-cart version are you using?
You need to create also the mode > invoice_dirty and this can be added with the help of file order.post.php but before i can give you some instructions i need to know you cs-cart version

How to make wp plugin auto-refreshing on the public side of view (auto load page)

First have to say that almost every time when searching on technical solutions.. search engine will direct me to this site here. I admit that i have learned such A LOT here just by searching through for answers..
but also have to say that not being a coder.. so don't understand much here at all ;)
Ok, the Problem:
Want to update wordpress tables or calendar within wp admin. These changes should become updated on the public side automatically and more or less instantly (~ few seconds is perfectly fine).
I found solutions about manipulating header.php, i found some ajax plugins I found -too much to count- info on how to implement ajax into wp
Sadly.. none of these could help me through as the plugins mostly either not work, are outdated or require countless file edits. Manipulating header.php seems odd.. as i don't want to loop-refresh the whole page, post etc.. but only get e.g. table or calendar data updated.
So maybe any of you coders know of something to e.g. get the plugin "All-in-One Event Calendar by Timely" to update the public visible part of the calendar once data edited in wp admin?
Greatly appreciate pointers in any direction to solve this.
P.S.: What would you think of plugins like "ajaxify everything" ? don't know if this really the way to go..
Again, thanks for your help, time and contribution!!
update
additional question:
I now found such plugin to let me chose which parts i want to "ajaxify".
Such plugin would ask me for a specific function name.
Now, where do i start to gather this information?
Below is the instruction from the plugin context inside wordpress admin
Generate Ajaxized DIV for your function
Ajaxize will allow you to ajaxize almost any php function on your
site.
It can be a plugin, a function you wrote, or even a core wordpress
function.
There are some (obvious or less obvious) limitations currently:
Functions must return valid HTML - this will be called in php and returned via the
Ajax call
Functions cannot accept any parameters (at least at the moment)
Enter a function name below.
Function Name: xxx input field xxx what put in here? xxx
The generated div can be inserted to any page/post on the site and
will ajaxize the call to the function automatically.
Please make sure you enter a valid function name, that the function
does not require any parameters, and that it returns valid HTML.
In your context you want to refresh the calendar automaticaly when there is a change in the WP_Admin;
but you can't exactly do this.
You can write a Js method which will check the time of lastest modification of the calendar at the load of the page, stock it in Var.
After you'll have a constant (each 10seconds) Js "daemon" which will get the time of lastest modification of the calendar and compare it to the stocked Var; If change you reload the calendar.
PS: Ajaxify everything is not really a solution due of the developpement you need To Ajaxify and to code for people who has disabled Javascript.
Hope it helps

Drupal 7 caching my form and printing old cached fields (Varnish/Memcache)

I have a profile2 form called by drupal_get_form - though after its been edited and saved, the fields still display the old information for awhile. How can I turn caching off here? I'm using memcache/varnish/apc btw.
I'm also printing these fields elsewhere and get the same problem.. I would rather this be dynamic and fresh for just these fields/forms.. any ideas on how to do that? Thanks!
Probably you need to exclude cache_form from memcache with:
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
in your settings.php file

Sorting a view by dropdown

Hey, i've been looking around for a ajax dropdown sorter for my Views in Drupal.
Unfortunatly, i haven't found alot of usefull information about this subject.
Can anyone tell me if theres a solution already available or can help me started on a custom module by telling me which hooks i should use?
I had a similar issue. Unfortunately I wasn't able to sort the data from the database which is by far the best way. I was however able to take the data and sort it with PHP using a preprocessor function. Depending on the name of your view, setup a function similar to the following:
function templatename_preprocess_name_of__view(&$vars)
{
//Super sweet sorting code goes here
}
The name of your view needs to follow the name of the template file that it is driven by, if there isn't on you should create one. Make sure to change dashes to underscores in your function name. Hope this is helpful. If you find a way to do it from the DB I'm all ears because that would be super awesome.

Resources