How to Publish products by default

  • Posts: 78
  • Thank you received: 1
10 years 1 month ago #209910

-- 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.

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 1 month ago #209912

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

		}

		if(empty($product_id) && empty($product->categories)) {
By
		} 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.

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.
The following user(s) said Thank You: adeptdesigns

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

Time to create page: 0.053 seconds
Powered by Kunena Forum