Skip to main content

How to Publish products by default

More
11 years 2 months ago #209910 by adeptdesigns
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.5.23
-- Browser(s) name and version -- : Firefox 39.0
-- Error-message(debug-mod must be tuned on) -- : none

Hello,

By default, new products are "unpublished". Is there a way to set all new products to "Published" by default? I don't see any options for this in the config.

Thank you,

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

More
11 years 2 months ago #209912 by Jerome
Hi,

We already have a patch for the next version.
Please edit the file "administrator/components/com_hikashop/views/product/view.html.php" and replace
Code:
} if(empty($product_id) && empty($product->categories)) {
By
Code:
} else { $product->product_quantity = -1; $product->product_published = 1; $categoryClass = hikashop_get('class.category'); $mainTaxCategory = 'tax'; $categoryClass->getMainElement($mainTaxCategory); $query = 'SELECT category_id FROM '. hikashop_table('category'). ' WHERE category_type = ' . $db->Quote('tax') . ' AND category_parent_id = '.(int)$mainTaxCategory.' ORDER BY category_ordering DESC'; $db->setQuery($query); $product->product_tax_id = $db->loadResult(); } if(empty($product_id) && empty($product->categories)) {
And it will force some elements during the product creation.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: adeptdesigns

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

Time to create page: 0.144 seconds
Powered by Kunena Forum