Blank custom hikashop menu item

  • Posts: 1040
  • Thank you received: 99
  • Hikashop Business
6 months 2 weeks ago #303458

Hi,

As we all know hikashop is joomla component so sometimes it gives unwanted issues...

As example:

If we create joomla article about shipping prices and using hikashop currency switcher the currency won't be changed in that article. There are some plugins which we could use to add php ( Sourcerer as ex...), load hikashop helper, use custom code ans so on, which would fix that....
But sometimes it's not enough and i feel this is kinda hacky way of doing it...

In the past we have encountered such issue like 3 or 4 times. So in order to fix it, we use one of the hikashop menu items which we don't use and it has own view, and we can create view override for it. In that view ovveride, based on menu item id we load different custom layout...

I hope you see what i mean here!

So it could be great if there would be some kinda blank hikashop menu item where we could select layout and load, as example, order details or whatever we need in that layout....


I have no idea if this would be useful for someone else and not just us but i would like to hear someones opinion regarding this feature request.

Thank you

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

  • Posts: 66586
  • Thank you received: 9792
  • MODERATOR
6 months 2 weeks ago #303460

Hi,

I'm not sure I understand everything of what you said, so I don't see what exactly it would be and how it would work nor why it would be useful.
For example, if you take a "blank" menu item and try to load the order details "layout", you have several problems:
- if it's just the layout (the view file), then you don't have any data to feed the layout and it will just crash
- if it's also the function loading all the data for the view file, then you have to have the correct data in the URL and/or the post so that the function can load the correct data. In that case, I don't see why not just create create a menu item with the type you want and in the view override, load what you want to load or include another view file or something ?

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

  • Posts: 1040
  • Thank you received: 99
  • Hikashop Business
6 months 2 weeks ago #303535

Hi,

Well, i not 100% sure how hikashop works but i have seen such addon in other joomla component and it felt very useful. Basically u do this:

1. Create new menu item, select menu item type->some component->blank page.
2. In that menu item there was tab called "layout", it had preselected default layout. In the source of that layout there was some tips how to load some data and how to create own layout.
3. So basically you create own override in template html folder and select it via that menu option... and then it's just matter what you need. Similar as we can select different layout on product page from template view override but this one would be for menu item...

So we could create as much as we need hikashop menu items which would use different custom layout...

This for sure is more useful for people who have some development experience.

This would allow more flexibility creating pages with php related to hikashop.

I just thought i will share the idea...
I am pretty happy the direction hikashop is going now but still would like it to be as best as it can.

Thanks

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

  • Posts: 66586
  • Thank you received: 9792
  • MODERATOR
6 months 1 week ago #303536

Hi,

Ok, I see what you mean. I'm not that convinced that it would be that useful. In most cases, you'll want to modify views that already exists.
If you want to create new views, these views will probably have actions (links, buttons, etc) on them which will require controllers to handle these actions and just provide some blank view won't help.
So you could directly create the controller and view files inside the structure of your HikaShop so that you can reuse the structure and functions we already have. It's basically 3 small files in two folders:
- a file components/com_hikashop/controllers/blank.php where you would have your tasks (you can use components/com_hikashop/controllers/cron.php as an example
- a file components/com_hikashop/views/blank/view.html.php where you load the data for the view files ( you can look at components/com_hikashop/views/entry/view.html.php )
- a folder components/com_hikashop/views/blank/tmpl/ with one php file per view you want to have.
That will allow you to do your things without having to create a whole component for that and you won't loose your files when you update HikaShop. And if you need something a bit bigger, then it's better to have your own custom component. It's actually not that difficult as there is a really good tutorial on the Joomla documentation that can be followed:
docs.joomla.org/J3.x:Developing_an_MVC_C...ng_a_Basic_Component

I suppose that it could have some uses to have a blank view by default in HikaShop. However, so far, I didn't see many people who could have needed that.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum