Coder Social home page Coder Social logo

woocommerce / woocommerce-blocks Goto Github PK

View Code? Open in Web Editor NEW
399.0 92.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 Issues

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.

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)

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.

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.

'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"].

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.

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.

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.

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

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.

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.

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

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

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.

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?

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

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.

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.

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.

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.

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.

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.