Delete an item from the cart module
- eMicroMart
-
Topic Author
- Offline
-- HikaShop version -- : 2.1.3
-- Joomla version -- : 3.1.5
-- PHP version -- : 5.4
JoomSEF + Hikashop
I have a problem with a cart module when I edit part of SEF URL to include Thai language.
If I don't include Thai in URLs or turn JoomSEF off, everything is perfect.
When I included Thai language in the URL, I found that something wrong with Base64 encode and decode.
\components\com_hikashop\views\product\tmpl\cart.php
line: 329 .... urlencode(base64_encode(urldecode($this->params->get('url'))))
When I tried to decode the result of line: 329, I got a very weird URL. Not the right URL.
No matter what I set the "URL when the cart is empty" or not, it happens when I include Thai in URLs.
Do you have any idea? Does Base64 support Thai characters ( UTF-8 ) ?
Thanks
Please Log in or Create an account to join the conversation.
- eMicroMart
-
Topic Author
- Offline
Can I just put base64_encode($this->params->get('url')) ?
Please Log in or Create an account to join the conversation.
- eMicroMart
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
- eMicroMart
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
- eMicroMart
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
- eMicroMart
-
Topic Author
- Offline
base64_decode(urldecode(url))
Anyway, I think the problem comes from how hikashop decode the return_url when users delete an item from the cart module. Could you help me, please?
Please Log in or Create an account to join the conversation.
- eMicroMart
-
Topic Author
- Offline
From the line 422 in C:\xampp\htdocs\thaioptics\components\com_hikashop\controllers\product.php
$url = JRequest::getVar('url','');
it returns the wrong URL. I found that getVar gets the url varialble from superglobal $_REQUEST.
The url in the $_REQUEST is already encoded but the encoded url is wrong when the url has some Thai characters.
Although, I know what happens but I still have no idea how to fix it. :sick:
Please Log in or Create an account to join the conversation.
I don't think that changing such code will help in any way.
Note that in all your messages, you didn't say once what was your problem... so it's hard to help you.
You just said that the URLs were wrong but you didn't give any links so we can't even see what's going on. What are the URLs that don't work when the SEF is turned off ? Why do you think that the problem is in hikashop and not in JoomSEF (it's joomsef which handles the SEFing of the URLs so I would consider that to be a problem with JoomSEF not HikaShop actually) ?
Please Log in or Create an account to join the conversation.
- Posts: 5
- Thank you received: 0
Regarding the discussed problem. I'm also encountering a problem with the delete X button in the Cart module when SEF is on in the global configuration of Joomla. What happens is that after deleting there is a redirect to photonland.nl/photonland.nl/hikashop-men...y/15-polykristallijn while this should be photonland.nl/hikashop-menu-for-categori...y/15-polykristallijn . This results in a 404 error. When SEF is off the problem doesn't occur and there is only one time "photonland.nl". Any good advice how to proceed? Is this a Joomla problem?
Thanks for helping me out!
Regards
Frans
Please Log in or Create an account to join the conversation.
- eMicroMart
-
Topic Author
- Offline
Anyway, let's me guess
Please Log in or Create an account to join the conversation.
- Posts: 5
- Thank you received: 0
Half an hour ago I made "Live site" empty and indeed that did the trick (found the proposal on another topic as well). I don't want to go to a predefined website but stay on the same website. Regarding Joomla 1.5, I'm up to date on the latest version of 2.5.
However, all my Google hits are broken now :S
Isn't it possible to fix this in the php code of product instead?
Thxs Frans
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Posts: 5
- Thank you received: 0
LiveSite is set as follows: public $live_site = ' photonland.nl ';
However after making my Cart empty in the Cart Module it tries to open the following page: " photonland.nl/photonland.nl/hikashop-men...y/15-polykristallijn ", which is causing a 404 article not found error because of the double/extra generated "photonland.nl"
When I set LiveSite to public $live_site = '' and after making the Cart Module empty, " photonland.nl/photonland.nl/hikashop-men...y/15-polykristallijn " is not causing an error anymore. But now every and any article on the site starts with " photonland.nl/photonland.nl/../ .. , so for me this is a solution, but not a very clean and good one.
When I set SEF friendly URL option to "No" in the joomla configuration settings and after making the Cart Module empty the URL "returned" is " photonland.nl/index.php?option=com_hikas...istallijn&Itemid=266 ", which is exactly the same URL as before emptying the Cart Module.
I'm not an experienced PHP programmer (in my younger day's I used to program a lot though), but what I don't understand is that Joomla SEF only in combination with Hikashop returns an extra "photonland.nl/" in the beginning. :blink:
I must be missing something, clearly there is a lot left to learn for me in PHP and Joomla ...
Maybe a very stupid question but isn't it possible to cut/peel of the first "photonland.nl" off the string? I tried to find the location but there was "encoding" and "decoding" there and I have no experience with Apache and PHP at all. So for me it's only speculating what is going on there :huh: (did some adaption at another place though for layout purpose, needed product width set to 50% instead of 49% and found the right place to do so
However, compliments for Hikashop so far. Looks very good! Everything is working fine (except for above) in combination with responsive Joomlart template (Virtuemart directly caused unwanted behaviour).
Regarding my problem, my website is www.photonland.nl
Thanks in advance for your answer!
Regards Frans
Please Log in or Create an account to join the conversation.
- Posts: 5
- Thank you received: 0
Trying to paste it one more time:
"public $live_site = ' photonland.nl ';"
Regards,
Frans
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Posts: 5
- Thank you received: 0
Just tried that option. But it doesn't make a difference for the Hikashop Cart Module. I set the URL in the configuration screen for the cart to " photonland.nl/index.php?option=com_hikas...t=listing&Itemid=266 ".
But to make things clear, the problem is not related to Cart is empty. For instance, when I have two types of items X and Y displayed in the Hikashop Cart Module and I have ordered every item one time. So quantity of X=1 and Y=1 and with the delete button (x) I want to remove item X. After doing so the Cart is not empty. What happens is the following. When I click the remove button for item X in the Hikashop Cart Module you can see that the quantity is correctly set to "0". Then a split second later a referral to " photonland.nl/photonland.nl/hikashop-men...y/15-polykristallijn " takes place and this URL is wrong while it contains one "photonland.nl" too much. So the 404 screen pops up. URL should be "http:///photonland.nl/hikashop-menu-for-categories-listing/category/15-polykristallijn" in order to make things correctly working.
Regards Frans
Please Log in or Create an account to join the conversation.
I just wanted to try your shopping cart, but the given links returns 404 error, and there is no more products in the webshop part.
Thanks to put back products in order to test and debug the problem.
Please Log in or Create an account to join the conversation.
To clarify, the right redirection URL after a delete from the cart module would be:
http:www.domain_name/shopping-cart.html
instead I am redirected to a URL that includes my sub-directory:
http:www.domain_name/HESCOM/shopping-cart.html
When SEF is turned off in the Joomla Global Configuration it all works OK. So when I delete the product from the cart module I am redirected to the same page, the cart module page, and the product is gone.
I have tried everything suggested on this thread. I would appreciate any suggestions. Thanks!
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Finally, I decided to just use the Joomla's Redirection Manager and that solved the problem. I'm OK with this solution only because the cart module page is the only one with this problem. If you see a problem with this solution I would appreciate the input. Thanks!
Please Log in or Create an account to join the conversation.