- Posts: 44
- Thank you received: 0
Show product_msrp to certain groups
12 years 2 months ago #164477
by denoo
Show product_msrp to certain groups was created by denoo
-- HikaShop version -- : 2.3.1
Hi,
I'm going to use product_msrp column to show discounts. To be more correct I'm going to show old price in product_msrp and discounted price in price_value column. We have about 2000 products and there are discounts often. I didn't find another way to import discounts than import directly in the hikashop_discount table. And we decided to use product_msrp column for discount to import everything using classic product import. I'm using price_access feature and the problem is when the main price is hidden the product_msrp is shown and not affected. How can I also hide it?
As I understand it's complicated to sort by discount, but is it possible to sort by product_msrp price?
Thanks in advance.
Denis
Hi,
I'm going to use product_msrp column to show discounts. To be more correct I'm going to show old price in product_msrp and discounted price in price_value column. We have about 2000 products and there are discounts often. I didn't find another way to import discounts than import directly in the hikashop_discount table. And we decided to use product_msrp column for discount to import everything using classic product import. I'm using price_access feature and the problem is when the main price is hidden the product_msrp is shown and not affected. How can I also hide it?
As I understand it's complicated to sort by discount, but is it possible to sort by product_msrp price?
Thanks in advance.
Denis
Please Log in or Create an account to join the conversation.
12 years 2 months ago #164551
by nicolas
Replied by nicolas on topic Show product_msrp to certain groups
Hi,
1. There is no option to hide the MSRP when there is no price found. To do that, simply edit the file "listing_price" of the view "product" via the menu Display>Views and add such code at the beginning:
<?php if(empty($this->row->prices) || !count($this->row->prices)) return; ?>
2. Sorting by MSRP is easy. In the options of your products listing menu/module that you can edit via the menu Display>Content menus/modules, simply select the product_msrp column in the "ordering column" option.
1. There is no option to hide the MSRP when there is no price found. To do that, simply edit the file "listing_price" of the view "product" via the menu Display>Views and add such code at the beginning:
<?php if(empty($this->row->prices) || !count($this->row->prices)) return; ?>
2. Sorting by MSRP is easy. In the options of your products listing menu/module that you can edit via the menu Display>Content menus/modules, simply select the product_msrp column in the "ordering column" option.
Please Log in or Create an account to join the conversation.
12 years 2 months ago - 12 years 2 months ago #164792
by denoo
Replied by denoo on topic Show product_msrp to certain groups
Hi,
thank you.
1. The problem is that this will hide this part of code also - echo JText::_('FREE_PRICE');
2. And is it possible to sort it using the filter singledropdown for example?
Off topic: Is it possible to sort by product code using filter ?
Thanks
Denis
thank you.
1. The problem is that this will hide this part of code also - echo JText::_('FREE_PRICE');
2. And is it possible to sort it using the filter singledropdown for example?
Off topic: Is it possible to sort by product code using filter ?
Thanks
Denis
Last edit: 12 years 2 months ago by denoo.
Please Log in or Create an account to join the conversation.
12 years 2 months ago #164800
by Xavier
Replied by Xavier on topic Show product_msrp to certain groups
Hi,
1. You can edit the file "product / listing_price" and add the following code at the top:
2. This is not yet available, at this time you can filter on product name but not product code.
1. You can edit the file "product / listing_price" and add the following code at the top:
Code:
$this->row->product_msrp = 0.0;
$this->element->main->product_msrp = 0.0;
2. This is not yet available, at this time you can filter on product name but not product code.
Please Log in or Create an account to join the conversation.
12 years 2 months ago #165493
by denoo
Replied by denoo on topic Show product_msrp to certain groups
Hi, Xavier
I'd added your code and after that there was no msrp_price at all.
The goal is to show both price and msrp_price to certain group and show FREE_PRICE text to others.
And sorry - on my test web I have hikashop 2.2.0 and not 2.3.1 as i mentioned above (don't no if it matters)
Thanks
Denis
I'd added your code and after that there was no msrp_price at all.
The goal is to show both price and msrp_price to certain group and show FREE_PRICE text to others.
And sorry - on my test web I have hikashop 2.2.0 and not 2.3.1 as i mentioned above (don't no if it matters)
Thanks
Denis
Please Log in or Create an account to join the conversation.
12 years 2 months ago #165518
by nicolas
Replied by nicolas on topic Show product_msrp to certain groups
Hi,
Instead of the code Xavier or I gave, then you can use that code:
Instead of the code Xavier or I gave, then you can use that code:
Code:
<?php if(empty($this->row->prices) || !count($this->row->prices)){ echo JText::_('FREE_PRICE'); return; } ?>
The following user(s) said Thank You: denoo
Please Log in or Create an account to join the conversation.
12 years 2 months ago #165548
by denoo
Replied by denoo on topic Show product_msrp to certain groups
Hi, Nicolas,
thanks. It works.
Before my last post I have tried:
<?php if(empty($this->row->prices) || !count($this->row->prices)) return;
echo JText::_('FREE_PRICE'); ?>
Gonna learn "return" function.
Thanks.
Denis
thanks. It works.
Before my last post I have tried:
<?php if(empty($this->row->prices) || !count($this->row->prices)) return;
echo JText::_('FREE_PRICE'); ?>
Gonna learn "return" function.
Thanks.
Denis
Please Log in or Create an account to join the conversation.
Time to create page: 0.193 seconds