Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

Добавление пробелов при выводе описания


Recommended Posts

Здравствуйте

подскажите пожалуйста, как можно исправить следующую ситуацию:

 

opencart 1.5.6.1

 

при выводе краткого описания товара

 

<h2 class="title title_size_22" style="box-sizing: border-box; font-weight: normal; padding: 0px; margin: -4px 0px 12px; line-height: 1.4em; font-size: 22px;">Общие характеристики</h2><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Тип управления</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">электромеханическое&nbsp;</span></dd></dl><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Регулировка скорости шитья</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">плавная&nbsp;</span></dd></dl><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Кнопка реверса</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">есть&nbsp;</span></dd></dl></div><div class="product-spec__body" style="box-sizing: border-box; margin-bottom: 30px; color: rgb(43, 43, 43); font-family: Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;"><h2 class="title title_size_22" style="box-sizing: border-box; font-weight: normal; padding: 0px; margin: -4px 0px 12px; line-height: 1.4em; font-size: 22px;">Швейные операции</h2><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Количество швейных операций</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">4&nbsp;</span></dd></dl><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Выполнение петли</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">ручное&nbsp;</span></dd></dl><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Строчки</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">обметочная&nbsp;</span></dd></dl><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Максимальная длина стежка</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">4 мм&nbsp;</span></dd></dl><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Максимальная ширина стежка</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">4 мм&nbsp;</span></dd></dl></div><div class="product-spec__body" style="box-sizing: border-box; margin-bottom: 30px; color: rgb(43, 43, 43); font-family: Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;"><h2 class="title title_size_22" style="box-sizing: border-box; font-weight: normal; padding: 0px; margin: -4px 0px 12px; line-height: 1.4em; font-size: 22px;">Конструкция</h2><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Вышивальный блок</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">нет&nbsp;</span></dd></dl><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Дисплей</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">нет&nbsp;</span></dd></dl><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Рукавная платформа</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">есть&nbsp;</span></dd></dl><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Отсек для аксессуаров</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">есть&nbsp;</span></dd></dl><dl class="product-spec-item" style="box-sizing: border-box; position: relative; margin: 0px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><dt class="product-spec-item__name" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 363.578125px; vertical-align: top; font-size: 15px; line-height: 17px; background: inherit;"><span class="product-spec-item__name-inner" style="box-sizing: border-box; position: relative; padding: 0px 10px 0px 0px; z-index: 2; background: inherit;">Вес</span></dt><dd class="product-spec-item__value" style="box-sizing: border-box; margin: 0px 0px 7px; display: inline-block; width: 378.40625px; vertical-align: bottom; font-size: 15px; line-height: 18px; background: inherit;"><span class="product-spec-item__value-inner" style="box-sizing: border-box; position: relative; display: block; padding: 0px 0px 0px 10px; z-index: 2; background: inherit;">5.7 кг&nbsp;</span></dd></dl></div><div class="product-spec__body" style="box-sizing: border-box; margin-bottom: 30px; color: rgb(43, 43, 43); font-family: Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;"><div class="title title_size_22" style="box-sizing: border-box; line-height: 1.4em; font-size: 22px; margin-top: -4px; margin-bottom: 12px;"><span style="font-size: 15px; line-height: 22px;">П</span><span style="line-height: 22px; color: rgb(153, 153, 153); font-size: 12.8000001907349px;">еред покупкой уточняйте технические характеристики и комплектацию у продавца</span>

 

с помощью функции:

 

<?php echo utf8_substr($product['description'], 0, 300); ?>

 

получаю строку следующего вида:

 

Общие характеристикиТип управленияэлектромеханическое Регулировка скорости шитьяплавная Кнопка реверсаесть Швейные операцииКоличество швейных операций4 Выполнение петлиручное Строчкиобметочная Максимальная длина стежка4 мм Максимальная ширина стежка4 мм КонструкцияВышивальный блокнет Дисплейнет Рука...

 

Как можно добавить пробелы (или другие символы) на месте удаления html тегов чтобы "разлепить".

Может быть на месте каждого удаляемого тега поставить пробел а потом в подстроке почистить лишние пробелы, или есть какая стандартная функция для решения подобной задачи?

 

 

Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз
  • Зараз на сторінці   0 користувачів

    • Ні користувачів, які переглядиють цю сторінку
×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.