crombiecrunch
Forum Replies Created
-
Forum: Plugins
In reply to: [Custom Product Tabs for WooCommerce] Use IF statements to display dataSo the above code does work, I was just using the wrong attribute name. needed to add attribute_pa_
thanks again @jpowersdev
Forum: Plugins
In reply to: [Custom Product Tabs for WooCommerce] Use IF statements to display datahey @jpowersdev thanks for that, I tried the following but its still showing “color” for example.
global $product; add_filter( 'woocommerce_display_product_attributes', 'remove_product_information', 10, 2 ); function remove_product_information( $product_attributes, $product ) { // Remove an attribute from the array unset($product_attributes['color']); return $product_attributes; } echo wc_display_product_attributes( $product );Forum: Plugins
In reply to: [Custom Product Tabs for WooCommerce] Use IF statements to display dataOk me again, haha.
So Since I have so many attributes and will be adding more doing it as above is not right.
So I found `global $product;
echo wc_display_product_attributes( $product );`Which does display every attribute assigned to that product, but now I am trying to figure out how to filter some of the data out. So for example there are attributes like brand, brand logo, and base category that I do not want to be displayed.
And also if possible I would like it so that it just doesn’t make a huge list straight down but maybe in a couple of columns of data.
And I need to make sure to buy you a few coffees for all the help.
Forum: Plugins
In reply to: [Custom Product Tabs for WooCommerce] Use IF statements to display datathanks, il check paypal.
so this code works
<?php global $product; $warranty = $product->get_attribute( 'warranty' ); if (!empty($warranty)) { echo "<div>Warranty: " . $warranty . "</div>"; }Forum: Plugins
In reply to: [Custom Product Tabs for WooCommerce] Use IF statements to display dataoh and my order 34845 has been processing since August 11, 2021
Forum: Plugins
In reply to: [Custom Product Tabs for WooCommerce] Use IF statements to display dataSo it looks like I might want to use both. Ive been trying to play with the code but no luck, if maybe you can help Ill give both uses I would like.
So A. for the tabs themselves – this one is fixed I found code from Ebonie that was posted 8 months ago that is working for hiding empty custom tabs.
Then B.
I have data that displays in the panel such as
color
style
warrantybut again say not all products have a value say for warranty so instead of it just displaying ‘Warranty: ‘ and nothing there Id want the whole warranty line removed.
And finally, is there a way to set a width for the text? It seems some of the data that gets imported runs past the margins while most wraps like it should.
- This reply was modified 4 years, 9 months ago by crombiecrunch.