Hi all,
Hope everyone is having a great week.
I’m hoping to get some help with putting 6 products in our ‘product recommendations’ section on our product pages, while making the section centered (currently I can add six with code but they go off to the RHS of the page and make the products smaller.
Theme: Palo Alto
URL: https://www.coffee.prestigerepairs.com.au/collections/manual-coffee-machines/products/ascaso-baby-t-zero-coffee-machine
What we currently have
What we are looking for
Thank you.
2 Likes
Hi ,
I am from Mageplaza - Shopify solution expert.
To increase the number of products in the recommendation section, you need to follow these two steps:
Step 1: Change the number of displayed products1. From your Shopify admin, go to Online Store > Themes.
-
On the Palo Alto theme, click Actions (…) > Edit code.
-
In the left-side folder directory, find the Sections folder and open the product-recommendations.liquid file.
-
Use Ctrl + F (or Cmd + F on Mac) to find the code containing limit:. It is usually located within a for loop or in the schema section at the bottom of the file. You will likely see a code snippet similar to this:
Đoạn mã
{%- for product in recommendations.products limit: 4 -%}
Or in the schema section:
JSON
{
"type": "range",
"id": "limit",
"min": 2,
"max": 4,
"step": 1,
"label": "Number of products to show",
"default": 4
}
-
Change the value:
-
If it’s in the loop, change limit: 4 to limit: 6.
-
If it’s in the schema, increase the “max” and “default” values to 6.
-
Click Save.
Step 2: Add the following CSS code to your theme.css file to apply the desired customization
@media only screen and (min-width: 1440px) {
.one-quarter {
width: calc((var(--wrapper-width) - var(--grid-gutter) * 3) / 6);
}
}
**Result: ( image with 4 product )
Please let me know if it works as expected
Best regards!