0

linking my pages using permalinks so that when i upload everything to the live server i would have all my pages to connected but having one problem with this page.

the permalink is:

http://localhost/wordpress/checkout/

and when i use:

$thischeckout = WC()->cart->get_checkout_url();
echo esc_html( $thischeckout ); 

or

echo $thischeckout; 

i do get the permalink correctly as so:

http://localhost/wordpress/checkout/

but when i place that in href it redirects me to a wrong page:

href="<?php echo $thischeckout?>‎‎"

or

href="<?php echo WC()->cart->get_checkout_url()?>‎‎"

or

href="<?php echo esc_html($thischeckout)?>‎‎"

the wrong url that i am getting is:

http://localhost/wordpress/checkout/%E2%80%8E%E2%80%8E

any hints what might be causing the problem would be appreciated thanks in advance

Hazo
  • 33
  • 1
  • 7

2 Answers2

0

It looks like this may have been answered here

Wordpress putting %E2%80%8E at the end of my url, howcome?

It looks to be a copy and paste issue?

More detail from that post:

Step 1) Identify the link, and open the post or page it appears on in the WordPress Dashboard.

Step 2) We need to delete the invisible character causing the issue, so delete the last several characters from the URL, including the quotation mark, so that this Step 3) Manually retype what was deleted.

Step 4) Click Update then go and check the revised post to confirm the problem is resolved.

https://www.wpkb.com/fix-wordpress-links-%E2%80%8E-end/

adprocas
  • 1,863
  • 1
  • 14
  • 31
0

You are not giving space between $thischeckout and ?>‎‎ also you are missing the semicolon.

href="<?php echo $thischeckout; ?>‎‎"

It might work.!!!

Logan Young
  • 385
  • 2
  • 9