[solved] listing_price product listing question

  • Posts: 101
  • Thank you received: 12
11 years 6 months ago #106696

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:

if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){
					if($price->price_min_quantity>1){
						echo JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->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: 11 years 6 months ago by SG.

Please Log in or Create an account to join the conversation.

  • Posts: 101
  • Thank you received: 12
11 years 6 months ago #106697

I removed this comment about question 2 (and of course question2 above is also deleted for now) :-)

Last edit: 11 years 6 months ago by SG.

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
11 years 6 months ago #106727

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

The following user(s) said Thank You: SG

Please Log in or Create an account to join the conversation.

  • Posts: 101
  • Thank you received: 12
11 years 6 months ago #106758

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.

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

INTO:
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1) && !empty($this->element->product_id) ){

Thanks again Nicolas!
EDIT End

Last edit: 11 years 6 months ago by SG.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum