Coder Social home page Coder Social logo

woocommerce / woocommerce-blocks Goto Github PK

View Code? Open in Web Editor NEW
398.0 93.0 220.0 255.31 MB

(Deprecated) This plugin has been merged into woocommerce/woocommerce

Home Page: https://wordpress.org/plugins/woo-gutenberg-products-block/

License: GNU General Public License v3.0

JavaScript 13.86% PHP 32.57% Shell 0.74% Dockerfile 0.01% SCSS 4.16% TypeScript 47.68% HTML 0.84% CSS 0.02% MDX 0.13%
woocommerce-blocks wordpress gutenberg woocommerce hacktoberfest

woocommerce-blocks's Introduction

๐Ÿ“ฃ Announcement: New documentation location

The documentation for WooCommerce Blocks has moved to the WooCommerce monorepo.

Please refer to the documentation in the new location as the files in this repository will no longer be updated and the repository will be archived.


WooCommerce Blocks

Latest Tag View JavaScript and CSS Linting PHP Coding Standards Unit Tests E2E Tests

This is the feature plugin for WooCommerce + the Gutenberg. This plugin serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor.

Use this plugin if you want access to the bleeding edge of available blocks for WooCommerce. However, stable blocks are bundled into WooCommerce, and can be added from the "WooCommerce" section in the block inserter.

Table of Contents

Documentation

To find out more about the blocks and how to use them, check out the documentation on WooCommerce.com.

If you want to see what we're working on for future versions, or want to help out, read on.

Code Documentation

  • Blocks - Documentation for specific Blocks.
  • Editor Components - Shared components used in WooCommerce blocks for the editor (Gutenberg) UI.
  • WooCommerce Blocks Handbook - Documentation for designers and developers on how to extend or contribute to blocks, and how internal developers should handle new releases.
  • WooCommerce Blocks Storybook - Contains a list and demo of components used in the plugin.

Installing the plugin version

We release a new version of WooCommerce Blocks onto WordPress.org every few weeks, which can be used as an easier way to preview the features.

Note: The plugin follows a policy of supporting the "L0" strategy for version support. What this means is that the plugin will require the most recent version of WordPress. It will also require the most recent version of WooCommerce core at the time of a release. You can read more about this policy here.

1.Ensure you have the latest available versions of WordPress and WooCommerce installed on your site. 2. The plugin version is available on WordPress.org. Download the plugin version here. 3. Activate the plugin.

Installing the development version

  1. Ensure you have the latest versions of WordPress and WooCommerce installed on your site.
  2. Get a copy of this plugin using the green "Clone or download" button on the right.
  3. Make sure you're using Node.js v16.15. If you use a Node version management tool such as nvm or n, you can do so by running nvm use or n auto, respectively.
  4. npm install to install the dependencies.
  5. composer install to install core dependencies.
  6. To compile the code, run any of the following commands
    1. npm run build (production build).
    2. npm run dev (development build).
    3. npm start (development build + watching for changes).
  7. Activate the plugin.

The source code is in the assets/ folder, and the compiled code is stored into build/.

Getting started with block development

Run through the "Writing Your First Block Type" tutorial for a quick course in block-building.

For deeper dive, try looking at the core blocks code, or see what components are available.

To begin contributing to the WooCommerce Blocks plugin, see our getting started guide and developer handbook.

Other useful docs to explore:

Long-term vision

WooCommerce Blocks are the easiest, most flexible way to build your store's user interface and showcase your products.

woocommerce-blocks's People

Contributors

albarin avatar alexflorisca avatar aljullu avatar claudiulodro avatar danieldudzic avatar danielwrobert avatar dependabot[bot] avatar dinhtungdu avatar gigitux avatar github-actions[bot] avatar haszari avatar imanish003 avatar kmanijak avatar mikejolley avatar nefeline avatar nerrad avatar nielslange avatar opr avatar ralucastan avatar renovate[bot] avatar roykho avatar ryelle avatar senadir avatar sunyatasattva avatar tarhi-saad avatar tarunvijwani avatar thealexandrelara avatar tiagonoronha avatar tjcafferkey avatar wavvves avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

woocommerce-blocks's Issues

Block options to choose order and limit product count

Store owners should be able to choose the order products are listed in a block. Like the shortcode, that could by popularity, newness etc.

A use case could be the I want a unique landing page for a category, rather than the default archive you get with core. On that page, I only want to show my 3 best selling products.

It should also be more clear how you could limit the amount of products which should be displayed.

UX: Changing display type

I'm curious why there are two different "screens"/user experiences for the same type of change:

1) Selecting the display mode the first time:

2) Changing the display mode after a product block has been configured:


I was thinking it could just go back to the first screen after clicking Display different products. That way the user is already familiar with the option choices and experience.

'undefined' class name on grid product blocks

