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

#   Contact button conditions

##

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

Less More

- Posts: 46
- Thank you received: 2
-
-

6 years 6 months ago [\#318860](#318860) by [philament](/forum/user/58296-philament "View philament's Profile")  *[Contact button conditions](/forum/33-customers/899798-contact-button-conditions#318860 "-- HikaShop version -- : 4.3 -- Joomla version -- : 3.18 -- PHP version -- : 7.3  Hello, in the product page, is it possible, simply, to make the contact button appear only for products that are no longer in stock? thank you in advance for your advice")* was created by *[philament](/forum/user/58296-philament "View philament's Profile")*

-- HikaShop version -- : 4.3
-- Joomla version -- : 3.18
-- PHP version -- : 7.3

Hello,
in the product page, is it possible, simply, to make the contact button appear only for products that are no longer in stock?
thank you in advance for your advice

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84OTk3OTgtY29udGFjdC1idXR0b24tY29uZGl0aW9ucz90bXBsPW1hcmtkb3du) 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: 86584
- Thank you received: 14325
-
-

6 years 6 months ago [\#318893](#318893) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Contact button conditions](/forum/33-customers/899798-contact-button-conditions#318893 "-- HikaShop version -- : 4.3 -- Joomla version -- : 3.18 -- PHP version -- : 7.3  Hello, in the product page, is it possible, simply, to make the contact button appear only for products that are no longer in stock? thank you in advance for your advice")*

Hi,

Yes. Activate the contact button for all the products in the HikaShop configuration.
Then, you can add the code: Code:

if($this-&gt;element-&gt;product_quantity !=0) $contact = 0;

after the code: Code:

$contact = (int)$this-&gt;config-&gt;get('product_contact', 0);

in the file product / show_default.php via the menu Display&gt;Views.

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

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

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

Less More

- Posts: 46
- Thank you received: 2
-
-

6 years 6 months ago [\#319041](#319041) by [philament](/forum/user/58296-philament "View philament's Profile")  Replied by *[philament](/forum/user/58296-philament "View philament's Profile")* on topic *[Contact button conditions](/forum/33-customers/899798-contact-button-conditions#319041 "-- HikaShop version -- : 4.3 -- Joomla version -- : 3.18 -- PHP version -- : 7.3  Hello, in the product page, is it possible, simply, to make the contact button appear only for products that are no longer in stock? thank you in advance for your advice")*

Hello,

I am confused but I do not arrive at the expected result, surely that I made a mistake somewhere. The contact button always remains displayed even if the product has stock.
I paid contact for all products. I placed the provided code of my template, see the capture because it is here that my knowledge stops.

[ ![Capture.JPG](/forum/attachment/49348) ](/forum/attachment/49348 "Capture.JPG")

[ ![Capture2.JPG](/forum/attachment/49349) ](/forum/attachment/49349 "Capture2.JPG")

thank you in advance for your clarification

- [ ![Capture.JPG](/forum/attachment/49348) ](/forum/attachment/49348 "Capture.JPG") [ ](/forum/attachment/49348?download=1 "Capture.JPG")
- [ ![Capture2.JPG](/forum/attachment/49349) ](/forum/attachment/49349 "Capture2.JPG") [ ](/forum/attachment/49349?download=1 "Capture2.JPG")

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

6 years 6 months ago [\#319045](#319045) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Contact button conditions](/forum/33-customers/899798-contact-button-conditions#319045 "-- HikaShop version -- : 4.3 -- Joomla version -- : 3.18 -- PHP version -- : 7.3  Hello, in the product page, is it possible, simply, to make the contact button appear only for products that are no longer in stock? thank you in advance for your advice")*

Hello,

I just tested it on my end with the same customization, and it worked fine. Can you make sure that you properly edited the file of the good front-end template via "Hikashop-&gt;Display-&gt;Views" ? Thank you.

Kind regards,
Mohamed.

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

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

Less More

- Posts: 46
- Thank you received: 2
-
-

6 years 6 months ago [\#319119](#319119) by [philament](/forum/user/58296-philament "View philament's Profile")  Replied by *[philament](/forum/user/58296-philament "View philament's Profile")* on topic *[Contact button conditions](/forum/33-customers/899798-contact-button-conditions#319119 "-- HikaShop version -- : 4.3 -- Joomla version -- : 3.18 -- PHP version -- : 7.3  Hello, in the product page, is it possible, simply, to make the contact button appear only for products that are no longer in stock? thank you in advance for your advice")*

hello Mohamed,
I do not understand. I am in the right template, in the view indicated, but the button remains displayed on all products.
Maybe there is another parameter that forces it? but I have not found.
Can you take a closer look? access to the back?

Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84OTk3OTgtY29udGFjdC1idXR0b24tY29uZGl0aW9ucz90bXBsPW1hcmtkb3du) 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: 86584
- Thank you received: 14325
-
-

6 years 6 months ago [\#319121](#319121) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Contact button conditions](/forum/33-customers/899798-contact-button-conditions#319121 "-- HikaShop version -- : 4.3 -- Joomla version -- : 3.18 -- PHP version -- : 7.3  Hello, in the product page, is it possible, simply, to make the contact button appear only for products that are no longer in stock? thank you in advance for your advice")*

Hi,

Either you're using another view file than show_default.php, like show_tabular.php or show_reversed.php (or another one you or your template provider created), or you're not editing the file for the correct template, or your product has variants (and in that case, the code would have to be modified to support variants), or you have some caching system on your website and you need to clear the cache to see the change.
To check which view file to edit, you should activate temporarily the "Display view files" setting of the HikaShop configuration.
It will tell you which view files are used on which page of your website, so you'll be able to confirm that it is show_default.php which is used on the product page or another one.
Also, to check that you're in the correct view file for the correct template, you can just add &lt;?php exit; ?&gt; at the top of the view.
If you get a blank page on the frontend for that page after that, then you're editing the correct view file. If not, then either you have some caching or you're editing the wrong file.

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

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

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