Wednesday, December 7, 2022
HomeWordPress Developmentplugins - WooCommerce + Gravity Varieties and 'foreach'

plugins – WooCommerce + Gravity Varieties and ‘foreach’


I’m attempting to create a desk the place I basically merge Gravity Varieties and WooCommerce. I’m able to loop via every with ‘foreach’, however cannot get Woo to goto the subsequent document once I nest the Woo ‘foreach’ throughout the GF ‘foreach’. My code is slopppy, so please forgive my rookie ignorance.

'''
        foreach ($types as $kind) :
            $entry_id = $kind['id'];
            $fname = $kind['87'];
            $iname = $kind['113'];
            $invest_amount = $kind['111'];
            $accepted = $kind['is_approved'];
        if ($accepted == 1) {$accepted = "Permitted";}
    elseif  ($accepted == 2) {$accepted = "Disapproved";}
    elseif  ($accepted == 3) {$accepted = "Pending";}
                        else {$accepted = "Software";}
        
    $doc_link = "/view/kc-investor-form-view/entry/" . $kind['id'];
           
        
        foreach ( $customer_orders->orders as $customer_order ) {
            $order      = wc_get_order( $customer_order );
            $woo_entry_id = $order->get_meta( '_entry_id', true );
            $woo_order_id = $order->get_order_number();
            $trans_link = "/my-account/view-order/" . $woo_order_id;
            
        }
            
     
$html .= "
<tr>
            <td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-order-number" data-title="Order">
                          $entry_id
                      </td>
                  <td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-order-date" data-title="Date">
                          $fname

                      </td>
                      <td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-order-date" data-title="Date">
                         $woo_invest_name

                      </td>
                  <td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-order-status" data-title="Standing">
                          $invest_amount
                      </td>
                  <td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-order-total" data-title="Whole">
                         $accepted
                      </td>
                  <td class="kc-button-col woocommerce-orders-table__cell woocommerce-orders-table__cell-order-actions" data-title="Actions">
                          <a href="https://wordpress.stackexchange.com/questions/411901/$doc_link" goal="_blank" class="woocommerce-button wp-element-button button view kc-list-button">Software</a>
                          <a href="$trans_link" class="woocommerce-button wp-element-button button view kc-list-button">Transaction</a>      
                          </td></tr>";
    endforeach;// END loop via kind knowledge outcomes
    $html .= "
    </tr>
        </tbody>
   </desk>";   
   print($html);

'''

I am not even positive I’ve the fitting method. I’ve the ID of the final GF kind the consumer stuffed out put right into a Woo customized meta discipline known as “_entry_id” on checkout. I would like to have the ability to match the Gravity Kind to the WooCommerce order for every row. One thing like

    'echo $order_id the place $entry_id = $woo_entry_id;'

Any course could be drastically appreciated.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments