Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finishing your pdp #13

Open
github-learning-lab bot opened this issue Mar 5, 2020 · 3 comments
Open

Finishing your pdp #13

github-learning-lab bot opened this issue Mar 5, 2020 · 3 comments

Comments

@github-learning-lab
Copy link

Finishing your pdp

Branch: pdp3

Introduction

In this step we'll finish setting up our product page. We've learned how to stack blocks using Stack Layout, and we've also learned how to suggest similar product and better customize the SKU Selector for products with SKU images.

Use the following product URL to test this step: /3-colors-retro-stand-mixer/p.

image

Stack Layout

stack-layout is a type of layout that allows blocks to stack on top of others. It comes in handy when you want to a badge on top of an image or product. It's also useful when placing rich text onto images (using a rich-text and an image).

image

(In the image, a shelf is stacked on top a carrossel 👆)

In this step, we'll use stack-layout to place the brand on top of product images.

Activity

Develop the product page by adding the step below to product.jsonc:

  1. Declare a shelf.relatedProducts under the product's main line
"store.product": {
  "children": [
    "breadcrumb",
    "flex-layout.row#main",
    "shelf.relatedProducts"
  ]
}

⚠️ Remember, this product shelf is only displayed for the /3-colors-retro-stand-mixer/p product.

  1. From the left column, change product-images with a stack-layout declaration;
"flex-layout.col#left": {
  "children": [
    "stack-layout#brand"
  ]
}
  1. Define stack-layout and set product-images and product-brand as children;
"stack-layout#brand": {
  "children": [
    "product-images",
    "product-brand"
  ]
}
  1. Consult the documentation to change the way in which product-brand is displayed. You should make the logo appear with a height of 30 and include the displayMode: "logo" prop.

  2. Review the documentation to make the sku-selector do the following:

  • start without any selected SKU;
  • show the name by SKU variation;
  • display an error message if no SKU variation was selected.

ℹ️ Remember to read through the Stack Layout documentation if you have any questions during the activity.

ℹ️ Remember to use the /3-colors-retro-stand-mixer/p product to test this step.


If you're still unsure as to how to send your answers, click here.

@vtex-course-hub
Copy link

Oopsie, something went wrong 😿

Results

✅✅✅✅✅❌

Tests

✅ Code compilation
✅ Define related products shelf
✅ Use and define a stack-layout on the left column
✅ Use product images and product brand within the stack layout
✅ Define correct props on product-brand
❌ You didn't define the props correctly on sku-selector

Try again 😁

@vtex-course-hub
Copy link

You did great! 😁

Results

✅✅✅✅✅✅

Tests

✅ Code compilation
✅ Define related products shelf
✅ Use and define a stack-layout on the left column
✅ Use product images and product brand within the stack layout
✅ Define correct props on product-brand
✅ Define correct props on sku-selector

@github-learning-lab
Copy link
Author

You have successfully completed this step!

Go to the next step!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants