Viewing 8 replies - 1 through 8 (of 8 total)
  • momo

    (@thesesameshop)

    Hi, I’d like to know the same. Thanks.

    Plugin Author Vishal Kothari

    (@ashokrane)

    Hi @defran16 @thesesameshop,

    Currently there is no way to change the logo dimensions without changing the code in the plugin itself.

    You can change it from the file: woocommerce-delivery-notes/includes/wcdn-template-functions.php . In this file, you need to go to the function: wcdn_company_logo()

    In above function, go to line 183:

    <img src="<?php echo $attachment_src[0]; ?>" width="<?php echo round( $attachment_src[1] / 4 ); ?>" height="<?php echo round( $attachment_src[2] / 4 ); ?>" alt="<?php echo esc_attr( $company ); ?>" />

    Change above line to:

    <img src="<?php echo $attachment_src[0]; ?>" width="500" height="500" alt="<?php echo esc_attr( $company ); ?>" />

    Replace the width & height with the values you desire. I have put them as 500.

    :Vishal

    Thread Starter defran16

    (@defran16)

    Thanks Vishal. I made this edit, and the logo resized, but it seems to stay the same size no matter what dimensions I add to that file. For example, I used the following two settings, but they both displayed the same size logo:

    ” width=”<361( $attachment_src[1] / 4 ); >” height=”<100( $attachment_src[2] / 4 ); >” alt=”<?php echo esc_attr( $company ); ?>” />

    ” width=”<200( $attachment_src[1] / 4 ); >” height=”<55( $attachment_src[2] / 4 ); >” alt=”<?php echo esc_attr( $company ); ?>” />

    At least the logo is legible now, but I would like to know if my syntax is incorrect as I would like to get the correct size if possible.

    Also, this would be a nice feature to add to the settings page so that people can set the logo size right from there.

    Plugin Author Vishal Kothari

    (@ashokrane)

    @defran16,

    You haven’t replaced it correctly. Please replace the whole line with what I have given. Then change the width & height values from 500 to the values that you want. It’s important that you do it exactly this way.

    I will be adding this to the features soon.

    :Vishal

    Thread Starter defran16

    (@defran16)

    Thanks. Sorry, I didn’t realize that I modified incorrectly. I just changed it to ” width=”361″ height=”100″ alt=”<?php echo esc_attr( $company ); ?>” /> but it’s still not altering the logo size.

    Plugin Author Vishal Kothari

    (@ashokrane)

    @defran16,

    Does your line number 183 look like this after the change:

    <img src="<?php echo $attachment_src[0]; ?>" width="361" height="100" alt="<?php echo esc_attr( $company ); ?>" />

    Let me know.

    Thread Starter defran16

    (@defran16)

    yes, it looks just like that

    Plugin Author Vishal Kothari

    (@ashokrane)

    @defran16,

    Then it should work. I tested at my end & the logo size does change based on the dimensions mentioned in the above line.

    :Vishal

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Change logo size’ is closed to new replies.