New Landing How can we help? Atelier child theme – overriding function from content-product.php

Viewing 14 posts - 1 through 14 (of 14 total)
  • Posted in: Atelier
  • #231101
    techtherapy
    Member
    Post count: 105

    Please can you explain how I can override the following code from content-product.php

    // Width, Height parameters
    	if ( $sf_product_multimasonry ) {
    
    		$masonry_thumb_size = sf_get_post_meta( get_the_ID(), 'sf_masonry_thumb_size', true );
    
    		if ( $masonry_thumb_size == "large" ) {
    		    $classes[] = 'col-sm-6 size-large';
    		    $width = 'col-sm-6';
    		    $thumb_width = 720;
    		    $thumb_height = 578;
    		} else if ( $masonry_thumb_size == "tall" ) {
    		    $classes[] = 'col-sm-3 size-tall';
    		    $width = 'col-sm-3';
    		    $thumb_width = 360;
    		    $thumb_height = 578;
    		} else {
    			$classes[] = 'col-sm-3 size-standard';
    			$width = 'col-sm-3';
    			$thumb_width = 360;
    			$thumb_height = 289;
    		}
    
    	} else {
    		
    		if ( $product_layout == "grid" ) {
    			if ( $sidebar_config == "no-sidebars" ) {
    				$classes[] = 'col-sm-sf-5';
    				$width = 'col-sm-sf-5';
    			} else {
    				$classes[] = 'col-sm-3';
    				$width = 'col-sm-3';
    			}
    		} else if ($woocommerce_loop['columns'] == 4) {
    			$classes[] = 'col-sm-3';
    			$width = 'col-sm-3';
    		} else if ($woocommerce_loop['columns'] == 5) {
    			$classes[] = 'col-sm-sf-5';
    			$width = 'col-sm-sf-5';
    		} else if ($woocommerce_loop['columns'] == 3) {
    			$classes[] = 'col-sm-4';
    			$width = 'col-sm-4';
    		} else if ($woocommerce_loop['columns'] == 2) {
    			$classes[] = 'col-sm-6';
    			$width = 'col-sm-6';
    		} else if ($woocommerce_loop['columns'] == 1) {
    			$classes[] = 'col-sm-12';
    			$width = 'col-sm-12';
    		} else if ($woocommerce_loop['columns'] == 6) {
    			$classes[] = 'col-sm-2';
    			$width = 'col-sm-2';
    		}
    

    In the child theme folder I’ve tried 2 methods – creating /woocommerce/content-product.php, and also adding the above code to funtions.php. Neither work. I’d be grateful for some help.

    #231145
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    For woocommerce templates you just need to copy the same folder structure to your child theme. Not sure why that’s not working for you

    – Kyle

    #231152
    techtherapy
    Member
    Post count: 105

    i can test it by removing the file from the parent theme, and placing it in the child theme. when i reload the site, the products don’t display. any ideas?

    Attachments:
    You must be logged in to view attached files.
    #231155
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    What changes have you made to the file?

    – Kyle

    #231157
    techtherapy
    Member
    Post count: 105

    thumb height and width in the masonry section

    #231219
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please create woocommerce directory inside child theme directory and paste the content.product.php file. Hope it should help to you.
    Thanks
    Mohammad

    #231266
    techtherapy
    Member
    Post count: 105

    thanks Mohammed. Pretty sure I’ve done that correctly – please have a look at the screenshot I posted above.

    #231273
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me specific page url to check and resolve.
    Thanks
    Mohammad

    #231300
    techtherapy
    Member
    Post count: 105
    This reply has been marked as private.
    #231320
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me correct login detail to investigate this issue.
    Thanks
    Mohammad

    #231322
    techtherapy
    Member
    Post count: 105
    This reply has been marked as private.
    #231340
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please check it now after clear the cache of browser.
    Thanks
    Mohammad

    #231344
    techtherapy
    Member
    Post count: 105

    thanks. Can you tell me what you did?

    #231349
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I activated only child theme and got all things perfect. That was only cache issue.
    Thanks
    Mohammad

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register