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..
How to fetch database data to frontend in Spryker?
HI TEAM, can anyone guide me how to fetch database data to frontend in spryker. any guide link?
Comments
-
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
Hey,
please have a look at the developer learning plan at academy.spryker.com π0 -
i checked im not getting that tutorial can u give me link?
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
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
0 -
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.
0 -
im having one more doubt. in frontend breadcrumb value is fetched. how you can show it as page title
0 -
β’ 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 title0 -
There is the
metaTitle
block in thepage-blank.twig
which means on product abstract and product concrete pages you could overwrite it in the related template and use the breadcrumb fromProductViewTransfer->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 mentionedmetaTitle
0 -
For quote requests there already exists a page-layout you can overwrite in your project code:
page-layout-quote-request.twig
0 -
Please can u tell me in which folder is page-blank.twig file?
0 -
i want to place this code in twig file. how to keep it as separate block of html code
0 -
{{data.quoteRequest.quoteRequestReference}}
0 -
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') %}
0 -
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
(insrc/Pyz/Yves/QuoteRequestPage/Theme/default/templates/page-layout-quote-request/page-layout-quote-request.twig
, again if it does not exist, create it)0 -
Can u tell me how to hide the title in twig file based on condition of quote request such as approved, rejected, in progress.
0 -
{% if data.quoteRequest.status == '<your status>' %}
0 -
ok
0 -
can i send u file will u help me in doing it?
0 -
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.
0 -
ok. thanks
0 -
Hi .can u give me idea how to group bundled products in backoffice in Quote request page which is stored in database.?
0 -
-
??
0 -
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?
0 -
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?
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 930 Developer Corner
- 788 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random