fix(produit) rétablis le sélecteur de variation
- passe temporairement du sélecteur d'attribut au sélecteur de variation, car il n'est pas possible de mettre à jour le prix affiché au changement de variation...
This commit is contained in:
parent
a5b240cd3f
commit
a39682d363
3 changed files with 48 additions and 48 deletions
|
|
@ -169,8 +169,8 @@ function charge_scripts_styles_page_panier(): void {
|
|||
|
||||
add_action('wp_enqueue_scripts', 'charge_scripts_styles_page_panier');
|
||||
|
||||
$lal = wp_json_encode($contexte);
|
||||
echo "<script>console.debug({$lal});</script>";
|
||||
// $lal = wp_json_encode($contexte);
|
||||
// echo "<script>console.debug({$lal});</script>";
|
||||
|
||||
// Rendu
|
||||
Timber::render(
|
||||
|
|
|
|||
|
|
@ -86,12 +86,12 @@ function charge_scripts_page_produit(): void {
|
|||
|
||||
add_action('wp_enqueue_scripts', 'charge_scripts_page_produit');
|
||||
|
||||
$lal = wp_json_encode($context);
|
||||
echo "<script>console.debug({$lal});</script>";
|
||||
// $lal = wp_json_encode($context);
|
||||
// echo "<script>console.debug({$lal});</script>";
|
||||
|
||||
$lol = wc_get_product()->get_children();
|
||||
$lol = wp_json_encode($lol);
|
||||
echo "<script>console.debug({$lol});</script>";
|
||||
// $lol = wc_get_product()->get_children();
|
||||
// $lol = wp_json_encode($lol);
|
||||
// echo "<script>console.debug({$lol});</script>";
|
||||
|
||||
// Rendu
|
||||
Timber::render(
|
||||
|
|
|
|||
|
|
@ -12,48 +12,48 @@
|
|||
<h3 class="selecteur-produit__nom">{{ produit.name }}</h3>
|
||||
|
||||
<div class="selecteur-produit__attribut-variation">
|
||||
{% if produit.attributes %}
|
||||
{% for attribut in produit.attributes %}
|
||||
<div class="test">
|
||||
{{ include('parts/pages/produit/selecteur-attributs-produit.twig') }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<!--
|
||||
{% if variations_produit|length > 1 %}
|
||||
<label
|
||||
for="selecteur-variation"
|
||||
id="label-selecteur-variation"
|
||||
>
|
||||
Option:
|
||||
</label>
|
||||
|
||||
<div class="selecteur-produit__attribut-variation__selecteurs">
|
||||
<select
|
||||
aria-labelledby="label-selecteur-variation"
|
||||
id="selecteur-variation"
|
||||
name="variations"
|
||||
>
|
||||
<option
|
||||
disabled
|
||||
selected
|
||||
value=""
|
||||
>
|
||||
--
|
||||
</option>
|
||||
{% for variation in variations_produit %}
|
||||
<option
|
||||
data-prix="{{ variation.prix }}"
|
||||
value="{{ variation.id }}"
|
||||
>
|
||||
{{ variation.titre }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{#
|
||||
{% if produit.attributes %}
|
||||
{% for attribut in produit.attributes %}
|
||||
<div class="test">
|
||||
{{ include('parts/pages/produit/selecteur-attributs-produit.twig') }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
-->
|
||||
#}
|
||||
|
||||
{% if variations_produit|length > 1 %}
|
||||
<label
|
||||
for="selecteur-variation"
|
||||
id="label-selecteur-variation"
|
||||
>
|
||||
Option:
|
||||
</label>
|
||||
|
||||
<div class="selecteur-produit__attribut-variation__selecteurs">
|
||||
<select
|
||||
aria-labelledby="label-selecteur-variation"
|
||||
id="selecteur-variation"
|
||||
name="variations"
|
||||
>
|
||||
<option
|
||||
disabled
|
||||
selected
|
||||
value=""
|
||||
>
|
||||
--
|
||||
</option>
|
||||
{% for variation in variations_produit %}
|
||||
<option
|
||||
data-prix="{{ variation.prix }}"
|
||||
value="{{ variation.id }}"
|
||||
>
|
||||
{{ variation.titre }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<p class="selecteur-produit__prix">{{ prix_maximal ?? produit.price }}€</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue