bobbingwide / vgc

VGC - Garden Vista Group theme
GNU General Public License v2.0
0 stars 0 forks source link

Improve store page to display selected product categories below the banner and above products #51

Closed bobbingwide closed 8 months ago

bobbingwide commented 1 year ago

In #47 we added a banner image to be displayed above the product grid.

The new requirement is to be able to display a selection of product categories as found on many other WooCommerce sites.

Requirement

Proposed solution

image

bobbingwide commented 1 year ago

This is a screen capture from the prototype using the following shortcode.

[product_categories ids=119,168,381,100,]

image

bobbingwide commented 1 year ago

In my local environment there are 25 categories marked as popular_category

SELECT count(*), meta_value FROM `vgcwp_termmeta` where meta_key = 'popular_category' group by meta_value;

They can all be turned off.

update `vgcwp_termmeta` set meta_value = 0 where meta_key = 'popular_category' and meta_value = 1;

But this caused the vgc_get_popular_categories() to return an empty array, which needs to be catered for in vgc_display_popular_categories().

bobbingwide commented 1 year ago

The IDs for the popular categories to be included are:

Category ID
Sheds 15
Summerhouses 168
Greenhouses 78
Garden office 23
Lugarde log cabins & home office 79
Workshop 80
Glass rooms, gazebos & verandas 81
Garden tidies & bikes stores 82

These can be updated using the following SQL.

update `vgcwp_termmeta` set meta_value = 1 where meta_key = 'popular_category' and term_id in ( 15, 168, 78, 23, 79, 80, 81, 82 );

Each of these product categories already have an associated image.

bobbingwide commented 1 year ago

In my local environment there are 25 categories marked as popular_category

Ditto for Live

They can all be turned off.

Ditto for Live

The product categories to be displayed in the store page have been updated using the same SQL as above. There are now 8 popular categories and 378 others

bobbingwide commented 8 months ago

Delivered in v1.5.0