• Resolved DODO Internet

    (@studioviv)


    Hello,

    I have a custom build plugin in my website and a part of that plugin get the filled in options of this plugin. But recently that code isn’t working anymore since a few days (3 july).

    The code:

    $options = THEMECOMPLETE_EPO_API()->get_option( $order_id, 'all' );
      foreach ($order->get_items() as $item_key => $item) {
        $item_data = $item->get_data();
        $product = $item->get_product();
        $comment = '';
        foreach ($options as $item_id => $epos){
           if ($item_key == $item_id) {
             foreach ($epos as $epo) {
               $comment .= $epo['name'] . " : " . $epo['value'] . "\n";
             }
           }
        }
    
        $product_arr[] = array( 'product_id' => $product->get_sku(),
                                'name' => $item_data['name'],
                                'price' => $product->get_price(),
                                'qty' => $item_data['quantity'],
                                'opmerking' => $opmerking );
    
      }

    Was there any kind of update of this plugin which changed some of this code? Or some Woocommerce update?

    I hope you can help me so this code is working again.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter DODO Internet

    (@studioviv)

    I have found that the var $item_id in the foreach loop of the options is empty. So the check of the item_key == $item_id in the loop is always false. And I can’t find any other value in the array for the check.

    See array:

    array(1) {
      [""]=>
      array(2) {
        [0]=>
        array(18) {
          ["mode"]=>
          string(7) "builder"
          ["cssclass"]=>
          string(0) ""
          ["hidelabelincart"]=>
          string(0) ""
          ["hidevalueincart"]=>
          string(0) ""
          ["hidelabelinorder"]=>
          string(0) ""
          ["hidevalueinorder"]=>
          string(0) ""
          ["element"]=>
          array(4) {
            ["type"]=>
            string(6) "upload"
            ["rules"]=>
            array(1) {
              [0]=>
              array(1) {
                [0]=>
                string(1) "0"
              }
            }
            ["rules_type"]=>
            array(1) {
              [0]=>
              array(1) {
                [0]=>
                string(0) ""
              }
            }
            ["_"]=>
            array(1) {
              ["price_type"]=>
              bool(false)
            }
          }
          ["name"]=>
          string(12) "Kies uw foto"
          ["value"]=>
          string(141) "[image_url]"
          ["display"]=>
          string(197) "[image_name]"
          ["price"]=>
          float(0)
          ["section"]=>
          string(23) "5ee22044b78a41.03365127"
          ["section_label"]=>
          string(12) "Kies uw foto"
          ["percentcurrenttotal"]=>
          int(0)
          ["fixedcurrenttotal"]=>
          int(0)
          ["currencies"]=>
          array(0) {
          }
          ["price_per_currency"]=>
          array(1) {
            ["EUR"]=>
            string(0) ""
          }
          ["quantity"]=>
          int(1)
        }
        [1]=>
        array(17) {
          ["mode"]=>
          string(7) "builder"
          ["cssclass"]=>
          string(0) ""
          ["hidelabelincart"]=>
          string(0) ""
          ["hidevalueincart"]=>
          string(0) ""
          ["hidelabelinorder"]=>
          string(0) ""
          ["hidevalueinorder"]=>
          string(0) ""
          ["element"]=>
          array(4) {
            ["type"]=>
            string(9) "textfield"
            ["rules"]=>
            array(1) {
              [0]=>
              array(1) {
                [0]=>
                string(0) ""
              }
            }
            ["rules_type"]=>
            array(1) {
              [0]=>
              array(1) {
                [0]=>
                string(0) ""
              }
            }
            ["_"]=>
            array(1) {
              ["price_type"]=>
              bool(false)
            }
          }
          ["name"]=>
          string(26) "Tekst op taart (optioneel)"
          ["value"]=>
          string(21) "[text]"
          ["price"]=>
          float(0)
          ["section"]=>
          string(23) "6012dc5d3772d0.99768898"
          ["section_label"]=>
          string(26) "Tekst op taart (optioneel)"
          ["percentcurrenttotal"]=>
          int(0)
          ["fixedcurrenttotal"]=>
          int(0)
          ["currencies"]=>
          array(0) {
          }
          ["price_per_currency"]=>
          array(0) {
          }
          ["quantity"]=>
          int(1)
        }
      }
    }
    

    Hey there!

    Thanks for reaching out about our Extra Product Sorting Options plugin. I’m happy to help out here ??

    Unfortunately, help with custom code is outside the scope of our support policy, so I’ll be limited in how much I’m able to help directly. However, I can confirm from our changelog that the last plugin update was April 27, so no recent change in the plugin should have introduced this problem.

    I’m sorry I can’t help more directly with this, but I hope you’ll find this information useful! Would you please let me know if there’s anything else I can help with?

    Thanks,
    Patrick
    SkyVerge

    Thread Starter DODO Internet

    (@studioviv)

    Hello,

    I know and understand that this isn’t a part of the support policy.

    But the product ID whose options are is gone. And now I can’t check which options belong to which products. And I can’t find anything similar in the rest of the array either. Do you happen to know how the plugin itself checks which option belongs to which product?

    Or can you tell me how the function THEMECOMPLETE_EPO_API()->get_option($order_id, ‘all’) works. And if it possible to change the ‘all’ value to for example the product ID?

    Regards.

    Hey there!

    This is the support forum for WooCommerce Extra Product Sorting Options. It looks like you’re talking about a plugin by a different developer, called WooCommerce Extra Product Options. The plugin is made by themecomplete, I’d recommend reaching out to them through their support forum.

    Would you please let me know if there’s anything else I can help with?

    Thanks,
    Patrick
    SkyVerge

    Thread Starter DODO Internet

    (@studioviv)

    Hello,

    Oops. My fault. Thanks for the help anyway!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘php codes get_option’ is closed to new replies.