S
S
Sergey Mironov2016-06-26 19:59:09
opencart
Sergey Mironov, 2016-06-26 19:59:09

How to show hidden news after paying for goods in opencart?

Hello!
Threw a problem here. In general, on opencart, you need to implement something like paid subscriptions: we pay for the goods, a section is shown. For example, there is a product and there is a section, such as news, articles that are hidden for ordinary visitors, open only after payment.
The task is to show hidden news after payment.
What logic do I see, can you offer something simpler:
1. Check if the user is registered
2. If registered, check if there is a product in his order that is linked to this news section
3. If so, look at the status of the order. If paid, then we show the news
There are no problems with the first paragraph. You can check like this:
<?php if ($logged) { ?> one <?php } else { ?> another <?php } ?>
Here is the problem with the second point. How to link a section to a product so that after paying for this particular product, only this section opens? There will just be a lot of goods and sections. By section, I mean all the articles in the news block. I hope I explained clearly. I will be glad for any help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Yerusalimsky, 2016-06-26
@werber

I am not familiar with this script, but there is a suspicion that there is a table with users in the script database. I would finish the core so that in the page opening handler there would be a request to a new field, for example, AccessList, where IDs of pages that are available to the user would be dropped in advance. Naturally, this field must be filled in during the order payment core process.
This is a very general formulation, but I think the principle of adding functionality has become clear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question