<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ use MagentoFrameworkPricingAmountAmountFactory; ?> <?php /** @var MagentoCatalogPricingRenderFinalPriceBox $block */ /** ex: MagentoCatalogPricingPriceRegularPrice */ /** @var MagentoFrameworkPricingPricePriceInterface $priceModel */ $priceModel = $block->getPriceType(‘regular_price’); /** ex: MagentoCatalogPricingPriceFinalPrice */ /** @var MagentoFrameworkPricingPricePriceInterface $finalPriceModel */ $finalPriceModel = $block->getPriceType(‘final_price’); $idSuffix = $block->getIdSuffix() ? $block->getIdSuffix()… Continue reading Magento Show only tier prices for Level Customer- No promotional prices
Author: Bibin Johnson
Declaring Collection Types in Payload
import { CollectionConfig } from “payload/types”; export type User = { id: string; name: string; email: string; role: “admin” | “editor” | “user”; // Enum type for roles createdAt: string; updatedAt: string; }; const Users: CollectionConfig = { slug: “users”, fields: [ { name: “name”, type: “text”, required: true, }, { name: “email”, type: “email”,… Continue reading Declaring Collection Types in Payload
Dew Diamonds Web Application Workflow
PD Order Creation & Approval A new PD order is created in the system. The Sales Supervisor reviews and approves the order. Once approved, the order moves to the Sketch Phase. 2. Sketch Creation & Approval Employees (Designers) create the Sketches based on the PD order. Once the sketches are completed, they are submitted for… Continue reading Dew Diamonds Web Application Workflow
Handling Relationships in PostgreSQL in Payload
Payload automatically manages relational data using PostgreSQL under the hood. The relationships will be stored as JSON fields containing references to related documents. const user = await payload.find({ collection: “users”, where: { id: { equals: “USER_ID” }, }, depth: 2, // Fetch nested relationships }); console.log(user); Use depth in API calls to fetch nested relational… Continue reading Handling Relationships in PostgreSQL in Payload
Workflow for the relations on Postgress DB using Payload
Payload CMS uses a schema-based approach to define relationships in the collections configuration. One to One import { CollectionConfig } from “payload/types”; const Users: CollectionConfig = { slug: “users”, fields: [ { name: “profile”, type: “relationship”, relationTo: “profiles”, // The related collection unique: true, // Ensures one-to-one relationship }, ], }; export default Users; import… Continue reading Workflow for the relations on Postgress DB using Payload
Schema Extension in Payload
This hook runs before the schema is built. You can use it to extend your database structure with tables that won’t be managed by Payload. import { postgresAdapter } from ‘@payloadcms/db-postgres’ import { integer, pgTable, serial } from ‘@payloadcms/db-postgres/drizzle/pg-core’ postgresAdapter({ beforeSchemaInit: [ ({ schema, adapter }) => { return { …schema, tables: { …schema.tables, addedTable:… Continue reading Schema Extension in Payload
PLesk Postgres DB management using external Application
Use the Plesk DB the third part of the application using Dbeaver. Provide the connection using SSH to the Dbeaver After that Connect the particular DB to the Dbeaver Application
Creating Migrations in Payload
For creating the migration in the payload we may need to run the payload script Create a new migration file in the migrations directory. You can optionally name the migration that will be created. By default, migrations will be named using a timestamp. npm run payload migrate:create optional-name-here To run the migrations from the crated… Continue reading Creating Migrations in Payload
Access plesk postgres Database using SSH thunnel
Modify postgresql.conf: 1. Open the file /var/lib/pgsql/data/postgresql.conf in a text editor Add the following line at the end of the file: listen_addresses = ‘*’ Save the changes and close the file. Modify pg_hba.conf: Open the file /var/lib/pgsql/data/pg_hba.conf in a text editor Add the following line at the end of the file: host same role all 203.0.113.2/32 md5 203.0.113.2/32… Continue reading Access plesk postgres Database using SSH thunnel
Schema Creation for the enitre work Flow
When designing a schema for employees based on roles, the goal is to establish a flexible structure that dynamically manages permissions. Here’s how we achieve this: Create a Roles Table The Roles table defines different roles within the system (e.g., Admin, Manager, Employee). Columns: role_id (Primary Key): Unique identifier for each role. role_name: Name of… Continue reading Schema Creation for the enitre work Flow