How to get form return value to stay on same page for cart module

Phoca Cart - complex e-commerce extension
maintainthedomain
Phoca Member
Phoca Member
Posts: 46
Joined: 21 Sep 2018, 11:34

How to get form return value to stay on same page for cart module

Post by maintainthedomain »

Hi

I added a delete button to the cart module (extracted from cart_checkout.php) ...it seemed to work at first, but now I realized that the page jumps back to index.php (without parameters) every time I delete an item because the return value of the form is not set...

I tried to set it to $_SERVER['PHP_SELF'] and JUri(...) and what not without luck...the best result so far I got with $_SERVER['HTTP_REFERRER']...
(all base64 encoded...)

Also tried to use PhocacartRoute::getCategoryRoute(....); but got nowhere...

I didnt set any form action (action="") as well.

Can you give me noob again a heads-up how to solve this, so that I stay on the same page, when an item is deleted??

Thanks in advance! :)

Tags:
maintainthedomain
Phoca Member
Phoca Member
Posts: 46
Joined: 21 Sep 2018, 11:34

Re: How to get form return value to stay on same page for cart module

Post by maintainthedomain »

okay, solved this with jquery...

just used something like jQuery(".ph-cart-small-box input[name=return]").val(btoa(window.location.href))....
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How to get form return value to stay on same page for cart module

Post by Jan »

Ok, thank you for the info.

Jan
If you find Phoca extensions useful, please support the project
Post Reply