Product listing display

  • Posts: 301
  • Thank you received: 1
12 years 4 months ago #56794

I am wanting to put the word "from" in front of the price on the product listing page - when I click on a category and it brings up the list of products under that category.

This is the code I have put (I am not a coder)

<!-- PRODUCT PRICE -->
<?php
}
if($this->params->get('show_price')){
$this->setLayout('listing_price');
echo "<strong>from</strong>".$this->loadTemplate();
}
?>

But on the front end it puts the word "from" then puts the price 2 lines below

How can I put the word directly in front of the price?
Thanks

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #56827

You should do your modification in the file "listing_price" and not the "listing_img_title" view file.
There you can directly put it next to the product:

if(empty($this->element->prices)) echo 'from ';
echo $this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id);

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

  • Posts: 301
  • Thank you received: 1
12 years 4 months ago #56839

Thanks - I can get the word from in front of the price but its doing the same thing as if it I am putting the word from in the PRICE BEGINNING in the language file.

I am only wanting the word from to show on the product listing as I have products with options. But the word from is also showing in the mini cart and in the checkout cart as well.

Can I just force it to show on the product_listing results on its own?
Thanks

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #56865

Ah yes, I didn't think of the cart display.
Try like that instead:

if(empty($this->element->prices)&&($_GET=='listing'||@$this->module)) echo 'from ';
echo $this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id);

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

  • Posts: 301
  • Thank you received: 1
12 years 4 months ago #56876

Thanks
I sort of got it working after a few errors but its still placing 'from' everywhere.

I'm not sure which lines I am supposed to replace with your code exactly. I was sort of taking a guess. Does it just go in as new lines or replace existing code? I add as new code but I get the word from and the main price showing $0.00 then the option price which is what I am using.

So still confused :)

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #56915

Hi,

The line :
if(empty($this->element->prices)&&($_GET=='listing'||@$this->module)) echo 'from ';

should be placed before the line:
echo $this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id);

I don't see how that code would still display everywhere though.
Maybe without the ||@$this->module it would help ?

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

  • Posts: 301
  • Thank you received: 1
12 years 4 months ago #56967

Great - thanks.
I am still getting the 'from' in the mini cart module but not in the checkout process.
Removed ||@$this->module and 'from' doesn't appear at all anymore so have put it back for now.
It's just the mini-cart where there is now an issue.

It might be worth adding the ability to put the word from in a product listing in the language file. No need for it in the mini cart or checkout. I have a lot of products which have basic price and have options - the
'from' tells the customer that is the cheapest price even if it isn't as options are required.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #57009

Then edit the file "cart" of the view "product" via the menu Display->Views and add the line:
$this->module = false;

after the first <?php tag.

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

  • Posts: 301
  • Thank you received: 1
12 years 4 months ago #57358

Thanks - this worked for the mini-cart. But I notice the word "from" is also showing in the featured products module I have.

I haven't add a related products sections as well yet but assume this would also show the word "from" if I add that module.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #57414

Yes.
Is that a problem ?

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

  • Posts: 301
  • Thank you received: 1
12 years 4 months ago #57446

Now that I think about it - its not a problem :)
Thanks

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

Time to create page: 0.072 seconds
Powered by Kunena Forum