Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SimpleCatalog
#26
oh, wow, thanks for pointing out the oblivious! i had a mix of catalog and catelog! now it all seems to work, and your post for the multiple images also works.

Thanks for your help!
Reply
#27
though, now i see that when uploading more than 3 images for an item i get a 500 error, any ideas about that?
Reply
#28
You're welcome! ;-)
Reply
#29
Any server restrictions or settings?
Reply
#30
nope, this server used to run wordpress before so it should be all ok.
The images do seem to upload, just the front end doesnt show them, it give a 500 error
Reply
#31
look at the server logs - 500 is an internal server error.
Reply
#32
i have been told by support from the server that the problem is coming from the htaccess file from the cms, but this only hapens when adding more than 3 images to an item
Reply
#33
Huh I can't imagine what the number of pictures has to do with .htaccess.
Reply
#34
niether can i, thats what the support team said when i asked, they said that the 500 error is because of the htaccess file.

Any ideas though? what would be the difference between having 3 images and 4 images?
Reply
#35
i figured it out!

in the config.php there is this line:


$config->itemDetailsImageSizes = array(
0 => array('w' => 600, 'h' => 600),
1 => array('w' => 300, 'h' => 300),
2 => array('w' => 300, 'h' => 300)
);

it has only 3 images, when i add a fourth:
3 => array('w' => 300, 'h' => 300)

It works, and i can have 4 images.
So im guessing this line of code is limiting the number of images you can have by how many images you set there.

So, how do we make this not be a "max" amount?
Reply
#36
If you want all images to be the same size, just change the getResizedUrl() function in your hook from:

PHP Code:
$path_r = \ImCatalog\Util::getResizedUrl($currentItem,
     
$key,
     
$this->processor->config->itemDetailsImageSizes[$key]['w'],
     
$this->processor->config->itemDetailsImageSizes[$key]['h'],
     
'resize'
 
); 

to:
PHP Code:
$path_r = \ImCatalog\Util::getResizedUrl($currentItem,
     
$key,
     
$this->processor->config->itemDetailsImageSizes[0]['w'],
     
$this->processor->config->itemDetailsImageSizes[0]['h'],
     
'resize'
 
); 

Or whatever you want ...
Reply
#37
thats not what i was saying.

The issue is that the array only has 3 items in it, and because of this there are only 3 images that show on the front end, and adding a fourth gives a 500 error.

When you add another item to the array, the fourth image shows.
So the array is limiting the amount of images that can be shown on the front end.

Thats what needs to be fixed.
Is there a way to make the array not limit the amount of images?
Reply
#38
Have you tried what I wrote? - if not please do it!
I know what you meant: this array contains variable information to display the images in different sizes. With the specification of ...
Code:
$this->processor->config->itemDetailsImageSizes[0]['w'],
$this->processor->config->itemDetailsImageSizes[0]['h'],
... only the first array element is used for all images and there should be no more errors.
Reply
#39
yes i tried it, it didnt work
Reply
#40
That tells us the problem is somewhere else.
Is GSDEBUG set to 'true'?
Please post GS log here after calling the site.
Reply
#41
where do i check if its set to true?
Reply
#42
nevermind, figured it out.

Its on, when i reload the page i get this error:



Notice: Undefined offset: 3 in /home/content/94/8651994/html/dev/products/plugins/im_sc_extender.php on line 72

Notice: Undefined offset: 3 in /home/content/94/8651994/html/dev/products/plugins/im_sc_extender.php on line 73

Fatal error: Uncaught exception 'InvalidArgumentException' with message '$maxWidth must be numeric' in /home/content/94/8651994/html/dev/products/plugins/imanager/phpthumb/GdThumb.inc.php:172 Stack trace: #0 /home/content/94/8651994/html/dev/products/plugins/im_simple_catalog/inc/_Util.php(64): GdThumb->resize(NULL, NULL) #1 /home/content/94/8651994/html/dev/products/plugins/im_sc_extender.php(75): ImCatalog\Util::getResizedUrl(Object(SimpleItem), 3, NULL, NULL, 'resize') #2 /home/content/94/8651994/html/dev/products/plugins/im_sc_extender.php(39): ExtendedController->getTemplate(Object(SimpleItem)) #3 /home/content/94/8651994/html/dev/products/plugins/im_sc_extender.php(25): ExtendedController->renderFrontendItemDetails() #4 /home/content/94/8651994/html/dev/products/plugins/im_simple_catalog/lib/controller.php(523): ExtendedController->renderSection('FrontendItemDet...') #5 /home/content/94/8651994/html/dev/products/plugins/im_simple_catalog/lib/controller.php(258): ImCatalog\Controller->__renderFrontendItemDetailsConte in /home/content/94/8651994/html/dev/products/plugins/imanager/phpthumb/GdThumb.inc.php on line 172
Reply
#43
ok, i understand, i used your solution of changing $key to 0 in the actual plugin, and not in the extender, now i did it in the extender and it works
Reply
#44
Yeah, that was meant in the "hook" ...
Reply
#45
great, all seems to work now, thanks for your help!
Reply
#46
is there a way to add a custom field to all categories?
I saw the instructions in a link you posted, but that`s for adding a custom field for each category manually and individually, is there a way to add one for all categories?
Reply
#47
what im trying to do is to use the categories as "sub categories", and to group them into actual categories on the page based on the custom fields.

So, i would create 4 categories for example, for 2 i would give a custom field value of "cat a", and for the other 2 i would give the custom field value "cat b", and on the catelog page i would display them grouped together based on the custom field value.

Is this possible?
Reply
#48
Hello,

(2018-12-27, 00:00:14)usderofit Wrote: is there a way to add a custom field to all categories?

You can simply use SC API to add your field to the categories. Here is an example that you can use to do this, but remember to adjust the '$fieldname' parameter:

https://gist.github.com/bigin/c7634296a4...0535a4afc5

(2018-12-27, 03:15:21)usderofit Wrote: So, i would create 4 categories for example, for 2 i would give a custom field value of "cat a", and for the other 2 i would give the custom field value "cat b", and on the catelog page i would display them grouped together based on the custom field value.

I don't know exactly what you're doing, aren't you able to do that with the already existing Tags field?
Reply
#49
Thank you for the code, where exactly would i put it though?


And the Tags field are only in the items, not in the categories from what i see.

What i want is to group the categories, and add a header for each category group for example, so it would be something like:

Group 1:
-category a
--item a
--item b
-category b
--item a
--item b
--item c
etc.

I just want to group the categories on the front end, so what ever way that is possible is good.
Reply
#50
Okay, I get it, then the script will be of no use to you ... I'll take a look at it, then I'll get back to you.
Reply




Users browsing this thread: 1 Guest(s)