Price Beginning

  • Posts: 32
  • Thank you received: 1
11 years 3 months ago #117493

Hi

I needed to have a couple of options for the PRICE_BEGINNING string ie "from" and " "
To do this i Changed the following line in the Listing_Price view

echo JText::_('PRICE_BEGINNING');

to
if(isset($this->element->main)) echo JText::_($this->element->main->salemethod1);

elseif(isset($this->row)) echo JText::_($this->row->salemethod1);

else echo JText::_($this->element->salemethod1);
    
    $i=0;

salemethod1 is then set up as a custom backend field with the two options.

This works fine but my problem is that i only want this to display in the category listing and not on the product page.
How would I achieve this?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #117612

Hi,

I think that using:

if(JRequest::getVar('layout','show') == 'listing'){
// your code
}
can be the solution.

The following user(s) said Thank You: Tracy

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

  • Posts: 32
  • Thank you received: 1
11 years 3 months ago #117733

Thanks Xavier

Worked perfectly

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

  • Posts: 32
  • Thank you received: 1
11 years 3 months ago #117752

Hi Xavier.

Just noticed a strange occurence after using your method. A hikashop cart module which i have at the top of every page only displays correctly on product listing pages.

On all other pages it moves down about 40px. I changed the css to make it right on most page but now on a product listings it is 40px too high.

Here is a link to how it should look
www.therebelcakeco.com/

And here to a product listing page
www.therebelcakeco.com/boiled-sweets

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #117803

Hi,

I don't think that the two problems are related.
The modification don't do anything on the cart module.

I don't really see why you have a difference like that between the two pages. The html code seems to be the same in this part of the website.
It's maybe due to the absolute positioning.

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

  • Posts: 32
  • Thank you received: 1
11 years 3 months ago #117821

Hi Xavier,

It is definitely related because when i remove the code you gave me the cart displays correctly. I also just realised that it only happens when something is in the cart, otherwise its ok, so i dont know if you did this to see what i was talking about.

I have removed the code for the moment so that you can see when you click on the two links above they now both show the same and correctly.

Last edit: 11 years 3 months ago by Tracy.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #117862

Yes, you're right.
The cart display price use the same view, so it can be affected.

Thanks to try the following code:

if(JRequest::getVar('layout','show') == 'listing' && $this->params->get('from','nothing') != 'module'){
// your code
}

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

  • Posts: 32
  • Thank you received: 1
11 years 3 months ago #117867

Nearly right!!!

Now it is moved on all pages when there is something in the cart. (ie when a price is displayed) however when the cart is empty (no price displayed) it is still in its original position. so if i edit css to move it when item are in the cart it will be in wrong position when cart is empty.

Maybe there is a way to get the empty cart to display a price of "€0.00" and it might work?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #117873

And with a "||" instead the "&&" in the if condition ? :)

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

  • Posts: 32
  • Thank you received: 1
11 years 3 months ago #117906

No difference in position of cart but brought back the original problem of "from" in the product page :(

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #117984

So you can put back the "&&" and edit the view "product / cart" to add a "<br/>" tag or something else when the cart is empty.

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

  • Posts: 32
  • Thank you received: 1
11 years 3 months ago #118049

Thanks xavier.

Managed to get it sorted by messing around with the css after all.

Thanks again

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

Time to create page: 0.098 seconds
Powered by Kunena Forum