phImageBox (on item view page)

Phoca Cart - complex e-commerce extension
MM0233
Phoca Member
Phoca Member
Posts: 22
Joined: 02 Feb 2018, 18:18

phImageBox (on item view page)

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: phImageBox (on item view page)

Post 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
If you find Phoca extensions useful, please support the project
MM0233
Phoca Member
Phoca Member
Posts: 22
Joined: 02 Feb 2018, 18:18

Re: phImageBox (on item view page)

Post 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!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: phImageBox (on item view page)

Post 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
If you find Phoca extensions useful, please support the project
MM0233
Phoca Member
Phoca Member
Posts: 22
Joined: 02 Feb 2018, 18:18

Re: phImageBox (on item view page)

Post 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.
MM0233
Phoca Member
Phoca Member
Posts: 22
Joined: 02 Feb 2018, 18:18

Re: phImageBox (on item view page)

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: phImageBox (on item view page)

Post 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
If you find Phoca extensions useful, please support the project
MM0233
Phoca Member
Phoca Member
Posts: 22
Joined: 02 Feb 2018, 18:18

Re: phImageBox (on item view page)

Post 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?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: phImageBox (on item view page)

Post 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
If you find Phoca extensions useful, please support the project
Post Reply