State dropdown not displaying

  • Posts: 9
  • Thank you received: 0
11 years 7 months ago #96612

Hello all. I'm getting a javascript error on my hikashop + joomla website. When I go to checkout and when I input the address the state dropdown box doesn't display but "State:*" is displayed. I've checked the address_template view and it calls the address_state which is what the column name is in custom field name.

When I view the console log in chrome I get these errors:

function addControls() {
	var container = document.id('fontsize');
	var content = '<h3>'+ fontSizeTitle +'</h3><p><a title="'+ biggerTitle +'"  href="#" onclick="changeFontSize(2); return false">'+ bigger +'</a><span class="unseen">.</span><a href="#" title="'+resetTitle+'" onclick="revertStyles(); return false">'+ reset +'</a><span class="unseen">.</span><a href="#"  title="'+ smallerTitle +'" onclick="changeFontSize(-2); return false">'+ smaller +'</a></p>';
	container.set('html', content);
Uncaught TypeError: Cannot call method 'set' of null
}

Uncaught TypeError: Cannot call method 'set' of null md_stylechanger.js:66
The page at www.olmecapparel.com/products/checkout/step/step-0 displayed insecure content from olmecapparel.com/index.php?option=com_hi...tates_of_America_223 .
hikashop.js:239
The page at www.olmecapparel.com/products/checkout/step/step-0 displayed insecure content from www.olmecapparel.com/index.php?option=co...tates_of_America_223 .


Seems as if it might be blocked by Chrome from displaying because it is deemed insecure? Not certain if the TypeError is the culprit either.

Any help is appreciated

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

  • Posts: 12953
  • Thank you received: 1778
11 years 7 months ago #96646

Hi,

1. Did you made some hikashop's files/views customization ? if yes, what were these customization ?

2. Can you give me a temporary access to your website, then I'll be able to reproduce the problem ?

Thank you.

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

  • Posts: 9
  • Thank you received: 0
11 years 7 months ago #96653

I sent you the login information in a private message.

I haven't made any views changes as of yet. I was browsing through some as I was trying to get a gist of what they did for when I did though, as I'm new to joomla and hikashop.

From looking at the contents of that javascript error message it seems it may be from me editting my main page template. I removed the links that allowed you to increase the font size from the header. I'm not certain if it is looking for that component and isn't finding it. I googled how to remove it and deleted

$doc->addScript($this->baseurl.'/templates/beez5/javascript/md_stylechanger.js', 'text/javascript', true);
from the main page template and no longer have the error message.

After doing so it still isn't displaying the dropdown.

Thanks for the help.

Last edit: 11 years 7 months ago by midgetwithamatch.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #96811

Hi,

Generally to solve this problem, you have to publish back the "france" zone.
Go in Display > Custom fields, change the default value for "address_country" to france, save. Then set again your default zone, save.
Edit the custom field "address_state" and change it's default value to the desired one of the selected country.

And unpublish the zone "france". (if you want to disable it).

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

  • Posts: 9
  • Thank you received: 0
11 years 7 months ago #96959

I went and set the default zone to France and then saved.

What do you mean by "Then set again your default zone, save." Do you mean set it to France again or set it to whatever I want my default zone to be then save?

If you mean the second then I set it to United States and saved and it still didn't show. I then went through and set the default zone to France and unpublished just that custom field and the state dropdown still doesn't show.

What I'm assuming is happening is that I'm forcing SSL https on checkout and it is attempting to load information from an http url and is considering that content insecure? But I'm assuming that assumption is not correct since it is loading the country drop down from an http url...


Well either way I'm still working on getting it sorted out. I appreciate the help thus far. Xavier if you want the login info to the site I can give it to you as well.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 7 months ago #97072

Hi,

I too think that it comes from the HTTPS/HTTP issue.

If you turn off the SSL, it should work fine right ?
In that case, it's definitely coming for that.
The system uses the joomla library to generate the URL for the dropdown retrieval. So it's not an issue in HikaShop.
I'm guessing that maybe you configured a live site in your configuration.php and you didn't put https but http in it and so joomla is generating the URL with http for the dropdown. So you shoudl check on that.

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

  • Posts: 9
  • Thank you received: 0
11 years 7 months ago #97096

Thanks nicolas, I disabled the force SSL on checkout. I no longer get the error message or warning message about it displaying insecure content when I attempt to show the address modification page but the state dropdown still isn't being displayed. Here is the html. It seems that according to what I have set it is pulling the default address_state. My configuration is this: address_country default zone set to France and is published, address_state default zone set to Ain and is published.

Which views affect the address window? I'm assuming address -> address_template, address -> form, and address -> listing? Do you think I went through and just recopied over those files with ones from a fresh hikashop rar it would do anything or be helpful?

        <tr class="hikashop_address_address_state_line" id="hikashop_address_address_state">
          <td class="key">
            <label for="address_state">State</label>          
          </td>
          <td>
            <span id="data_address_address_state_container"></span><input type="hidden" id="data_address_address_state_default_value" name="data_address_address_state_default_value" value="state_Ain_1306"> <span class="hikashop_field_required">*</span>          
          </td>
        </tr>

You are correct that in my configuration.php I have the 'http' url set but that was because I don't want to force SSL for the entire site which I'm assuming if I were to change it to 'https' it would?

Last edit: 11 years 7 months ago by midgetwithamatch.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 7 months ago #97128

You should edit your country field, set the default value to the country you want and save, then edit the state field, select the default value you want and save.

That should make the system load the proper fields.

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

  • Posts: 9
  • Thank you received: 0
11 years 7 months ago #97198

I already had it set to United States and to Alabama but when Xavier told me to change the default zone to France that's what I did and just left it that until I could at least get it to display.

I just went through set it to United States and to Alabama. Still not displaying which was the settings I had when I initially posted.

Another thing to add is that if I click the link in the error message about the state dropdown it displays the state drop down but just by itself. The link I'm referring to is: /index.php?option=com_hikashop&ctrl=checkout&task=state&Itemid=134&tmpl=component&field_type=address&field_id=data_address_address_state&field_namekey=address_state&namekey=country_United_States_of_America_223

Last edit: 11 years 7 months ago by midgetwithamatch.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 7 months ago #97323

Hi,

I think that you have a configuration which specify the base url of your website because the web call for the dropdown is not correct.
You have server rule (in your apache, thanks to an htaccess I guess) which redirect the user from "yourdomain" to " www.yourdomain ".

Problem is that, the configuration specify that the website is on "yourdomain".
So, the ajax call is made from " www.yourdomain " to "yourdomain" and the server redirect the call to " www.yourdomain " which is kept as a security issue for the browser.

You just have to configure the right website url (so with the "www") and the ajax call will work fine.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 9
  • Thank you received: 0
11 years 7 months ago #97461

Interesting, I do indeed have a redirect in my htaccess that redirects any none www to www! Never thought that would affect anything on the site explicitly.

It took me a few tries to get it to allow me to override the configuration, finally deleted it and the uploaded the changed configuration file but once I did the state drop down displayed on the first refresh of the website. I'm a happy camper!

Thanks everyone for helping me get this sorted out. You helped me solve a couple problems along the way.

You can mark this topic as solved :lol:.

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

Time to create page: 0.091 seconds
Powered by Kunena Forum