Jump to content

Edit History

koubin

koubin


gramatic

Hello,

for Prestashop 1.7 I would like to know, if there is an easy way to display the variant additional price (price impact for the standalone product).

Lets say I sell cups. It would look like this:

Cup  $20

Variants:

- cup with color +$5

- cup with image +$10

 

I have found the place where to add it. It is product-variants.tpl and the code there:   

       {foreach from=$group.attributes key=id_attribute item=group_attribute}
            <option value="{$id_attribute}" title="{$group_attribute.name}"{if $group_attribute.selectedselected="selected"{/if}>{$group_attribute.name} ...HERE ADD VARIANT PRICE...</option>
       {/foreach}

but I can't figure out how to find and use the correct variable for that (I also have no idea how to find available variables in the TPL. The {debug} is not sufficient for that)

I guess it should be something like this:

{$combinations.price}

and the $combinations should be somehow referenced in TPL and PHP, but don't know how and where.

Could someone give me a little insight on how this works?

Thanks

koubin

koubin

Hello,

for Prestashop 1.7 I would like to know, if there is an easy way to display the variant additipnal price (price impact for the standalone product).

Lets say I sell cups. It would look like this:

Cup  $20

Variants:

- cup with color +$5

- cup with image +$10

 

I have found the place where to add it. It is product-variants.tpl and the code there:   

       {foreach from=$group.attributes key=id_attribute item=group_attribute}
            <option value="{$id_attribute}" title="{$group_attribute.name}"{if $group_attribute.selectedselected="selected"{/if}>{$group_attribute.name} ...HERE ADD VARIANT PRICE...</option>
       {/foreach}

but I can't figure out how to find and use the correct variable for that (I also have no idea how to find available variables in the TPL. The {debug} is not sufficient for that)

I guess it should be something like this:

{$combinations.price}

and the $combinations should be somehow referenced in TPL and PHP, but don't know how and where.

Could someone give me a little insight on how this works?

Thanks

koubin

koubin

Hello,

for Prestashop 1.7 I would like to know, if there is an easy way to display the variant additipnal price (price impact for the standalone product).

Lets say I sell cups. It would look like this:

Cup  $20

Variants:

- cup with color +$5

- cup with image +$10

 

I have found the place where to add it. It is product-variants.tpl and the code there:   

       {foreach from=$group.attributes key=id_attribute item=group_attribute}
            <option value="{$id_attribute}" title="{$group_attribute.name}"{if $group_attribute.selectedselected="selected"{/if}>{$group_attribute.name} ...HERE ADD VARIANT PRICE...</option>
       {/foreach}

but I can't figure out how to find and use the correct variable for that (I also have no idea how to find available variables in the TPL. The {debug} is not sufficient for that)

I guess it should be something like this:

{$combinations.price}

and the $combinations should be somehow referenced in TPL and PHP, but don't know how and where.

Could someone give me a little insight on how this works?

Thanks

×
×
  • Create New...