Skip to content

shahkochaki/wordpress-plugin-fastbuy-commerce

Repository files navigation

FastBuy Commerce - خرید سریع ووکامرس

افزونه حرفه‌ای برای ایجاد صفحه خرید سریع در فروشگاه‌های ووکامرس که امکان دسترسی آسان و سریع به محصولات را فراهم می‌کند.

ویژگی‌های کلیدی

🚀 عملکرد

  • صفحه خرید سریع: نمایش تمامی محصولات در قالب لیست منظم
  • دسته‌بندی هوشمند: نمایش محصولات بر اساس دسته‌بندی با امکان جمع و باز کردن
  • افزودن سریع به سبد: افزودن محصولات به سبد خرید بدون رفرش صفحه
  • نمایش متغیرها: پشتیبانی کامل از محصولات متغیر و ویژگی‌های آن‌ها

� چندزبانه

  • پشتیبانی چندزبانه: پشتیبانی کامل از زبان‌های فارسی و انگلیسی
  • مدیریت زبان: سیستم پیشرفته برای مدیریت زبان‌های مختلف
  • تغییر زبان: امکان تغییر زبان برای کاربران
  • پشتیبانی RTL: پشتیبانی کامل از زبان‌های راست به چپ
  • ترجمه‌های قابل ویرایش: امکان ویرایش و اضافه کردن ترجمه‌های جدید

�🎨 ظاهر و طراحی

  • طراحی ریسپانسیو: سازگار با تمامی دستگاه‌ها و اندازه صفحه‌ها
  • رنگ‌بندی قابل تنظیم: امکان تنظیم رنگ دسته‌بندی‌ها از پنل مدیریت
  • انیمیشن‌های نرم: تجربه کاربری بهتر با انیمیشن‌های طراحی شده
  • تم‌پذیری: قابلیت سفارشی‌سازی توسط طراحان
  • پشتیبانی RTL: طراحی اختصاصی برای زبان‌های راست به چپ

🛠️ مدیریت

  • پنل مدیریت کامل: کنترل تمامی تنظیمات از پنل ادمین وردپرس
  • سیستم لایسنس: محافظت از افزونه با سیستم لایسنس پیشرفته
  • پشتیبانی از shortcode: امکان قرار دادن در هر صفحه یا پست
  • تنظیمات انعطاف‌پذیر: کنترل نمایش محصولات ناموجود، تعداد محصولات و...
  • مدیریت زبان‌ها: تب اختصاصی برای مدیریت زبان‌ها و ترجمه‌ها

نصب و راه‌اندازی

پیش‌نیازها

  • WordPress 5.0 یا بالاتر
  • WooCommerce 4.0 یا بالاتر
  • PHP 7.4 یا بالاتر

مراحل نصب

  1. فایل ZIP افزونه را در بخش افزونه‌های وردپرس آپلود کنید
  2. افزونه را فعال کنید
  3. از منوی FastBuy Commerce در پنل ادمین تنظیمات را انجام دهید
  4. لایسنس خود را فعال کنید
  5. محصولات را در دسته خریدسریع قرار دهید

استفاده

Shortcode

برای نمایش صفحه خرید سریع از shortcode زیر استفاده کنید:

[fastbuy_commerce]

پارامترهای shortcode

[fastbuy_commerce title="خرید سریع" show_title="yes" category="fastbuy-commerce"]
  • title: عنوان صفحه (پیش‌فرض: "خرید سریع")
  • show_title: نمایش عنوان (yes/no)
  • category: اسلاگ دسته‌بندی مورد نظر

تنظیمات موجود

تنظیمات عمومی

  • دسته‌بندی‌های فعال: نمایش/عدم نمایش دسته‌بندی‌ها در بالای صفحه
  • سبد خرید: نمایش/عدم نمایش دکمه مشاهده سبد خرید
  • محصولات ناموجود: نمایش/عدم نمایش محصولات ناموجود

تنظیمات نمایش

  • حالت دسته‌بندی‌ها: باز یا جمع شده بودن زیرمجموعه‌ها
  • حالت محصولات: باز یا جمع شده بودن لیست محصولات
  • تعداد محصولات: حداکثر تعداد محصولات نمایش داده شده

تنظیمات ظاهری

  • رنگ دسته‌بندی اصلی: رنگ پس‌زمینه دسته‌بندی‌های اصلی
  • رنگ زیردسته: رنگ پس‌زمینه زیردسته‌ها

مدیریت زبان‌ها

افزونه از تب مدیریت زبان‌ها برای مدیریت کامل زبان‌ها استفاده می‌کند:

