- Posts: 32
- Thank you received: 1
Price Beginning
13 years 1 month ago #117493
by Tracy
Price Beginning was created by Tracy
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
to
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?
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
Code:
echo JText::_('PRICE_BEGINNING');
to
Code:
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.
13 years 1 month ago #117612
by Xavier
Replied by Xavier on topic Price Beginning
Hi,
I think that using:
can be the solution.
I think that using:
Code:
if(JRequest::getVar('layout','show') == 'listing'){
// your code
}
The following user(s) said Thank You: Tracy
Please Log in or Create an account to join the conversation.
13 years 1 month ago #117733
by Tracy
Replied by Tracy on topic Price Beginning
Thanks Xavier
Worked perfectly
Worked perfectly
Please Log in or Create an account to join the conversation.
13 years 1 month ago #117752
by Tracy
Replied by Tracy on topic Price Beginning
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
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.
13 years 1 month ago #117803
by Xavier
Replied by Xavier on topic Price Beginning
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.
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.
13 years 1 month ago - 13 years 1 month ago #117821
by Tracy
Replied by Tracy on topic Price Beginning
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.
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: 13 years 1 month ago by Tracy.
Please Log in or Create an account to join the conversation.
13 years 1 month ago #117862
by Xavier
Replied by Xavier on topic Price Beginning
Yes, you're right.
The cart display price use the same view, so it can be affected.
Thanks to try the following code:
The cart display price use the same view, so it can be affected.
Thanks to try the following code:
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.
13 years 1 month ago #117867
by Tracy
Replied by Tracy on topic Price Beginning
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?
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.
13 years 1 month ago #117873
by Xavier
Replied by Xavier on topic Price Beginning
And with a "||" instead the "&&" in the if condition ?
Please Log in or Create an account to join the conversation.
13 years 1 month ago #117906
by Tracy
Replied by Tracy on topic Price Beginning
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.
13 years 1 month ago #117984
by Xavier
Replied by Xavier on topic Price Beginning
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.
13 years 1 month ago #118049
by Tracy
Replied by Tracy on topic Price Beginning
Thanks xavier.
Managed to get it sorted by messing around with the css after all.
Thanks again
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.232 seconds