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');
|
add_action('wp_enqueue_scripts', 'charge_scripts_styles_page_panier');
|
||||||
|
|
||||||
$lal = wp_json_encode($contexte);
|
// $lal = wp_json_encode($contexte);
|
||||||
echo "<script>console.debug({$lal});</script>";
|
// echo "<script>console.debug({$lal});</script>";
|
||||||
|
|
||||||
// Rendu
|
// Rendu
|
||||||
Timber::render(
|
Timber::render(
|
||||||
|
|
|
||||||
|
|
@ -86,12 +86,12 @@ function charge_scripts_page_produit(): void {
|
||||||
|
|
||||||
add_action('wp_enqueue_scripts', 'charge_scripts_page_produit');
|
add_action('wp_enqueue_scripts', 'charge_scripts_page_produit');
|
||||||
|
|
||||||
$lal = wp_json_encode($context);
|
// $lal = wp_json_encode($context);
|
||||||
echo "<script>console.debug({$lal});</script>";
|
// echo "<script>console.debug({$lal});</script>";
|
||||||
|
|
||||||
$lol = wc_get_product()->get_children();
|
// $lol = wc_get_product()->get_children();
|
||||||
$lol = wp_json_encode($lol);
|
// $lol = wp_json_encode($lol);
|
||||||
echo "<script>console.debug({$lol});</script>";
|
// echo "<script>console.debug({$lol});</script>";
|
||||||
|
|
||||||
// Rendu
|
// Rendu
|
||||||
Timber::render(
|
Timber::render(
|
||||||
|
|
|
||||||
|
|
@ -12,48 +12,48 @@
|
||||||
<h3 class="selecteur-produit__nom">{{ produit.name }}</h3>
|
<h3 class="selecteur-produit__nom">{{ produit.name }}</h3>
|
||||||
|
|
||||||
<div class="selecteur-produit__attribut-variation">
|
<div class="selecteur-produit__attribut-variation">
|
||||||
{% if produit.attributes %}
|
{#
|
||||||
{% for attribut in produit.attributes %}
|
{% if produit.attributes %}
|
||||||
<div class="test">
|
{% for attribut in produit.attributes %}
|
||||||
{{ include('parts/pages/produit/selecteur-attributs-produit.twig') }}
|
<div class="test">
|
||||||
</div>
|
{{ include('parts/pages/produit/selecteur-attributs-produit.twig') }}
|
||||||
{% endfor %}
|
</div>
|
||||||
{% endif %}
|
{% endfor %}
|
||||||
|
|
||||||
<!--
|
|
||||||
{% 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 %}
|
{% 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>
|
</div>
|
||||||
|
|
||||||
<p class="selecteur-produit__prix">{{ prix_maximal ?? produit.price }}€</p>
|
<p class="selecteur-produit__prix">{{ prix_maximal ?? produit.price }}€</p>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue