Wenn Sie bestimmte Produktdaten für die Variationentabelle aktivieren oder deaktivieren möchten, können Sie den Filter “woocommerce_variations_table_data” wie folgt verwenden.In diesem Beispiel für die Produkt-ID 565 hat es keinen Preis (pr), keine Zugabe zum Warenkorb (ca) und keinen Sku (sk). Stattdessen haben wir Stock (st) und Abmessungen hinzugefügt.
Funktion modify_variations_table_data($data) {globales $Produkt;if($Produkt->get_id() == 565) {unset($daten);unset($daten);unset($daten);$data='Bestand';$data='Dimensionen';} $data zurückgeben;}add_filter( 'woocommerce_variations_table_data', 'modify_variations_table_data', 10, 1 );
Referenz der Variablen:
- im’ => Bild
- ‘sk’ => SKU
- ‘pr’ => Preis
- ‘st’ => Bestand
- ‘at’ => Attribute
- ‘ca’ => Zum Warenkorb hinzufügen
- ‘de’ => Beschreibung
- ‘di’ => Abmessungen
- wir’ => Gewicht
Hi, i’m trying to add a custom download link at the end of every variation in the table. ¿How can i accomplish this? I need a column in the variation table that has a download link for every item. Is this possible?
Only when you modify the code / add a filter.
Could it be, for example, that in a line of the table, which is a variation, an image appears, and in other variations, no?
Hello, I have made the filter to add the image to articles that I want, but it is added at the end of the table, is it possible to put it in the first column?
Why do you ask?
Hello because I need it to appear in the first column. The first thing I did was add the image column in the plugin options, and remove that column in the products that I do not want to appear, but there are more products that I do not want to appear and few that do, so I opted for the option. adding the column, but I ran into the problem that adds it at the end, after the add to cart button, and I want the first column to be added, is it possible?
You will need to reorder the data keys of the array.
Hello, because I have products that must come out with the image column and others that don’t, but there are many more that do not come out with the image column, so I add that column with that code but the last one puts it, and I need the first one to appear , it’s possible?