Overview

Namespaces

  • None
  • VSP
    • Core
      • Abstracts
      • Interfaces
      • Traits
        • WC_Compatibility
    • Deprecation
    • Helper
    • Modules
      • Addons
      • Logger

Traits

  • Array_Helper
  • Framework
  • String_Helper
  • URL
  • WC_Helper
  • WP
  • Overview
  • Namespace
  • Class

Trait WC_Helper

Trait WC_Helper

Direct Known Users

VSP\Helper
Namespace: VSP\Core\Traits
Package: VSP\Core\Traits
Author: Varun Sridharan varunsridharan23@gmail.com
Located at includes/core/traits/class-wc-helper.php
Methods summary
public static array|mixed
# wc_payment_methods( boolean $slug = false, string $cache_key = 'vsp' )

Fetches Gateways From WooCommerce And Returns It.

Fetches Gateways From WooCommerce And Returns It.

Parameters

$slug
$cache_key
Custom Cache key for customized data via filter.

Returns

array|mixed
public static mixed
# wc_shipping_methods( boolean $slug = false, string $cache_key = 'vsp' )

Parameters

$slug
$cache_key
Custom Cache key for customized data via filter.

Returns

mixed

Throws

Exception
public static array
# wc_shipping_methods_by_instance( string $cache_key = 'vsp' )

Fetches All Shipping Methods By Instance ID.

Fetches All Shipping Methods By Instance ID.

Parameters

$cache_key
Custom Cache key for customized data via filter.

Returns

array
public static mixed
# wc_product_sky_by_id( $product_id )

Fetches & Returns Product's SKU.

Fetches & Returns Product's SKU.

Parameters

$product_id

Returns

mixed
public static boolean
# wc_has_product_in_cart( $product_id )

Checks if product exists in cart.

Checks if product exists in cart.

Parameters

$product_id

Returns

boolean
public static array
# wc_get_product_ids_in_cart( string $type = ARRAY_A, boolean|string $child = true )

Returns A list of Product ids From WooComerce Cart.

Returns A list of Product ids From WooComerce Cart.

Parameters

$type
ARRAY_A / ARRAY_N.
$child
If set to true then it also adds variation ids,

Returns

array

Since

0.8.7
public static boolean
# wc_clear_cart( )

Clears WC Cart.

Clears WC Cart.

Returns

boolean
public static boolean
# wc_is_cart_empty( )

Checks if WooCommerce Cart is empty.

Checks if WooCommerce Cart is empty.

Returns

boolean

Since

0.8.7
public static boolean
# wc_clear_cart_if_notempty( )

Clears Cart if Not Empty.

Clears Cart if Not Empty.

Returns

boolean
public static array|mixed
# wc_get_tax_classes( false $slug = false, string $cache_key = 'vsp' )

Returns A List of enabled tax classes in WooCommerce.

Returns A List of enabled tax classes in WooCommerce.

Parameters

$slug
if set to true then it returns only the tax class slugs
$cache_key

Returns

array|mixed
API documentation generated by ApiGen