WordPress.org

Forums

WooCommerce - excelling eCommerce
[resolved] Get un-sanitized variation data (2 posts)

  1. sk
    Member
    Posted 2 years ago #

    I'm working to output variation data within a table on the product page.

    I'm using the below to retrieve the variation data
    $available_variations = $product->get_available_variations();

    At the moment it's working nicely except that the variation values output the sanitized version i.e. '1.7 in' outputs as '1-7in'

    I'm thinking the solution might have something to do with lines 26 - 48 in woocommerce/templates/single-product/add-to-cart/variable.php

    Any help would be awesome

    Cheers ya all

    http://wordpress.org/extend/plugins/woocommerce/

  2. sk
    Member
    Posted 2 years ago #

    I used the get_term_by() function to retrieve the values and it works now. It wasn't easy as custom attributes created on the fly are stored differently from attributes that are stored as custom tax!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic