Changing Default Category upon Adding a Product

  • Posts: 2
  • Thank you received: 0
9 years 5 months ago #231267

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- Error-message(debug-mod must be tuned on) -- : No error message, just a quick question

Hey Hikashop Mods,

Big fan of Hikashop, thank you for making and maintaining support for it.
I just had a quick question. Is there any way to change the default category that is listed upon adding a product?

I did search around for this question in other threads, but I don't think this has been asked yet. If so, I apologize, please give me the link to that thread and close out this one.

Thank you for your time!
And I did not mean to put this in "Install & Update".

Last edit: 9 years 5 months ago by dougwoody.

Please Log in or Create an account to join the conversation.

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
9 years 5 months ago #231275

Hi,

There is no option for that.
You can add such code:

$categoryClass = hikashop_get('class.category');
$category = $categoryClass->get(XXX);
$product->categories = array($category->category_id => $category);
where XXX is the id of the category, after the line:
$product->product_tax_id = $db->loadResult();
of the file administrator/components/com_hikashop/views/product/view.html.php

The following user(s) said Thank You: dougwoody

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
9 years 5 months ago #231607

Hey Nicholas,

Thank you for your quick response.
I now have the desired category as my default category upon adding products.

Thank you for your time.

Please Log in or Create an account to join the conversation.

Time to create page: 0.044 seconds
Powered by Kunena Forum