Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Send Data To Database Rate Topic   - - - - -

 

Posted 18 September 2019 - 02:57 PM #1

Hello friends.
I read the CS-Cart codes and functions, but found functions that were just for get data and use.
I created an add-on for post a new product. How do I send data to the database? Information like: Product information in the cs-cart_product table, category information selected. Selected features information.
Thanks for help me.



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 899 posts

Posted 18 September 2019 - 04:01 PM #2

Hello

 

Function fn_update_product who located in file app/functions/fn.catalog.php

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 

Posted 19 September 2019 - 07:00 AM #3

Hello

 

Function fn_update_product who located in file app/functions/fn.catalog.php

 

Best regards

Robert

Hello
thanks for the answer
Is this function used to send data or update it?



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 899 posts

Posted 19 September 2019 - 07:36 AM #4

Hello

 

This function creates or updates the product depending on the parameters.

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 

Posted 19 September 2019 - 07:42 AM #5

Hello

 

This function creates or updates the product depending on the parameters.

 

Best regards

Robert

Thanks Robert



 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 899 posts

Posted 19 September 2019 - 07:50 AM #6

Hello

 

You are welcome :)

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19789 posts

Posted 19 September 2019 - 01:36 PM #7

Minimum amount of parameters:

 

- product (product name)

- price

- category_ids (array with IDs of categories)

- status

- company_id (ID of store-front or vendor)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 

Posted 25 September 2019 - 07:43 PM #8

Minimum amount of parameters:

 

- product (product name)

- price

- category_ids (array with IDs of categories)

- status

- company_id (ID of store-front or vendor)

thanks bro. You always helped me. Thank you. :wub: :wub:

Another question? How do I send selected features?
What is the parameter for the features?

All the information I want to send is as follows.
۱. Product Name.
۲. Category (Only one category should be selected.)
۳. Selected features.
۴. Price
۵. currency
۶. I added a column in the cs-cart_products table called the video_link. I want to add data to this column.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19789 posts

Posted 26 September 2019 - 05:08 AM #9

Another question? How do I send selected features?

 

It depends on the feature type. I suggest you to do the following

 

- open the /app/controllers/backend/products.php file

 

- add

fn_print_die($_REQUEST['product_data']);

after

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

- add test product with selected features and check the product_features element of the array which will be printed in the screen


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 

Posted 28 September 2019 - 06:11 AM #10

hi my friend...

I got the parameters with this code: fn_print_die(). But there is a problem.

We had a page to post a new product but wanted to change it ... I changed, it but error when clicking send: Sorry, service is temporarily unavailable.
The current page was like all the information you received was in one place ... that is, you must enter the product name first and then the category. After selecting the category there, I think using AJAX it would display the relevant features of that category.

f354325612.png

 

But I want to choose a category before anything else ... I did. And on another page I got the category and sent it to the product insertion page with parameter: category_id.

But the features of that category were not displayed. In PHP code I copied the part that was to get features and add it to another part. This will show up after sending the ID to the related features category. But an error occurred after clicking send. I looked to see that catgory_id could not be sent, so I added it to the array using session but it still made an error when registering.

 

all codes:

<?php 
/**
 * CS-Cart Custom Product - CS-Cart Custom Product 
 * 
 * PHP Version 7.1
 * 
 * @category  Addon
 * @package   Multivendor
 * @author    Webkul Software Pvt. Ltd. <support@webkul.com>
 * @copyright 2010 Webkul Software Pvt. Ltd. All rights reserved.
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @version   GIT:1.0
 * @link      Technical Support:  http://webkul.uvdesk.com
 */
if (!defined('BOOTSTRAP')) {
    die('Access Denied');
}
use Tygh\Registry;
use Tygh\Tools\Url;

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $suffix = 'manage';
    if ($mode == 'update') {
        $suffix = 'add';
        fn_save_post_data('wk_product_data');
        $auth = Tygh::$app['session']['auth'];
        $wk_product_data = $_REQUEST['wk_product_data'];
        if ($wk_product_data) {
            // Registry::set('runtime.company_id', $auth['company_id']);
            list($product_ids, $paid_product_ids, $paid_products_cost, $original_cost) = Fn_Create_Wk_Custom_product($wk_product_data, $auth);
            if (empty($product_ids)) {
                return array(CONTROLLER_STATUS_REDIRECT,'wk_custom_product.add');
            }
            fn_restore_post_data('wk_product_data');
            if ($paid_product_ids && $paid_products_cost && $paid_products_cost>0) {
                fn_define('ORDER_MANAGEMENT', true);
                $cart = &Tygh::$app['session']['cart'];
                $auth = &Tygh::$app['session']['auth'];
                $vendor_id = $auth['company_id'];
                fn_clear_cart($cart, true);
                $cart['user_data'] = fn_get_user_info($auth['user_id'], true, $cart['profile_id']);
                $cart['is_custom_order'] = 'Y';
                $product_id = Fn_Wk_Custom_Product_Get_Custom_product();
                $product_extra = array(
                    'paid_product_ids' => $paid_product_ids
                );
                fn_add_product_to_cart(
                    array(
                        $product_id => array(
                            'product_id'      => $product_id,
                            'amount'          => 1,
                            'price'           => $paid_products_cost,
                            'list_price'      => $original_cost,
                            'product_options' => array(),
                            'stored_price'    => 'Y',
                            'stored_discount' => 'Y',
                            'discount'        => 0,
                            'company_id'      => 0,
                            'extra'           => $product_extra,
                        ),
                    ),
                    $cart,
                    $auth
                );

                list($status, $redirect_params) = fn_checkout_update_steps(
                    $cart, $auth, array(
                        'update_step' => 'step_three',
                        'next_step'   => 'step_four',
                    )
                );

                return array(
                    CONTROLLER_STATUS_REDIRECT,
                    Url::buildUrn(array('checkout', 'checkout'), $redirect_params),
                );
            }
            return array(CONTROLLER_STATUS_REDIRECT,'wk_custom_product.manage');
        }
    }

    if ($mode == 'wk_update') {
        fn_save_post_data('wk_product_data');
        $wk_product_data = $_REQUEST['wk_product_data'];
        $product_id = $_REQUEST['product_id'];
        if ($wk_product_data && $product_id) {
            if (isset($wk_product_data['images'])) {
                Fn_Create_Product_Uploadable_image($wk_product_data['images'], $product_id);
            }
            $wk_product_data['category_ids'] = array($wk_product_data['category_ids']);
            if(isset($wk_product_data['custom_product_data']))
                unset($wk_product_data['custom_product_data']);
            if(isset($wk_product_data['custom_product_data']))
                unset($wk_product_data['custom_product_data']);
            if (isset($wk_product_data['product_features'])) {
                $price_feature_id = Registry::get('addons.wk_custom_product.product_price_features');
                $currency_feature_id = Registry::get('addons.wk_custom_product.product_currency_features');
                $online_payment_feature_id = Registry::get('addons.wk_custom_product.online_product_features');
                $product_features = $wk_product_data['product_features'];
                if (isset($product_features[$online_payment_feature_id])) {
                    $wk_product_data['is_online_product'] = $product_features[$online_payment_feature_id] == 'Y'?'Y':'N';
                }
                if (isset($product_features[$price_feature_id])) {
                    $wk_product_data['price'] = $product_features[$price_feature_id];
                }
                if (isset($product_features[$currency_feature_id])) {
                    $wk_product_data['currency'] = $product_features[$currency_feature_id];
                }
            }
            if (Registry::get('addons.sd_google_translate_api.gt_api_events.update_entity_via_website') == 'Y' || Registry::get('addons.sd_google_translate_api.gt_api_events.create_entity_via_website') == 'Y') {
                $create = empty($_REQUEST['product_id']) ? true : false;
                Registry::set('gt_api_update_product', $create);
            }

            $product_id = fn_update_product($wk_product_data, $product_id);

            fn_wk_custom_product_assign_urgent_badge($product_id);

            fn_restore_post_data('wk_product_data');
        }
        $suffix = 'wk_edit?product_id=' . $product_id;
    }

    if ($mode == 'calculate_price') {
        $all_product_data = $_REQUEST['all_product_data'];
        $selected_product_data = $_REQUEST['selected_product_data'];
        list($all_product_price, $selected_product_price) = Fn_Wk_Calculate_Plan_price($all_product_data, $selected_product_data);
        Tygh::$app['view']->assign('value', $all_product_price);
        $res = Registry::get('view')->fetch('common/price.tpl');
        Registry::get('ajax')->assignHtml("wk_all_product_plan_price_total", $res);
        $id= $_REQUEST['result_ids'];
        Tygh::$app['view']->assign('value', $selected_product_price);
        $res = Registry::get('view')->fetch('common/price.tpl');
        Registry::get('ajax')->assignHtml("$id", $res);
        exit;
    }

    if ($mode == 'upload_image') {
        echo Fn_Upload_Custom_Product_Temp_images();
        exit;
    }

    if ($mode == 'delete_image') {
        $product_id = $_REQUEST['product_id'];
        $pair_id = $_REQUEST['pair_id'];
        fn_delete_image_pairs($product_id, 'product', '', array($pair_id));
        exit;
    }

    //
    // Delete product
    //
    if ($mode == 'delete') {
        if (!empty($_REQUEST['product_id'])) {
            $result = fn_delete_product($_REQUEST['product_id']);
            $suffix = 'manage';
            if ($result) {
                fn_set_notification('N', __('notice'), __('text_product_has_been_deleted'));
            } else {
                $suffix = 'wk_edit?product_id=' . $_REQUEST['product_id'];
            }
        }
    }
    return array(CONTROLLER_STATUS_REDIRECT, 'wk_custom_product.'.$suffix);
}

