Skip to main content

Shipping Same Address Checkbox having issues

More
11 years 9 months ago #182475 by magicwords
-- 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

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

More
11 years 9 months ago #182527 by nicolas

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

More
11 years 9 months ago #184037 by magicwords
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.

More
11 years 9 months ago #184056 by nicolas
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.

More
11 years 9 months ago #184102 by magicwords

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.

More
11 years 9 months ago #184130 by nicolas
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.

More
11 years 9 months ago #184221 by magicwords
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.

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

More
11 years 9 months ago #184229 by nicolas
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
This attachment is hidden for guests.
Please log in or register to see it.

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

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

Time to create page: 0.221 seconds
Powered by Kunena Forum