=== First Order Coupon ===
Contributors: e93didban
Tags: woocommerce, coupon, first order, discount, user restriction, logged-in
Requires at least: 5.0
Tested up to: 6.8
Requires PHP: 7.2
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create discount coupons for first-time logged-in buyers in WooCommerce. Restricts coupon usage to only the user's first order and requires login.

== Description ==

This plugin adds a checkbox to WooCommerce coupon settings that restricts coupon usage only to logged-in users on their first order.

**Key Features:**
- Seamless integration with WooCommerce coupons
- Restricts usage to logged-in users only (account required)
- Checks previous orders based on user ID and order status (processing or completed)
- Lightweight and fast
- Multi-language support (English and Persian)
- Fully compatible with WooCommerce 8.9 and above

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate the plugin via the “Plugins” menu in WordPress.
3. Create a new coupon and enable the “First order only” checkbox under “Usage restriction.”

== Frequently Asked Questions ==

= Does the user need to be logged in to use this coupon? =
Yes, this coupon is only valid for logged-in users on their first order. Guests cannot use this coupon.

= How does the plugin detect the first order? =
By checking previous orders of the logged-in user based on user ID and order status "processing" or "completed."


Only completed or processing orders are counted when determining if the user has placed a previous order.

== Screenshots ==

1. Checkbox option in WooCommerce coupon settings
2. Error message displayed when coupon conditions are not met (e.g., user not logged in or not first order)

== Changelog ==

= 1.1.1 =
* Removed load_plugin_textdomain call for WordPress 4.6+ compatibility
* Removed asset files from plugin ZIP to comply with repository guidelines

= 1.1 =
* Added multi-language support
* Clarified login requirement for coupon usage

= 1.0 =
* Initial release

== Upgrade Notice ==

= 1.1 =
Added internationalization and clarified that login is required to use the coupon. Update recommended.

= 1.1.1 =
Removed outdated translation loader and plugin asset files for better repository compliance.

<!--:fa-->
=== افزونه کوپن خرید اول ووکامرس ===
توسعه‌دهنده: e93didban
برچسب‌ها: ووکامرس، کوپن، خرید اول، تخفیف، محدودیت کاربر، ورود به سیستم
نیاز به وردپرس نسخه: ۵.۰ به بالا
تست شده تا: ۶.۸.۱
نیاز به PHP نسخه: ۷.۲ به بالا
نسخه پایدار: ۱.۱
مجوز: GPLv2 یا بالاتر
آدرس مجوز: https://www.gnu.org/licenses/gpl-2.0.html

ساخت کوپن تخفیف فقط برای خریداران وارد شده که برای اولین بار خرید می‌کنند. محدود کردن استفاده از کوپن فقط به اولین سفارش کاربر و نیاز به ورود به حساب کاربری.

== معرفی افزونه ==

این افزونه گزینه‌ای جدید به بخش تنظیمات کوپن‌های ووکامرس اضافه می‌کند تا استفاده از کوپن فقط برای کاربران وارد شده و اولین سفارش آنها معتبر باشد.

**ویژگی‌های کلیدی:**
- یکپارچه‌سازی کامل با سیستم کوپن ووکامرس
- محدود کردن استفاده کوپن به کاربران وارد شده (نیاز به حساب کاربری)
- بررسی سفارش‌های قبلی بر اساس شناسه کاربری و وضعیت سفارش «در حال پردازش» یا «تکمیل شده»
- سبک و سریع
- پشتیبانی از زبان فارسی و انگلیسی
- کاملاً سازگار با ووکامرس نسخه ۸.۹ و بالاتر

== نصب افزونه ==

۱. پوشه افزونه را در مسیر `/wp-content/plugins/` آپلود کنید.  
۲. از منوی «افزونه‌ها» در وردپرس، افزونه را فعال کنید.  
۳. کوپن جدید بسازید و گزینه «فقط برای اولین سفارش» را در بخش «محدودیت استفاده» فعال کنید.  

== سوالات متداول ==

= آیا کاربر باید وارد سایت شود تا بتواند از این کوپن استفاده کند؟ =  
بله، این کوپن فقط برای کاربران وارد شده معتبر است و کاربران مهمان نمی‌توانند از آن استفاده کنند.

= افزونه چطور متوجه می‌شود که کاربر اولین بار خرید می‌کند؟ =  
با بررسی سفارش‌های قبلی کاربر بر اساس شناسه کاربری و وضعیت سفارش «در حال پردازش» یا «تکمیل شده».

فقط سفارش‌هایی با وضعیت «تکمیل شده» یا «در حال پردازش» برای تشخیص اولین خرید کاربر در نظر گرفته می‌شوند.

== تصاویر افزونه ==

1. گزینه جدید در تنظیمات کوپن ووکامرس  
2. پیام خطا هنگام عدم احراز شرایط کوپن (مثلاً کاربر وارد نشده یا اولین سفارش نیست)

== تاریخچه تغییرات ==

= ۱.۱.۱ =
* حذف تابع load_plugin_textdomain برای سازگاری بهتر با وردپرس نسخه ۴.۶ به بالا  
* حذف پوشه assets از فایل زیپ افزونه مطابق با استانداردهای مخزن وردپرس  

= 1.1 =  
* اضافه شدن پشتیبانی چندزبانه  
* توضیح بیشتر در مورد نیاز به ورود کاربر برای استفاده از کوپن  

= 1.0 =  
* انتشار اولیه  

== نکات به‌روزرسانی ==

= 1.1 =  
اضافه شدن پشتیبانی چندزبانه و توضیح نیاز ورود به سیستم برای استفاده از کوپن. به‌روزرسانی توصیه می‌شود.

= ۱.۱.۱ =
بهبود ساختار افزونه برای سازگاری با استانداردهای مخزن وردپرس. تابع ترجمه قدیمی و فایل‌های تصویری حذف شده‌اند.

<!--:-->