ilyarolf / AiogramShopBot

Aiogram Telegram bot shop with ways to deposit in USDT,LTC,BTC
MIT License
25 stars 8 forks source link

Restock #42

Open kiljorn1109 opened 1 week ago

kiljorn1109 commented 1 week ago

any way to specify the item quantity for restock? i didn t find it in the code and it just replenishes everything by 1.

ilyarolf commented 1 week ago

@kiljorn1109 Hi, what you mean? If you want to add multiple items in the same category and subcategory it would look like this, each entry in items = 1 item. In this example, you will have 2 products of the same category and the same subcategory.

{
    "items": [
        {
            "category": "Category#1",
            "subcategory": "Subcategory#1",
            "price": 50,
            "description": "Mocked description",
            "private_data": "Mocked private data"
        },
        {
            "category": "Category#1",
            "subcategory": "Subcategory#1",
            "price": 50,
            "description": "Mocked description",
            "private_data": "Mocked private data"
        }
    ]
}
kiljorn1109 commented 1 week ago

Well the stock keeping of it, after i enter the categories and subs for it i don t have an option for quantity or somethjng else but i have in the /admin the restock announcement option

ilyarolf commented 1 week ago

@kiljorn1109 To be honest, I don't understand what you want. Can you please explain what you expect to get from the bot, and what you actually get. Also describe what you do to get it.

kiljorn1109 commented 1 week ago

@ilyarolf So the git i cloned, i have the bot the contact cards the products, everything but in the products.json let s say i don t have the quantity of the specified product, but when i enter from a buyer account i see that i have a quantity, is there any way i could set that ?

Screenshot 2024-06-27 at 19 24 21
ilyarolf commented 1 week ago

If you want to set the quantity of items manually, there is no such functionality. The quantity of items means all items that have the "is_sold == False" field. If you plan to sell items that you have in infinite quantity, it will be easier to generate 999+ such records, and add "contact admin" or something like that to the "private_data" field.

{
    "items": [
        {
            "category": "Category#1",
            "subcategory": "Subcategory#1",
            "price": 50,
            "description": "Mocked description",
            "private_data": "Contact Admin"
        },
        {
            "category": "Category#1",
            "subcategory": "Subcategory#1",
            "price": 50,
            "description": "Mocked description",
            "private_data": "Contact Admin"
        }
        ........... 999+ records
        ,
        {
            "category": "Category#1",
            "subcategory": "Subcategory#1",
            "price": 50,
            "description": "Mocked description",
            "private_data": "Contact Admin"
        }
    ]
}
ilyarolf commented 3 days ago

@kiljorn1109 Is your issue still relevant?