Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #397529

    Hi,

    we are using WooCommerce and the Enfold Product List option but having trouble getting the product image looking how we want it in the Product List.

    The Product List pulls in a 180×180 version of the product image into class=”av-catalogue-item product_type_variable” but we want to display a landscape image instead.

    I’ve removed the border radius and originally tried object-fit: which worked a treat until I tested IE which as usual doesn’t support it. (sigh).

    Can you advise where in the php I can edit the image being used in your Product list or kindly provide a filter.

    Thanks again.

    #397595

    Update:

    In functions.php I have added the following line to register a new image size

    $avia_config['imgSize']['catalog']= array('width'=>490, 'height'=>340 ); // images for catalog

    Then in config-templatebuilder\avia-shortcodes\productslider.php

    I have changed line 358 from “square” to “catalog” and so far it’s all looking ok (apart from the way WordPress has cropped the images but that’s for me to sort).

    Now… This all works fine when I edit productslider.php within the Enfold theme structure but if I then try it in my child theme the changes don’t show.

    I have the following structure:

    Ridelines (theme name)
    – functions.php (with the new $avia_config[‘imgSize’])
    – \config-templatebuilder
    – – \avia-shortcodes
    – – – productslider.php (with the square changed to catalog)

    So this is the same file and directory structure as in the Enfold theme but it doesn’t seem to be picking up my changes at all.

    #397752

    Hi!

    WooCommerce has options for this in Dashboard > WooCommerce > Settings > Products > Display. You can change the image sizes for your catalogs there and decide if you want them cropped or not.

    Cheers!
    Elliott

    #397775

    Hi Elliot,

    Thanks for your reply. I’d already played with these but the markup still had the 180×180 image displaying despite what I changed the WooCommerce Catalog settings to and produced:

    <img width=”180″ height=”180″ src=”full-path-to-image-180×180.jpg”

    So no matter what I did in WC, Enfold still produced a square image.

    Further to this, can you advise how I make a copy and place productslider.php into my child skin as I need to make a load more changes and don’t want it overwritten on the next update.

    Thanks.

    #397989

    Hi!

    1.) You can follow the solution provided here: https://kriesi.at/support/topic/best-way-to-add-image-sizes/#post-351286

    2.) Add this to the child theme’s functions.php:

    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths)
    {
    $template_url = get_stylesheet_directory();
    array_unshift($paths, $template_url.'/shortcodes/');
    
    return $paths;
    }

    Create a folder called shortcodes. Place the modified shortcode file inside.

    Best regards,
    Ismael

    #398042

    Ismael,

    thank you.

    That is sooo going in my bolierplate child theme functions.php

    Please consider this issue well and truly closed.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Is it possible to change the WooCommerce image pulled by Product List?’ is closed to new replies.