Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Forum: Plugins
    In reply to: [Gravity PDF] Multilines
    Thread Starter roundsquaredk

    (@roundsquaredk)

    I figured out to use:
    $form_data['products'][33]['options'][13][option_name]
    To get the a product. But again its on one line.

    But when i use your code:
    echo implode( '<br>', $form_data['products'][33]['options'][13][option_name] );

    It doesn’t show anything?

    Then i tried the loop

    <?php
    /* loop through all products */
    foreach($form_data['products'] as $product) {
    ?>
        <?php echo $product['name']; ?>
        <?php echo $product['price']; ?>
        <?php echo $product['quantity']; ?>
        <?php echo $product['subtotal_formatted']; ?>
        <br>
    <?php
        /* Inner loop to loop through options field */
        foreach($product['options'] as $option) {
        ?>
            <?php echo $option['field_label']; ?>
            <?php echo $option['option_name']; ?>
            <?php echo $option['option_label']; ?>
            <?php echo $option['price_formatted']; ?>
            <br>
        <?php } /* close option loop */ ?>
    ?>
    <?php } /* close foreach loop */ ?>

    But here I can’t exclude some of the option names.

    Forum: Plugins
    In reply to: [Gravity PDF] Multilines
    Thread Starter roundsquaredk

    (@roundsquaredk)

    I cant get it to work.
    Would u mind to take a look?
    https://madhytten.dk/?gf_pdf=1&fid=1&lid=23&template=buffet-template.php&data=1 ;

    [products] => Array
            (
                [33] => Array
                    (
                        [name] => Mad til festen
                        [price] => 0,00 kr.
                        [price_unformatted] => 0.00
                        [options] => Array
                            (
                                [0] => Array
                                    (
                                        [field_label] => Antal k?d
                                        [option_name] => 2 slags k?d (175 kr)
                                        [option_label] => Antal k?d: 2 slags k?d (175 kr)
                                        [price] => 175
                                        [price_formatted] => 175,00 kr.
                                    )
    
                                [1] => Array
                                    (
                                        [field_label] => V?lg k?d (2 slags)
                                        [option_name] => Oksem?rbrad med stegte svampe, bagte hvidl?g og timian
                                        [option_label] => V?lg k?d (2 slags): Oksem?rbrad med stegte svampe, bagte hvidl?g og timian
                                        [price] => 20
                                        [price_formatted] => 20,00 kr.
                                    )

    Here i want to get the data from all the “option_name”.
    How to do that?

    Thread Starter roundsquaredk

    (@roundsquaredk)

    sorry – this is the right URL; https://findjobabroad.com/jobs2

Viewing 3 replies - 1 through 3 (of 3 total)