- Posts: 101
- Thank you received: 12
[solved] listing_price product listing question
13 years 3 months ago - 13 years 3 months ago #106696
by SG
[solved] listing_price product listing question was created by SG
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:
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
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->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: 13 years 3 months ago by SG.
Please Log in or Create an account to join the conversation.
13 years 3 months ago - 13 years 3 months ago #106697
by SG
Replied by SG on topic listing_price product listing questions
I removed this comment about question 2 (and of course question2 above is also deleted for now)
Last edit: 13 years 3 months ago by SG.
Please Log in or Create an account to join the conversation.
13 years 3 months ago #106727
by nicolas
Replied by nicolas on topic listing_price product listing questions
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){
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.
13 years 3 months ago - 13 years 3 months ago #106758
by SG
Replied by SG on topic listing_price product listing questions
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.
INTO:
Thanks again Nicolas!
EDIT End
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->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){
INTO:
Code:
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: 13 years 3 months ago by SG.
Please Log in or Create an account to join the conversation.
Time to create page: 0.185 seconds