Вывод количества покупок товара

  • Posts: 13
  • Thank you received: 0
1 year 2 months ago #356020

Здравствуйте!
Ищу плагин, который выводит количество покупок данного товара в карточке товара. В стандартных инструментах такого не нашел. Может быть кто-то встречал в сторонних плагинах?
Спасибо!

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
1 year 2 months ago #356025

Hi,

If I understand correctly, you want to display the number of sales on the product details page on the frontend, is that correct ?
You can do so by editing the file product / show_default.php (which is the layout for the product details page on the frontend) via the menu Display>Views and add such code there:

<?php echo $this->element->product_sales; ?>

The following user(s) said Thank You: DenisM

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

  • Posts: 13
  • Thank you received: 0
1 year 2 months ago #356032

Да, Вы всё правильно поняли.
Спасибо получилось на Joomla 4.
С сайтом на Joomla 3 пока не получилось.
Если не сложно подскажите, пожалуйста, как дать название этой строчке. (Я пока что не очень понимаю PHP)

Yes, you understood everything correctly.
Thanks, it worked on Joomla 4.
It hasn't worked out yet with a Joomla 3 site.
If it’s not difficult, please tell me how to name this line. (I don't really understand PHP yet)

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
1 year 2 months ago #356033

Hi,

The same modification will work on Joomla 3, Joomla 4 and Joomla 5.
If it doesn't work then either:
- you placed the code in a place which is not displayed by HikaShop and thus it's not displayed on the frontend. Moving the code elsewhere in the view file would be the solution.
- you placed the code in an invalid place of the code, which led to an error displayed on the frontend. Moving the code elsewhere in the view file would be the solution.
- you made the view override for a template which you're not using on your frontend. Making the change for the correct template would be the solution.
- you got an error when saving the modification due to a firewall on your website or a security extension / module. The simplest would be to make the override manually via FTP: www.joomlart.com/tutorials/joomla-4-tuto...omponents-and-layout

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

  • Posts: 13
  • Thank you received: 0
1 year 2 months ago #356057

Спасибо за помощь!

Thanks for the help!

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

Time to create page: 0.060 seconds
Powered by Kunena Forum