What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
HI TEAM, can anyone guide me how to fetch database data to frontend in spryker. any guide link?
Hey,
please have a look at the developer learning plan at academy.spryker.com π
i checked im not getting that tutorial can u give me link?
Have a look here: https://academy.spryker.com/learn/public/learning_plan/view/73/spryker-backend-fundamentals
the persist and fetch one is one way to learn; for projects you would likely use publish&synchronize
Depends on the kind of data.
If it's non customer related data, like products, availabilities, etc. you don't retrieve the data from the database but from the storage (redis), where it get's synchronized into via publish & synchronize (https://docs.spryker.com/docs/scos/dev/back-end-development/data-manipulation/data-publishing/publish-and-synchronization.html)
If it's customer related data, like addresses, or the data needs a live calculation, like cart sums, you retrieve the data from the backend application (Zed Gateway) which fetchs the data from the database (https://docs.spryker.com/docs/scos/dev/back-end-development/data-manipulation/data-interaction/transfer-data-between-yves-and-zed.html#imple[β¦]lient).
The frontend (Yves/Glue) should not have direct access to the database as this would reduce the scaleability of your shop.
There is a possibility to replace the storage with database access (https://docs.spryker.com/docs/scos/dev/tutorials-and-howtos/howtos/howto-replace-key-value-storage-with-database.html), but this is a scenario you should only choose if you have a very few customers, but a high amount of products/categories/etc. For example in some B2B scenarios. But as I assume by the question that you are not too familiar with Spryker better forget about this scenario for now, as it applies only to a few edge cases.
im having one more doubt. in frontend breadcrumb value is fetched. how you can show it as page title
β’ in this screenshot. the u can see breadcrumb value Home / Customer Account / Quote Requests / #RED--1-15
So i want o show #RED--1-15 as separate page title
There is the metaTitle
block in the page-blank.twig
which means on product abstract and product concrete pages you could overwrite it in the related template and use the breadcrumb from ProductViewTransfer->getCategoriesBreadcrumb()
On other parts, like quote request, you will need to find the right template (either you have already a page-layout, like page-layout-customer.twig
or you need to modify the related view to overwrite the above mentioned metaTitle
For quote requests there already exists a page-layout you can overwrite in your project code: page-layout-quote-request.twig
Please can u tell me in which folder is page-blank.twig file?
i want to place this code in twig file. how to keep it as separate block of html code
{{data.quoteRequest.quoteRequestReference}}
src/Pyz/Yves/ShopUi/Theme/default/templates/page-blank/page-blank.twig
(if it does not exists, create it and extend the core one):
{% extends template('page-blank', '@SprykerShop:ShopUi') %}
i want to place this code in twig file. how to keep it as separate block of html code
This is something which should be done in the more specific page layout page-layout-quote-request.twig
(in src/Pyz/Yves/QuoteRequestPage/Theme/default/templates/page-layout-quote-request/page-layout-quote-request.twig
, again if it does not exist, create it)
Can u tell me how to hide the title in twig file based on condition of quote request such as approved, rejected, in progress.
{% if data.quoteRequest.status == '<your status>' %}
ok
can i send u file will u help me in doing it?
No, sorry if you need someone to implement your requirements for you, either you can hire my company (Smart Commerce SE) or you can learn how and where to implement things.
I'm happy to help on the learning journey, but I wan't do the work for you.
There is an excellent tutorial on twig available at https://twig.symfony.com/doc/3.x/api.html, as well as the https://academy.spryker.com/learn/course/external/view/elearning/381/spryker-frontend-for-backend-developers course for the spryker specific parts.
ok. thanks
Hi .can u give me idea how to group bundled products in backoffice in Quote request page which is stored in database.?
??
i have database column in which values are stored based on that column i want to fetch on backoffice quote request page. Can anybody give me idea how to do it?
Hi .can u give me idea how to sort cart items in spryker in backoffice? can i do it directly in twig file or should i make use of controller?