Modifier for OpenCart 3. Will not work with other versions!
This add-on adds to the product card a display of the total number of copies of this product sold. On the product page, next to the stock balance, a line appears with the text “Already purchased: X items,” where X is the total number of product units purchased in completed orders (with the status “Completed”).
Main features:
- Shows customers how many times this product has already been purchased.
- Does not affect the standard display of product availability in the warehouse.
- Automatically counts sales only for completed orders (order_status_id = 5).
- Easy integration - does not require manual edits in the template or code.
For whom it is suitable:
- For stores on OpenCart with the Unishop2 theme that want to increase trust in products and increase conversion through social proof.
Installation:
- Install the modifier through the standard OpenCart add-on manager.
- Clear the modification cache and refresh the product page.
How it works:
- In the product card, after the block with availability, the line “Already purchased: X pieces” appears if this product has already been purchased at least once.
- If there were no sales, the block is not displayed.
Tested on template version: 3.3.0.0 ocStore version 3.0.3.7
D
This modifier is distributed as is, the author of the modifier does not provide support or assistance with installation. You can make all changes YOURSELF!
I made this modifier for myself, maybe it will be useful to someone else.
Uploaded:
21.07.2025
Updated:
05.02.2026
Viewed:
1224
Работает на Unishop2 3.5.5.1 и livestore 3.0.4.2
Остается только один вопросик: можно как-то сам текст выделить, например по жирнее и другим цветом. Это куда надо влезть?
Спасибо большое за ваш отзыв!
Если вы хотите изменить внешний вид выводимой информации, то вам нужно зайти в административной части вашего сайта в раздел "Расширения" - "Модификаторы" и найти там модификатор с названием "Количество купленных товаров UniShop2" и нажать кнопку "Редактировать" (иконка зеленого карандаша).
В самом конце кода модификатора найти вот этот кусок кода:
<file path="catalog/view/theme/unishop2/template/product/product.twig"> <operation> <search index="0"><![CDATA[{% if show_attr == 2 and attribute_groups %}]]></search> <add position="before"><![CDATA[ {% if purchased_quantity is defined %} <li class="product-data__item purchased-qty"> <div class="product-data__item-div">{{ text_purchased_quantity_label }}</div> {{ purchased_quantity }} шт. </li> {% endif %} ]]></add> </operation> </file>Чтобы добавить стили внесите изменения в эту строчку:<div class="product-data__item-div">{{ text_purchased_quantity_label }}</div> {{ purchased_quantity }} шт.Можете использовать использовать инлайн-стили, либо вынести в отдельный CSS-класс и вставить ваш код CSS в настройках шаблона UniShop2 в раздел "Свои стили и скрипты".Если нужен более сложный и гибкий функционал - обращайтесь, могу на платной основе сделать доработку под ваш запрос.