[Skip to main content](#vessel-content)

#   How to Publish products by default

##

- **[adeptdesigns](/forum/user/4465-adeptdesigns "View adeptdesigns's Profile")**
- [![adeptdesigns's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4465-adeptdesigns "View adeptdesigns's Profile") Topic Author
- [ Offline](/forum/user/4465-adeptdesigns)

Less More

- Posts: 78
- Thank you received: 1
-
-

11 years 3 months ago [\#209910](#209910) by [adeptdesigns](/forum/user/4465-adeptdesigns "View adeptdesigns's Profile")  *[How to Publish products by default](/forum/26-product-category-display/878447-how-to-publish-products-by-default#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 &quot;unpublished&quot;. Is there a way to set all new products to &quot;Published&quot; by default? I don't see any options for this in the config.  Thank you,")* was created by *[adeptdesigns](/forum/user/4465-adeptdesigns "View adeptdesigns's Profile")*

-- 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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Nzg0NDctaG93LXRvLXB1Ymxpc2gtcHJvZHVjdHMtYnktZGVmYXVsdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 3 months ago [\#209912](#209912) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[How to Publish products by default](/forum/26-product-category-display/878447-how-to-publish-products-by-default#209912 "-- 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 &quot;unpublished&quot;. Is there a way to set all new products to &quot;Published&quot; by default? I don't see any options for this in the config.  Thank you,")*

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) &amp;&amp; empty($product-&gt;categories)) {

By Code:

} else { $product-&gt;product_quantity = -1; $product-&gt;product_published = 1; $categoryClass = hikashop_get('class.category'); $mainTaxCategory = 'tax'; $categoryClass-&gt;getMainElement($mainTaxCategory); $query = 'SELECT category_id FROM '. hikashop_table('category'). ' WHERE category_type = ' . $db-&gt;Quote('tax') . ' AND category_parent_id = '.(int)$mainTaxCategory.' ORDER BY category_ordering DESC'; $db-&gt;setQuery($query); $product-&gt;product_tax_id = $db-&gt;loadResult(); } if(empty($product_id) &amp;&amp; empty($product-&gt;categories)) {

And it will force some elements during the product creation.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [adeptdesigns](/forum/user/4465-adeptdesigns "View adeptdesigns's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Nzg0NDctaG93LXRvLXB1Ymxpc2gtcHJvZHVjdHMtYnktZGVmYXVsdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.039 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
