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

#   Let main product description always visible

##

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

Less More

- Posts: 262
- Thank you received: 9
-
-
-

7 months 3 weeks ago [\#370773](#370773) by [laurent](/forum/user/268-laurent "View laurent's Profile")  *[Let main product description always visible](/forum/26-product-category-display/910176-let-main-product-description-always-visible#370773 "Hi, When using variants, the variant's description is displayed and the main product description is hidden as soon as you select a variant, as long as the variant's description exists. This is the expected behavior. However, we would like the main product description to always be displayed (above or below) the selected variant description. In our case, the main description does not change much from one variant to another, so it would be simpler not to have to copy, paste and maintain the same description for each variant.  Apparently the main description is always present in the DOM (display:none) and is changed via JavaScript upon the variant selection event.  Is there a simple way to always keep the main description visible?  Thanks.  Laurent")* was created by *[laurent](/forum/user/268-laurent "View laurent's Profile")*

Hi,
When using variants, the variant's description is displayed and the main product description is hidden as soon as you select a variant, as long as the variant's description exists.
This is the expected behavior. However, we would like the main product description to always be displayed (above or below) the selected variant description. In our case, the main description does not change much from one variant to another, so it would be simpler not to have to copy, paste and maintain the same description for each variant.

Apparently the main description is always present in the DOM (display:none) and is changed via JavaScript upon the variant selection event.

Is there a simple way to always keep the main description visible?

Thanks.

Laurent

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MTAxNzYtbGV0LW1haW4tcHJvZHVjdC1kZXNjcmlwdGlvbi1hbHdheXMtdmlzaWJsZT90bXBsPW1hcmtkb3du) or [Create an account](/register) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86324
- Thank you received: 14285
-
-

7 months 3 weeks ago [\#370775](#370775) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Let main product description always visible](/forum/26-product-category-display/910176-let-main-product-description-always-visible#370775 "Hi, When using variants, the variant's description is displayed and the main product description is hidden as soon as you select a variant, as long as the variant's description exists. This is the expected behavior. However, we would like the main product description to always be displayed (above or below) the selected variant description. In our case, the main description does not change much from one variant to another, so it would be simpler not to have to copy, paste and maintain the same description for each variant.  Apparently the main description is always present in the DOM (display:none) and is changed via JavaScript upon the variant selection event.  Is there a simple way to always keep the main description visible?  Thanks.  Laurent")*

Hi,

The variant selection mechanism works by replacing the innerHTML of the hikashop_product_description_main div with the variant's description content. So it's not just a CSS display toggle. That means a pure CSS solution won't work here.

The simplest approach is to create a view override of the show_default.php template and add a second description div with a different ID, so the variant swap logic won't touch it. You can do this from the backend via Display &gt; Views and add, right above or below the existing description block, something like: Code:

&lt;!-- FIXED MAIN DESCRIPTION --&gt; &lt;div class="hikashop_product_main_description_fixed"&gt;&lt;?php $mainProduct = !empty($this-&gt;element-&gt;main) ? $this-&gt;element-&gt;main : $this-&gt;element; echo JHTML::_('content.prepare', preg_replace('#&lt;hr *id="system-readmore" */&gt;#i', '', $mainProduct-&gt;product_description)); ?&gt;&lt;/div&gt; &lt;!-- EO FIXED MAIN DESCRIPTION --&gt;

Since this div doesn't use the hikashop_product_description_main ID, the JavaScript variant swap function will leave it alone. The main description will always stay visible, and the original description block below (or above) will continue to swap to show the selected variant's description as usual.

If you want the variant description block to only appear when a variant actually has its own description (and not just repeat the main description), you could also leave the variant descriptions empty and only fill them for variants that have specific extra information.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MTAxNzYtbGV0LW1haW4tcHJvZHVjdC1kZXNjcmlwdGlvbi1hbHdheXMtdmlzaWJsZT90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 262
- Thank you received: 9
-
-
-

7 months 1 week ago [\#370930](#370930) by [laurent](/forum/user/268-laurent "View laurent's Profile")  Replied by *[laurent](/forum/user/268-laurent "View laurent's Profile")* on topic *[Let main product description always visible](/forum/26-product-category-display/910176-let-main-product-description-always-visible#370930 "Hi, When using variants, the variant's description is displayed and the main product description is hidden as soon as you select a variant, as long as the variant's description exists. This is the expected behavior. However, we would like the main product description to always be displayed (above or below) the selected variant description. In our case, the main description does not change much from one variant to another, so it would be simpler not to have to copy, paste and maintain the same description for each variant.  Apparently the main description is always present in the DOM (display:none) and is changed via JavaScript upon the variant selection event.  Is there a simple way to always keep the main description visible?  Thanks.  Laurent")*

Hello,

Sorry for the delay. It works very well. Thank you. For now, I let it "as is" but I'll go further for the case where variant has no description. If we need it.

Regards,

Laurent

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MTAxNzYtbGV0LW1haW4tcHJvZHVjdC1kZXNjcmlwdGlvbi1hbHdheXMtdmlzaWJsZT90bXBsPW1hcmtkb3du) or [Create an account](/register) 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.053 seconds

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