Adding the recommended products section to product-info section

I have been trying to accomplish this for a while now. I want to move the recommended products from the bottom of the page and place them inside the product-info section, just under the add-to-cart button. I was able to create a snippet and remove the schema for the product-recommendations section and it kind of works (photo below). However, it doesn’t show the add to cart button and the dynamic accessories bases on metafields. Does anyone know of a workaround for this?

This is what I get when I create a new snippet and render it without the schema

{%- assign selected_variant = product.selected_or_first_available_variant -%}
{%- assign product_form_id = 'product_form_' | append: section.id | append: product.id -%}

  {%- if section.settings.enable_image_zoom -%}
    

  {%- endif -%}

  
    {%- form 'product', product, id: product_form_id, class: 'product-form' -%}
      {%- for block in section.blocks -%}
        {%- case block.type -%}
          {%- when 'product_meta' -%}
            {%- render 'product-meta', product: product, block: block -%}
          {%- when 'variant_selector' -%}
            {%- render 'product-variant-selector', product: product, form: form, block: block -%}
{% if product.metafields.my_fields.used_cameras %}
    

 {{ product.metafields.my_fields.used_cameras.value }}

  {% endif %}
          {%- when 'buy_buttons' -%}
            {%- render 'product-buy-buttons', product: product, form: form, block: block -%}

          {%- when 'text' -%}
            {%- if block.settings.content != blank -%}
              
                {{- block.settings.content -}}
              

            {%- endif -%}

          {%- when 'button' -%}
            {%- if block.settings.text != blank -%}
              {{ block.settings.text | escape }}
            {%- endif -%}

          {%- when 'store_pickup' -%}
            {%- comment -%}The availability container will be added automatically if there is store pickup available{%- endcomment -%}
            

              {%- render 'store-availability', product_variant: product.selected_or_first_available_variant -%}
            

          {%- when 'featured_description' -%}
            {%- comment -%}This is only shown on the featured product section{%- endcomment -%}
            {%- if product.description != blank -%}
              
                {% capture desctabs %}{{ product.description | remove: 'data-section-type="product"'   }}{% endcapture %}{% render 'product-description-tabs' with desctabs %}
              

            {%- endif -%}

          {%- when '@app' -%}
            {%- render block -%}
        {%- endcase -%}
      {%- endfor -%}
{% render 'product-recommendations' %}
    

---

   

          
  

---

  
    

Free Shipping Orders $99+

    
  

                
   

---

  
            

2-Year Warranty 90-Day Returns

  

               
   

---

  
            

Expert Customer Service

  

    
    
         
  

---

  
    

Secure Checkout

    
  

    

    

---

  
      {%- assign product_meta_block = section.blocks | where: 'type', 'product_meta' | first -%}

      {%- if product_meta_block != blank and product_meta_block.settings.show_share_buttons -%}
        
          {{ 'product.general.share' | t }}

          {%- assign share_url = shop.url | append: product.url | url_param_escape -%}
          {%- assign twitter_text = product.title | url_param_escape -%}
          {%- assign pinterest_description = product.description | strip_html | truncatewords: 15 | url_param_escape -%}
          {%- assign pinterest_image = product.featured_media | img_url: '1024x' | prepend: 'https:' -%}

          

            - [{%- render 'icon', icon: 'facebook' -%}](https://www.facebook.com/sharer.php?u={{ share_url }})
            

            - [{%- render 'icon', icon: 'pinterest' -%}](https://pinterest.com/pin/create/button/?url={{ share_url }}{% if pinterest_image != blank %}&media={{ pinterest_image }}{% endif %}&description={{ pinterest_description }})
            

            - [{%- render 'icon', icon: 'twitter' -%}](https://twitter.com/share?{% if twitter_text != blank %}text={{twitter_text}}&{% endif %}url={{ share_url }})
            

            - [{% render 'icon', icon: 'email' %}](mailto:?&subject={{ product.title | escape }}&body={{ share_url }})
            
          

        

      
      {%- endif -%}
    {%- endform -%}
     {% for collection in product.collections %}
    
  {% if collection.handle == "in-stock-trail-cameras" %}
     
      ## Buy it with:
      
      

    
      

    

    

    

    

    
    

  
  {% endif %}
{% endfor %}

  

  {% comment %}
  ------------------------------------------------------------------------------
  Product Data. This must be outputted for all products (including home page).

  IMPORTANT: THIS CODE IS VITAL. DO NOT EDIT IT NOR REMOVE IT. MAKE SURE TO KEEP
  THE EXACT SAME ATTRIBUTES.
  ------------------------------------------------------------------------------
  {% endcomment %}

  {%- assign variant_selector_block = section.blocks | where: 'type', 'variant_selector' | first -%}

  

The code above is our product-info section with the render product-recommendations snippet

{%- assign use_recommendations = true -%}

{%- for block in section.blocks -%}
  {%- if block.settings.product != blank -%}
    {%- assign use_recommendations = false -%}
  {%- endif -%}
{%- endfor -%}

{%- capture section_settings -%}
{
  "stackable": false,
  "layout": "vertical",
  "productId": {{ product.id | json }},
  "useRecommendations": {{ use_recommendations | json }},
  "recommendationsCount": 10
}
{%- endcapture -%}

{% schema %}
{
  "name": "Product recommendations",
  "templates": ["product"],
  "max_blocks": 6,
  "settings": [
    {
      "type": "paragraph",
      "content": "Dynamic recommendations change and improve with time. [Learn more](https://help.shopify.com/en/themes/development/recommended-products). You can manually select products by adding content."
    },
    {
      "type": "text",
      "id": "heading",
      "label": "Heading",
      "default": "You may also like"
    },
    {
      "type": "checkbox",
      "id": "show_quick_buy",
      "label": "Show quick buy",
      "default": false
    }
  ],
  "blocks": [
    {
      "type": "product",
      "name": "Product",
      "settings": [
        {
          "type": "paragraph",
          "content": "Dynamic recommendations are not shown if products are explicitly selected."
        },
        {
          "type": "product",
          "id": "product",
          "label": "Product"
        }
      ]
    }
  ],
  "presets": [
    {
      "category": "Product",
      "name": "Product recommendations"
    }
  ]
}
{% endschema %}

The code above is the actual code for the product-recommendations section which I cannot include in the product-info section as it doesn’t allow it.

Any help would be appreciated.

Render is for snippets, while ‘product-recommendations’ is a section.

Just copying code to a new snippet wouldn’t work as section schema doesn’t work.

You could try changing default for ‘show_quick_buy’ to true.

Look for

{ "type": "checkbox", "id": "show_quick_buy", "label": "Show quick buy", "default": false }

And replace with

{ "type": "checkbox", "id": "show_quick_buy", "label": "Show quick buy", "default": true }

If this doesn’t help, I have another solution (which I did type but lost before posting reply due to page refresh :sweat_smile: ) that might help. Try and let me know.