Skip to main content

product button code in search result

More
12 years 1 week ago #172504 by gulp
-- HikaShop version -- : 2.3.2

Hello,
the search results shows the hikashop product code ( 2|link|picture|menuid:419 ) in the description of articles listed.
This is unpleasant to see for users, is there a way to hide it or make the plugin be parsed before the data is being shown ?

Please Log in or Create an account to join the conversation.

More
12 years 1 week ago #172506 by Jerome
Hi,

The best will be to edit the plugin "search | hikashop_products" in order to parse the "$row->text" fields before the return.
I will recommend you to duplicate the plugin otherwise, you will loose your modification with updates ; by creating a new (custom) search plugin, you will be sure that the updates won't modify yours.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

More
12 years 1 week ago #172619 by gulp
Well, I can try to override the plugin (how?), but don't you think this is a kind of issue for the plugin ?
All the users that exploit the insert-product-button will have this kind of problem ...

Thank you for the suggestion !

Please Log in or Create an account to join the conversation.

More
12 years 1 week ago #172631 by Xavier
Hi,

Are you sure that this code is not present in your product description ?
By default the plugin return only the product description for the description part of the result.

If it's a variant, thanks to check the product description of this variant.

Else to parse the content, you have to duplicate the plugin, rename it (folder name, file names, file content), and in the function "onSearch()" parse the content after "$row->text=$row->product_description;".

You have to edit the content of "$row->text".

Please Log in or Create an account to join the conversation.

More
12 years 1 week ago #172817 by gulp
The element that contains the insert-product-button code isn't a product, but it's a joomla article that by the insert-product-button code recalls a product, then because this code is present in the description of the article is normal that the search results reports this string as a element description. I think this could be hided or parsed in some manner to avoid people see the coding instead of plain text

Please Log in or Create an account to join the conversation.

More
12 years 1 week ago #172841 by nicolas
Hi,

The product code plugin of HikaShop parses the whole page and can replace product tags anywhere, even in the search results.
So the problem is actually that something else is stripping out the opening and closing tags without removing the content inside in your search results and thus you see the text.
You can try to trick it like this:
Code:
That way, it should not be a problem for HikaShop to parse the tags and if something else strips the opening and closing tags, the rest will be in a HTML comment and thus not visible.

Please Log in or Create an account to join the conversation.

More
12 years 1 week ago - 12 years 1 week ago #173025 by gulp
Are you planning to update the plugin with this change ?
Meanwhile could you suggest me where is the code to update ?
Last edit: 12 years 1 week ago by gulp.

Please Log in or Create an account to join the conversation.

More
12 years 1 week ago #173030 by Xavier
Hi,

There is nothing to edit in the plugins, you just have to edit the Joomla article where this tag has been added.
It's a tag added by HikaShop when you click on the button to display a product in an article.

Please Log in or Create an account to join the conversation.

More
12 years 1 week ago #173233 by gulp
Sure, I know, but I can't think to a simple user that correct the insert-product-button code adding braces inside.
Then I need to override your plugin to always avoid this issue for this site.
I suggest you to a little improve this plugin by:
- adding this braces, if you think it's a good solution for everybody
- make the menu-id selectable with an html-select to let the user quick decide the destination item-id

Could you please suggest where to update the code to add braces ?

Thank you

Please Log in or Create an account to join the conversation.

More
12 years 1 week ago #173243 by Xavier
Hi,

You have to edit the plugin in "plugins/editors-xtd/hikashopproduct" file "hikashopproduct.php, function "productDisplay()", replace:
Code:
document.getElementById('product_insert').value = "{"+"product"+"}";
By:
Code:
document.getElementById('product_insert').value = "{"+"product"+"}<!--";
And:
Code:
document.getElementById('product_insert').value=document.getElementById('product_insert').value + "{/"+"product"+"}";
By:
Code:
document.getElementById('product_insert').value=document.getElementById('product_insert').value + "-->{/"+"product"+"}";

