This is how the product description is defined:
And this is how it renders:
Any ideas why this happens? Also, the 2 periods at the end are not part of the description either. Where are those coming from?
Do this if you must have them
Code: Select all
4" x 4"
Or not
I have tried a few methods without success either I will find a way or someone will come along and tell you and laugh at me :-)
Attachments
Clipboard07.jpg (3.65 KiB) Viewed 1974 times
mikeinterserv wrote: ↑Thu Feb 04, 2021 10:30 pmWell its the quote marks
Do this if you must have themEnter the quotes directly in edit mode not code view then it should workCode: Select all
4" x 4"
Code: Select all
'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',
In Extensions - Themes : Your theme the product description length can be set.
The periods at the end are the continuation marks for short text.CJC wrote: ↑Thu Feb 04, 2021 10:49 pmNope, not the quote marks at all. I can remove them completely and it renders the same way. Also, doesn't explain the extra periods at the end.mikeinterserv wrote: ↑Thu Feb 04, 2021 10:30 pmWell its the quote marks
Do this if you must have themEnter the quotes directly in edit mode not code view then it should workCode: Select all
4" x 4"
The post above shows you where they are in the code if you want to remove them
There is not much of a workaround without editing some code by the look of it and yes it creates just a flow of text to the character limit stripping anything in its path :-)
If you are happy to edit the code you can do this
BACKUP the ORIGINAL FILE FIRST
catalog/controller/extension/module/featured.php
If you have extension/mod that uses featured the page will be in system/storage/modification/yourmod
Find
Code: Select all
'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',
Code: Select all
'description' => utf8_substr(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length'),
This will also eliminate the periods
pprmkr made a good post also and to remind you you can also edit the length of the short description in the theme settings.
If you have an installed extension that may use the featured page for example, an out of stock ribbon and add cart disable the mod will place the modified files in a directory structure in system/storage/modification/yourmodification/catalog/controller/extension/featured.php
or it may just be
system/storage/modification/catalog/controller/extension/featured.php
it will be obvious to you when you find it
This is how OC uses mods without affecting core files. If you need to edit featured of a mod then the system path you need to test.
If no mods then the standard path to the original file is what you need. If you edit the original and LATER add MOD you can get a bit confused as to whats going on. Hope that helps
Just to note: This is not something to do unless you really need to, but if you really need to this is the solution to do it. Just make sure you backup your original file and you can reverse it in an instant if you get something wrong. It will do no other harm in any way to anything else.
These edits are say - on this file change the word “yes” to “no”
This edit then becomes the “new” file
this file is stored in your modification folder (where that is is where you put it and further explanation may require your OC version)
What this means is that everytime you press the refresh button in the modifications page - it re-creates these files - and these are the ones that show on your front-end
However - if you change the modifed file it will only edit your front-end for as long as your modifications are not refreshed
So the bottom line is you do not need to touch this file - you need the actual file
- this file will only be of use if the code you are changing has already been changed - so it in effect is running before you walk
usually resulting in falling over -
so ignore all of that and just try the edit on the correct file as suggested
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Thank You.
mikeinterserv wrote: ↑Fri Feb 05, 2021 4:16 amYes certainly
If you have an installed extension that may use the featured page for example, an out of stock ribbon and add cart disable the mod will place the modified files in a directory structure in system/storage/modification/yourmodification/catalog/controller/extension/featured.php
or it may just be
system/storage/modification/catalog/controller/extension/featured.php
it will be obvious to you when you find it
This is how OC uses mods without affecting core files. If you need to edit featured of a mod then the system path you need.
If no mods then the standard path to the original file is what you need. If you edit the original and LATER add MOD you can get a bit confused as to whats going on. Hope that helps
Just to note: This is not something to do unless you really need to, but if you really need to this is the solution to do it. Just make sure you backup your original file and you can reverse it in an instant if you get something wrong. It will do no other harm in any way to anything else.
by mona wrote: ↑Fri Feb 05, 2021 4:23 amWhen you install and extension it makes edits (not always but in this explanation).
These edits are say - on this file change the word “yes” to “no”
This edit then becomes the “new” file
this file is stored in your modification folder (where that is is where you put it and further explanation may require your OC version)
What this means is that everytime you press the refresh button in the modifications page - it re-creates these files - and these are the ones that show on your front-end
However - if you change the modifed file it will only edit your front-end for as long as your modifications are not refreshed
So the bottom line is you do not need to touch this file - you need the actual file
- this file will only be of use if the code you are changing has already been changed - so it in effect is running before you walk
usually resulting in falling over -
so ignore all of that and just try the edit on the correct file as suggested
Please state your OC version
Post the OCMOD
Post the OCMOD log TAB
Then we can help you with that.
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Which is exactly how you test it first without damage - one quick refresh and your back to where you were
Then you can modify the file you need
developers sometimes test that way yes - the user is not a developer - simple problems - simple solutions - not baffle with science - it just causes confusion -
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Well Mona finally we agree on somethingmikeinterserv wrote: ↑Fri Feb 05, 2021 4:16 amJust to note: This is not something to do unless you really need to, but if you really need to this is the solution to do it. Just make sure you backup your original file and you can reverse it in an instant if you get something wrong. It will do no other harm in any way to anything else.
The issue is that the featured module removes html tagging - which is things like <p> and <br/>
This is done in this file
catalog/controller/extension/module/featured.php
on this line
Code: Select all
'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',
Code: Select all
'description' => utf8_substr(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length'),
and the two dots at the end is because the length of the description is set in admin
Code: Select all
'theme_' . $this->config->get('config_theme') . '_product_description_length'
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Take note this approach has been modified on the master branch for future reference, however. Prefixes with, either, the default theme and custom themes are no longer used this way.by mona wrote: ↑Fri Feb 05, 2021 6:03 amSo just to clarify this post to make it of use both to the user (apologies) and the forum users generally
The issue is that the featured module removes html tagging - which is things like <p> and <br/>
This is done in this file
catalog/controller/extension/module/featured.php
on this lineand if it is changed toCode: Select all
'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',
you will notice that instead of the code strip_tags it changes to the code html_entity_decodeCode: Select all
'description' => utf8_substr(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length'),
and the two dots at the end is because the length of the description is set in adminPlease mark this topic as solved by adding [SOLVED] to the title if it helps - so any other users in the future may be able to benefitCode: Select all
'theme_' . $this->config->get('config_theme') . '_product_description_length'
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Featured Module Fix</name>
<code>Featured module</code>
<version>1.4</version>
<author>C2 It</author>
<link>http://www.c2-it.com</link>
<file path="catalog/controller/extension/module/featured.php">
<operation>
<search><![CDATA['description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',]]></search>
<add position="replace"><![CDATA['description' => utf8_substr(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length'),]]></add>
</operation>
</file>
</modification>
by mona wrote: ↑Fri Feb 05, 2021 6:03 amSo just to clarify this post to make it of use both to the user (apologies) and the forum users generally
The issue is that the featured module removes html tagging - which is things like <p> and <br/>
This is done in this file
catalog/controller/extension/module/featured.php
on this lineand if it is changed toCode: Select all
'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',
you will notice that instead of the code strip_tags it changes to the code html_entity_decodeCode: Select all
'description' => utf8_substr(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length'),
and the two dots at the end is because the length of the description is set in adminPlease mark this topic as solved by adding [SOLVED] to the title if it helps - so any other users in the future may be able to benefitCode: Select all
'theme_' . $this->config->get('config_theme') . '_product_description_length'
Users browsing this forum: Semrush [Bot] and 511 guests