Parcel terminals / Omniva / Smartpost

  • Posts: 26
  • Thank you received: 1
8 years 5 months ago #242091

-- HikaShop version -- : 2.1.0
-- Joomla version -- : 2.5.17
-- PHP version -- : 5.6.16
-- Browser(s) name and version -- : Chrome

In estonia we have a parcel terminals
uus.smartpost.ee/en/what-is-a-parcel-terminal

Now to the problem:
I want to add a shippin method with a dropdown menu for the parcel terminals. BUT in groups.
I can make a single dropdown menu but it gets difficult to navigate with so many parcel terminals. So there needs to be a way to categorize them.

So i need to add OPTGROUP and OPTION to the dropdown. How can i go about doing that? Any ideas?

I hope i explained myself well enough.

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

  • Posts: 26
  • Thank you received: 1
8 years 5 months ago #242092

I have tried to add subzones so states but i can not seem to show a custom field that would show subzones after i choose a state. Ideas?

I allso tried to figure out a way to add optgroup option to com_hikashop\views\field\tmpl\form.php
Any help here on what i need to change? im guessing it is not the only file that needs to be edited for OPTGROUP option

Still can not figure this out :D
stackoverflow.com/questions/13489498/how...ectbox-with-optgroup

Last edit: 8 years 5 months ago by jackinthex.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 5 months ago #242115

Hi,

So I suppose that you'r trying to do such selection with a custom field of the table "order".
I think that's a good idea.
The simplest will be to edit the file "custom_fields" of the view "checkout" via the menu Display>Views.
There, you'll get the dropdown HTML in the return of the function call:

$this->fieldsClass->display(
			$oneExtraField,
			$this->$type->$fieldName,
			'data['.$type.']['.$fieldName.']',
			false,
			' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type.'\',0);"'
		);
so just add some str_replace on that HTML to insert your optgroup in the dropdowns where you need them.

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

  • Posts: 1119
  • Thank you received: 114
8 years 5 months ago #242191

Hi,

I am looking to have this too. I only need single dropdown menu for shipping method.
@jackinthex are u willing to share your method/plugin? Or this could be done much simplier. However i couldnt find how to.

Thanks

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

  • Posts: 26
  • Thank you received: 1
8 years 5 months ago #242202

PHP is quite new to me. I can read HTML and CSS but not PHP.
I can not figure out where and how should i add str_replace.

I get the idea you are throwing at me.(or maybe im understading incorectly) And it should work.
Can you please give me an example for any random option in dropdown replaced to optgroup. I need around ~12 optgroups in total. I can understand replacing 1 option to optgroup but not more then that with str_replace

In the dropdown i will have 112 locations in total. I will enter them in SQL
And all the 112 locations will be in about 12-13 optgroups.


My first idea was to have a checkbox in the backend for OPTRGOUP. Or a Single Dropdown with optgroup option so it would be very easy to enter everything in SQL
But if i understand your idea correctly it will still be doable and not too much extra work. I just do not understand how to implement it.



kyratn wrote: Hi,

I am looking to have this too. I only need single dropdown menu for shipping method.
@jackinthex are u willing to share your method/plugin? Or this could be done much simplier. However i couldnt find how to.

Thanks


Have not gotten it to work yet. But i will share once i figure it out. Nicolas will probably explain it to us :)

Last edit: 8 years 5 months ago by jackinthex.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 5 months ago #242231

Hi,

Here is a simple example, supposing that you have the HTML of a dropdown in the variable $html with only two groups and no class, ids, in the HTML tags:

$html = str_replace(
 array(
   '<select>',
   'my first group last option text</option>',
   'my second group last option text</option>'
 ),
 array(
   '<select><optgroup label="first group name">',
   'my first group last option text</option></optgroup><optgroup label="second group name">',
   'my second group last option text</option></optgroup>'
 ),
 $html
);

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

  • Posts: 1119
  • Thank you received: 114
8 years 5 months ago #242249

Hi,

Thanks for share, but I think this should be added to hikashop shipping plugin itself not custom field view.
I could take one of hikashop shipping plugins and customize it to my needs but problem is that I don't know how to add it that these options/terminal addresses could be added in plugin so buyer could choose and after order, it should be shown in back-end order view so I would know which terminal buyer has chosen.

