Jump to content

Display extra field on Table ps_product_attribute , in Product.tpl


Talezam

Recommended Posts

Hi all,

 

I have Prestashop 1.6.

 

I added one extra field in PREFIX_product_attribute. I can change the value in the BO and it's work. I can see the value on the table (PREFIX_product_attribute).

 

When, i make :

<pre>{$combinations|@print_r:1}</pre>

I can see my new value but i don't know how display this value on Product.tpl. And, this value need to change as Reference, when i change attribute.

 

Example :

 

When I choose the attribute 80, the suite display :

 

Attribute : 80

Reference : ZA 80

New value : XXX

 

When I choose the attribute 100, the suite display :

 

Attribute : 100

Reference : ZA 100

New value : YYY

 

 

Thanks all.

 

Ps : Sorry for my bad english.

 

 

Edited by Talezam (see edit history)
Link to comment
Share on other sites

Hello, 

 

I know it, but i can't test this, if i can't display the new value on the BO with smarty.

 

In product.js, i think i need to use these function :

~261. function addCombination
~283. function findCombination(firstTime)
~362 function updateDisplay()

Maybe with :

{if (selectedCombination['reference'])
$('#product_reference span').text(selectedCombination['reference']);
else if (productReference)
$('#product_reference span').text(productReference);
$('#product_reference:hidden').show('slow');
}
else
$('#product_reference:visible').hide('slow');

In the third function. i can use it, for display or not, if there is a value. 

 

2 weeks I'm looking for this shit ....

Edited by Talezam (see edit history)
Link to comment
Share on other sites

No one can help me ? I try, but i can't find.

 

When i make :

<hr>
    <pre>{$combinations|@print_r:1}</pre>
<hr> 

I have :

Array
(
[8] => Array
(
[attributes_values] => Array
(
[1] => 82 mm
)

[attributes] => Array
(
[0] => 1
)

[price] => 0
[specific_price] => Array
(
)

[ecotax] => 0
[weight] => 0
[quantity] => 0
[reference] => ZA 802
[fire_class] => 262
[unit_impact] => 0.00
[minimal_quantity] => 1
[available_date] =>
[id_image] => -1
[list] => '1'
)

)

How can I retrieve the value [8] corresponding to the id of combination ? I 'm not really comfortable with Smarty...

 

Tal'

Edited by Talezam (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...