/**
* Plugin Name: Nafaah Advanced Addon
* Plugin URI: https://nafaah.com/
* Description: Premium WooCommerce product widgets for Elementor with modular, product-first components.
* Version: 1.0.0
* Author: Nafaah
* Author URI: https://nafaah.com/
* Text Domain: nafaah-advanced-addon
* Domain Path: /languages
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Direct access বন্ধ
}
define( 'NAA_ADDON_PATH', plugin_dir_path( __FILE__ ) );
define( 'NAA_ADDON_URL', plugin_dir_url( __FILE__ ) );
class NAA_Addon_Plugin {
public function __construct() {
add_action( 'wp_enqueue_scripts', array( $this, 'register_assets' ) );
add_action( 'init', array( $this, 'load_files' ) );
// Elementor widgets register hobar shomoy eta call hobe
add_action( 'elementor/widgets/register', array( $this, 'register_elementor_widget' ) );
add_action( 'elementor/editor/after_enqueue_scripts', array( $this, 'enqueue_editor_assets' ) );
add_action( 'wp_ajax_naa_product_carousel_product_search', array( $this, 'ajax_product_search' ) );
}
/**
* CSS/JS load kora — shobshomoy enqueue kora hocche jate wp_head e thik shomoy e print hoy
* (content-er bhitor theke enqueue korle wp_head onek age already print hoye jay, tai CSS load hoy na)
*/
public function register_assets() {
wp_enqueue_style(
'naa-product-style',
NAA_ADDON_URL . 'assets/css/style.css',
array(),
'2.3.1'
);
wp_enqueue_script(
'naa-product-script',
NAA_ADDON_URL . 'assets/js/carousel.js',
array(),
'2.3.1',
true
);
}
/**
* Shudhu shared renderer load kori (shortcode ekhon r register hocche na — Elementor widget e shob hocche)
*/
public function load_files() {
require_once NAA_ADDON_PATH . 'includes/class-naa-product-renderer.php';
}
/**
* Load the product AJAX search only inside the Elementor editor.
*/
public function enqueue_editor_assets() {
// Product search is configured directly on Elementor's SELECT2 control.
// Do not replace/destroy Elementor's Select2 instance from editor JS.
}
/**
* AJAX product search used by the Manual product selector in Elementor.
*/
public function ajax_product_search() {
if ( ! current_user_can( 'edit_posts' ) ) {
wp_send_json_error( array( 'message' => __( 'Permission denied.', 'nafaah-advanced-addon' ) ), 403 );
}
$nonce = isset( $_REQUEST['nonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['nonce'] ) ) : '';
if ( ! wp_verify_nonce( $nonce, 'naa_product_carousel_product_search' ) ) {
wp_send_json( array( 'results' => array(), 'pagination' => array( 'more' => false ) ), 403 );
}
$term = isset( $_REQUEST['term'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['term'] ) ) : '';
$page = isset( $_REQUEST['page'] ) ? max( 1, absint( $_REQUEST['page'] ) ) : 1;
if ( '' === $term ) {
wp_send_json( array(
'results' => array(),
'pagination' => array( 'more' => false ),
) );
}
$per_page = 20;
$query = new WP_Query(
array(
'post_type' => 'product',
'post_status' => 'publish',
'posts_per_page' => $per_page,
'paged' => $page,
's' => $term,
'orderby' => 'title',
'order' => 'ASC',
'no_found_rows' => false,
'fields' => 'ids',
)
);
$results = array();
foreach ( $query->posts as $product_id ) {
$title = get_the_title( $product_id );
$sku = function_exists( 'wc_get_product' ) && wc_get_product( $product_id )
? wc_get_product( $product_id )->get_sku()
: '';
$label = $title . ' (#' . $product_id . ')';
if ( $sku ) {
$label .= ' — SKU: ' . $sku;
}
$results[] = array(
'id' => (string) $product_id,
'text' => $label,
);
}
wp_send_json( array(
'results' => $results,
'pagination' => array(
'more' => $page < (int) $query->max_num_pages,
),
) );
}
/**
* Elementor er widgets manager tairi hobar shomoy eta call hoy
*/
public function register_elementor_widget( $widgets_manager ) {
require_once NAA_ADDON_PATH . 'includes/class-naa-product-renderer.php';
require_once NAA_ADDON_PATH . 'includes/class-naa-product-elementor-widget.php';
$widgets_manager->register( new \NAA_Product_Carousel_Widget() );
$widgets_manager->register( new \NAA_Product_Grid_Widget() );
$widgets_manager->register( new \NAA_Product_List_Widget() );
$widgets_manager->register( new \NAA_Product_Showcase_Widget() );
$widgets_manager->register( new \NAA_Category_Products_Widget() );
$widgets_manager->register( new \NAA_Category_Grid_Widget() );
}
}
new NAA_Addon_Plugin();
বেগম রোকেয়া – Buy Books Online in Bangladesh | Fast Delivery | Nafaah.com
Skip to content-
You cannot add "সেক্টর কমান্ডারদের কথা" to the cart because the product is out of stock.
বেগম রোকেয়া
পৃষ্ঠা : 16
কভার : পেপার ব্যাক
সংস্করণ : 3rd Edition, 2017
ভাষা : bangla