Π—Π²Π΅Ρ€Π½Ρ–Ρ‚ΡŒ ΡƒΠ²Π°Π³Ρƒ >> Π‘Ρ‚Π²ΠΎΡ€ΡŽΡ”ΠΌΠΎ якісні Ρ‚Π° сучасні сайти. Π”ΠΎΠΎΠΏΡ€Π°Ρ†ΡŒΠΎΠ²ΡƒΡ”ΠΌΠΎ Π²ΠΆΠ΅ Π³ΠΎΡ‚ΠΎΠ²Ρ– ΠΏΡ€ΠΎΠ΅ΠΊΡ‚ΠΈ сайтів. ΠœΠ°Ρ”ΠΌΠΎ Π²Π΅Π»ΠΈΠΊΠΈΠΉ досвід Ρ€ΠΎΠ±ΠΎΡ‚ΠΈ Π² Π²Π΅Π± ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΡƒΠ²Π°Π½Π½Ρ–. ΠšΡ€Π°Ρ‰Ρ– ΡƒΠΌΠΎΠ²ΠΈ Ρ‚Π° Ρ†Ρ–Π½ΠΈ Π½Π° Π½Π°ΡˆΡ– послуги. ЗвСртайтСся ☎ (097) 162-68-00    ☎ (063) 162-68-00
Date of receipt in the product card opencart
How to add the date of publication of the product in opencart
πŸ’Ό Creation of modern websites of any complexity. | πŸ‘Œ WEB-UKRAINE.COM

Date of receipt in the product card opencart

πŸ“† The ability to display the date in the product of the online storeπŸ’₯ opencart.

5/53 ratings

Greetings to friends, today I want to publish a short note from some usefulness for the online store opencart, namely in this article I will show how you can display the date of publication of the goods in the card, as well as in the list of goods of the category.

All of you already know that when you publish a product in the form of adding the product to the admin panel, there is a field in which you can specify when this product appeared on the site, and so we will display this field in the store template.

Of course, I rarely use it when develop an online store this opportunity, so I think that the buyer before the light bulb when you added this product, but some customers are asking to do this, so we'll consider the option of displaying the date in the card and product category, perhaps someone else will need this note.

And so proceed first to the card of the goods.

In order to add the date of receipt to the card we need, edit only three files, namely:

First we will make changes to theΒ catalog/controller/product/product.php, file, edit:

We are looking for a line:

After that we add the following:

That is, we added a language variable.

Further in the same file we are looking for:

And then we add:

The next step is to add the text itself to theΒ catalog/language/russian/product/product.php file, where before:

Adding:

The same is done with all the languages that you use on your website.

Well, the last point is the output of the publication date in the product template itself in theΒ catalog/view/theme/*/template/product/product.tpl file:

We find something like this:

And lower or higher, add this:

PS: The date is displayed completely, together from the exact time, if you need to remove the output of time and leave only the date of receipt, then instead of:

Add the following code:

That's all, now next to the field of the model will be the date of receipt of the goods.

As I promised at the beginning of the article, we will also consider the possibility of outputting the date in the list of goods of the category, and so proceed:

As with the addition of the date in the product card, in the category we will only make changes to the three files, and our actions will be almost identical, except for a few moments.

We will make changes to the files:

We will make the first changes to theΒ catalog/controller/product/category.php.

We are looking for a line:

After that we add the following code:

Further in the same file we are looking for:

And then add the following:

Then open the language file catalog/language/russian/product/category.php

And after:

Adding:

Well, the last edit the template file category catalog/view/theme/*/template/product/category.tpl :

It's a bit more complicated here, since the list of products as usual has two kinds of display, grid and list, for this we need to do for one and for another option:

And so, to display the date of receipt of goods in the category we will be under the name of the goods:

We find:

And then we add:

Further we are looking for:

After we add:

After we search:

And add it again below:

That's actually all that needed to be done to ensure that the list of goods under the name added the date of receipt. Use it, I hope I spent my time writing this article knowingly and to whom it will be useful. Good luck to you.

You may also like

No Comment

You can post first response comment.

Leave a Reply

Π’ΠΈΠ±Π΅Ρ€Ρ–Ρ‚ΡŒ спосіб спілкування
Звязатися Π· Π½Π°ΠΌΠΈ!
Ми Π³ΠΎΡ‚ΠΎΠ²Ρ– Π΄ΠΎ Π΄Ρ–Π°Π»ΠΎΠ³Ρƒ.