Show product_msrp to certain groups

  • Posts: 44
  • Thank you received: 0
11 years 1 month ago #164477

-- 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

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

  • Posts: 84300
  • Thank you received: 13697
  • MODERATOR
11 years 1 month ago #164551

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.

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

  • Posts: 44
  • Thank you received: 0
11 years 1 month ago #164792

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

Last edit: 11 years 1 month ago by denoo.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #164800

Hi,

1. You can edit the file "product / listing_price" and add the following code at the top:

$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.

  • Posts: 44
  • Thank you received: 0
11 years 1 month ago #165493

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

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

  • Posts: 84300
  • Thank you received: 13697
  • MODERATOR
11 years 1 month ago #165518

Hi,

Instead of the code Xavier or I gave, then you can use that 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.

  • Posts: 44
  • Thank you received: 0
11 years 1 month ago #165548

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

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

Time to create page: 0.074 seconds
Powered by Kunena Forum