ویژگی‌های مدیریت زبان

  • زبان‌های پیش‌فرض: پشتیبانی از فارسی و انگلیسی
  • آپلود زبان جدید: امکان آپلود فایل‌های ترجمه (.po)
  • تغییر زبان: امکان تغییر زبان فعال
  • نمایش آمار: نمایش تعداد زبان‌ها و وضعیت RTL
  • پیش‌نمایش: مشاهده حالت‌های مختلف تغییر زبان

تنظیمات چندزبانه

  1. به تب مدیریت زبان‌ها بروید
  2. برای افزودن زبان جدید فایل .po مربوطه را آپلود کنید
  3. کد زبان (مثل en_US) را وارد کنید
  4. زبان مورد نظر را فعال کنید

ساختار فایل‌های ترجمه

فایل‌های ترجمه در مسیر languages/ قرار دارند:

  • fastbuy-commerce.pot: فایل template اصلی
  • fastbuy-commerce-fa_IR.po/mo: ترجمه فارسی
  • fastbuy-commerce-en_US.po/mo: ترجمه انگلیسی

ساختار فایل‌ها

fastbuy-commerce/
├── fastbuy-commerce.php              # فایل اصلی افزونه
├── uninstall.php             # مدیریت حذف افزونه
├── README.md                 # مستندات
├── includes/                 # فایل‌های PHP
│   ├── class-fastbuy-commerce-admin.php            # کلاس مدیریت ادمین
│   ├── class-fastbuy-commerce-frontend.php         # کلاس مدیریت frontend
│   ├── class-fastbuy-commerce-assets.php           # مدیریت CSS/JS
│   ├── class-fastbuy-commerce-license.php          # مدیریت لایسنس
│   ├── class-fastbuy-commerce-language-manager.php # مدیریت زبان‌ها
│   └── functions.php                        # توابع کمکی
├── templates/                # قالب‌ها
│   └── fast-buy.php         # قالب اصلی خرید سریع
├── assets/                   # فایل‌های استاتیک
│   ├── css/
│   │   ├── style.css        # استایل‌های frontend
│   │   ├── admin.css        # استایل‌های admin
│   │   ├── rtl.css          # استایل‌های RTL
│   │   └── admin-rtl.css    # استایل‌های admin RTL
│   ├── js/
│   │   ├── frontend.js      # JavaScript frontend
│   │   └── admin.js         # JavaScript admin
│   └── images/              # تصاویر افزونه
└── languages/               # فایل‌های ترجمه
    ├── fastbuy-commerce.pot        # Template اصلی
    ├── fastbuy-commerce-fa_IR.po   # ترجمه فارسی
    ├── fastbuy-commerce-fa_IR.mo   # فایل باینری فارسی
    ├── fastbuy-commerce-en_US.po   # ترجمه انگلیسی
    └── fastbuy-commerce-en_US.mo   # فایل باینری انگلیسی

سفارشی‌سازی

سفارشی‌سازی قالب

برای سفارشی‌سازی ظاهر، فایل زیر را در تم خود کپی کنید:

yourtheme/fastbuy-commerce/fast-buy.php

هوک‌های موجود

Actions

// قبل از نمایش محصولات
do_action('fastbuy_commerce_before_products', $category);

// بعد از نمایش محصولات
do_action('fastbuy_commerce_after_products', $category);

// قبل از افزودن به سبد خرید
do_action('fastbuy_commerce_before_add_to_cart', $product_id);

Filters

// فیلتر کردن محصولات
$products = apply_filters('fastbuy_commerce_products', $products, $category);

// تغییر تنظیمات
$settings = apply_filters('fastbuy_commerce_settings', $settings);

// سفارشی‌سازی HTML دکمه افزودن به سبد
$button_html = apply_filters('fastbuy_commerce_add_to_cart_button', $button_html, $product);

CSS Classes

کلاس‌های CSS مهم برای سفارشی‌سازی:

.fastbuy-commerce-container          /* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
/* کانتینر اصلی */
.fastbuy-commerce-category-headers   /* هدر دسته‌بندی‌ها */
.fast-buy .cat-thumbnail      /* تصاویر دسته‌بندی */
.fast-buy .product-item       /* آیتم محصول */
.fast-buy .product-price      /* قیمت محصول */
.fastbuy-commerce-notice; /* اعلان‌ها */

عیب‌یابی

مشکلات رایج

محصولات نمایش داده نمی‌شوند

  • بررسی کنید محصولات در دسته "خریدسریع" قرار دارند
  • وضعیت انتشار محصولات را بررسی کنید
  • تنظیمات "نمایش محصولات ناموجود" را بررسی کنید

افزودن به سبد کار نمی‌کند

  • بررسی کنید JavaScript فعال باشد
  • کنفلیکت با سایر افزونه‌ها را بررسی کنید
  • کنسول مرورگر را برای خطاها بررسی کنید

