S
S
SHKD2020-03-20 12:21:49
htaccess
SHKD, 2020-03-20 12:21:49

How to create a clickable link with Woocommerce parameters collection?

Hello!

The situation is as follows:

The site is written in wordpress + woocommerce. It is necessary that after clicking on the "Place an order" button on the checkout page, there is a redirect to the bank page with certain data in the link.

I pasted the code in functions.php

function wc_custom_redirect_after_purchase() {
global $wp;

if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) {
wp_redirect( ' https://pay.amra-bank.com/contactcaptcha?cam=d5f12... ' );
exit;
}
}

The transition works. QUESTION: 1) How can I link the parameter in the link inv=0938929392, namely the number itself, with the generation of woocommerce order numbers.
2) How do I link the parameter in the amo=555100 link, namely the number, to the amount of the woocommerce order.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2019-08-21
@MiXaLiN17

Variables $1-$9 store matches with the RewriteRule pattern.
Variables %1-%9 store matches with the RewriteCond pattern.

RewriteCond %{REQUEST_URI} ^/catalog/books-for-parents-and-children/([^/]+)/$
RewriteRule ^.*$ /catalog/book-%1/ [R=301,L]

I
Igor Vorotnev, 2020-03-20
@HeadOnFire

You do not need to do black magic, but file a custom payment method . Or find a ready-made plugin that allows you to add them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question