Thanks

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

  • Posts: 26
  • Thank you received: 1
8 years 5 months ago #242257

I agree. Ideal would be a shipping plugin.
Right now im using custom field/address. I can view in backend what the customer has selected.
I tryed to add dropdown menu to shipping method description but that info will not be relayed back to me. If it would be saved then it would solve all the problems :P

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

  • Posts: 12953
  • Thank you received: 1778
8 years 5 months ago #242272

Hello,
There is actually no option in Hikashop to do that and developing it will require a lot of work and modification on the current Hikashop version, so using the solution that Nicolas gave you using "Order" custom fields will probably be the best in your case.

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

  • Posts: 26
  • Thank you received: 1
8 years 5 months ago #242413

So i thought i was done with this problem and managed to make a workaround.
But now i stepped on another problem

Custom field from Aadress does not display on Shipping invoice nor invoice. What do i need to add to invoice and shipping invoice to display custom field?
I need that info for shipping. It displays fine on backend shipping and billing info but not invoice. Am i missing a checkbox somewhere?

This is in invoice.php But id does not display custom fields added to address.

Last edit: 8 years 5 months ago by jackinthex.

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

  • Posts: 1119
  • Thank you received: 114
8 years 5 months ago #242414

Hi,

Sorry for off topic but its seems there is a plenty Omniva modules created for Magento, Wordpress but non for hikashop.
Its kinda frustrating that we have to do it by our self and hikashop has only few shipping/payment plugins available by default. How old is hikashop, 4-5 years? I think in that time there could be more integration in this. Even Virtuemart has more...
No shipping plugin with dropdown option/selection? I don't think that terminals are popular only in Baltic States....

Simple link: en.e-abi.ee/catalogsearch/result/?___sto...iva&___from_store=lt
And omniva: www.omniva.lt/widget/

If we could get one of these modules then maybe someone could convert it to hikashop.
As my template is compatible with wordpress, sometimes I think to migrate from Joomla/hikashop and have all integrations wordpress offer. This would be cheaper then creating everything for hikashop by my self or pay someone....

Thanks

Again sorry for off topic...

Last edit: 8 years 5 months ago by kyratn.

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

  • Posts: 12953
  • Thank you received: 1778
8 years 5 months ago #242433

Hello,

@jackinthex

Custom field from Aadress does not display on Shipping invoice nor invoice. What do i need to add to invoice and shipping invoice to display custom field?

The solution will be to add your field on the "address_template" file of the "Order" view of your back-end template via "Hikashop->Display->Views".

@kyratn

Thanks for your feedback.

The following user(s) said Thank You: jackinthex

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

  • Posts: 26
  • Thank you received: 1
8 years 5 months ago #242487

kyratn wrote: Hi,

Sorry for off topic but its seems there is a plenty Omniva modules created for Magento, Wordpress but non for hikashop.
Its kinda frustrating that we have to do it by our self and hikashop has only few shipping/payment plugins available by default. How old is hikashop, 4-5 years? I think in that time there could be more integration in this. Even Virtuemart has more...
No shipping plugin with dropdown option/selection? I don't think that terminals are popular only in Baltic States....

Simple link: en.e-abi.ee/catalogsearch/result/?___sto...iva&___from_store=lt
And omniva: www.omniva.lt/widget/

If we could get one of these modules then maybe someone could convert it to hikashop.
As my template is compatible with wordpress, sometimes I think to migrate from Joomla/hikashop and have all integrations wordpress offer. This would be cheaper then creating everything for hikashop by my self or pay someone....

Thanks

Again sorry for off topic...


I agree with you. I was allso thinking of jumping ship. But right now im sticking it out because i have been on hikashop from 2011. I hope someone gets the time to make the plugin. I wish i had the time to try it but right now i do not have the skills nor time to make a proper plugin.

But im on the list to buy this plugin :D Will convert back to business once its available :P

The following user(s) said Thank You: Mohamed Thelji

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

Time to create page: 0.120 seconds
Powered by Kunena Forum