kilbot / WooCommerce-POS

:bangbang: All development now at https://github.com/wcpos.
http://wcpos.com
GNU General Public License v3.0
353 stars 125 forks source link

Images on Multisite #10

Closed leighs-hammer closed 10 years ago

leighs-hammer commented 10 years ago

I have noticed ( ant this may be from multisite ) that the {featured_src} seems to be adding additional data to the file string :

For example: /wp-content/uploads/sites/113/2014/06/filename_1024x1024-157x999.jpg

Where the file would actually be: /wp-content/uploads/sites/113/2014/06/filename_1024x1024.jpg

It is probably just a part of the string. But thought I would highlight it, it may be a simple fact that the system I am testing on is on a multisite install.

I will look at it and see if i can come up with a fix and post it up.

Again! Love your work!

leighs-hammer commented 10 years ago

OK so ... class-pos-product.php

Line : 144 $thumb_suffix = '-'.$this->thumb_size['width'].'x'.$this->thumb_size['height'];

Is returning a random size and appending it. as such -157X999

however the true value 150x150 is not being brought in via the thumb_size ( line 29 )

Any way removing that line on 144, commenting it out worked for me, however returning the full image I understand on large stores would drastically decrease performance.

leighs-hammer commented 10 years ago

After a bit more poking.

The sizes for catalogue in wocommerce on my side were set all random. With the increasing over rides back to the general media settings, It may be an idea to add to the admin section that I see you are building an option to use either store image sizes or wordpress image sizes. Noting that the Wordpress ones in my case would have been correct, and the general woo settings are left large or random from prior testing on our side.

Alternately just a simple note to make sure that the woo setting for thumbs and the wp setting for thumbs are kept the same.

:)

kilbot commented 10 years ago

Hi @sixthcore, thanks for raising the issue.

I think the best solution for this is documentation. I have written a FAQ for the issue: http://woopos.com.au/faq/product-images-not-showing/

At the moment I am taking these things into consideration:

  1. For speed, the POS should serve thumbnails not full-size images.
  2. The POS could use either the WP or WC thumbnail, but I think its more intuitive to use the same settings as WC.
  3. If either the WP or WC thumbnail settings are changed then it will break the thumbails (there is no direct reference to thumbnails in the database). So it's up to the user to keep their thumbnails in order.

If there is a specific use case which requires the POS to use a different thumbnail please let me know and certainly an option could be added to the POS settings.

I'll mark this as closed. Thanks for your input!

leighs-hammer commented 10 years ago

nah you are 100% right! documentation all the way.