Shipping Same Address Checkbox having issues

  • Posts: 66
  • Thank you received: 0
10 years 5 months ago #182475

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6

Hello,

I tried including the checkbox. But when I check 'Use the same address as for billing", then I get the errors even the Billing Address fields are filled up properly. Please see the attached screenshot for the error.




Requesting you to Kindly look into this asap

Thank You,

Gaurav

Attachments:

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

  • Posts: 83832
  • Thank you received: 13572
  • MODERATOR
10 years 5 months ago #182527

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

  • Posts: 66
  • Thank you received: 0
10 years 5 months ago #184037

Hi according to your given suggestion I tried to follow the instructions given in your link, that is:

Change the code:
$currentTask = 'shipping_address';
if( (empty($task) || $task == $currentTask) && !empty($data[$currentTask])) {

to:
$same_address = JRequest::getString('same_address');
$currentTask = 'shipping_address';
if( (empty($task) || $task == $currentTask) && !empty($data[$currentTask]) && $same_address != 'yes') {

in the file administrator/components/com_hikashop/classes/address.php and that should fix the problem.


But after doing this, the page becomes completely blank, nothing comes up. When I restore the original file without the above suggested modification, it works normally as it would. But the problem of the error despite of selecting the checkbox remains same.

PLEASE GUIDE!!!

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

  • Posts: 83832
  • Thank you received: 13572
  • MODERATOR
10 years 5 months ago #184056

Hi,

It means that there is a bug if you have a blank page.
Please try again and do a screenshot of your code modification and turn on the "error reporting" and "debug mode" options of the Joomla configuration and if you get the blank page, it will display an error message that you can give us so that we can tell you what's wrong.

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

  • Posts: 66
  • Thank you received: 0
10 years 5 months ago #184102

Change the code:
$currentTask = 'shipping_address';
if( (empty($task) || $task == $currentTask) && !empty($data[$currentTask])) {

to:
$same_address = JRequest::getString('same_address');
$currentTask = 'shipping_address';
if( (empty($task) || $task == $currentTask) && !empty($data[$currentTask]) && $same_address != 'yes') {

in the file administrator/components/com_hikashop/classes/address.php and that should fix the problem.


According to your instructions, I made the changes to the address.php and enabled the error reporting in joomla configuration to check why it is not working. Here is the error I got.

Parse error: syntax error, unexpected 'defined' (T_STRING) in /home/pponline3/public_html/administrator/components/com_hikashop/classes/address.php on line 1

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

  • Posts: 83832
  • Thank you received: 13572
  • MODERATOR
10 years 5 months ago #184130

Please zip the file /home/pponline3/public_html/administrator/components/com_hikashop/classes/address.php and provide the zip so that we can see what you did.

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

  • Posts: 66
  • Thank you received: 0
10 years 5 months ago #184221

I have zipped the two address.php files one, which is the original from hikashop and the other one which is modified according to the instructions given here. That is according:

Change the code:
$currentTask = 'shipping_address';
if( (empty($task) || $task == $currentTask) && !empty($data[$currentTask])) {

to:
$same_address = JRequest::getString('same_address');
$currentTask = 'shipping_address';
if( (empty($task) || $task == $currentTask) && !empty($data[$currentTask]) && $same_address != 'yes') {

in the file administrator/components/com_hikashop/classes/address.php and that should fix the problem.


Please find attached zip file.

Attachments:

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

  • Posts: 83832
  • Thank you received: 13572
  • MODERATOR
10 years 5 months ago #184229

Hi,

The issue is that when you edited the file, your text editor replaced all the \r\n (compatible with all the OSes) in the file with only \r (on a mac I suppose) and that your server only sees the \n (a linux based server).
Because of that, your server thinks that all the code of the file is on one line and crashes when processing it.
Here is a zip with your modified file where I converted back the \r to \r\n

File Attachment:

File Name: address_20...2-23.zip
File Size:3 KB

Here is more information about \r and \n and issues with them:
en.wikipedia.org/wiki/Newline

Attachments:

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

Time to create page: 0.073 seconds
Powered by Kunena Forum