Ajouter sur un thème

Bonjour,

J’ai actuellement le thème VIVID et j’aimerai ajouter/modifié des choses.

Ajouter une section “Icône avec texte”
Mettre le bouton “Ajouter au panier” à côté du sélecteur de quantité.

Comment faire ?

@Angel54 to change the placement of the add to cat button after Quantity, need to change the code positions on the main product section.

le me know which type of icon section you want.

Je souhaite également mettre le texte enrichi en pleine largeur. Ou du moins allongé le texte.

Pour la couleur elle n’est pas non plus en pleine largeur mais seulement la largeur du texte.
Il n’est pas non plus possible de laisser le titre au centre et le texte sur la droite.

Merci de vos réponses.

Hello ProtoMan44

Pour l’icone avec texte je ne peux pas envoyé de photos. C’est le genre sur thème gratuit comme craft où j’ai vu.

Pour le changement du code, je ne sais pas m’y prendre avec le code CSS.

@Angel54 it is not only CSS needed, it needs custom code on HTML, LIQUID, CSS, and JS.

until now yu have not share the store URL , please share it in private.

C’est envoyé en privé.
ça se passe comment pour le code personnalisé ?

@Angel54
:

{% comment %}
  Renders icon with text block

  Accepts:
  - block: {Object} passes in the block information.

  Usage:
  {% render 'icon-with-text',
    block: block
  %}
{% endcomment %}
{%- liquid
  assign heading_1_empty = false
  assign heading_2_empty = false
  assign heading_3_empty = false
  assign text_only_all_items = true

  if block.settings.heading_1 == empty
    assign heading_1_empty = true
  endif

  if block.settings.heading_2 == empty
    assign heading_2_empty = true
  endif

  if block.settings.heading_3 == empty
    assign heading_3_empty = true
  endif

  if heading_1_empty == false and block.settings.icon_1 != 'none' or block.settings.image_1 != null
    assign text_only_all_items = false
  elsif heading_2_empty == false and block.settings.icon_2 != 'none' or block.settings.image_2 != null
    assign text_only_all_items = false
  elsif heading_3_empty == false and block.settings.icon_3 != 'none' or block.settings.image_3 != null
    assign text_only_all_items = false
  endif
-%}

  {%- unless heading_1_empty -%}
    - {%- if block.settings.image_1 == null -%}
          {%- render 'icon-accordion', icon: block.settings.icon_1 -%}
        {%- else -%}
        
        {%- endif -%}
      
          {{- block.settings.heading_1 -}}
      
    

  {%- endunless -%}
  {%- unless heading_2_empty -%}
    - {%- if block.settings.image_2 == null -%}
          {% render 'icon-accordion', icon: block.settings.icon_2 -%}
        {%- else -%}
        
        {%- endif -%}
      
          {{- block.settings.heading_2 -}}
      
    

  {%- endunless -%}
  {%- unless heading_3_empty -%}
    - {%- if block.settings.image_3 == null -%}
          {% render 'icon-accordion', icon: block.settings.icon_3 -%}
        {%- else -%}
        
        {%- endif -%}
      
          {{- block.settings.heading_3 -}}
      
    
  {%- endunless -%}

Je dois donc copié/collé cela ? à quel endroit ?

@Angel54 create a new section, then add this code in it :

{%- liquid
  assign heading_1_empty = false
  assign heading_2_empty = false
  assign heading_3_empty = false
  assign text_only_all_items = true

  if block.settings.heading_1 == empty
    assign heading_1_empty = true
  endif

  if block.settings.heading_2 == empty
    assign heading_2_empty = true
  endif

  if block.settings.heading_3 == empty
    assign heading_3_empty = true
  endif

  if heading_1_empty == false and block.settings.icon_1 != 'none' or block.settings.image_1 != null
    assign text_only_all_items = false
  elsif heading_2_empty == false and block.settings.icon_2 != 'none' or block.settings.image_2 != null
    assign text_only_all_items = false
  elsif heading_3_empty == false and block.settings.icon_3 != 'none' or block.settings.image_3 != null
    assign text_only_all_items = false
  endif
-%}

  {%- unless heading_1_empty -%}
    - {%- if block.settings.image_1 == null -%}
          {%- render 'icon-accordion', icon: block.settings.icon_1 -%}
        {%- else -%}
        
        {%- endif -%}
      
          {{- block.settings.heading_1 -}}
      
    

  {%- endunless -%}
  {%- unless heading_2_empty -%}
    - {%- if block.settings.image_2 == null -%}
          {% render 'icon-accordion', icon: block.settings.icon_2 -%}
        {%- else -%}
        
        {%- endif -%}
      
          {{- block.settings.heading_2 -}}
      
    

  {%- endunless -%}
  {%- unless heading_3_empty -%}
    - {%- if block.settings.image_3 == null -%}
          {% render 'icon-accordion', icon: block.settings.icon_3 -%}
        {%- else -%}
        
        {%- endif -%}
      
          {{- block.settings.heading_3 -}}
      
    
  {%- endunless -%}

{% schema %}
{
  "name": "Icon with Text",
  "settings": [
    {
      "type": "select",
      "id": "layout",
      "label": "Layout",
      "options": [
        {
          "value": "default",
          "label": "Default"
        },
        {
          "value": "alternative",
          "label": "Alternative"
        }
      ],
      "default": "default"
    }
  ],
  "blocks": [
    {
      "type": "icon_text",
      "name": "Icon and Text",
      "settings": [
        {
          "type": "text",
          "id": "heading_1",
          "label": "Heading 1",
          "default": ""
        },
        {
          "type": "select",
          "id": "icon_1",
          "label": "Icon 1",
          "options": [
            {
              "value": "none",
              "label": "None"
            },
            {
              "value": "icon1",
              "label": "Icon 1"
            },
            {
              "value": "icon2",
              "label": "Icon 2"
            }
          ],
          "default": "none"
        },
        {
          "type": "image_picker",
          "id": "image_1",
          "label": "Image 1"
        }
      ]
    },
    {
      "type": "icon_text",
      "name": "Icon and Text",
      "settings": [
        {
          "type": "text",
          "id": "heading_2",
          "label": "Heading 2",
          "default": ""
        },
        {
          "type": "select",
          "id": "icon_2",
          "label": "Icon 2",
          "options": [
            {
              "value": "none",
              "label": "None"
            },
            {
              "value": "icon1",
              "label": "Icon 1"
            },
            {
              "value": "icon2",
              "label": "Icon 2"
            }
          ],
          "default": "none"
        },
        {
          "type": "image_picker",
          "id": "image_2",
          "label": "Image 2"
        }
      ]
    },
    {
      "type": "icon_text",
      "name": "Icon and Text",
      "settings": [
        {
          "type": "text",
          "id": "heading_3",
          "label": "Heading 3",
          "default": ""
        },
        {
          "type": "select",
          "id": "icon_3",
          "label": "Icon 3",
          "options": [
            {
              "value": "none",
              "label": "None"
            },
            {
              "value": "icon1",
              "label": "Icon 1"
            },
            {
              "value": "icon2",
              "label": "Icon 2"
            }
          ],
          "default": "none"
        },
        {
          "type": "image_picker",
          "id": "image_3",
          "label": "Image 3"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "Default",
      "category": "Custom"
    }
  ]
}
{% endschema %}

Merci pour ton retour.

J’ai ajouter une section et voici ce qu’on me dit :