if ($mode == 'category') {

    $auth = Tygh::$app['session']['auth'];
    if (empty($auth['user_id'])) {
        return array(CONTROLLER_STATUS_REDIRECT, 'auth.login_form?return_url=' . urlencode(Registry::get('config.current_url')));
    }
    if (empty($auth['company_id']) || $auth['user_type'] != 'V') {
        fn_set_notification("W", __("warning"), __("before_post_an_add_register_yourself_as_publisher"));
        return array(CONTROLLER_STATUS_REDIRECT,'companies.vendor_plans');
    }

    if(!isset($_REQUEST['category_id']) || empty($_REQUEST['category_id']) || $_REQUEST['category_id'] == '0'){

        Registry::get('view')->assign('get_category', true);

    }elseif(isset($_REQUEST['category_id']) && !empty($_REQUEST['category_id'])) {

        Registry::get('view')->assign('sub_category', true);
        Registry::get('view')->assign('sub_category_picker', $_REQUEST['category_id']);

    }
}

if ($mode == 'health_beauty') {

}


if ($mode == 'add' || $mode == 'wk_edit') {

    $auth = Tygh::$app['session']['auth'];
    if (empty($auth['user_id'])) {
        return array(CONTROLLER_STATUS_REDIRECT, 'auth.login_form?return_url=' . urlencode(Registry::get('config.current_url')));
    }
    if (empty($auth['company_id']) || $auth['user_type'] != 'V') {
        fn_set_notification("W", __("warning"), __("before_post_an_add_register_yourself_as_publisher"));
        return array(CONTROLLER_STATUS_REDIRECT,'companies.vendor_plans');
    }
    fn_add_breadcrumb(__("wk_post_an_ad"));
    $discount_data = Fn_Get_Custom_Product_Plan_Pricing_discount();
    Registry::get('view')->assign('discount_data', $discount_data);
    if ($mode == 'add') {
        $wk_product_data = fn_restore_post_data('wk_product_data');
        if ($wk_product_data) {
            // if(!isset($wk_product_data['product']))
                // Registry::get('view')->assign('wk_product_data_list', $wk_product_data);
        }
        $wk_custom_product_type_data = Fn_Get_Custom_Product_Type_data();
        if ($wk_custom_product_type_data) {
            Registry::get('view')->assign('wk_pricing_data', $wk_custom_product_type_data['pricing_data']);
            $wk_custom_product_data = isset($wk_custom_product_type_data[DESCR_SL])?$wk_custom_product_type_data[DESCR_SL]:$wk_custom_product_type_data[CART_LANGUAGE];
            Registry::get('view')->assign('wk_custom_product_data', $wk_custom_product_data);
        }

    } else {
        if ($_REQUEST['product_id']) {
            $product_data = fn_get_product_data($_REQUEST['product_id'], $auth, DESCR_SL, '', true, true, true, true, true, false, false);
         
            if (empty($product_data) || $product_data['company_id'] != $auth['company_id']) {
                fn_set_notification('E', __('warning'), __('incorrect_data_entered'));
                return array(CONTROLLER_STATUS_REDIRECT,'wk_custom_product.add');
            }
            if(!isset($_REQUEST['items_per_page']))
                $_REQUEST['items_per_page'] = 10;
            
            $_REQUEST['wk_parent_features'] = true;
            list($product_features, $features_search) = fn_get_paginated_product_features(
                $_REQUEST,
                $auth, $product_data,
                DESCR_SL
            );
            Tygh::$app['view']->assign('product_features', $product_features);
            Tygh::$app['view']->assign('features_search', $features_search);
            Tygh::$app['view']->assign('wk_product_data', $product_data);
            Tygh::$app['view']->assign('product_id', $_REQUEST['product_id']);
            $wk_custom_product_type_data = Fn_Get_Custom_Product_Type_data();
            if ($wk_custom_product_type_data) {
                Registry::get('view')->assign('wk_pricing_data', $product_data['custom_pricing_data']);
                $wk_custom_product_data = isset($wk_custom_product_type_data[DESCR_SL])?$wk_custom_product_type_data[DESCR_SL]:$wk_custom_product_type_data[CART_LANGUAGE];
                Registry::get('view')->assign('wk_custom_product_data', $wk_custom_product_data);
            }
            Registry::get('view')->assign('wk_selected_custom_product_data', $product_data['custom_product_data']);
            list($price,$list_price) = Fn_Wk_Calculate_Selected_Plan_price($product_data['custom_product_data'],  $product_data['custom_pricing_data'], $product_data);
            Registry::get('view')->assign('wk_plan_price', $price);
            Registry::get('view')->assign('wk_plan_list_price', $list_price);
        }
    }

    // i added get features code in there

    $items_per_page = 100;
    $path = $product_features = $features_search = array();
    $id= $_REQUEST['result_ids'];
    $category_ids = fn_set_session_data('category_ids', $category_id);
    $_REQUEST['wk_product_data'] = $category_ids;
    $category_id = $_REQUEST['category_id'];
    if ($category_id) {
        $_params = array(
            'category_ids' => array($category_id),
            'product_id' => $_REQUEST['product_id'],
            'statuses' => array('A', 'H'),
            'exclude_group'=>true,
            'variants' => true,
            'plain' => false,
            'display_on' => '',
            'existent_only' => false,
            'variants_selected_only' => false
        );
        $_params = fn_array_merge($_REQUEST, $_params);
        list($product_features, $features_search) = fn_get_product_features($_params, $items_per_page, DESCR_SL);
        // fn_print_r($product_features);
    }
    Tygh::$app['view']->assign('product_id', $_REQUEST['product_id']);
    Tygh::$app['view']->assign('category_id', $category_id);
    Tygh::$app['view']->assign('product_features', $product_features);
    Tygh::$app['view']->assign('features_search', $features_search);

    if (!empty($_REQUEST['data_name'])) {
        Tygh::$app['view']->assign('data_name', $_REQUEST['data_name']);
    }
}

