Page 1 of 1

A Simple Modification to Product Gallery page.

Posted: Sat Apr 01, 2023 6:43 pm
by madruga
Hello,

I need a simple modification to product gallery page.

I want a product colour selected from the selectbox to be passed as a $colour variable to the catalog\includes\modules\pi\product_info\pi_gallery.php page each time the colour selection changes and reload the page.

I know that the attributes form(s) loaded on the pi_gallery.php page are derived from the catalog\includes\modules\pi\product_info\templates\tpl_pi_options_attributes.php file but can't see the full code as output in html.

<div class="col-sm-<?php echo $content_width; ?> pi-options-attributes mt-2">
<h6><?php echo PI_OA_HEADING_TITLE; ?></h6>

<?php
foreach ($options as $option) {
echo '<div class="form-group row">' . PHP_EOL;
echo ' <label for="input_' . $option['id'] . '" class="col-form-label col-sm-3 text-left text-sm-right">' . $option['name'] . '</label>' . PHP_EOL;
echo ' <div class="col-sm-9">' . PHP_EOL;
echo $option['menu'] . PHP_EOL;
echo $fr_input;
echo ' </div>' . PHP_EOL;
echo '</div>' . PHP_EOL;
}
?>
</div>

I could have done this myself but as I don't know where code for html output is, I am unable to do it.

Is this something someone can help with? I hope so.
Select Colour.jpg
Many thanks.

Re: A Simple Modification to Product Gallery page.

Posted: Sun Apr 02, 2023 4:44 pm
by LeeFoster
Are you looking to change the image based on the selected option?

Re: A Simple Modification to Product Gallery page.

Posted: Sun Apr 02, 2023 6:28 pm
by madruga
Hi @LeeFoster , yes this is what I want to do.

Re: A Simple Modification to Product Gallery page.

Posted: Mon Apr 03, 2023 3:16 pm
by LeeFoster
madruga wrote: Sun Apr 02, 2023 6:28 pm Hi @LeeFoster , yes this is what I want to do.
I did something similar with an older version. I'm on holiday at the moment but will share it with you when I get back on Friday