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

#   add product delivery time

##

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 11 months ago -  10 years 11 months ago [\#224648](#224648) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  *[add product delivery time](/forum/4-how-to/881181-add-product-delivery-time#224648 "Hi,  Again I need little help with php. I want to display delivery time on product page and hide it if product sold out with custom message.  After reading some topics I have added this code:  So if item stock is 1 it will display message ( 'CUSTOM&#95;DELIVERY&#95;TIME, CUSTOM&#95;DELIVERY ) if its sold out it will display other message ( CUSTOM&#95;SOLDOUT ). That's OK. However if item stock is more then 1 it will not display what I need. How can I have to display message ( 'CUSTOM&#95;DELIVERY&#95;TIME, CUSTOM&#95;DELIVERY ) if stock is 1 or more and display ( CUSTOM&#95;SOLDOUT ) if product is sold out? Could anyone help me to fix it?  Kind Regards")* was created by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")*

Hi,

Again I need little help with php.
I want to display delivery time on product page and hide it if product sold out with custom message.

After reading some topics I have added this code:
Code:

&lt;div class="hikashop__custom_delivery"&gt; &lt;?php if($this-&gt;row-&gt;product_quantity &gt; 0) echo ' &lt;span class="hikashop_product_deliver_time pull-right"&gt;'.JText::_('CUSTOM_DELIVERY_TIME').'&lt;/span&gt;&lt;span class="hikashop_product_deliver pull-right"&gt;'.JText::_('CUSTOM_DELIVERY').'&lt;/span&gt;'; else echo ' &lt;span class="hikashop_product_soldout_message"&gt;'.JText::_('CUSTOM_SOLDOUT').'&lt;/span&gt;'; ?&gt; &lt;/div&gt;

So if item stock is 1 it will display message ( 'CUSTOM_DELIVERY_TIME, CUSTOM_DELIVERY ) if its sold out it will display other message ( CUSTOM_SOLDOUT ). That's OK.
However if item stock is more then 1 it will not display what I need. How can I have to display message ( 'CUSTOM_DELIVERY_TIME, CUSTOM_DELIVERY ) if stock is 1 or more and display ( CUSTOM_SOLDOUT ) if product is sold out?
Could anyone help me to fix it?

Kind Regards

Last edit: 10 years 11 months ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

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

10 years 11 months ago [\#224673](#224673) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[add product delivery time](/forum/4-how-to/881181-add-product-delivery-time#224673 "Hi,  Again I need little help with php. I want to display delivery time on product page and hide it if product sold out with custom message.  After reading some topics I have added this code:  So if item stock is 1 it will display message ( 'CUSTOM&#95;DELIVERY&#95;TIME, CUSTOM&#95;DELIVERY ) if its sold out it will display other message ( CUSTOM&#95;SOLDOUT ). That's OK. However if item stock is more then 1 it will not display what I need. How can I have to display message ( 'CUSTOM&#95;DELIVERY&#95;TIME, CUSTOM&#95;DELIVERY ) if stock is 1 or more and display ( CUSTOM&#95;SOLDOUT ) if product is sold out? Could anyone help me to fix it?  Kind Regards")*

Hi,

That code is correct for what you want, which means that the problem comes from where you added that code. You must have added it inside a block of code which only display in some cases.

Also, note that if you have some products with unlimited quantity, it's better to use != instead of &gt; in your condition since unlimited is -1

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

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 11 months ago [\#224697](#224697) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[add product delivery time](/forum/4-how-to/881181-add-product-delivery-time#224697 "Hi,  Again I need little help with php. I want to display delivery time on product page and hide it if product sold out with custom message.  After reading some topics I have added this code:  So if item stock is 1 it will display message ( 'CUSTOM&#95;DELIVERY&#95;TIME, CUSTOM&#95;DELIVERY ) if its sold out it will display other message ( CUSTOM&#95;SOLDOUT ). That's OK. However if item stock is more then 1 it will not display what I need. How can I have to display message ( 'CUSTOM&#95;DELIVERY&#95;TIME, CUSTOM&#95;DELIVERY ) if stock is 1 or more and display ( CUSTOM&#95;SOLDOUT ) if product is sold out? Could anyone help me to fix it?  Kind Regards")*

Hi,

I see what was the problem. I have added that code to show_default in quantity line after I moved it to product/ quantity it started to work.

Thanks again Nicolas!

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

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