if ($mode == 'manage') {
    $auth = Tygh::$app['session']['auth'];
    if (empty($auth['user_id'])) {
        fn_set_notification("W", __("warning"), __("wk_login_to_access_it"));
        return array(CONTROLLER_STATUS_REDIRECT, 'auth.login_form?return_url=' . urlencode(Registry::get('config.current_url')));
    }
    fn_add_breadcrumb(__("wk_my_posts_breadcrumb"));

    unset(Tygh::$app['session']['product_ids']);
    unset(Tygh::$app['session']['selected_fields']);

    $params = $_REQUEST;
    $params['only_short_fields'] = true;
    $params['apply_disabled_filters'] = true;
    $params['extend'][] = 'companies';
    $params['area'] = 'A';
    $params['company_id'] = $auth['company_id'];
    $params['wk_custom_product'] = true;
    list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.admin_elements_per_page'), DESCR_SL);
    fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_options' => false, 'get_discounts' => false));

    $page = $search['page'];
    $valid_page = db_get_valid_page($page, $search['items_per_page'], $search['total_items']);
    if ($page > $valid_page) {
        $_REQUEST['page'] = $valid_page;
        return array(CONTROLLER_STATUS_REDIRECT, Registry::get('config.current_url'));
    }

    Tygh::$app['view']->assign('products', $products);
    Tygh::$app['view']->assign('search', $search);
}