مشکل در نمایش تصاویر

  • بررسی کنید تصاویر دسته‌بندی‌ها تنظیم شده باشند
  • مجوزهای فایل‌ها را بررسی کنید

حالت Debug

برای فعال‌سازی حالت دیباگ:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

پشتیبانی و به‌روزرسانی

اطلاعات نسخه

  • نسخه فعلی: 2.0.0
  • تاریخ انتشار: 2025
  • سازگاری WordPress: 5.0+
  • سازگاری WooCommerce: 4.0+

تغییرات نسخه 2.0.0

  • بازنویسی کامل کد با معماری OOP
  • بهبود عملکرد و سرعت
  • طراحی جدید و مدرن
  • پشتیبانی از AJAX
  • سیستم template جدید
  • بهبود امنیت
  • پشتیبانی بهتر از موبایل

تماس با پشتیبانی

مجوز

این افزونه تحت مجوز GPL v2 یا بالاتر منتشر شده است.

توسعه‌دهنده

علی شاه کوچکی


برای دریافت آخرین نسخه و پشتیبانی، لطفاً وب‌سایت رسمی را مطالعه کنید.

  • README.md. The file that you’re currently reading.
  • A plugin-name directory that contains the source code - a fully executable WordPress plugin.

Features

  • The FastBuy Commerce is based on the Plugin API, Coding Standards, and Documentation Standards.
  • All classes, functions, and variables are documented so that you know what you need to change.
  • The FastBuy Commerce uses a strict file organization scheme that corresponds both to the WordPress Plugin Repository structure, and that makes it easy to organize the files that compose the plugin.
  • The project includes a .pot file as a starting point for internationalization.

Installation

The FastBuy Commerce can be installed directly into your plugins folder "as-is". You will want to rename it and the classes inside of it to fit your needs. For example, if your plugin is named 'example-me' then:

  • rename files from plugin-name to example-me
  • change plugin_name to example_me
  • change plugin-name to example-me
  • change Plugin_Name to Example_Me
  • change PLUGIN_NAME_ to EXAMPLE_ME_

It's safe to activate the plugin at this point. Because the FastBuy Commerce has no real functionality there will be no menu items, meta boxes, or custom post types added until you write the code.

WordPress.org Preparation

The original launch of this version of the FastBuy Commerce included the folder structure needed for using your plugin on WordPress.org. That folder structure has been moved to its own repo here: https://github.com/DevinVinson/Plugin-Directory-FastBuy Commerce

Recommended Tools

i18n Tools

The WordPress Plugin FastBuy Commerce uses a variable to store the text domain used when internationalizing strings throughout the FastBuy Commerce. To take advantage of this method, there are tools that are recommended for providing correct, translatable files:

Any of the above tools should provide you with the proper tooling to internationalize the plugin.

License

The WordPress Plugin FastBuy Commerce is licensed under the GPL v2 or later.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

A copy of the license is included in the root of the plugin’s directory. The file is named LICENSE.

Important Notes

Licensing

The WordPress Plugin FastBuy Commerce is licensed under the GPL v2 or later; however, if you opt to use third-party code that is not compatible with v2, then you may need to switch to using code that is GPL v3 compatible.

For reference, here's a discussion that covers the Apache 2.0 License used by Bootstrap.

Includes

Note that if you include your own classes, or third-party libraries, there are three locations in which said files may go:

  • plugin-name/includes is where functionality shared between the admin area and the public-facing parts of the site reside
  • plugin-name/admin is for all admin-specific functionality
  • plugin-name/public is for all public-facing functionality

Note that previous versions of the FastBuy Commerce did not include Plugin_Name_Loader but this class is used to register all filters and actions with WordPress.

The example code provided shows how to register your hooks with the Loader class.

What About Other Features?

The previous version of the WordPress Plugin FastBuy Commerce included support for a number of different projects such as the GitHub Updater.

These tools are not part of the core of this FastBuy Commerce, as I see them as being additions, forks, or other contributions to the FastBuy Commerce.

The same is true of using tools like Grunt, Composer, etc. These are all fantastic tools, but not everyone uses them. In order to keep the core FastBuy Commerce as light as possible, these features have been removed and will be introduced in other editions, and will be listed and maintained on the project homepage.

Credits

The WordPress Plugin FastBuy Commerce was started in 2011 by Tom McFarlin and has since included a number of great contributions. In March of 2015 the project was handed over by Tom to Devin Vinson.

The current version of the FastBuy Commerce was developed in conjunction with Josh Eaton, Ulrich Pogson, and Brad Vincent.

The homepage is based on a design as provided by HTML5Up, the FastBuy Commerce logo was designed by Rob McCaskill of BungaWeb, and the site favicon was created by Mickey Kay.

Documentation, FAQs, and More

If you’re interested in writing any documentation or creating tutorials please let me know .