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

#   Administration: Related Products: Display only Published products when adding?

##

- **[jazzmang](/forum/user/5807-jazzmang "View jazzmang's Profile")**
- [![jazzmang's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5807_2014-05-02.jpg)](/forum/user/5807-jazzmang "View jazzmang's Profile") Topic Author
- [ Offline](/forum/user/5807-jazzmang)

Less More

- Posts: 291
- Thank you received: 26
-
-
- [](http://www.interkan.net)
-

3 years 3 months ago [\#353620](#353620) by [jazzmang](/forum/user/5807-jazzmang "View jazzmang's Profile")  *[Administration: Related Products: Display only Published products when adding?](/forum/32-content-creation/906750-administration-related-products-display-only-published-products-when-adding#353620 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 3.10.12 -- PHP version -- : 8.0.29 -- Browser(s) name and version -- : n/a -- Error-message(debug-mod must be tuned on) -- : None  There appears to be no way to tell if a product is published when adding Related Products in the Administration area while editing a product.  Is there any way to filter unpublished or color-code them?  Otherwise, staff users cannot tell without manually checking the related products' status in another window.  When there are over 1000 products that have accumulated over the years, it becomes a problem.  It would be nice to have filter options at this level or, at the very least, color-coding them (red/green).")* was created by *[jazzmang](/forum/user/5807-jazzmang "View jazzmang's Profile")*

-- HikaShop version -- : 4.7.4
-- Joomla version -- : 3.10.12
-- PHP version -- : 8.0.29
-- Browser(s) name and version -- : n/a
-- Error-message(debug-mod must be tuned on) -- : None

There appears to be no way to tell if a product is published when adding Related Products in the Administration area while editing a product.

Is there any way to filter unpublished or color-code them?

Otherwise, staff users cannot tell without manually checking the related products' status in another window.

When there are over 1000 products that have accumulated over the years, it becomes a problem.

It would be nice to have filter options at this level or, at the very least, color-coding them (red/green).

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

3 years 3 months ago [\#353622](#353622) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Administration: Related Products: Display only Published products when adding?](/forum/32-content-creation/906750-administration-related-products-display-only-published-products-when-adding#353622 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 3.10.12 -- PHP version -- : 8.0.29 -- Browser(s) name and version -- : n/a -- Error-message(debug-mod must be tuned on) -- : None  There appears to be no way to tell if a product is published when adding Related Products in the Administration area while editing a product.  Is there any way to filter unpublished or color-code them?  Otherwise, staff users cannot tell without manually checking the related products' status in another window.  When there are over 1000 products that have accumulated over the years, it becomes a problem.  It would be nice to have filter options at this level or, at the very least, color-coding them (red/green).")*

Hi,

There is no option to filter them. But color coding can be added quite easily.

To do that, you first need to edit the product / form view file via the menu Display&gt;Views. There, you can find this block of code which displays the related products option: Code:

if(hikashop_acl('product/edit/related')) { ?&gt; &lt;dt class="hikashop_product_related"&gt;&lt;label for="data_product_related_text"&gt;&lt;?php echo JText::_('RELATED_PRODUCTS'); ?&gt;&lt;/label&gt;&lt;/dt&gt; &lt;dd class="hikashop_product_related"&gt;&lt;?php echo $this-&gt;nameboxType-&gt;display( 'data[product][related]', @$this-&gt;product-&gt;related, hikashopNameboxType::NAMEBOX_MULTIPLE, 'product', array( 'delete' =&gt; true, 'sort' =&gt; true, 'default_text' =&gt; '&lt;em&gt;'.JText::_('HIKA_NONE').'&lt;/em&gt;', ) ); ?&gt;&lt;/dd&gt; &lt;?php }

There, below the line: Code:

'default_text' =&gt; '&lt;em&gt;'.JText::_('HIKA_NONE').'&lt;/em&gt;',

you can add the line: Code:

'displayFormat' =&gt; '&lt;span class="product_published_{product_published}"&gt;[{product_id}] {product_name}&lt;/span&gt;',

That way, in the selector tree, each product name will be surrounded by a span with either the class product_published_0 or the class product_published_1
Then, you can add a piece of CSS to your backend template ( [ joomlaforever.com/overrides/override-the...e-cache-admin-module](https://joomlaforever.com/overrides/override-the-invalidate-cache-admin-module) ) for these classes. For example: Code:

.product_published_0{ background-color: #ffdddd; }

will display a light red background for unpublished products.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vOTA2NzUwLWFkbWluaXN0cmF0aW9uLXJlbGF0ZWQtcHJvZHVjdHMtZGlzcGxheS1vbmx5LXB1Ymxpc2hlZC1wcm9kdWN0cy13aGVuLWFkZGluZz90bXBsPW1hcmtkb3du) 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.047 seconds

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