Updating HikaShop has broken shipping

  • Posts: 31
  • Thank you received: 0
11 years 7 months ago #95859

Previously, I had worked with Nicholas to get the checkout address portion customized so that a user was able to enter one address for each (one shipping, one billing) and not be presented with a column of bulleted choices for each. After the update, what I see is that when I uncheck the "use same as billing" box, nothing happens. I am not sure how to fix this.

Also, the update seems to have removed many custom changes to the style sheet that I had previously made, resulting in some enormous spacing issues on the product pages that were not there before. I greatly appreciate your help.

Attachments:

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

  • Posts: 31
  • Thank you received: 0
11 years 7 months ago #95862

I was able to fix the spacing issues and some other minor style items that came up, but I still cannot get the shipping address to pop up when I uncheck the box.

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

  • Posts: 82785
  • Thank you received: 13353
  • MODERATOR
11 years 7 months ago #95868

Hi,

Regarding the CSS make sure that you make your changes via the configuration interface and not directly in the CSS file as you will loose your customizations when you update.

Regarding the shipping address, I guess that's it's a javascript error.
You should open your browser javascript error log to get the error message on that page.
Also, I see that it doesn't seam the be the default checkbox style. Is your template override the checkboxes ? That could potentially break them.

Finally, a link to the shop would help so that we can see that.

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

  • Posts: 31
  • Thank you received: 0
11 years 7 months ago #96167

Nicholas,

I had been making my changes to the CSS using the configuration interface, but somehow things still were undone during the update. No matter - I was able to get them back in line in relatively short order (though I will elaborate if I encounter additional troubles).

The Javascript console returns the following error when I uncheck the checkbox for the shipping address:

Uncaught TypeError: Cannot read property 'href' of null checkout:254
hikashopEditAddress checkout:254
onclick

The site is www.skillbuildersbooks.com . Our template (from Rocket Theme) does override some input elements, but it hasn't been a problem prior to this that I am aware of.

Thank you again for your help - you are the most responsive developer whose products I've ever worked with. This forum is invaluable.

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 7 months ago #96525

Hi,

When you uncheck the button, HikaShop would display the list of your shipping addresses.
If you just have one address, it would open the popup to add an address.
In order to open this popup, it uses the button "new" which in your case have the id "hikashop_checkout_shipping_address_edit_85".
But there is no "new" button under the billing address, maybe you modified your view and delete it.

That's why there is a javascript error.

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: 31
  • Thank you received: 0
11 years 7 months ago #96527

Jerome,

Thank you for getting back to me. I had previously hidden the New button under the billing address because the client does not want people to be able to have more than one address for billing or shipping - either the same for both, or one for each. This was working prior to the update, but perhaps it was a fluke that it worked at all.

I unhid the New button (which I disabled in the custom style sheet) so that it appears under the Billing Address portion, but that did not make the checkbox behave as expected.

This is the contents of my checkout/address_view.php. Could you let me know if anything is amiss?

<?php 
//if(!empty($this->addresses)) $this->addresses = array(reset($this->addresses));
defined('_JEXEC') or die('Restricted access'); ?>

<?php
global $Itemid;
$url_itemid='';
if(!empty($Itemid)){
  $url_itemid='&Itemid='.$Itemid;
}
$same_address = false;
if($this->shipping_address==$this->billing_address){
  $same_address = true;
}

