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

#   \[solved\] listing\_price product listing question

##

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

Less More

- Posts: 101
- Thank you received: 12
-
-

13 years 5 months ago -  13 years 5 months ago [\#106696](#106696) by [SG](/forum/user/12204-sg "View SG's Profile")  *[\[solved\] listing\_price product listing question](/forum/2-general-talk-about-hikashop/83045-solved-listing-price-product-listing-question#106696 "Hi,  A question about the product / listing&#95;price.php  1) Hiding &quot;per unit for buying at least&quot; only in product listing. In product details page it should be visible. In product/listing&#95;price.php there is this code:  I'd like to HIDE it only in the PRODUCT LISTING and SHOW it in the PRODUCT DETAILS PAGE. Is there a way to know where we are? So I can use a if-structure here.  Thanks")* was created by *[SG](/forum/user/12204-sg "View SG's Profile")*

Hi,

A question about the **product / listing\_price.php**

**1) Hiding "per unit for buying at least" only in product listing. In product details page it should be visible.**
In product/listing_price.php there is this code:
Code:

if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $this-&gt;params-&gt;get('per_unit',1)){ if($price-&gt;price_min_quantity&gt;1){ echo JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price-&gt;price_min_quantity); }else{ echo JText::_('PER_UNIT'); } }

I'd like to HIDE it only in the PRODUCT LISTING and SHOW it in the PRODUCT DETAILS PAGE.
Is there a way to know where we are? So I can use a if-structure here.

Thanks

Last edit: 13 years 5 months ago by [SG](/forum/user/12204-sg "View SG's Profile").

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

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

Less More

- Posts: 101
- Thank you received: 12
-
-

13 years 5 months ago -  13 years 5 months ago [\#106697](#106697) by [SG](/forum/user/12204-sg "View SG's Profile")  Replied by *[SG](/forum/user/12204-sg "View SG's Profile")* on topic *[listing\_price product listing questions](/forum/2-general-talk-about-hikashop/83045-solved-listing-price-product-listing-question#106697 "Hi,  A question about the product / listing&#95;price.php  1) Hiding &quot;per unit for buying at least&quot; only in product listing. In product details page it should be visible. In product/listing&#95;price.php there is this code:  I'd like to HIDE it only in the PRODUCT LISTING and SHOW it in the PRODUCT DETAILS PAGE. Is there a way to know where we are? So I can use a if-structure here.  Thanks")*

I removed this comment about question 2 (and of course question2 above is also deleted for now) ![:-)](/media/kunena/emoticons/3.png ":-)")

Last edit: 13 years 5 months ago by [SG](/forum/user/12204-sg "View SG's Profile").

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

13 years 5 months ago [\#106727](#106727) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[listing\_price product listing questions](/forum/2-general-talk-about-hikashop/83045-solved-listing-price-product-listing-question#106727 "Hi,  A question about the product / listing&#95;price.php  1) Hiding &quot;per unit for buying at least&quot; only in product listing. In product details page it should be visible. In product/listing&#95;price.php there is this code:  I'd like to HIDE it only in the PRODUCT LISTING and SHOW it in the PRODUCT DETAILS PAGE. Is there a way to know where we are? So I can use a if-structure here.  Thanks")*

Sure, you can just add:
if(empty($this-&gt;element-&gt;product_id) &amp;&amp; $price-&gt;price_min_quantity&gt;1) continue;
after the line:
foreach($this-&gt;row-&gt;prices as $price){

The following user(s) said Thank You: [SG](/forum/user/12204-sg "View SG's Profile")

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

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

Less More

- Posts: 101
- Thank you received: 12
-
-

13 years 5 months ago -  13 years 5 months ago [\#106758](#106758) by [SG](/forum/user/12204-sg "View SG's Profile")  Replied by *[SG](/forum/user/12204-sg "View SG's Profile")* on topic *[listing\_price product listing questions](/forum/2-general-talk-about-hikashop/83045-solved-listing-price-product-listing-question#106758 "Hi,  A question about the product / listing&#95;price.php  1) Hiding &quot;per unit for buying at least&quot; only in product listing. In product details page it should be visible. In product/listing&#95;price.php there is this code:  I'd like to HIDE it only in the PRODUCT LISTING and SHOW it in the PRODUCT DETAILS PAGE. Is there a way to know where we are? So I can use a if-structure here.  Thanks")*

Thanks it works!

**EDIT Begin:**
Since we still wanted to display the price and not the text "per unit ..." in the product listing we changed.
Code:

if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $this-&gt;params-&gt;get('per_unit',1)){

INTO:
Code:

if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $this-&gt;params-&gt;get('per_unit',1) &amp;&amp; !empty($this-&gt;element-&gt;product_id) ){

Thanks again Nicolas!
EDIT End

Last edit: 13 years 5 months ago by [SG](/forum/user/12204-sg "View SG's Profile").

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

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

[](#top)
