Tagged: woocommerce
-
AuthorPosts
-
February 27, 2021 at 4:35 pm #1284126
I have a client that wants a certain layout of information for each product displayed on the main shop page product grid.
Currently by default you get image, product name, price, and action button. They would like the info of product brand, type (such as shorts or pants), size, then price. I have tried to search out this info and not been able to find anything other then look and feel changes to the template.Thank You
February 28, 2021 at 4:10 pm #1284234Hey dschneekloth,
Here are the links for you, maybe they can give you some ideas:
https://medium.com/@shareblogtips/top-5-plugins-for-woocommerce-custom-product-options-use-case-update-2019-35c9124079f6
If you need further assistance please let us know.
Best regards,
VictoriaFebruary 28, 2021 at 6:41 pm #1284280Victoria thank you for the reply! I will be checking it out so I can better refine my fix.
I managed to figure it out mean time its not pretty but works for what I need. I will share the code functions below for anyone else that may run into this./* Add brand and size to shop page working */
add_action(‘woocommerce_after_shop_loop_item_title’, ‘dstm_display_product_category’, 5);
function dstm_display_product_category()
{
global $product;
$brand = $product->get_attribute(‘brand’);
if (empty($brand)) {
} else {
if(isset($brand)){
echo ‘Brand: ‘ . $brand . ‘<br />’;
}
}
}add_action(‘woocommerce_after_shop_loop_item_title’, ‘cstm_display_product_category’, 5);
function cstm_display_product_category()
{
global $product;
$size = $product->get_attribute(‘size’);
if (empty($size)) {
} else {if(isset($size)){
echo ‘Size: ‘ . $size . ‘<br />’;
}
}
}
require_once( ‘functions-enfold.php’);- This reply was modified 3 years, 9 months ago by dschneekloth.
March 1, 2021 at 5:47 am #1284324Hi,
Did you need additional help with this topic or shall we close?Best regards,
Jordan ShannonMarch 1, 2021 at 5:24 pm #1284484Yes this can be closed
thanksMarch 1, 2021 at 5:26 pm #1284488Hi,
If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Add fields to products display on shop page WooCommerce’ is closed to new replies.