Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0.*] Cannot use the wc_get_attribute_taxonomies function after including it #14179

Closed
royvanos opened this issue Apr 10, 2017 · 1 comment
Closed

Comments

@royvanos
Copy link

royvanos commented Apr 10, 2017

EXPLANATION OF THE ISSUE

I'm trying to get all attribute taxonomies for my plugin using the wc_get_attribute_taxonomies function which is declared in woocommerce/includes/wc-attribute-functions.php, however, when I call the function, I get the following error:

Fatal error: Cannot redeclare wc_attributes_array_filter_variation() (previously declared in /home/roy/www/wcconnector/web/wp-content/plugins/woocommerce/includes/wc-attribute-functions.php:321) in /home/roy/www/wcconnector/web/wp-content/plugins/woocommerce/includes/wc-attribute-functions.php on line 321

STEPS TO REPRODUCE THE ISSUE

  1. WooCommerce version 3.0.*
  2. PHP 7.0.12
  3. Apache 2.4.18

SYSTEM STATUS

WordPress Environment

Home URL: http://wcconnector.local
Site URL: http://wcconnector.local
WC Version: 3.0.1
Log Directory Writable: ✔
WP Version: 4.8-alpha-40387
WP Multisite: –
WP Memory Limit: 8 GB
WP Debug Mode: –
WP Cron: ✔
Language: en_US

Server Environment

Server Info: Apache/2.4.18 (Ubuntu)
PHP Version: 7.0.12-1+deb.sury.org~xenial+1
PHP Post Max Size: 2 GB
PHP Time Limit: 0
PHP Max Input Vars: 1000
cURL Version: 7.47.0
OpenSSL/1.0.2g

SUHOSIN Installed: –
MySQL Version: 5.7.11
Max Upload Size: 2 GB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 3.0.1
WC Database Prefix: aawcc_
woocommerce_sessions: ✔
woocommerce_api_keys: ✔
woocommerce_attribute_taxonomies: ✔
woocommerce_downloadable_product_permissions: ✔
woocommerce_order_items: ✔
woocommerce_order_itemmeta: ✔
woocommerce_tax_rates: ✔
woocommerce_tax_rate_locations: ✔
woocommerce_shipping_zones: ✔
woocommerce_shipping_zone_locations: ✔
woocommerce_shipping_zone_methods: ✔
woocommerce_payment_tokens: ✔
woocommerce_payment_tokenmeta: ✔
MaxMind GeoIP Database: ✔

Security

Secure connection (HTTPS): ❌Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.
Hide errors from visitors: ✔

Active Plugins (4)

Test Payment Module for Woocommerce: by Sean Barton (Tortoise IT) – 1.5
Active Ants WooCommerce Connector: by Active Ants B.V. – 1.0.0
WooCommerce: by Automattic – 3.0.1
WordPress Importer: by wordpressdotorg – 0.6.3

Settings

API Enabled: ✔
Force SSL: –
Currency: EUR (€)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

WC Pages

Shop base: #13 - /shop/
Cart: #14 - /cart/
Checkout: #15 - /checkout/
My account: #16 - /my-account/

Theme

Name: Shapely
Version: 1.1.2
Author URL: https://colorlib.com/
Child Theme: ❌ – If you're modifying WooCommerce on a parent theme you didn't build personally
then we recommend using a child theme. See: How to create a child theme

WooCommerce Support: ❌ Not declared

Templates

Overrides: –

ADDITIONAL NOTES

I can currently work around this issue by copying the code from the wc_get_attribute_taxonomies function.

@royvanos royvanos changed the title Cannot use the wc_get_attribute_taxonomies function after including it [3.0.*]Cannot use the wc_get_attribute_taxonomies function after including it Apr 10, 2017
@royvanos royvanos changed the title [3.0.*]Cannot use the wc_get_attribute_taxonomies function after including it [WC 3.0.*] Cannot use the wc_get_attribute_taxonomies function after including it Apr 10, 2017
@royvanos royvanos changed the title [WC 3.0.*] Cannot use the wc_get_attribute_taxonomies function after including it [3.0.*] Cannot use the wc_get_attribute_taxonomies function after including it Apr 10, 2017
@mikejolley
Copy link
Member

Do not include the file. That will mean you include it and then WC includes it later. This is a problem in your code. Run it later (after init) once the files are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants