Server IP : 162.0.217.223 / Your IP : 216.73.216.153 Web Server : LiteSpeed System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : mypckeys ( 1539) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mypckeys/yeslicense.org/wp-content/plugins/woo-stripe-payment/src/Utilities/ |
Upload File : |
<?php namespace PaymentPlugins\Stripe\Utilities; class ProductUtils { /** * @param \WC_Product $product * * @return void */ public static function get_product_variations( $product ) { if ( $product && $product->get_type() === 'variable' ) { $results = wp_cache_get( 'wc_stripe_product_variations' ); if ( ! \is_array( $results ) ) { $results = []; } if ( isset( $results[ $product->get_id() ] ) ) { return $results[ $product->get_id() ]; } $results[ $product->get_id() ] = []; $children = $product->get_children(); if ( ! empty( $children ) ) { foreach ( $children as $child_id ) { $variation = wc_get_product( $child_id ); if ( $variation ) { $results[ $product->get_id() ][] = $variation; } } } wp_cache_add( 'wc_stripe_product_variations', $results ); return $results[ $product->get_id() ]; } return []; } }