Page 1 of 1

phImageBox (on item view page)

Posted: 04 Apr 2018, 17:09
by MM0233
Hello to all again, Is it possible to exclude (or move to last) the first photo from the array in the item view page only?

example: if I upload 3 photos on a product i need the first on the entire website but only 2 and 3 on the item view page.

How can i modify the com_phocacart/item/default.php or the "var" $dataImage?

Thanks

Re: phImageBox (on item view page)

Posted: 08 Apr 2018, 14:53
by Jan
Hi, yes this needs to be customized. What is the difference between "entire website" and "item view page" Which views do you exactly mean?

Jan

Re: phImageBox (on item view page)

Posted: 09 Apr 2018, 17:20
by MM0233
I wanna exclude the first photo ONLY in product page (the default full view of an object).
I need the first photo in ALL the modules of the website (as it is).
Thanks Jan!

Re: phImageBox (on item view page)

Posted: 16 Apr 2018, 11:44
by Jan
Hi, so then only the product view needs to be customized:

components\com_phocacart\views\item\tmpl\default.php

the $x->image is main image
$this->t['add_images'] includes additional images, so you need to skip the main image and load the first image of additional images as main :idea:

Jan

Re: phImageBox (on item view page)

Posted: 19 Apr 2018, 11:46
by MM0233
it's just what i'm trying to do with poor results.

I've tried an easy way with a substitution:

$x->image row 60 and 61
changed with
$v2->image (got from additional images row 100 and 101)

but nothing, the image box is not displayed. I need another solution.

Re: phImageBox (on item view page)

Posted: 19 Apr 2018, 12:03
by MM0233
Tried to substitute:
(row 60)
$image = PhocacartImage::getThumbnailName($this->t['pathitem'], $x->image, 'large');
$imageL = PhocacartImage::getThumbnailName($this->t['pathitem'], $x->image, 'large');
$dataImage = 'data-image="'.JURI::base(true).'/'.$image->rel.'"';

WITH:
$image = PhocacartImage::getThumbnailName($this->t['pathitem'], $v2->image, 'large');
$imageL = PhocacartImage::getThumbnailName($this->t['pathitem'], $v2->image, 'large');
$dataImage = JURI::base(true).'/'.$imageL->rel;

but nothing. There's something else i'm missing.

Re: phImageBox (on item view page)

Posted: 19 Apr 2018, 17:05
by Jan
Hi, additional images are a part of array, so you need to get this array and foreach it to get the results.

Jan

Re: phImageBox (on item view page)

Posted: 23 Apr 2018, 16:56
by MM0233
I'm afraid that the first image is not part of an array while the additional images yes, are part of one.
The first image have a separate form and his url written on this cell of the databese: phocacart_products (column: image)
others images are written on: phocacart_product_images (column: image).
I think calling a specific value of an array is not the solution of this case.
What do you think about it?

Re: phImageBox (on item view page)

Posted: 28 Apr 2018, 10:37
by Jan
Hi, not sure what do you exactly mean, but in words.

In case, you want to skip the main image to be displayed on product page, you need to disable/comment the code for getting main image and change it to first image of additional images. So there is an array of additional images and you need to get some image (e.g. first) from this array of images and set it instead of the main image :idea:

Jan