if ($mode == 'get_category_features') {
    $items_per_page = 100;
    $path = $product_features = $features_search = array();
    $id= $_REQUEST['result_ids'];
    $category_id = $_REQUEST['category_id'];
    if ($category_id) {
        $_params = array(
            'category_ids' => array($category_id),
            'product_id' => $_REQUEST['product_id'],
            'statuses' => array('A', 'H'),
            'exclude_group'=>true,
            'variants' => true,
            'plain' => false,
            'display_on' => '',
            'existent_only' => false,
            'variants_selected_only' => false
        );
        $_params = fn_array_merge($_REQUEST, $_params);
        list($product_features, $features_search) = fn_get_product_features($_params, $items_per_page, DESCR_SL);
        // fn_print_r($product_features);
    }
    Tygh::$app['view']->assign('product_id', $_REQUEST['product_id']);
    Tygh::$app['view']->assign('category_id', $category_id);
    Tygh::$app['view']->assign('product_features', $product_features);
    Tygh::$app['view']->assign('features_search', $features_search);
    //Registry::get('view')->assign('id', $_REQUEST['data_name']);

    if (!empty($_REQUEST['data_name'])) {
        Tygh::$app['view']->assign('data_name', $_REQUEST['data_name']);
    }
    $res = Registry::get('view')->fetch('addons/wk_custom_product/views/wk_custom_product/components/products_update_features.tpl');
    Registry::get('ajax')->assignHtml("$id", $res);
    Registry::get('ajax')->assign('category_path', fn_get_category_path($category_id));
    exit;
} 

if ($mode == 'check_expiry') {
    Fn_Check_Custom_Product_expiry();
}


 

Posted 28 September 2019 - 06:30 AM #11


fn_print_die($_REQUEST['product_data']);

 

old tpl code:

