Plugin Directory

Changeset 3761221


Ignore:
Timestamp:
10/23/2026 09:00:10 AM (5 weeks ago)
Author:
rajanit2000
Message:

Update to version 3.0.0 from GitHub

Location:
wp-smart-variations
Files:
129 added
4 deleted
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-smart-variations/assets/banner-772x250.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • wp-smart-variations/assets/icon-128x128.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • wp-smart-variations/assets/icon-256x256.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • wp-smart-variations/tags/3.0.0/install.php

    r1807648 r3761221  
    11<?php
    2 /*
    3 Plugin Name: WP Smart Variations
    4 Author: <strong>Rajan V</strong>
    5 Version: 1.0
    6 Description: This is variations plugin for WP-e Commerce Site.
    7 */
     2/**
     3 * Plugin Name:          SwatchCraft – Variation Swatches for WooCommerce
     4 * Plugin URI:           https://wordpress.org/plugins/wp-smart-variations/
     5 * Description:          Colour, image and button swatches for WooCommerce variations, on product pages and product cards, with variation image galleries and a variations table.
     6 * Version:              3.0.0
     7 * Requires at least:    6.5
     8 * Requires PHP:         7.4
     9 * Requires Plugins:     woocommerce
     10 * Author:               Rajan V
     11 * Author URI:           https://profiles.wordpress.org/rajanit2000/
     12 * License:              GPL-2.0-or-later
     13 * License URI:          https://www.gnu.org/licenses/gpl-2.0.html
     14 * Text Domain:          wp-smart-variations
     15 * WC requires at least: 9.0
     16 * WC tested up to:      11.2
     17 *
     18 * @package SwatchCraft
     19 */
    820
    9 /*  Copyright 2007-2018 Rajan V (email: ratanit2000 at gmail.com)
     21defined( 'ABSPATH' ) || exit;
    1022
    11     This program is free software; you can redistribute it and/or modify
    12     it under the terms of the GNU General Public License as published by
    13     the Free Software Foundation; either version 2 of the License, or
    14     (at your option) any later version.
     23define( 'SWATCHCRAFT_VERSION', '3.0.0' );
     24define( 'SWATCHCRAFT_FILE', __FILE__ );
     25define( 'SWATCHCRAFT_DIR', plugin_dir_path( __FILE__ ) );
     26define( 'SWATCHCRAFT_URL', plugin_dir_url( __FILE__ ) );
    1527
    16     This program is distributed in the hope that it will be useful,
    17     but WITHOUT ANY WARRANTY; without even the implied warranty of
    18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    19     GNU General Public License for more details.
    20 
    21     You should have received a copy of the GNU General Public License
    22     along with this program; if not, write to the Free Software
    23     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    24 */
    25 
    26 // Hook for adding admin menus
    27 add_action('wp_footer', 'variationScript');
    28 add_action('wp_head', 'whshCSS');
    29 
    30 function whshCSS(){
    31         echo '<link type="text/css" rel="stylesheet" href="'.plugins_url().'/wp-smart-variations/css/custom.css" />';
     28if ( ! file_exists( SWATCHCRAFT_DIR . 'vendor/autoload.php' ) ) {
     29        add_action(
     30                'admin_notices',
     31                static function () {
     32                        echo '<div class="notice notice-error"><p>' . esc_html__( 'SwatchCraft is missing its vendor folder. Run composer install, or install the plugin from WordPress.org.', 'wp-smart-variations' ) . '</p></div>';
     33                }
     34        );
     35        return;
    3236}
    3337
    34 function variationScript() {
    35     ?>
    36         <script type="text/javascript" >
    37         jQuery(function(){
    38                 jQuery('.wpsc_variation_forms').append('<div class="new-variation-div"></div>');
    39                 var i = 0;
    40                 jQuery( ".wpsc_variation_forms" ).each(function() {
    41                         var output = '';
    42                         var variation = '';
    43                         jQuery(this).find('.wpsc_select_variation').each(function(){
    44                                 var name = jQuery(this).attr('name');
    45                                         jQuery(this).find('option').each(function(){
    46                                                 var val = jQuery(this).text();
    47                                                 var value = jQuery(this).attr('value');
    48                                                 if( value != '0' ){
    49                                                         variation = variation + '<label class="new-variation-radio radio-variation" for="'+name+i+'"><input class="wpsc_select_variation" type="radio" id="'+name+i+'" name="'+name+'" value="'+value+'" rel=' + val +' />'+val+'</label>';
    50                                                 }
    51                                                 i++;
    52                                         });
    53                                         variation = '<div class="variation-variation">'+variation+'</div>';
    54                                 output = variation;
    55                         });
    56                         jQuery(this).find('.new-variation-div').html( output );
    57                         jQuery(this).find('table').hide();
    58                 });
    59         });
    60     </script>
    61         <?php
    62 }
     38require SWATCHCRAFT_DIR . 'vendor/autoload.php';
    6339
    64 ?>
     40register_activation_hook( __FILE__, array( 'SwatchCraft\Plugin', 'activate' ) );
     41
     42SwatchCraft\Plugin::boot();
  • wp-smart-variations/tags/3.0.0/readme.txt

    r1807648 r3761221  
    1 === WP Smart Variations ===
     1=== SwatchCraft – Variation Swatches for WooCommerce ===
     2
    23Contributors: rajanit2000
    3 Tags:  WP-Commerce change variations, wp-ecommerce, variations, variations checkbox, variations radio, product variations, ecommerce variations
    4 Requires at least: 3.0
    5 Tested up to: 4.1
    6 Stable tag: 4.1
     4Tags: variation swatches, color swatches, woocommerce variations, image swatches, product variations
     5Requires at least: 6.5
     6Tested up to: 7.1
     7Requires PHP: 7.4
     8Stable tag: 3.0.0
    79License: GPLv2 or later
    8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
     10License URI: https://www.gnu.org/licenses/gpl-2.0.html
    911
    10 This is WP eCommerce variations Plugin for WP eCommerce Site. Its use to WP-Commerce change variations from selects to inputs
     12Colour, image and button swatches for WooCommerce variations, on product pages and shop cards. Formerly WP Smart Variations. Free.
    1113
    1214== Description ==
    1315
    14 This is WP eCommerce variations Plugin for WP eCommerce Site. Its use to swap select box to radio buttons for Product variations
     16SwatchCraft replaces WooCommerce's variation dropdowns with swatches: colour dots, pattern images, size buttons or radio buttons. Shoppers see every option at once, see which ones are out of stock, and pick a variation in one click.
    1517
    16 = Custom Options =
    17        
    18         1. Install Plugin
    19         2. No need short code
    20         3. No need functions
     18SwatchCraft is the new name and a complete rewrite of **WP Smart Variations**. The plugin slug is still `wp-smart-variations`. Everything is free.
     19
     20= Swatches =
     21
     22* **Colour** swatches with one colour, or two colours split diagonally ("Navy and white").
     23* **Image** swatches for patterns, materials and prints, chosen from the media library.
     24* **Button** swatches with the value name or a short label ("XL" for "Extra large"), and **radio** buttons.
     25* **Automatic buttons:** attributes without a swatch type show as buttons, so every product gets swatches without any setup. Switch it off to keep dropdowns for those attributes.
     26* Set the type on each attribute (Products → Attributes), colours and images on its terms, and override both per product in the new **Swatches** tab of the product data box. Custom attributes of a single product can have swatches too.
     27* Already use WooCommerce's colour and image fields on attribute terms? SwatchCraft uses them.
     28
     29= Made for shoppers =
     30
     31* **Unavailable** combinations are crossed out or hidden; clicking a crossed-out value starts the choice again from it.
     32* **Out-of-stock** values are crossed out, left clickable (for backorders) or hidden.
     33* The chosen value next to the attribute name ("Colour: Navy"), tooltips with the value name, and optionally its **price** and **stock**.
     34* Price, stock, image and add to cart update exactly as with dropdowns: WooCommerce still runs the form, so themes and plugins that work with variations keep working.
     35* **Accessible:** each attribute is a radio group with arrow-key navigation, and screen readers hear the names of colour and image swatches.
     36* **Large products** (hundreds of variations) work too: SwatchCraft follows WooCommerce when it loads variations one at a time.
     37* **Works without JavaScript:** the dropdowns stay until the swatches can work.
     38
     39= Extras =
     40
     41* **Swatches on product cards** in the shop, categories and related products. Choosing a swatch shows that variation's image on the card and links to the product with the value already chosen. Works with classic shop templates and the Product Collection block.
     42* **Variation image galleries:** add more images to each variation. Choosing it shows them in the product gallery.
     43* **Variations table:** every variation with its image, price, stock and a quantity field, added to the cart in one go. Show it below the add-to-cart form, instead of it, or only on chosen products, or place it anywhere with the **Variations Table** block or the `[swatchcraft_table id="123"]` shortcode.
     44
     45= For any theme =
     46
     47* Works with block themes and classic themes, on phones and desktops.
     48* Round, rounded or square swatches in three sizes, styled with CSS custom properties so your theme can restyle them.
     49* A settings page with a live preview: WooCommerce → SwatchCraft.
     50* Compatible with WooCommerce order storage (HPOS) and the cart and checkout blocks.
     51* No external services, no tracking.
    2152
    2253== Installation ==
    2354
    24         1. Its very simple Install and Active
    25        
     551. Install SwatchCraft from **Plugins → Add New** and activate it. WooCommerce must be active.
     562. Your variable products now show buttons instead of dropdowns.
     573. For colour or image swatches, go to **Products → Attributes**, edit an attribute (for example "Colour") and choose **Colour** or **Image** as its swatch type. Then open **Configure terms** and pick a colour or image for each term.
     584. Adjust the look and the extras under **WooCommerce → SwatchCraft**.
     59
    2660== Frequently Asked Questions ==
    2761
    28 1. Is this plugin working without WP eCommerce Plugin?
     62= I used WP Smart Variations 1.0. What changes? =
    2963
    30         No, WP eCommerce Plugin is required for this plugin
     64Version 1.0 turned WP eCommerce variation dropdowns into radio buttons. If WP eCommerce is still active on your site, that behaviour stays. SwatchCraft 3.0 adds swatches for WooCommerce. Version 1.0 stored no data, so there is nothing to move.
     65
     66= Do I have to set up every product? =
     67
     68No. Attributes without a swatch type show as buttons automatically. Set a colour or image type once on a global attribute and all products using it get those swatches. The product's Swatches tab is only needed for exceptions and for custom attributes of that product.
     69
     70= How do I make a two-colour swatch? =
     71
     72Edit the term (for example "Navy and white") and fill in both **Colour** and **Second colour**. The swatch is split diagonally between them.
     73
     74= Can I keep dropdowns for some attributes? =
     75
     76Yes. Choose **Dropdown** as the swatch type of the attribute, or of the attribute on one product. To keep dropdowns everywhere except where you chose a type, switch off "Buttons for attributes without a swatch type" in the settings.
     77
     78= Why are out-of-stock values not crossed out on some products? =
     79
     80Products with more variations than the "Large products" setting (30 by default) load variations one at a time from the server, as WooCommerce does. Their stock is known only once a variation is chosen. Raise the setting (up to 500) if your server is fast enough to send all variations with the page.
     81
     82= Which attribute is shown on product cards? =
     83
     84The one you choose under WooCommerce → SwatchCraft → Product cards. Automatic picks an attribute with "Show swatches on product cards" ticked, otherwise the first colour or image attribute. A product can hide its card swatches in its Swatches tab.
     85
     86= Can I change how the swatches look? =
     87
     88Choose the shape and size in the settings, or override the `--swatchcraft-size`, `--swatchcraft-radius`, `--swatchcraft-gap`, `--swatchcraft-border`, `--swatchcraft-active` and `--swatchcraft-surface` CSS custom properties in your theme.
     89
     90= Is there an API for developers? =
     91
     92Yes. The `swatchcraft_attribute_type` and `swatchcraft_attribute_options` filters change the swatch type and the values of an attribute, `swatchcraft_loaded` fires when SwatchCraft has loaded with WooCommerce, and the variations table adds to the cart through the `swatchcraft/v1/cart` REST route.
    3193
    3294== Screenshots ==
    3395
    34 1. screenshot-1.png
     961. Colour and size swatches on a product page, with the chosen values next to the attribute names.
     972. Out-of-stock and unavailable values are crossed out; tooltips show the price and stock.
     983. Image swatches for patterns, together with colour and size swatches.
     994. Swatches on product cards in the shop: choosing one shows that variation's image.
     1005. The variations table: choose quantities and add several variations to the cart at once.
     1016. The settings page with a live preview.
     1027. Colours and images on attribute terms, with an optional second colour and short label.
     1038. The Swatches tab of a product: swatch type, colours and images for each attribute, product cards and the variations table.
    35104
    36105== Changelog ==
    37106
     107= 3.0.0 =
     108* New: renamed to SwatchCraft and rewritten from scratch for WooCommerce.
     109* New: colour (one or two colours), image, button and radio swatches for variation attributes, set on attributes and terms, with per-product overrides.
     110* New: automatic buttons for attributes without a swatch type, including custom product attributes.
     111* New: unavailable and out-of-stock values crossed out or hidden, the chosen value next to the attribute name, and tooltips with price and stock.
     112* New: swatches on product cards, with image swap and links to the chosen variation.
     113* New: variation image galleries.
     114* New: variations table with bulk add to cart, as a block, a shortcode or on product pages.
     115* New: settings page with a live preview under WooCommerce → SwatchCraft.
     116* New: keyboard and screen reader support, and dropdowns kept when JavaScript is off.
     117* Improvement: the WP eCommerce radio buttons of version 1.0 load from a script file instead of inline code, only where WP eCommerce runs.
     118* Requires WordPress 6.5, PHP 7.4 and WooCommerce 9.0 or later.
     119
    38120= 1.0 =
    39 
    40 * New: WP eCommerce Variation Plugin
     121* Radio buttons for WP eCommerce variations.
    41122
    42123== Upgrade Notice ==
    43124
    44 The current version of WP Smart Wishlist requires WordPress 3.0 or higher. If you use older version of WordPress, you need to upgrade WordPress first.
     125= 3.0.0 =
     126WP Smart Variations is now SwatchCraft: colour, image and button swatches for WooCommerce, with shop card swatches, variation galleries and a variations table. Requires WordPress 6.5, PHP 7.4 and WooCommerce 9.0.
  • wp-smart-variations/trunk/install.php

    r1807648 r3761221  
    11<?php
    2 /*
    3 Plugin Name: WP Smart Variations
    4 Author: <strong>Rajan V</strong>
    5 Version: 1.0
    6 Description: This is variations plugin for WP-e Commerce Site.
    7 */
     2/**
     3 * Plugin Name:          SwatchCraft – Variation Swatches for WooCommerce
     4 * Plugin URI:           https://wordpress.org/plugins/wp-smart-variations/
     5 * Description:          Colour, image and button swatches for WooCommerce variations, on product pages and product cards, with variation image galleries and a variations table.
     6 * Version:              3.0.0
     7 * Requires at least:    6.5
     8 * Requires PHP:         7.4
     9 * Requires Plugins:     woocommerce
     10 * Author:               Rajan V
     11 * Author URI:           https://profiles.wordpress.org/rajanit2000/
     12 * License:              GPL-2.0-or-later
     13 * License URI:          https://www.gnu.org/licenses/gpl-2.0.html
     14 * Text Domain:          wp-smart-variations
     15 * WC requires at least: 9.0
     16 * WC tested up to:      11.2
     17 *
     18 * @package SwatchCraft
     19 */
    820
    9 /*  Copyright 2007-2018 Rajan V (email: ratanit2000 at gmail.com)
     21defined( 'ABSPATH' ) || exit;
    1022
    11     This program is free software; you can redistribute it and/or modify
    12     it under the terms of the GNU General Public License as published by
    13     the Free Software Foundation; either version 2 of the License, or
    14     (at your option) any later version.
     23define( 'SWATCHCRAFT_VERSION', '3.0.0' );
     24define( 'SWATCHCRAFT_FILE', __FILE__ );
     25define( 'SWATCHCRAFT_DIR', plugin_dir_path( __FILE__ ) );
     26define( 'SWATCHCRAFT_URL', plugin_dir_url( __FILE__ ) );
    1527
    16     This program is distributed in the hope that it will be useful,
    17     but WITHOUT ANY WARRANTY; without even the implied warranty of
    18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    19     GNU General Public License for more details.
    20 
    21     You should have received a copy of the GNU General Public License
    22     along with this program; if not, write to the Free Software
    23     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    24 */
    25 
    26 // Hook for adding admin menus
    27 add_action('wp_footer', 'variationScript');
    28 add_action('wp_head', 'whshCSS');
    29 
    30 function whshCSS(){
    31         echo '<link type="text/css" rel="stylesheet" href="'.plugins_url().'/wp-smart-variations/css/custom.css" />';
     28if ( ! file_exists( SWATCHCRAFT_DIR . 'vendor/autoload.php' ) ) {
     29        add_action(
     30                'admin_notices',
     31                static function () {
     32                        echo '<div class="notice notice-error"><p>' . esc_html__( 'SwatchCraft is missing its vendor folder. Run composer install, or install the plugin from WordPress.org.', 'wp-smart-variations' ) . '</p></div>';
     33                }
     34        );
     35        return;
    3236}
    3337
    34 function variationScript() {
    35     ?>
    36         <script type="text/javascript" >
    37         jQuery(function(){
    38                 jQuery('.wpsc_variation_forms').append('<div class="new-variation-div"></div>');
    39                 var i = 0;
    40                 jQuery( ".wpsc_variation_forms" ).each(function() {
    41                         var output = '';
    42                         var variation = '';
    43                         jQuery(this).find('.wpsc_select_variation').each(function(){
    44                                 var name = jQuery(this).attr('name');
    45                                         jQuery(this).find('option').each(function(){
    46                                                 var val = jQuery(this).text();
    47                                                 var value = jQuery(this).attr('value');
    48                                                 if( value != '0' ){
    49                                                         variation = variation + '<label class="new-variation-radio radio-variation" for="'+name+i+'"><input class="wpsc_select_variation" type="radio" id="'+name+i+'" name="'+name+'" value="'+value+'" rel=' + val +' />'+val+'</label>';
    50                                                 }
    51                                                 i++;
    52                                         });
    53                                         variation = '<div class="variation-variation">'+variation+'</div>';
    54                                 output = variation;
    55                         });
    56                         jQuery(this).find('.new-variation-div').html( output );
    57                         jQuery(this).find('table').hide();
    58                 });
    59         });
    60     </script>
    61         <?php
    62 }
     38require SWATCHCRAFT_DIR . 'vendor/autoload.php';
    6339
    64 ?>
     40register_activation_hook( __FILE__, array( 'SwatchCraft\Plugin', 'activate' ) );
     41
     42SwatchCraft\Plugin::boot();
  • wp-smart-variations/trunk/readme.txt

    r1807648 r3761221  
    1 === WP Smart Variations ===
     1=== SwatchCraft – Variation Swatches for WooCommerce ===
     2
    23Contributors: rajanit2000
    3 Tags:  WP-Commerce change variations, wp-ecommerce, variations, variations checkbox, variations radio, product variations, ecommerce variations
    4 Requires at least: 3.0
    5 Tested up to: 4.1
    6 Stable tag: 4.1
     4Tags: variation swatches, color swatches, woocommerce variations, image swatches, product variations
     5Requires at least: 6.5
     6Tested up to: 7.1
     7Requires PHP: 7.4
     8Stable tag: 3.0.0
    79License: GPLv2 or later
    8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
     10License URI: https://www.gnu.org/licenses/gpl-2.0.html
    911
    10 This is WP eCommerce variations Plugin for WP eCommerce Site. Its use to WP-Commerce change variations from selects to inputs
     12Colour, image and button swatches for WooCommerce variations, on product pages and shop cards. Formerly WP Smart Variations. Free.
    1113
    1214== Description ==
    1315
    14 This is WP eCommerce variations Plugin for WP eCommerce Site. Its use to swap select box to radio buttons for Product variations
     16SwatchCraft replaces WooCommerce's variation dropdowns with swatches: colour dots, pattern images, size buttons or radio buttons. Shoppers see every option at once, see which ones are out of stock, and pick a variation in one click.
    1517
    16 = Custom Options =
    17        
    18         1. Install Plugin
    19         2. No need short code
    20         3. No need functions
     18SwatchCraft is the new name and a complete rewrite of **WP Smart Variations**. The plugin slug is still `wp-smart-variations`. Everything is free.
     19
     20= Swatches =
     21
     22* **Colour** swatches with one colour, or two colours split diagonally ("Navy and white").
     23* **Image** swatches for patterns, materials and prints, chosen from the media library.
     24* **Button** swatches with the value name or a short label ("XL" for "Extra large"), and **radio** buttons.
     25* **Automatic buttons:** attributes without a swatch type show as buttons, so every product gets swatches without any setup. Switch it off to keep dropdowns for those attributes.
     26* Set the type on each attribute (Products → Attributes), colours and images on its terms, and override both per product in the new **Swatches** tab of the product data box. Custom attributes of a single product can have swatches too.
     27* Already use WooCommerce's colour and image fields on attribute terms? SwatchCraft uses them.
     28
     29= Made for shoppers =
     30
     31* **Unavailable** combinations are crossed out or hidden; clicking a crossed-out value starts the choice again from it.
     32* **Out-of-stock** values are crossed out, left clickable (for backorders) or hidden.
     33* The chosen value next to the attribute name ("Colour: Navy"), tooltips with the value name, and optionally its **price** and **stock**.
     34* Price, stock, image and add to cart update exactly as with dropdowns: WooCommerce still runs the form, so themes and plugins that work with variations keep working.
     35* **Accessible:** each attribute is a radio group with arrow-key navigation, and screen readers hear the names of colour and image swatches.
     36* **Large products** (hundreds of variations) work too: SwatchCraft follows WooCommerce when it loads variations one at a time.
     37* **Works without JavaScript:** the dropdowns stay until the swatches can work.
     38
     39= Extras =
     40
     41* **Swatches on product cards** in the shop, categories and related products. Choosing a swatch shows that variation's image on the card and links to the product with the value already chosen. Works with classic shop templates and the Product Collection block.
     42* **Variation image galleries:** add more images to each variation. Choosing it shows them in the product gallery.
     43* **Variations table:** every variation with its image, price, stock and a quantity field, added to the cart in one go. Show it below the add-to-cart form, instead of it, or only on chosen products, or place it anywhere with the **Variations Table** block or the `[swatchcraft_table id="123"]` shortcode.
     44
     45= For any theme =
     46
     47* Works with block themes and classic themes, on phones and desktops.
     48* Round, rounded or square swatches in three sizes, styled with CSS custom properties so your theme can restyle them.
     49* A settings page with a live preview: WooCommerce → SwatchCraft.
     50* Compatible with WooCommerce order storage (HPOS) and the cart and checkout blocks.
     51* No external services, no tracking.
    2152
    2253== Installation ==
    2354
    24         1. Its very simple Install and Active
    25        
     551. Install SwatchCraft from **Plugins → Add New** and activate it. WooCommerce must be active.
     562. Your variable products now show buttons instead of dropdowns.
     573. For colour or image swatches, go to **Products → Attributes**, edit an attribute (for example "Colour") and choose **Colour** or **Image** as its swatch type. Then open **Configure terms** and pick a colour or image for each term.
     584. Adjust the look and the extras under **WooCommerce → SwatchCraft**.
     59
    2660== Frequently Asked Questions ==
    2761
    28 1. Is this plugin working without WP eCommerce Plugin?
     62= I used WP Smart Variations 1.0. What changes? =
    2963
    30         No, WP eCommerce Plugin is required for this plugin
     64Version 1.0 turned WP eCommerce variation dropdowns into radio buttons. If WP eCommerce is still active on your site, that behaviour stays. SwatchCraft 3.0 adds swatches for WooCommerce. Version 1.0 stored no data, so there is nothing to move.
     65
     66= Do I have to set up every product? =
     67
     68No. Attributes without a swatch type show as buttons automatically. Set a colour or image type once on a global attribute and all products using it get those swatches. The product's Swatches tab is only needed for exceptions and for custom attributes of that product.
     69
     70= How do I make a two-colour swatch? =
     71
     72Edit the term (for example "Navy and white") and fill in both **Colour** and **Second colour**. The swatch is split diagonally between them.
     73
     74= Can I keep dropdowns for some attributes? =
     75
     76Yes. Choose **Dropdown** as the swatch type of the attribute, or of the attribute on one product. To keep dropdowns everywhere except where you chose a type, switch off "Buttons for attributes without a swatch type" in the settings.
     77
     78= Why are out-of-stock values not crossed out on some products? =
     79
     80Products with more variations than the "Large products" setting (30 by default) load variations one at a time from the server, as WooCommerce does. Their stock is known only once a variation is chosen. Raise the setting (up to 500) if your server is fast enough to send all variations with the page.
     81
     82= Which attribute is shown on product cards? =
     83
     84The one you choose under WooCommerce → SwatchCraft → Product cards. Automatic picks an attribute with "Show swatches on product cards" ticked, otherwise the first colour or image attribute. A product can hide its card swatches in its Swatches tab.
     85
     86= Can I change how the swatches look? =
     87
     88Choose the shape and size in the settings, or override the `--swatchcraft-size`, `--swatchcraft-radius`, `--swatchcraft-gap`, `--swatchcraft-border`, `--swatchcraft-active` and `--swatchcraft-surface` CSS custom properties in your theme.
     89
     90= Is there an API for developers? =
     91
     92Yes. The `swatchcraft_attribute_type` and `swatchcraft_attribute_options` filters change the swatch type and the values of an attribute, `swatchcraft_loaded` fires when SwatchCraft has loaded with WooCommerce, and the variations table adds to the cart through the `swatchcraft/v1/cart` REST route.
    3193
    3294== Screenshots ==
    3395
    34 1. screenshot-1.png
     961. Colour and size swatches on a product page, with the chosen values next to the attribute names.
     972. Out-of-stock and unavailable values are crossed out; tooltips show the price and stock.
     983. Image swatches for patterns, together with colour and size swatches.
     994. Swatches on product cards in the shop: choosing one shows that variation's image.
     1005. The variations table: choose quantities and add several variations to the cart at once.
     1016. The settings page with a live preview.
     1027. Colours and images on attribute terms, with an optional second colour and short label.
     1038. The Swatches tab of a product: swatch type, colours and images for each attribute, product cards and the variations table.
    35104
    36105== Changelog ==
    37106
     107= 3.0.0 =
     108* New: renamed to SwatchCraft and rewritten from scratch for WooCommerce.
     109* New: colour (one or two colours), image, button and radio swatches for variation attributes, set on attributes and terms, with per-product overrides.
     110* New: automatic buttons for attributes without a swatch type, including custom product attributes.
     111* New: unavailable and out-of-stock values crossed out or hidden, the chosen value next to the attribute name, and tooltips with price and stock.
     112* New: swatches on product cards, with image swap and links to the chosen variation.
     113* New: variation image galleries.
     114* New: variations table with bulk add to cart, as a block, a shortcode or on product pages.
     115* New: settings page with a live preview under WooCommerce → SwatchCraft.
     116* New: keyboard and screen reader support, and dropdowns kept when JavaScript is off.
     117* Improvement: the WP eCommerce radio buttons of version 1.0 load from a script file instead of inline code, only where WP eCommerce runs.
     118* Requires WordPress 6.5, PHP 7.4 and WooCommerce 9.0 or later.
     119
    38120= 1.0 =
    39 
    40 * New: WP eCommerce Variation Plugin
     121* Radio buttons for WP eCommerce variations.
    41122
    42123== Upgrade Notice ==
    43124
    44 The current version of WP Smart Wishlist requires WordPress 3.0 or higher. If you use older version of WordPress, you need to upgrade WordPress first.
     125= 3.0.0 =
     126WP Smart Variations is now SwatchCraft: colour, image and button swatches for WooCommerce, with shop card swatches, variation galleries and a variations table. Requires WordPress 6.5, PHP 7.4 and WooCommerce 9.0.
Note: See TracChangeset for help on using the changeset viewer.