0

We have develop own module for wedding planner. We post multiple products with description on form submit. How to get the "wedding" array in the below values.

Array
(
    [weeding] => Array
        (
            [pCategory] => Array
                (
                    [0] => -1
                    [1] => 45
                )

            [product_cat] => Array
                (
                    [0] => 
                    [1] => 14
                )

            [product_cat_input] => Array
                (
                    [0] => 23423
                    [1] => 
                )

            [product_qty] => Array
                (
                    [0] => 24
                    [1] => 23423
                )

            [product_description] => Array
                (
                    [0] => 234
                    [1] => 234
                )

            [metal_type] => Array
                (
                    [0] => 23
                    [1] => 234
                )

            [stone] => Array
                (
                    [0] => 2423423
                    [1] => 234
                )

            [weight] => Array
                (
                    [0] => 23
                    [1] => 23
                )

            [size] => Array
                (
                    [0] => 23
                    [1] => 23
                )

        )

    [fromprice] => 2
    [toprice] => 23
    [description] => 234
    [name] => vijay Kumar
    [email] => test@test.com
    [address] => Address
    [telephone] => 89
    [country] => IN
    [region_id] => 
    [region] => tamilnadu
    [city] => chennai
    [postcode] => 641029
)

We tried the below line. but this get all the value of post.

$post = $this->getRequest()->getParams('wedding');

Please advice for this.

  • 1
    Is this a typo '[weeding] => Array' – tecjam Feb 18 '15 at 10:46
  • @tecjam<please put this as answer – Amit Bera Feb 18 '15 at 10:48
  • @Amit: I'm not sure if this is the cause of the problem, or just a typo when creating the question. :) – tecjam Feb 18 '15 at 10:56
1

It should be: $post = $this->getRequest()->getPost('wedding');

If you use getParams() it returns the entire $_POST

Checkout class: Zend_Controller_Request_Http to see all the different methods available to access $_Request, $_Get and $_Post params.

| improve this answer | |
0

you can use getParam() instead of getParams()$post = $this->getRequest()->getParam('wedding');

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.