Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions includes/Product/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
// Add WooCommerce product brands support.
add_action( 'dokan_new_product_added', [ $this, 'update_product_brands_by_id' ], 10, 2 );
add_action( 'dokan_product_updated', [ $this, 'update_product_brands_by_id' ], 10, 2 );
add_action( 'dokan_product_edit_after_pricing_fields', [ $this, 'add_product_brand_template' ] );
add_action( 'dokan_product_edit_after_pricing_fields', [ $this, 'add_product_brand_template_in_edit_product' ] );
add_action( 'dokan_new_product_after_product_category', [ $this, 'add_product_brand_template_in_add_product' ] );

// Remove product type filter if pro not exists.
add_filter( 'dokan_product_listing_filter_args', [ $this, 'remove_product_type_filter' ] );
Expand Down Expand Up @@ -194,11 +195,11 @@
<div class="dokan-store-products-filter-area dokan-clearfix">
<form class="dokan-store-products-ordeby" method="get">
<input type="text" name="product_name" class="product-name-search dokan-store-products-filter-search"
placeholder="<?php esc_attr_e( 'Enter product name', 'dokan-lite' ); ?>" autocomplete="off"

Check warning on line 198 in includes/Product/Hooks.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found precision alignment of 3 spaces.
data-store_id="<?php echo esc_attr( $store_id ); ?>">

Check warning on line 199 in includes/Product/Hooks.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found precision alignment of 3 spaces.
<div id="dokan-store-products-search-result" class="dokan-ajax-store-products-search-result"></div>
<input type="submit" name="search_store_products" class="search-store-products dokan-btn-theme"
value="<?php esc_attr_e( 'Search', 'dokan-lite' ); ?>">

Check warning on line 202 in includes/Product/Hooks.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found precision alignment of 3 spaces.

<?php if ( is_array( $orderby_options['catalogs'] ) && isset( $orderby_options['orderby'] ) ) : ?>
<select name="product_orderby" class="orderby orderby-search"
Expand Down Expand Up @@ -574,6 +575,19 @@
);
}



/**
* Add product brand taxonomy template
*
* @since DOKAN_SINCE
*
* @return void
*/
public function add_product_brand_template_in_add_product(): void {
dokan_get_template_part( 'products/product-brand', '', [ 'product_brands' => [] ] );
}

/**
* Add product brand taxonomy template
*
Expand All @@ -583,7 +597,7 @@
*
* @return void
*/
public function add_product_brand_template( \WP_Post $post ): void {
public function add_product_brand_template_in_edit_product( \WP_Post $post ): void {
if ( ! current_user_can( 'dokan_edit_product' ) ) {
return;
}
Expand Down
2 changes: 2 additions & 0 deletions templates/products/new-product.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@
dokan_get_template_part( 'products/dokan-category-header-ui', '', $saved_product_cat_data );
?>

<?php do_action( 'dokan_new_product_after_product_category' ); ?>

<div class="dokan-form-group">
<label for="product_tag" class="form-label"><?php esc_html_e( 'Tags', 'dokan-lite' ); ?></label>
<select multiple="multiple" name="product_tag[]" id="product_tag_search" class="product_tag_search product_tags dokan-form-control dokan-select2" data-placeholder="<?php echo $can_create_tags ? esc_attr__( 'Select tags/Add tags', 'dokan-lite' ) : esc_attr__( 'Select product tags', 'dokan-lite' ); ?>">
Expand Down
2 changes: 1 addition & 1 deletion templates/products/product-brand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<div class="dokan-form-group">
<label for="product_brand" class="form-label"><?php esc_html_e( 'Brand', 'dokan-lite' ); ?></label>
<select multiple="multiple" id="product_brand" name="product_brand[]" class="product_brand_search dokan-form-control" data-placeholder="<?php esc_attr_e( 'Select brand', 'dokan-lite' ); ?>">
<select multiple="multiple" id="product_brand" name="product_brand[]" class="product_brand_search dokan-form-control" data-placeholder="<?php esc_attr_e( 'Select brand', 'dokan-lite' ); ?>" style="width: 100%;">
<?php if ( ! empty( $product_brands ) ) : ?>
<?php foreach ( $product_brands as $brand ) : ?>
<option value="<?php echo esc_attr( $brand->term_id ); ?>" selected="selected">
Expand Down
2 changes: 2 additions & 0 deletions templates/products/tmpl-add-product-popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
dokan_get_template_part( 'products/dokan-category-header-ui', '', $data );
?>

<?php do_action( 'dokan_new_product_after_product_category' ); ?>

<div class="dokan-form-group">
<label for="product_tag_search" class="form-label"><?php esc_html_e( 'Tags', 'dokan-lite' ); ?></label>
<select multiple="multiple" name="product_tag[]" id="product_tag_search" class="product_tag_search product_tags" data-placeholder="<?php echo esc_attr( $tags_placeholder ); ?>" style="width: 100%;"></select>
Expand All @@ -108,7 +110,7 @@
<?php do_action( 'dokan_new_product_after_product_tags' ); ?>

<div class="dokan-form-group">
<textarea name="post_excerpt" id="" class="dokan-form-control" rows="5" placeholder="<?php esc_attr_e( 'Enter some short description about this product...' , 'dokan-lite' ) ?>"></textarea>

Check failure on line 113 in templates/products/tmpl-add-product-popup.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Space found before comma in argument list

Check failure on line 113 in templates/products/tmpl-add-product-popup.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Inline PHP statement must end with a semicolon
</div>
</d>
</div>
Expand All @@ -116,7 +118,7 @@
<span class="dokan-show-add-product-error"></span>
<span class="dokan-show-add-product-success"></span>
<span class="dokan-spinner dokan-add-new-product-spinner dokan-hide"></span>
<input type="submit" id="dokan-create-new-product-btn" class="dokan-btn dokan-btn-default" data-btn_id="create_new" value="<?php esc_attr_e( 'Create product', 'dokan-lite' ) ?>">

Check failure on line 121 in templates/products/tmpl-add-product-popup.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Inline PHP statement must end with a semicolon
<?php
$display_create_and_add_new_button = true;
if ( function_exists( 'dokan_pro' ) && dokan_pro()->module->is_active( 'product_subscription' ) ) {
Expand All @@ -125,8 +127,8 @@
}
}
if ( $display_create_and_add_new_button ) :
?>

Check failure on line 130 in templates/products/tmpl-add-product-popup.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Line indented incorrectly; expected 5 tabs, found 4
<input type="submit" id="dokan-create-and-add-new-product-btn" class="dokan-btn dokan-btn-theme" data-btn_id="create_and_new" value="<?php esc_attr_e( 'Create & add new', 'dokan-lite' ) ?>">

Check failure on line 131 in templates/products/tmpl-add-product-popup.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Inline PHP statement must end with a semicolon
<?php endif; ?>
</div>
</form>
Expand All @@ -141,4 +143,4 @@
}
</style>
</script>
<?php do_action( 'dokan_add_product_js_template_end' );?>

Check failure on line 146 in templates/products/tmpl-add-product-popup.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Expected 1 space before closing PHP tag; 0 found
Loading