Jump to content

 

ffqa

Member Since 10 Jun 2021
Offline Last Active Jun 17 2021 03:06 PM
-----

Topics I've Started

Additional Tab In Product_Update.tpl

10 June 2021 - 04:28 PM

I am unsure how to display an additional tab on product variation pages, if it is a 'Variations as one product'.

 

I have a design/backend/templates/addons/my_addon/hooks/products/tabs_content.post.tpl

<div class="{if $selected_section !== "my_addon"}hidden{/if}" id="content_my_addon">
{include file="views/products/components/picker/picker.tpl"
    input_name="my_addon_data[]"
    item_ids=$my_addon
    multiple=true
    view_mode="external"
    select_group_class="btn-toolbar"
}
</div>

For variations as separate products it works just fine.

 

 

design\backend\templates\addons\product_variations\hooks\products\tabs_content.override.tpl

has a condition

{if !$product_type->isFieldAvailable("tabs_content")}
    <!-- Overridden by the Product Variations add-on -->
{/if}

So I added app\addons\my_addon\schemas\product_variations\product_types.post.php with

use Tygh\Addons\ProductVariations\Product\Type\Type;

$schema[Type::PRODUCT_TYPE_VARIATION]['tabs'][] = 'my_addon';

return $schema; 

and it actually adds a tab... without content.

 

 

I'm not sure what to make of this. I'm new to CS-Cart and smarty, can anyone shed some light on this for me?