0

can you help me please?

-- I've making ajax call to partial and sending the data ( productId )

$.request('onProductLoad', { data: {'productId': 22}, update: { 'Product/card': #result} })

how i can access this data in function onProductLoad() in the php code tab on a page that partial is placed in.

Thank you!

Uncertain
  • 1
  • 1

1 Answers1

0

Add a function called onProductLoad to the page and you can access the posted data as you would normally do in a component.

title = "My Page"
url = "/"
layout = "default"
==
<?
function onProductLoad()
{
    $productId = post('productId');
}
?>
==
Raja Khoury
  • 3,015
  • 1
  • 20
  • 19