- Posts: 109
- Thank you received: 5
Redirect URL On Address Save Failure
11 years 8 months ago #188348
by Ed_Hika
Redirect URL On Address Save Failure was created by Ed_Hika
-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6
Hello, there.
Good evening!
I am trying to change the redirection of the address/form.php on failure when the "OK" button is clicked.
When a mandatory field is not populated and the "OK" button is clicked, the URL is directed to something like "/index.php?option=com_hikashop&ctrl=address&Itemid=160&lang=en".
I would like the URL to be directed to something like "/index.php?option=com_hikashop&ctrl=address&layout=listing&view=address&Itemid=160&lang=en".
How can this be achieved?
I tried changing the following code in address/form.php from
to
Thanks.
Take care!
-- Joomla version -- : 3.3.6
Hello, there.
Good evening!
I am trying to change the redirection of the address/form.php on failure when the "OK" button is clicked.
When a mandatory field is not populated and the "OK" button is clicked, the URL is directed to something like "/index.php?option=com_hikashop&ctrl=address&Itemid=160&lang=en".
I would like the URL to be directed to something like "/index.php?option=com_hikashop&ctrl=address&layout=listing&view=address&Itemid=160&lang=en".
How can this be achieved?
I tried changing the following code in address/form.php from
Code:
echo $this->cart->
...
hikashop_completeLink('address&task=save')
...;
to
Code:
$strTask = 'address&task=save&view=address&layout=listing&Itemid=' . $Itemid;
$strURL = hikashop_completeLink($strTask);
...
echo $this->cart->
...
hikashop_completeLink($strURL)
...;
Thanks.
Take care!
Please Log in or Create an account to join the conversation.
11 years 8 months ago #188374
by Xavier
Replied by Xavier on topic Redirect URL On Address Save Failure
Hi,
The changes need to be done in the file "components/com_hikashop/controller/address.php" function "save()" and not in the view "address / form".
But why do you want to have this kind of url ?
The changes need to be done in the file "components/com_hikashop/controller/address.php" function "save()" and not in the view "address / form".
But why do you want to have this kind of url ?
Please Log in or Create an account to join the conversation.
11 years 8 months ago #188699
by Ed_Hika
Replied by Ed_Hika on topic Redirect URL On Address Save Failure
Thanks, Xavier.
You are right - why do I want that? I have since discovered that the URL wasn't my problem (at least that's the stage of my investigation so far).
Basically, I have changed address/listing.php and address/form.php to list multiple addresses and not have them popped up.
Everything works fine except for when mandatory fields is not filled in. When this happens and the "OK" button is clicked on to save, error messages are displayed in the Joomla! system message area. These messages are displayed together (unlinke Hikashop's popup messages).
The problem is that when these messages appear, the page does not contain the website's logo, header, footer, etc..
Please could you let me know where Hikashop (which file) throws up the error messages (when the mandatory fields for addresses are not filled in)?
Thanks.
Take care!
You are right - why do I want that? I have since discovered that the URL wasn't my problem (at least that's the stage of my investigation so far).
Basically, I have changed address/listing.php and address/form.php to list multiple addresses and not have them popped up.
Everything works fine except for when mandatory fields is not filled in. When this happens and the "OK" button is clicked on to save, error messages are displayed in the Joomla! system message area. These messages are displayed together (unlinke Hikashop's popup messages).
The problem is that when these messages appear, the page does not contain the website's logo, header, footer, etc..
Please could you let me know where Hikashop (which file) throws up the error messages (when the mandatory fields for addresses are not filled in)?
Thanks.
Take care!
Please Log in or Create an account to join the conversation.
11 years 8 months ago #188905
by Ed_Hika
Replied by Ed_Hika on topic Redirect URL On Address Save Failure
Hello, Xavier.
Good evening!
Please ignore the previous request. I have since discovered the reason why the error messages show up on a page without the header, footer, etc..
Hikashop has the following nifty piece of code in address/form.php.
By removing it, the error message display correctly.
Please could you help explain the following, though.
Why does Hikashop throw up a Joomla! Message (instead of a Joomla! Error) when the mandatory field Country is not populated on creation/save of an address (like all the other mandatory fields, for example, Street, City, Postcode and Telephone)?
Please see attached.
More importantly, how can I configure/customise Hikashop to ensure that the Joomla! Message for a blank Country will return a Joomla! Error instead?
Thanks.
Take care!
Good evening!
Please ignore the previous request. I have since discovered the reason why the error messages show up on a page without the header, footer, etc..
Hikashop has the following nifty piece of code in address/form.php.
Code:
<input type="hidden" name="tmpl" value="component"/>
By removing it, the error message display correctly.
Please could you help explain the following, though.
Why does Hikashop throw up a Joomla! Message (instead of a Joomla! Error) when the mandatory field Country is not populated on creation/save of an address (like all the other mandatory fields, for example, Street, City, Postcode and Telephone)?
Please see attached.
More importantly, how can I configure/customise Hikashop to ensure that the Joomla! Message for a blank Country will return a Joomla! Error instead?
Thanks.
Take care!
Please Log in or Create an account to join the conversation.
11 years 7 months ago #191630
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Redirect URL On Address Save Failure
Hi,
We do not have to generate a Joomla error because it's not a huge error which should stop the processing of the page ; it's not a 500 or a 403 ; it's just some mandatory fields...
And the address is not created, so I don't see where is the issue.
Regards,
We do not have to generate a Joomla error because it's not a huge error which should stop the processing of the page ; it's not a 500 or a 403 ; it's just some mandatory fields...
And the address is not created, so I don't see where is the issue.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.214 seconds