The code that adds a class to the shortcode if the list layout is selected needs to be updated to prevent adding the 'undefined' class. Currently, all generated shortcodes are of the form [products limit="3" class="undefined" columns="3"].

Tag select

Add an option to the Edit Mode of the products block for searching and selecting products by tag. This is similar to the product category search and select feature we already have built out for the Products block, but for tags. We may want to make some sort of reusable component that we can use for all of these features.

This feature isn't in the current design for the block, but I'm leaving this open in case it gets added later or that was an oversight.

Individual product blocks pre-populated

If I create a new product block using the "Individual Products" block the same products are auto-selected if I choose to create another product block with "Individual Products".

I'm not sure if this is intentional or not. If it is, wouldn't the better option for the user be to Duplicate the block or convert it to a re-usable block?

Individual products - remove rows slider

When displaying individual products we know the total number of products the user wants to display. So we only need to present a columns selector - rows should be automatically calculated.

Improve scalability of attribute and category selects.

The attribute and category select options will need testing and possible tweaking to make sure that they work OK on sites with hundreds or thousands of attributes or categories. Currently they pre-populate the list of attributes/categories with all of the attributes/categories when loaded, and this may not be scalable.

products do not display in 6-column format on backend....

Products do not display in 6-column format.

1-column, 2-column, 3-column, 4-column, and 5-column all work well.

  • 6-column setting works on the front end.
  • 6-column setting does NOT work on the back end - instead it works just like 1-column.

Sale/Featured/Top Rated/etc. options

We need the following possibilities added as options to the Products block (along with potentially other similar types of options):

  • On Sale
  • Featured
  • Best Sellers
  • Top Rated

I'm not sure the best way to implement these. They can be implemented as stand-alone options in the Edit Mode with no further customization or they can be implemented as a checkbox or something in the sidebar block options so they can be combined with options from the Edit Mode (e.g. Show products that are a specific attribute and on sale)

Modularization

I'm not sure at what point in the development process we should do this, but we need to modularize components where possible and export them so that third-party developers can extend and reuse WC components. See the Gutenberg blocks library for examples of how this should be done.

Remove list view

Just adding list-layout to the block output will require all themes to introduce new layout styles based just on that class.

Until a theme adds extra CSS to support this new class the frontend will not properly reflect what they are previewing in the block.

Storefront set to list view: https://cloudup.com/cCCN2gTKJDR

Individual select product blocks broken when page is reloaded.

This seems to be something probably caused by the latest version of Gutenberg. If you create a block with individual select products and save, when you come back to the page you get errors on the block:

screen shot 2018-02-23 at 10 51 11 am

screen shot 2018-02-23 at 10 51 19 am

I don't know why the validation expects an empty string for include, but that is not correct. Weirdly this only happens for the product select and not the category one.

Graceful error handling

The products block needs graceful error handling if columns gets set to 0 or the user inputs a crazy value for fields.

Final design

We need a public-facing final (or close-enough) design for the Products block. We can build the functionality without this, but it's necessary for polish and getting public feedback.

Search and select products by attribute

Add an option to the Edit Mode of the products block for searching and selecting products by attribute. This is similar to the product category search and select feature we already have built out for the Products block, but for attributes. We may want to make some sort of reusable component that we can use for all of these features.

Category shortcode argument might be incorrect?

categories vs category

Running master of WC core:

This shortcode is generated by Gutenberg, and doesn't output any products:

[products limit="3" columns="3" category="30,29,28,27"]

This shortcode works:
[products limit="3" columns="3" categories="30,29,28,27"]

Haven't really dug in much, but it's pretty strange since WC core is expecting category as far as I can tell.

CSS styling

The CSS styles need to be polished and finalized. This does not need to be completed until a final design is approved. Rough styles work until then.

Add a `from` transform to each block to support legacy shortcodes

If a page has the products shortcode already on it (from posts created using the classic editor) convert the shortcode into a pre-populated Products block. More investigating will need to be done to see if this is possible, but I believe Gutenberg 2.1 has some shortcode handling features so it should be possible.

Possible use case for transformations API: WordPress/gutenberg#4578

It shouldn't be possible to finish adding the block if no products are selected.

For example if you elect to display individual products but do not select any, then click done you see this;

no products

I appreciate that's what you'd see on the frontend but nobody would ever want to use the product block this way.

The "Done" button should be disabled (with cursor: not-allowed;) in this case with a tooltip which states "Please search for and select products to display first".

disabled

Switching to List View Should Keep Original Number of Products Visible

If you have a Grid View set to show 1 row with 4 columns and you switch to List View the number of rows is set to 1 which hides products. I think when switching the rows should be set to $rows * columns.

4 Columns x 2 Rows = 8 Rows
3 Columns x 3 Rows = 9 Rows

etc...

It's confusing switching to List View and having products disappear. Originally noted in #59

Grid view should be default

On current master after you insert a product block neither grid or list view are selected. Let's make grid the default.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.