- Posts: 108
- Thank you received: 6
limit products to 1 category
12 years 2 months ago #163198
by christofu
limit products to 1 category was created by christofu
Hi,
can a product be limited to 1 category?
i.e. when someone adds a product they only have the option of adding it to a singular category?
thanks
can a product be limited to 1 category?
i.e. when someone adds a product they only have the option of adding it to a singular category?
thanks
Please Log in or Create an account to join the conversation.
12 years 2 months ago #163211
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic limit products to 1 category
Hi,
For your HikaMarket questions, please use the HikaMarket forum section.
There is no restriction on the number of categories a product can have but you can create it manually.
In the "productmarket | form" view of HikaMarket, you will find the line
If you are replacing by
And it will display just one category (the first one).
Regards,
For your HikaMarket questions, please use the HikaMarket forum section.
There is no restriction on the number of categories a product can have but you can create it manually.
In the "productmarket | form" view of HikaMarket, you will find the line
Code:
echo $this->categoryType->displayMultiple('data[product][categories]', @$this->product->categories, '', $this->rootCategory);
Code:
$cat = 0;
if(!empty($this->product->categories)) {
$cats = array_keys($this->product->categories);
$cat = reset($cats);
}
echo $this->categoryType->displayMultiple('data[product][categories]', @$this->product->categories, '', $this->rootCategory);
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
12 years 3 weeks ago #169910
by christofu
Replied by christofu on topic limit products to 1 category
Hi Jerome,
is there an easy way of only allowing one category to be entered into the category form - I understand the above code will just take the first category entered?
I think will get confused if they are still able to enter multiple categories.
(plz feel free to move this to its correct category or I can restart this in the hikamarket area)
thanks
is there an easy way of only allowing one category to be entered into the category form - I understand the above code will just take the first category entered?
I think will get confused if they are still able to enter multiple categories.
(plz feel free to move this to its correct category or I can restart this in the hikamarket area)
thanks
Please Log in or Create an account to join the conversation.
12 years 3 weeks ago #169922
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic limit products to 1 category
Hi,
Well, you can call the function "displaySingle" instead of the function "displayMultiple", but at this moment you will have to change the input name to "data[product][categories][]" otherwise the rest of the HikaMarket code won't appreciate.
Regards,
Well, you can call the function "displaySingle" instead of the function "displayMultiple", but at this moment you will have to change the input name to "data[product][categories][]" otherwise the rest of the HikaMarket code won't appreciate.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.162 seconds