if(!empty($this->addresses)){
?>
<table>
<?php

    $varname = $this->type.'_address';
    if(empty($this->$varname) || !isset($this->addresses[$this->$varname])){
      $first = reset($this->addresses);
      $this->$varname = $first->address_id;
    }
    $done = false;
    $nb_addresses = count($this->addresses);
    $k=0;
    foreach($this->addresses as $address){
      $this->address =& $address;
      $checked = '';
      if(($this->$varname==$address->address_id)||(empty($address->address_id) && !$done)){
        $checked = 'checked="checked"';
        $done = true;
      }
      if(empty($checked)) continue;
      if($this->config->get('auto_submit_methods',1)&&empty($checked)){
        $checked.=' onclick="this.form.submit(); return false;"';
      }
  ?>
  <tr class="<?php echo "row$k"; ?>">
    <td>
      <input id="hikashop_checkout_<?php echo $this->type;?>_address_radio_<?php echo $address->address_id;?>" class="hikashop_checkout_<?php echo $this->type;?>_address_radio" type="radio" name="hikashop_address_<?php echo $this->type;?>" value="<?php echo $address->address_id;?>" <?php echo $checked; ?> />
    </td>
    <td><label for="hikashop_checkout_<?php echo $this->type;?>_address_radio_<?php echo $address->address_id;?>" style="cursor:pointer;">
      <span class="hikashop_checkout_<?php echo $this->type;?>_address_info">
  <?php
      $params = null;
      $js = '';
      $html = hikashop_getLayout('address','address_template',$params,$js);
      foreach($this->fields as $field){
        $fieldname = $field->field_namekey;
        $html=str_replace('{'.$fieldname.'}',$this->fieldsClass->show($field,$address->$fieldname),$html);
      }
      echo str_replace("\n","<br/>\n",str_replace("\n\n","\n",preg_replace('#{(?:(?!}).)*}#i','',$html)));
  ?>
      </span>
      </label>
    </td>
    <td>
      <span class="hikashop_checkout_<?php echo $this->type;?>_address_buttons">
        <?php if($nb_addresses>1){ ?>
          <a title="<?php echo JText::_('HIKA_DELETE'); ?>" class="hikashop_checkout_<?php echo $this->type;?>_address_delete" href="<?php echo hikashop_completeLink('checkout&step='.$this->step.'&redirect=checkout&task=deleteaddress&address_id='.$address->address_id.'&'.JUtility::getToken().'=1'.$url_itemid);?>"><img alt="<?php echo JText::_('HIKA_DELETE'); ?>" src="<?php echo HIKASHOP_IMAGES; ?>delete.png" border="0" /></a>
        <?php }
        ?>
        <a title="<?php echo JText::_('HIKA_EDIT'); ?>" class="modal hikashop_checkout_<?php echo $this->type;?>_address_edit" rel="{handler: 'iframe', size: {x: 450, y: 480}}" href="<?php echo hikashop_completeLink('address&task=edit&redirect=checkout&address_id='.$address->address_id.'&step='.$this->step.'&type='.$this->type.$url_itemid,true);?>" onclick="return hikashopEditAddress(this,<?php echo (int)$same_address?>,false);"><img alt="<?php echo JText::_('HIKA_EDIT'); ?>" src="<?php echo HIKASHOP_IMAGES; ?>edit.png" border="0" /></a>
      </span>
    </td>
  </tr>
  <?php
      $k = 1-$k;
    }
?>
</table>
<?php
}else{
  $app =& JFactory::getApplication();
  $app->enqueueMessage( JText::_('CREATE_OR_SELECT_ADDRESS') );
}
?>
<span id="hikashop_checkout_<?php echo $this->type;?>_address_new" class="hikashop_checkout_<?php echo $this->type;?>_address_new">
  <?php $html = $this->cart->displayButton(JText::_('HIKA_NEW'),'new',$this->params,'','var link = document.getElementById(\'hikashop_checkout_'. $this->type.'_address_new_link\'); if(link) return hikashopEditAddress(link,'.(int)$same_address.',true); return false;');
  if(strpos($html,'<a')!==false) echo $html; ?>
  <a id="hikashop_checkout_<?php echo $this->type;?>_address_new_link" rel="{handler: 'iframe', size: {x: 450, y: 480}}" href="<?php echo hikashop_completeLink('address&redirect=checkout&task=add&step='.$this->step.'&type='.$this->type.$url_itemid,true);?>" onclick="return hikashopEditAddress(this,<?php echo (int)$same_address; ?>,true);">
    <?php if(strpos($html,'<a')===false) echo $html; ?>
  </a>
</span>

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

  • Posts: 82785
  • Thank you received: 13353
  • MODERATOR
11 years 7 months ago #96726

Instead of changing the code in the view, you could have simply use CSS to hide the new button:
.hikashop_checkout_billing_address_new, .hikashop_checkout_shipping_address_new {display:none;}

That way, no view modification so you would be sure to not have such issues with the updates.

Also, instead of trying to put back the way it was, go on the listing of the views and click on the "remove customization" icon for that view file and that will put the default view file of the latest version. That way, you'll be sure whether or not it comes form that view file modifications.

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

  • Posts: 31
  • Thank you received: 0
11 years 7 months ago #96739

Nicholas,

Thank you for your reply.

I actually did hide the button using CSS, using the exact code you mentioned. Earlier, you helped me work out a fix for the checkout screen that got the addresses to work the way our client wanted. If I remove the customizations, that functionality will revert to the way it was, and I am concerned that I will not be able to customize it again to get things back to the way they were.

Would you be able to tell me if there is anything in the view that is incorrect? If that is not the best way to proceed, just let me know.

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

  • Posts: 82785
  • Thank you received: 13353
  • MODERATOR
11 years 7 months ago #97234

Then, before removing the customization, simply copy/paste the code of the view file in a text file on your local computer and if that doesn't help, you can always revert.

I can't comment on that code. I don't even know from which version it comes so I can't compare with the code of the same view file on my end since the code changed numerous times since the first version of HikaShop.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum