[Skip to main content](#vessel-content)

#   Adding a filter plugin

##

- **[terryt](/forum/user/31051-terryt "View terryt's Profile")**
- [![terryt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31051-terryt "View terryt's Profile") Topic Author
- [ Offline](/forum/user/31051-terryt)

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 11 months ago [\#220307](#220307) by [terryt](/forum/user/31051-terryt "View terryt's Profile")  *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#220307 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")* was created by *[terryt](/forum/user/31051-terryt "View terryt's Profile")*

Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.

Or is there filter plugins?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14263
-
-

10 years 11 months ago [\#220347](#220347) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#220347 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

You can extend it with a system plugin yes.
In fact, you can extend any class in the folders classes and helpers of the backend like that. You can find more information here:
[ www.hikashop.com/forum/2-general-talk-ab...custom-features.html](http://www.hikashop.com/forum/2-general-talk-about-hikashop/28425-overriding-hikashop-classes-for-custom-features.html)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[terryt](/forum/user/31051-terryt "View terryt's Profile")**
- [![terryt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31051-terryt "View terryt's Profile") Topic Author
- [ Offline](/forum/user/31051-terryt)

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 11 months ago [\#220676](#220676) by [terryt](/forum/user/31051-terryt "View terryt's Profile")  Replied by *[terryt](/forum/user/31051-terryt "View terryt's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#220676 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

okay I don't know how to do it. I don't want to replace the whole class, only one of the functions, getproductlist.
Something like this. Code:

class hikashopFilterClass extends hikashopClass { function getProductList(){ echo('test'; } }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14263
-
-

10 years 11 months ago [\#220733](#220733) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#220733 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

That's not a problem.
You can have such code in your plugin: Code:

include(HIKASHOP_BACK.'classes'.DS.'filter.php'); class hikashopFilterClassOverride extends hikashopFilterClass{ function getProductList(&amp;$parent, $filters){ echo 'test'; } }

The hikashop_get function which loads the classes will automatically load the override class instead of the normal class if it is already initialized in memory thanks to your system plugin.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[terryt](/forum/user/31051-terryt "View terryt's Profile")**
- [![terryt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31051-terryt "View terryt's Profile") Topic Author
- [ Offline](/forum/user/31051-terryt)

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 11 months ago -  10 years 11 months ago [\#220764](#220764) by [terryt](/forum/user/31051-terryt "View terryt's Profile")  Replied by *[terryt](/forum/user/31051-terryt "View terryt's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#220764 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Thanks, but I'm way over my head here as I can't seem to modify the existing output list.

Basically I am trying to look for a URL variable (eg &amp;something=true) and do a query to generate my own list of products instead of what the current page is doing.

I try to override GetProductList to intercept the output but it doesn't change anything.

I need to be able to generate a list of products and apply the same 'listing_img_desc.php' templates to the output to keep it all looking the same.

Last edit: 10 years 11 months ago by [terryt](/forum/user/31051-terryt "View terryt's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

10 years 11 months ago [\#220806](#220806) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#220806 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Hi,

Another solution could be to edit the view "product / listing_div" and add code like: Code:

if(JRequest::getVar('something','','GET') == true){ $products = array(); // Get the products /* Add your code there */ // Replace the content of $this-&gt;rows $this-&gt;rows = $products; }

That way, you can have the desired products thanks to an url parameter, filters are not mandatory.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[terryt](/forum/user/31051-terryt "View terryt's Profile")**
- [![terryt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31051-terryt "View terryt's Profile") Topic Author
- [ Offline](/forum/user/31051-terryt)

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 11 months ago -  10 years 11 months ago [\#220886](#220886) by [terryt](/forum/user/31051-terryt "View terryt's Profile")  Replied by *[terryt](/forum/user/31051-terryt "View terryt's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#220886 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Yes but is there a function to get the product row data by supplying a list of product id?

And the pagination will be wrong wont it?

I am trying to use the helper API but I don't know if this would be the correct way to get product id #66.
Code:

$helperProduct = hikashop::get('helper.product'); $this-&gt;rows = $helperProduct-&gt;processRequest('', '/products/:id', $this-params, array('ids'=&gt;array(66));

Last edit: 10 years 11 months ago by [terryt](/forum/user/31051-terryt "View terryt's Profile"). Reason: details

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

10 years 11 months ago [\#220934](#220934) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#220934 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Hi,

For the pagination, you can change the "$this-&gt;pageInfo" PHP object values.

To get the products from ids, you can use that code: Code:

$ids = array('1','2','x'); $productClass = hikashop_get('class.product'); $productClass-&gt;getProducts($ids); var_dump($productClass-&gt;products);

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[terryt](/forum/user/31051-terryt "View terryt's Profile")**
- [![terryt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31051-terryt "View terryt's Profile") Topic Author
- [ Offline](/forum/user/31051-terryt)

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 11 months ago [\#221121](#221121) by [terryt](/forum/user/31051-terryt "View terryt's Profile")  Replied by *[terryt](/forum/user/31051-terryt "View terryt's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221121 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Can't I run the product ID's through the helper? I need some way to check the product IDs are valid for the current visitor.
With hikashop_get('class.product') the prices come out as $0.00

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14263
-
-

10 years 11 months ago [\#221211](#221211) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221211 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Hi,

In each entry of the $productClass-&gt;products array, you have a "prices" attribute which itself is an array of all the prices of the product.
That way, you can access the prices of the products and use them.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[terryt](/forum/user/31051-terryt "View terryt's Profile")**
- [![terryt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31051-terryt "View terryt's Profile") Topic Author
- [ Offline](/forum/user/31051-terryt)

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 11 months ago [\#221255](#221255) by [terryt](/forum/user/31051-terryt "View terryt's Profile")  Replied by *[terryt](/forum/user/31051-terryt "View terryt's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221255 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Yes I can see those, but that doesn't explain why the prices are $0 and the images are missing when outputting the row. It seesm like they need to be sent through some function to be processed for row output but I don't know what that is. That is why I thought the helper function would be more useful because it would probably be intended for that, but no one uses it?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14263
-
-

10 years 11 months ago [\#221358](#221358) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221358 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

I don't see why the prices would be 0. The prices array should contain all the data of each price of the product available for the current customer.
Could you do a var_dump of the prices attribute ?
What do you get ?

The currencyHelper-&gt;format function call that you see in a lot of views is just to display the price_value of the price nicely, but the amount is already in there. So it's not necessary to use it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[terryt](/forum/user/31051-terryt "View terryt's Profile")**
- [![terryt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31051-terryt "View terryt's Profile") Topic Author
- [ Offline](/forum/user/31051-terryt)

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 11 months ago [\#221514](#221514) by [terryt](/forum/user/31051-terryt "View terryt's Profile")  Replied by *[terryt](/forum/user/31051-terryt "View terryt's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221514 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Here is a whole product. Code:

object(stdClass)#825 (59) { ["product_id"]=&gt; string(2) "40" ["product_parent_id"]=&gt; string(1) "0" ["product_name"]=&gt; string(13) "Vanilla Fudge" ["product_description"]=&gt; string(27) "" ["product_quantity"]=&gt; string(1) "0" ["product_code"]=&gt; string(16) "FF_Vanilla Fudge" ["product_published"]=&gt; string(1) "1" ["product_hit"]=&gt; string(1) "3" ["product_created"]=&gt; string(10) "1286498642" ["product_sale_start"]=&gt; string(10) "1286492400" ["product_sale_end"]=&gt; string(1) "0" ["product_delay_id"]=&gt; string(1) "0" ["product_tax_id"]=&gt; string(2) "11" ["product_type"]=&gt; string(4) "main" ["product_vendor_id"]=&gt; string(1) "0" ["product_manufacturer_id"]=&gt; string(2) "38" ["product_url"]=&gt; string(0) "" ["product_weight"]=&gt; string(5) "0.000" ["product_keywords"]=&gt; string(0) "" ["product_weight_unit"]=&gt; string(2) "lb" ["product_modified"]=&gt; string(10) "1447656993" ["product_meta_description"]=&gt; string(0) "" ["product_dimension_unit"]=&gt; string(2) "in" ["product_width"]=&gt; string(5) "0.000" ["product_length"]=&gt; string(5) "0.000" ["product_height"]=&gt; string(5) "0.000" ["product_max_per_order"]=&gt; string(1) "0" ["product_access"]=&gt; string(3) "all" ["product_group_after_purchase"]=&gt; string(0) "" ["product_min_per_order"]=&gt; string(1) "0" ["product_contact"]=&gt; string(1) "0" ["product_display_quantity_field"]=&gt; string(1) "0" ["product_last_seen_date"]=&gt; string(10) "1447901881" ["product_sales"]=&gt; string(1) "5" ["product_waitlist"]=&gt; string(1) "0" ["product_layout"]=&gt; string(0) "" ["product_average_score"]=&gt; string(1) "0" ["product_total_vote"]=&gt; string(1) "0" ["product_page_title"]=&gt; string(0) "" ["product_alias"]=&gt; string(13) "vanilla-fudge" ["product_price_percentage"]=&gt; string(9) "0.0000000" ["product_msrp"]=&gt; string(9) "0.0000000" ["product_canonical"]=&gt; string(42) "buy/ordering/product/40-vanilla-fudge.html" ["product_warehouse_id"]=&gt; string(1) "0" ["product_quantity_layout"]=&gt; string(0) "" ["ingredients"]=&gt; string(0) "" ["intro"]=&gt; string(0) "" ["glutenfree"]=&gt; string(5) "Vegan" ["special"]=&gt; string(0) "" ["prices"]=&gt; array(1) { [0]=&gt; object(stdClass)#830 (7) { ["price_id"]=&gt; string(2) "32" ["price_currency_id"]=&gt; string(1) "6" ["price_product_id"]=&gt; string(2) "40" ["price_value"]=&gt; string(7) "8.63636" ["price_min_quantity"]=&gt; string(1) "0" ["price_access"]=&gt; string(3) "all" ["price_site_id"]=&gt; string(0) "" } } ["files"]=&gt; array(0) { } ["images"]=&gt; array(1) { [0]=&gt; object(stdClass)#832 (9) { ["file_id"]=&gt; string(2) "15" ["file_name"]=&gt; string(0) "" ["file_description"]=&gt; string(0) "" ["file_path"]=&gt; string(31) "Vanilla_Fudge_4cae6952a2a4c.jpg" ["file_type"]=&gt; string(7) "product" ["file_ref_id"]=&gt; string(2) "40" ["file_free_download"]=&gt; string(1) "0" ["file_ordering"]=&gt; string(1) "0" ["file_limit"]=&gt; string(1) "0" } } ["variant_links"]=&gt; array(0) { } ["translations"]=&gt; array(0) { } ["categories"]=&gt; array(1) { [0]=&gt; string(2) "41" } ["categories_ordering"]=&gt; array(1) { [0]=&gt; string(1) "3" } ["related"]=&gt; array(0) { } ["options"]=&gt; array(0) { } ["variants"]=&gt; array(0) { } }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14263
-
-

10 years 11 months ago [\#221566](#221566) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221566 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Hi,

So the price is not 0. You can see there that the price is 8.63636:
[ take.ms/MSDA2](http://take.ms/MSDA2)
You can access it like that: Code:

$product-&gt;prices[0]-&gt;price_value

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[terryt](/forum/user/31051-terryt "View terryt's Profile")**
- [![terryt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31051-terryt "View terryt's Profile") Topic Author
- [ Offline](/forum/user/31051-terryt)

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 11 months ago [\#221584](#221584) by [terryt](/forum/user/31051-terryt "View terryt's Profile")  Replied by *[terryt](/forum/user/31051-terryt "View terryt's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221584 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Yes I know that, but you said I could replace the old $this-&gt;rows in the listing.php with the new rows from the getProducts function. I assume it would also use the prices since they are the same object layout.

Do I need to replace $this-&gt;rows[x]-&gt;prices, with the ones from each new row too?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14263
-
-

10 years 10 months ago [\#221602](#221602) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221602 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Hi,

I've reread the whole thread but I couldn't find any mention of "replacing" from us.

Xavier gave you some code on how to get the products data based on the ids of the products.
You then replied that the prices where 0.
We then asked for a var_dump of the products in order to check on that, as that should not happen.
And in the var_dump you provided, the price is not 0.

So I'm a bit lost. I don't understand what replacing you're trying to do, where your trying to do it, or why you're trying to do it ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[terryt](/forum/user/31051-terryt "View terryt's Profile")**
- [![terryt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31051-terryt "View terryt's Profile") Topic Author
- [ Offline](/forum/user/31051-terryt)

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 10 months ago [\#221705](#221705) by [terryt](/forum/user/31051-terryt "View terryt's Profile")  Replied by *[terryt](/forum/user/31051-terryt "View terryt's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221705 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

In this post - [ www.hikashop.com/support/forum/filters-s...r-plugin.html#220806](http://www.hikashop.com/support/forum/filters-search/880407-adding-a-filter-plugin.html#220806)
// Replace the content of $this-&gt;rows
$this-&gt;rows = $products;

I am trying to replace the product list with a new product list of specific product IDs that I select from the database while keeping the same template style.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14263
-
-

10 years 10 months ago [\#221706](#221706) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221706 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Hi,

The problem is that the getProducts function gives you the data of the product taken from the database.
It doesn't compute all the prices based on the tax rules, the discount rules, etc.
Thus the system might try to use a price which handle been computed if you just copy the rows "as is".
So what you can do is call the getPrices function of the class.currency for each product so that it will compute the prices for them to be displayed by the view of the frontend.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[terryt](/forum/user/31051-terryt "View terryt's Profile")**
- [![terryt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31051-terryt "View terryt's Profile") Topic Author
- [ Offline](/forum/user/31051-terryt)

Less More

- Posts: 28
- Thank you received: 0
-
-

10 years 10 months ago -  10 years 10 months ago [\#221865](#221865) by [terryt](/forum/user/31051-terryt "View terryt's Profile")  Replied by *[terryt](/forum/user/31051-terryt "View terryt's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221865 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

That is the kind of thing I was trying to avoid. I don't want to reinvent the whole process if there is some way of doing it as if it was a regular listing page with one or two functions.

Otherwise I have to get products, get prices, get images, get badges and some other steps I am not aware of that will cause problems later.

Why can't I use hikashop::get('helper.product'); for this? - I don't know how to use it but it doesn't seem to work.

BTW getPrices() is wrong, you need to use getListingPrices() for consistent layout

Last edit: 10 years 10 months ago by [terryt](/forum/user/31051-terryt "View terryt's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14263
-
-

10 years 10 months ago [\#221871](#221871) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adding a filter plugin](/forum/45-filters-search/880407-adding-a-filter-plugin#221871 "Can I extend the filter classes without editing the filter.php file? I want to add a new filter search function to getProductList() but I don't want to lose the ability to upgrade easily.  Or is there filter plugins?")*

Hi,

Well, the getProducts function is the closest we have of a function to easily load all the data of a bunch of products.
It is used for the export, copy and mass action systems, which don't require any calculation of the prices.
It's either that, or you basically have to do all the queries and processing manually, like in the listing function of the components/com_hikashop/views/product/view.html.php file.
Why there is no easy function to do that same thing in the class.product ? Well that's because the only place where that is needed is in that view file so there was no point in moving the code in the class.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4MDQwNy1hZGRpbmctYS1maWx0ZXItcGx1Z2luP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.423 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
