• Resolved hashimnaushahi

    (@hashimnaushahi)


    Hi there,

    Quick question…

    Does anybode know the code to output the product attributes on a single product page?

    I’ve turned the WooCommerce Product Tabs off and am creating my own design for my single product pages. And I’d like to show the product attributes as an unordered list which shows the labels as well as the values. But only those attributes that have the checkbox “Visible on the product page” marked in the product settings.

    I’m using the Kadence Theme and I’d like to this with a Kadence Element. It would be nice if the code for outputting the product attributes could be turned into a shortcode somehow. That way the shortcode can be used in a Kadence Element that displays on all single product pages on a specified location with the help of Kadendce’s Element Hooks so that all the single product pages automatically show the product attributes.

    If someone knows the code that outpust the product attributes, I’d be very grateful. And I think a lot of Kadence users will be very happy with this.

    Thank you in advance!

    Sincerely,

    Hashim

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers.

    Thread Starter hashimnaushahi

    (@hashimnaushahi)

    Hi gabrielfuentes,

    Thank you for your reply!

    I understand that the entire case is fairly complex. And I appreciate your suggestions. Hopefully they’ll help me get further with this.

    Could you help me with just one aspect of this question?

    Do you know the code that outputs the product attributes?

    Right now the product attributes are outputted in the product tabs on the single product page. So there should be a code that does that on that particular location of the single product page. If we know what that code is, we might be able to use that code on a different location of that same page with hooks.

    I’m looking forward to your reply. Thank you in advance!

    Sincerely,

    Hashim

    Hi @hashimnaushahi – the product attributes are outputted on the single product page tabs using the following function: wc_display_product_attributes

    You can find this in: .../wp-content/plugins/woocommerce/includes/wc-template-functions.php

    These are stored in an array, so you’ll need to continue from here. ??

    Mirko P.

    (@rainfallnixfig)

    Hi @hashimnaushahi,

    Just a heads up: we’ve not heard back from you in a while so I’ll go ahead and mark this thread as resolved. Hopefully, you were able to come up with a solution here and Joey’s contribution pointed you in the right direction.

    Please feel free to create a new thread if you have further questions.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Code to output attributes’ is closed to new replies.