You are here:  » WP plugin variable can I use for the name product?


WP plugin variable can I use for the name product?

Submitted by DVDAFFAIRES on Wed, 2018-12-12 22:39 in

Hi David.
In the WP plugin, which variable can I use for the name of a product?
I installed an AMZ search box in JavaScript widget, installed a function to run shortcodes and Php.
In JavaScript, I would like to display the name of the product consulted for the search to be automatic on AMZ.
I did the same in the previous script (without WP) and I had no problem, but in WP, I can not do it.
I do not know if you understood the meaning of my msg. I go through GG translator: o (

Cheers,
Raoul

Submitted by support on Thu, 2018-12-13 08:18

Hello Raoul,

You should be able to use

$_GET["pto_q"]

Cheers,
David.
--
PriceTapestry.com

Submitted by DVDAFFAIRES on Thu, 2018-12-13 10:28

Hello David,

It does not work in my text widget.

My AMZ code in the widget
{code saved}

Cheers,
Raoul

Submitted by support on Thu, 2018-12-13 10:46

Hello Raoul,

I noticed in your code that the index to $_GET included spaces which are significant, you had:

$ _GET [" pto_q "]

...if you REPLACE with;

$_GET["pto_q"]

...that might be all it is..

Cheers,
David.
--
PriceTapestry.com

Submitted by DVDAFFAIRES on Thu, 2018-12-13 10:59

Hello David,

I had built in the variable $_GET["pto_q"] correctly.
It's Google translation that integrates spaces automatically ...
But it does not work, sorry.
Would you have another idea?

Cheers,
Raoul

Submitted by support on Thu, 2018-12-13 11:12

Hello Raoul,

If you could double check that you see pto_q=keywords in the URL on the page that you are testing this, as alternative try:

<?php global $pto_q;echo $pto_q?>

Cheers,
David.
--
PriceTapestry.com

Submitted by DVDAFFAIRES on Thu, 2018-12-13 11:29

Hi David.

I understood !!!
I misspoke :o)
If I do a search, the keywords appear in the widget with the code $_GET["pto_q"].
That's not what I wanted to do.
I wanted to capture the title of the displayed product for inclusion in the AMZ search widget.

Sorry for my english :o(

Submitted by support on Thu, 2018-12-13 11:35

Hi,

The product name is in $pto_product so you can try:

<?php global $pto_product;echo $pto_product?>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by DVDAFFAIRES on Thu, 2018-12-13 11:54

Hi David.

Great !!!

It's exactly that.

Thank you very much for your help :o)

Cheers,
Raoul