Answer the question
In order to leave comments, you need to log in
How to organize a system for selling articles?
I am creating a site for the sale of articles, there is an article section, there are paid articles themselves, you need to make sure that there is a short description first and to read the article in full you need to pay money, so I’m sitting here I don’t know how to implement it all, I write in Yii2.
p.s. Thanks in advance!
Answer the question
In order to leave comments, you need to log in
So add a "short_description" field to the article table and output text from it. What's the problem then? And what about Yii2?
1/ the subscription model is more convenient for buyers
2/ look at https://republic.ru/ and analogues
3/ just like "articles" from nowhere, etc. no one will buy
Take it in vain. The toaster is a place where they suggest thoughts and answer questions to move on.
And on the question - as you were advised.
There is a short description and there is the text of the article.
And then, depending on what functionality you want, for example:
a) if the user is logged in, then he must have his own balance and money must be withdrawn from him for the buy button.
In this option, you can do the same subscriptions. A person replenishes the account, and you manipulate him.
b) if a person does not have an account, then generate a link for him after payment, accessible, say, 5 times, then kill.
Either send it to email, or immediately after payment by the payment service.
You can crop text. Implement the method in the model, for example:
public function getShortText($size=20){
return yii\helpers\StringHelper::truncateHtml($this->text,$size);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question