Zen Cart Logo
Forums / Other Business Topics / back link of 'ask a question success page' will be not right in same conditions

back link of 'ask a question success page' will be not right in same conditions

Views: 123

Results 1 to 6 of 6
24 Nov 2020, 8:02 PM
#1
sloan avatar

sloan

New Zenner

Join Date:
Jul 2016
Location:
China
Posts:
23
Plugin Contributions:
0

back link of 'ask a question success page' will be not right in same conditions

When I add a Captcha plugin in V157a, every thing works ok.
Just the bakc link of 'ask a question success page' always to be home page.
After alot of testing, I found that the back link of 'ask a question success page' will be affected in case the 'ask a question post page' have some thing like

<img id="captcha" src="captcha.php" onClick="this.src='captcha.php?nocache='+Math.random()" style="cursor:pointer" alt="<?php echo CAPTCHA_REFRESH; ?>" title="<?php echo CAPTCHA_REFRESH; ?>" />

it seems that the src="captcha.php" inside the page will affect the zen_back_link fucntion. so why not make change on the
\includes\templates\YOUR_TEMPLATES\templates\tpl_ask_a_question_default.php

search the code

<div class="mainContent success"><?php echo TEXT_SUCCESS; ?></div>

<div class="buttonRow"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>

And replace with

<div class="mainContent success"><?php echo TEXT_SUCCESS; ?></div>
<div class="buttonRow"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $pid) . '">' . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
24 Nov 2020, 8:22 PM
#2
sloan avatar

sloan

New Zenner

Join Date:
Jul 2016
Location:
China
Posts:
23
Plugin Contributions:
0

Re: back link of 'ask a question success page' will be not right in same conditions

The back link also maybe affected if the ask page and product page using lazyload

25 Nov 2020, 3:07 PM
#3
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: back link of 'ask a question success page' will be not right in same conditions

Does your captcha.php page or lazy loader remove itself from the navigation list? Somewhere in the header page..

$_SESSION['navigation']->remove_current_page();

You are hard coding a back link to correct navigation stacking issues, which could work if you only used ask-a-question form the product_info page. I use ask-a-question from the account_history_info page, product_auction_info page, and document_general_info page too. so hard coding a back link would be very confusing.. For me, heavy modified ZC157b the back link is going to the page it was linked from.

25 Nov 2020, 4:17 PM
#4
sloan avatar

sloan

New Zenner

Join Date:
Jul 2016
Location:
China
Posts:
23
Plugin Contributions:
0

Re: back link of 'ask a question success page' will be not right in same conditions

davewest:

Does your captcha.php page or lazy loader remove itself from the navigation list? Somewhere in the header page..

$_SESSION['navigation']->remove_current_page();

> 
> You are hard coding a back link to correct navigation stacking issues, which could work if you only used ask-a-question form the product_info page.  I use ask-a-question from the account_history_info page, product_auction_info  page, and document_general_info page too.  so hard coding a back link would be very confusing..  For me, heavy modified ZC157b the back link is going to the page it was linked from.

Thank you!
You mean add the code on captcha.php ```
$_SESSION['navigation']->remove_current_page();
```  will fix the problem, right?
25 Nov 2020, 11:48 PM
#5
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: back link of 'ask a question success page' will be not right in same conditions

sloan:

Thank you!
You mean add the code on captcha.php will fix the problem, right?

If the captcha is loading as a page or adding itself to the navigation history then yes that should help unless something else is affecting the stack. If you look at how popups are done you can see they do the same. (example, includes/modules/pages/pop_cvv_help/header_php.php) Popup help really don't need to be part of navigation history. Note that ZC157 has a built in captcha already.

26 Nov 2020, 12:36 AM
#6
sloan avatar

sloan

New Zenner

Join Date:
Jul 2016
Location:
China
Posts:
23
Plugin Contributions:
0

Re: back link of 'ask a question success page' will be not right in same conditions

davewest:

If the captcha is loading as a page or adding itself to the navigation history then yes that should help unless something else is affecting the stack. If you look at how popups are done you can see they do the same. (example, includes/modules/pages/pop_cvv_help/header_php.php) Popup help really don't need to be part of navigation history. Note that ZC157 has a built in captcha already.

Thanks again, I see how navigation history works on ZC157 now.
Are you serious that ZC157 has captcha already? I am using 1.5.7a, but I did see any configurations about captcha, how to set it working?