Please Log in or Create an account to join the conversation.

More
12 years 5 days ago #173593 by gulp
It works ! Thanxxx !!
Patch recommended !!

Please Log in or Create an account to join the conversation.

More
12 years 5 days ago - 12 years 5 days ago #173596 by gulp
No, sorry, it doesn't works fine, because (obviously) the code generated is being commented also on the module that loads the article, then the product code with image and product name doesn't show up !!!! :-(
Last edit: 12 years 5 days ago by gulp.

Please Log in or Create an account to join the conversation.

More
12 years 4 days ago #173784 by Jerome
Hi,

I'm afraid that I the patch proposed and the solution explained by Nicolas are not the same.

I was talking about modification in the search plugin...
So please, edit the search plugin and do what I was telling in my first message, I really don't know why they came on such different solution...
I know that my solution will work and won't impact the rest of the website.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

More
12 years 3 days ago #173898 by gulp
Hi Jerome,
don't you worry about this, the site is still in development then there is no hurry at present, but I would like to solve this issue.
I can't find your suggestion on how to solve it on the search plugin, could you please link it or re-post it here ?

Thank you

Please Log in or Create an account to join the conversation.

More
12 years 3 days ago - 12 years 2 days ago #173988 by Jerome
Hi,

The best will be to edit the plugin "search | hikashop_products" in order to parse the "$row->text" fields before the return.
I will recommend you to duplicate the plugin otherwise, you will loose your modification with updates ; by creating a new (custom) search plugin, you will be sure that the updates won't modify yours.

Like I said in my first message, you have to edit the "search/hikashop_products" plugins ( plugins/search/hikashop_products/hikashop_products.php).
In this file, the plugin prepare the content for the Joomla search component, it returns the product description in the "$row->text" variable.

The idea is to replace the content in this variable in order to remove the tags you don't want to display.
Like
Code:
$row->text = preg_replace('#\{product\}.*\{\/product\}#Ui', '', $row->text);

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Last edit: 12 years 2 days ago by Jerome.

Please Log in or Create an account to join the conversation.

More
12 years 3 days ago #174025 by gulp
Hi, I'm sorry but probably I didn't explained well this issue:
your patch hides the product description on the products records that comes as results of the search,
but the problem isn't on the product records, but in articles records that contains the code.

When the search lists one of these articles it doesn't parses (or hide) the plugin, but let the user view the raw ugly code.
I've attached a screenshot of the typical result when the search find both the product and also an article that contains the product code.

Please Log in or Create an account to join the conversation.

More
12 years 2 days ago #174119 by Jerome
Hi,

Oh... Right, I see.

Ok then, you can use the trick that Nicolas gave you in your articles, so you will add an "<!--" and " -->" to hide the content in most cases.
Then, in order to let the product insert plugin works, the best is to add the support for the tags too.

So edit the file "plugins/system/hikashopproductinsert/hikashopproductinsert.php" and replace
Code:
if (preg_match_all('#\{product\}(.*)\{\/product\}#Uis', $body, $matches)) {
By
Code:
if (preg_match_all('#\{product\}(.*)\{\/product\}#Uis', $body, $matches)) { if(!empty($matches[1])) $matches[1] = trim(str_replace(array('<!--','-->'),'',$matches[1]));
It will remove the tags while parsing the data and should display the content correctly afterwards.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #174451 by gulp
Hello,
I'm sorry to inform you that this code breaks the pages where the articles that contains the product code are loaded,
no errors to report except

(104) Connection reset by peer

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #174548 by Mohamed Thelji
Hello,
The problem is coming from one of your plugin System/search plugin which is hiding the "" tags, can you unpublish them one by one and tell me if you find the one which is hiding the product tag ?
Thanks.

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #174588 by gulp
I didn't change anything except for you patch, why should a plugin now try to hide the {product} tag ?
Which kind of plugin ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.480 seconds
Powered by Kunena Forum