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

#   WISHLIST - Override the function

##

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

Less More

- Posts: 57
- Thank you received: 4
-
-

11 years 6 months ago [\#201081](#201081) by [rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")  *[WISHLIST - Override the function](/forum/31-development/876850-wishlist-override-the-function#201081 "Hi guys,  I need your help. Can you tell me how can I override a function to wishlist?  For example, I have created a new plugin to override diferent views like product&#95;page&#95;view, listing view, compare view, mini-cart view, checkout view and now only less me the wishlist view.  To do that I have created a new plugin like:  and I have tried inside this functions to put for example if($view-&gt;getLayout() == 'wishlist') but I don't have any results. Can you help me please, to discover where I can do that and what name of function I need to solve my problem?  Thanks.")* was created by *[rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")*

Hi guys,

I need your help.
Can you tell me how can I override a function to wishlist?

For example, I have created a new plugin to override diferent views like product_page_view, listing view, compare view, mini-cart view, checkout view and now only less me the wishlist view.

To do that I have created a new plugin like: Code:

class plgHikashopOverrideData extends JPlugin { function plgHikashopOverrideData(&amp;$subject, $config) { ... } # function to override diferent views in hikashop function onHikashopBeforeDisplayView(&amp;view) { ... if($view-&gt;getName() == 'product') { if($view-&gt;getLayout() == 'show') { // for product page } elseif($view-&gt;getLayout()=='compare') { // for compare page } else { // for other views } } ] # function to cart and checkout function onAfterCartProductsLoad(&amp;cart) { ... } }

and I have tried inside this functions to put for example if($view-&gt;getLayout() == 'wishlist') but I don't have any results.
Can you help me please, to discover where I can do that and what name of function I need to solve my problem?

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3Njg1MC13aXNobGlzdC1vdmVycmlkZS10aGUtZnVuY3Rpb24/dG1wbD1tYXJrZG93bg==) 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)
-

11 years 6 months ago [\#201082](#201082) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[WISHLIST - Override the function](/forum/31-development/876850-wishlist-override-the-function#201082 "Hi guys,  I need your help. Can you tell me how can I override a function to wishlist?  For example, I have created a new plugin to override diferent views like product&#95;page&#95;view, listing view, compare view, mini-cart view, checkout view and now only less me the wishlist view.  To do that I have created a new plugin like:  and I have tried inside this functions to put for example if($view-&gt;getLayout() == 'wishlist') but I don't have any results. Can you help me please, to discover where I can do that and what name of function I need to solve my problem?  Thanks.")*

Hi,

Why not use the views override system ?
Here is the documentation for that:
[ www.hikashop.com/support/support/documen...ize-the-display.html](http://www.hikashop.com/support/support/documentation/153-customize-the-display.html)

Else the view name is "cart" and the layout is "showcart", but the same view is used for both cart and wishlist so you will have do to some checks to edit only the wishlist layout, or you can edit both.

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

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

Less More

- Posts: 57
- Thank you received: 4
-
-

11 years 6 months ago [\#201226](#201226) by [rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")  Replied by *[rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")* on topic *[WISHLIST - Override the function](/forum/31-development/876850-wishlist-override-the-function#201226 "Hi guys,  I need your help. Can you tell me how can I override a function to wishlist?  For example, I have created a new plugin to override diferent views like product&#95;page&#95;view, listing view, compare view, mini-cart view, checkout view and now only less me the wishlist view.  To do that I have created a new plugin like:  and I have tried inside this functions to put for example if($view-&gt;getLayout() == 'wishlist') but I don't have any results. Can you help me please, to discover where I can do that and what name of function I need to solve my problem?  Thanks.")*

Hi,

Thanks for you answer.

Override the view isn't a option because I have an WebService to set the objects that we wan't.
For example, I'm setting the product prices, product quantities, disconts, stock and expedition from an external DB and get all this information with an Soap Webservice.
Everything works with all view, except wishlist view.
So, how can I set for example $row-&gt;elements (products) in wishlist using my plugin to override?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3Njg1MC13aXNobGlzdC1vdmVycmlkZS10aGUtZnVuY3Rpb24/dG1wbD1tYXJrZG93bg==) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 6 months ago [\#201245](#201245) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[WISHLIST - Override the function](/forum/31-development/876850-wishlist-override-the-function#201245 "Hi guys,  I need your help. Can you tell me how can I override a function to wishlist?  For example, I have created a new plugin to override diferent views like product&#95;page&#95;view, listing view, compare view, mini-cart view, checkout view and now only less me the wishlist view.  To do that I have created a new plugin like:  and I have tried inside this functions to put for example if($view-&gt;getLayout() == 'wishlist') but I don't have any results. Can you help me please, to discover where I can do that and what name of function I need to solve my problem?  Thanks.")*

Hi,

It's normal that you can't use the onHikashopBeforeDisplayView(&amp;view) trigger to override that wishlist/cart view as it would require the addition of this attribute in the class of the file components/com_hikashop/views/cart/view.html.php :
var $triggerView = true;

But then you could simply call that onHikashopBeforeDisplayView trigger yourself from the showcart view override and you would be able to do that without hacking in the view.html.php file.

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

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

Less More

- Posts: 57
- Thank you received: 4
-
-

11 years 6 months ago [\#201384](#201384) by [rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")  Replied by *[rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")* on topic *[WISHLIST - Override the function](/forum/31-development/876850-wishlist-override-the-function#201384 "Hi guys,  I need your help. Can you tell me how can I override a function to wishlist?  For example, I have created a new plugin to override diferent views like product&#95;page&#95;view, listing view, compare view, mini-cart view, checkout view and now only less me the wishlist view.  To do that I have created a new plugin like:  and I have tried inside this functions to put for example if($view-&gt;getLayout() == 'wishlist') but I don't have any results. Can you help me please, to discover where I can do that and what name of function I need to solve my problem?  Thanks.")*

Hi nocolas.

I'm sorry but I don't understood very well what you tried to explain.
Can you please explain better ou show me a sample to understand what you tried to said?

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3Njg1MC13aXNobGlzdC1vdmVycmlkZS10aGUtZnVuY3Rpb24/dG1wbD1tYXJrZG93bg==) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 6 months ago [\#201387](#201387) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[WISHLIST - Override the function](/forum/31-development/876850-wishlist-override-the-function#201387 "Hi guys,  I need your help. Can you tell me how can I override a function to wishlist?  For example, I have created a new plugin to override diferent views like product&#95;page&#95;view, listing view, compare view, mini-cart view, checkout view and now only less me the wishlist view.  To do that I have created a new plugin like:  and I have tried inside this functions to put for example if($view-&gt;getLayout() == 'wishlist') but I don't have any results. Can you help me please, to discover where I can do that and what name of function I need to solve my problem?  Thanks.")*

Hi,

Edit the file "showcart" of the view "cart" via the menu Display&gt;Views and add the code: Code:

&lt;?php JPluginHelper::importPlugin('hikashop'); $dispatcher = JDispatcher::getInstance(); $dispatcher-&gt;trigger('onHikashopBeforeDisplayView', array(&amp;$this)); ?&gt;

at the beginning of the file and the onHikashopBeforeDisplayView function of your custom hikashop plugin will be called when you display the wishlist details page.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3Njg1MC13aXNobGlzdC1vdmVycmlkZS10aGUtZnVuY3Rpb24/dG1wbD1tYXJrZG93bg==) 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.061 seconds

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