Post by antmagn » Sat Aug 17, 2024 12:08 am

Hello eveyone, it's Tonia again. I'm trying to make my own product tabs because the extensions that I found mess with product twig file and I have alter it to make it look how I like it. I have found a way to change the "Specifications" label to "Ingredients" label, which is fine but I wanted to add one more tab with the label "how to use". But I do not know how to retrieve some product information for it to display. For example an isolated attribute of the product, or even the text from a disabled review that I could add manually. To make it more clear, I have three tabs, one is "Description", one is specifications which I changed it to "ingredients" and one that I added from product twig file which is label "how to use". Can anyone help me. I have a basic knowledge from programming. I tried to add product_sku as a data to display in the "how to use" tab but no luck.

Below is the secion of the product twig which I added manually:


<div class="tab-pane" id="tab-specificationHow">
<table class="table table-bordered">
{% for attribute_group in attribute_groups %}

<tbody>


<td>{{ product_sku }}How To</td>


</tbody>
{% endfor %}
</table>
</div>

A product example here: https://tonias-handmade.com/Facial-Clea ... rub-Almond

Thanks in advance,
Tonia

Attachments

CaptureHowTo.JPG

CaptureHowTo.JPG (48.01 KiB) Viewed 555 times

CaptureTwig.JPG

CaptureTwig.JPG (36.92 KiB) Viewed 555 times

Last edited by antmagn on Mon Aug 19, 2024 7:21 pm, edited 1 time in total.

New member

Posts

Joined
Fri Jul 23, 2021 8:38 pm

Post by ADD Creative » Sun Aug 18, 2024 11:28 pm

The information for the product you can use in the template has to be set in catalog/controller/product/product.php.

To use the SKU you would need to add the following to the controller.

Code: Select all

$data['product_sku'] = $product_info['sku'];

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by antmagn » Mon Aug 19, 2024 7:20 pm

ADD Creative wrote:
Sun Aug 18, 2024 11:28 pm
The information for the product you can use in the template has to be set in catalog/controller/product/product.php.

To use the SKU you would need to add the following to the controller.

Code: Select all

$data['product_sku'] = $product_info['sku'];
thank you very much, it worked :)

New member

Posts

Joined
Fri Jul 23, 2021 8:38 pm
Who is online

Users browsing this forum: No registered users and 19 guests