{* This file is not supported but exsists for backwards compatibility. Please don't use it. *}

{script src="js/tygh/node_cloning.js"}
{assign var="categories_company_id" value=$wk_product_data.company_id}
{if $wk_product_data.product_id}
    {assign var="id" value=$wk_product_data.product_id}
    {assign var="product_id" value=$wk_product_data.product_id}
{else}
	{assign var="id" value=0}
	{assign var="product_id" value=0}
{/if}
{include file="addons/wk_custom_product/pickers/map.tpl"}
{assign var="can_add_extra_products" value=false}
{if !$wk_product_data_list || count($wk_product_data_list)<10}
	{assign var="can_add_extra_products" value=true}
{/if}
<div class="wk_add_a_post_form_container">
    <form id='form' action="{""|fn_url}" method="post" name="product_update_form" class="form-horizontal form-edit" enctype="multipart/form-data"> {* product update form *}
		<input type="hidden" name="company_id" id="company_id" value="{$auth.company_id}" />
        <input type="hidden" name="wk_product_data[1][category_ids]" id="category_ids" value="{$smarty.request.category_id}" />
		<input type="hidden" name="fake" value="1" />
		{if $can_add_extra_products}
			{math equation="x+1" x=$_key|default:0 assign="new_key"}
			<div id="box_product_field_container" class="wk_product_field_container">
				{include file="common/subheader.tpl" title=__("information")}
				<input type="hidden" class="input_field_name" name="wk_product_data[{$new_key}]" value="" />
				<div class="ty-control-group">
					<label for="product_name" class="ty-control-group__title cm-required">{__("name")}:</label>
					<input type="text" id="product_name" name="wk_product_data[{$new_key}][product]" class="ty-input-text-full ad-post-custom-input-large" size="50" maxlength="255" value="" />
				</div>
				<div class="ty-control-group wk_category_container">
					{math equation="rand()" assign="rnd"}
					<label class="ty-control-group__title cm-required" for="celm_categories_{$rnd}_ids">{__("category")}:</label>
					{$c_id = "0"}
					{include file="addons/wk_custom_product/views/wk_custom_product/components/category_picker.tpl" data_id="elm_categories" input_name="wk_product_data[{$new_key}][category_ids]" item_ids=$c_id hide_link=true hide_delete_button=false default_name='' display_input_id="wk_selected_category_input_field`$key`"}
				</div>
				<div id="wk_features_field_container" class="wk_features_field_container">
				<!--wk_features_field_container{$new_key}-->
				</div>
				<div class="ty-control-group">
					<label for="location" class="ty-control-group__title cm-required">{__("location")}:</label>
					<input type="text" id="location" name="wk_product_data[{$new_key}][location]" class="ty-input-text-full wk_location_input ad-post-custom-input-large" size="50" maxlength="255" value="" />
					<input type="hidden" id="location_data" name="wk_product_data[{$new_key}][location_id]" class=" wk_location_data_input" size="50" value="" />
					{include file="buttons/button.tpl" but_text=__("wk_select_location") but_role="action" but_icon="fa fa-map-marker" but_meta="ty-btn__secondary cm-wcp-map-dialog"}
				</div>
				<div class="ty-control-group">
					<label for="elm_product_full_descr" class="ty-control-group__title">{__("description")}:</label>
					<textarea id="elm_product_full_descr" name="wk_product_data[{$new_key}][short_description]" rows="8" class="cm-wysiwyg1 wk-description-text-area ty-input-text-full ty-left ad-post-custom-textarea" maxlength="4000"></textarea>
					<span class="text-count">4000 {__("wk_characters_left")}</span>
				</div>
				{include file="addons/wk_custom_product/views/wk_custom_product/components/image_uploader.tpl" data_input_name="wk_product_data[`$new_key`][images][]"}

{*
                 <!-- Add videos by ID from YouTube -->
    			<div class="ty-control-group">
					<label for="youtube_embed" class="ty-control-group__title">{__("youtube_embed")}:</label>
					<input type="text" id="youtube_embed" name="wk_product_data[{$key}][youtube_embed]" class="ty-input-text-full" size="50" maxlength="255" value="" />
				</div>
*}

				{include file="addons/wk_custom_product/views/wk_custom_product/components/custom_product_plan.tpl" show_input=true data_input_name="wk_product_data[`$new_key`]" show_total=true id=$new_key}
			<!--box_product_field_container-->  
			</div>
		{/if}
		<div class="wk_post_add_footer">
			{include file="buttons/button.tpl" but_role="submit" but_name="dispatch[wk_custom_product.update]" but_text=__("wk_post_ad") but_meta="ty-btn__primary add-post-btn"}
		</div>
	</form>
</div>
{capture name="mainbox_title"}<span}>{__("wk_post_an_ad")}</span>{/capture}

new tpl code:

                {*
				<div class="ty-control-group wk_category_container">
					{math equation="rand()" assign="rnd"}
					<label class="ty-control-group__title cm-required" for="celm_categories_{$rnd}_ids">{__("category")}:</label>
					{$c_id = "0"}
					{include file="addons/wk_custom_product/views/wk_custom_product/components/category_picker.tpl" data_id="elm_categories" input_name="wk_product_data[{$new_key}][category_ids]" item_ids=$c_id hide_link=true hide_delete_button=false default_name='' display_input_id="wk_selected_category_input_field`$key`"}
				</div>
                *}
				<div id="wk_features_field_container" class="wk_features_field_container">
                {include file = "addons/wk_custom_product/views/wk_custom_product/components/products_update_features.tpl"}
				<!--wk_features_field_container{$new_key}-->
				</div>