[Added] option to add variants in view_item event
by Florian Palme <info@florian-palme.de>
This commit is contained in:
@ -209,6 +209,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<div class="card mb-5">
|
||||||
|
<div class="card-header">
|
||||||
|
{{ translate({ ident: "D3EXTENDEDCONFIG" }) }}
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="form-check mb-3">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" name="editval[bool][_blViewItemAddVariants]" {% if d3ViewObject.d3GetModuleConfigParam('_blViewItemAddVariants') %}checked{% endif %} id="blGA4enab">
|
||||||
|
<label class="form-check-label" for="flexCheckDefault">
|
||||||
|
{{ translate({ ident: "D3VIEWITEMADDVARIANTS" }) }}{% include "inputhelp.html.twig" with {'sHelpId': help_id("D3VIEWITEMADDVARIANTS_HELP"), 'sHelpText': help_text("D3VIEWITEMADDVARIANTS_HELP")} %}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="submit" name="save" class="btn btn-light" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
@ -13,7 +13,8 @@
|
|||||||
'eventLabel':'Product View',
|
'eventLabel':'Product View',
|
||||||
'ecommerce': {
|
'ecommerce': {
|
||||||
'currency': '{{ currency.name }}',
|
'currency': '{{ currency.name }}',
|
||||||
'items': [{
|
'items': [
|
||||||
|
{
|
||||||
'item_oxid': '{{ gtmProduct.getFieldData("oxid") }}',
|
'item_oxid': '{{ gtmProduct.getFieldData("oxid") }}',
|
||||||
'item_name': '{{ gtmProduct.getFieldData('oxtitle')|raw }}',
|
'item_name': '{{ gtmProduct.getFieldData('oxtitle')|raw }}',
|
||||||
'item_id': '{{ gtmProduct.getFieldData("oxartnum") }}',
|
'item_id': '{{ gtmProduct.getFieldData("oxartnum") }}',
|
||||||
@ -28,7 +29,26 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% set d3PriceObject = gtmProduct.getPrice() %}
|
{% set d3PriceObject = gtmProduct.getPrice() %}
|
||||||
'price': {{ d3PriceObject.getPrice() }}
|
'price': {{ d3PriceObject.getPrice() }}
|
||||||
}]
|
}{% if d3ViewObject.d3GetModuleConfigParam('_blViewItemAddVariants') %}
|
||||||
|
{% for gtmProduct.getVariants() in oVariant %}
|
||||||
|
, {
|
||||||
|
'item_name': '{{ oVariant.getRawFieldData("oxtitle") }}',
|
||||||
|
'item_id': '{{ oVariant.getFieldData("oxartnum") }}',
|
||||||
|
'item_brand': '{% if gtmManufacturer %}{{ gtmManufacturer.getFieldData('oxtitle')|raw }}{% endif %}',
|
||||||
|
'item_variant': '{% if oVariant.getFieldData("oxvarselect") %}{{ oVariant.getFieldData("oxvarselect") }}{% endif %}',
|
||||||
|
{% if gtmCategory %}
|
||||||
|
'item_category': '{{ gtmCategory.getSplitCategoryArray(0, true) }}',
|
||||||
|
'item_category2':'{{ gtmCategory.getSplitCategoryArray(1, true) }}',
|
||||||
|
'item_category3':'{{ gtmCategory.getSplitCategoryArray(2, true) }}',
|
||||||
|
'item_category4':'{{ gtmCategory.getSplitCategoryArray(3, true) }}',
|
||||||
|
'item_list_name':'{{ gtmCategory.getSplitCategoryArray() }}',
|
||||||
|
{% endif %}
|
||||||
|
{% set d3PriceObject = oVariant.getPrice() %}
|
||||||
|
'price': {{ d3PriceObject.getPrice() }}
|
||||||
|
}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
]
|
||||||
}{% if oViewConf.isDebugModeOn() %},
|
}{% if oViewConf.isDebugModeOn() %},
|
||||||
'debug_mode': 'true'
|
'debug_mode': 'true'
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user