Cms\Block
הכנסת בלוק סטטי – CmsBlock עדכון קובץ LYOUT רלוונטי : app/design/frontend/Abra/Theme/Magento_Cms/layout/cms_page_view.xml בניה של הבלוק ושימוש ב IDENTIFIER שימוש בבלוק כשורטקוד במידה ורוצים קוסץ ממודול: דגש על נתיב הקובץ : ניתן לבחור כל תקיה מתוך designלדוגמא : במידה ויש צורך להעביר CLASS לביצוע פונקציונליות : הדפסה מקובץ PHTML : מבלוק אחר לבלוק אחר :
דריסה של מודול : Overview of block, model, controller, helper
ביצוע של דריסה או הרחבה של פונקציות קיימות: בניה של המודול או מציאת המודול הקיים העתקת הקלאסס הרצוי di.xml רישום הדריסה Using Plugin VS Using Preference plugin : תוספת של מגנטו 2 , מאפשר דריסה או התערכבות בנקודות זמן ( לפי , אחרי וכו') , הדרך היותר נכונה Preference : דריסה מלאה של הקלאס Plugin …. Read More
Helper Class
שימוש בהילפר: מאפשר לממש את הקלאס או כל קטע קוד במודולים חיצונים למודול שבו נבנה את ההילפר דרכים למימוש : בקובץ PHTML בקלאס של המודול הרצוי : בניה של הילפר: יש ליצור קובץ Data.phpvandor>module>Helper>Data.php במידה ורוצים למשוך פונקציונאליות מהמודול צריך לבצע בניה של קונסטרקטור ומשיכה של הקלאס הרצוי קישור למדריך רלוונטי:https://www.mageplaza.com/devdocs/create-helper-class-magento-2.html#what
magento – css media queries
mobile Tablet Laptops Desktop Breakpoints Breakpoints are used in the CSS code to set up the screen width at which the design switches from the mobile to the desktop version. The Blank and Luma themes use Less variables to implement the following breakpoints: @screen__xxs: 320px @screen__xs: 480px @screen__s: 640px @screen__m: 768px (in the Blank and Luma …. Read More
messageManager
יצירת הודעה במגנטו 2 use MagentoFrameworkMessageManagerInterface; use below code in your file to add messages, protected _messageManager; public function __construct( MagentoFrameworkViewElementTemplateContext $context, MagentoFrameworkMessageManagerInterface $messageManager ) { parent::__construct($context); $this->_messageManager = $messageManager; } and then add below functions in your methods to show messages: $this->_messageManager->addError(__("Error Message")); $this->_messageManager->addWarning(__("Warning")); $this->_messageManager->addNotice(__("Notice")); $this->_messageManager->addSuccess(__("Success Message")); I hope this will help you fixing …. Read More
Debugging PHP with PhpStorm
Debugging PHP with PhpStorm
phpstorm shortcuts
קיצור דרך ב PHPSTORM https://shortcutworld.com/PhpStorm/win/JetBrains-PhpStorm_Shortcuts חיפוש בקובץ לפי שם : ctrl+f12 חזרה למקום הקודם : ctrl+alt+< , > קיצור לסוגר הרלוונטי : ctrl+shift+m מסדר רווחים ctrl+alt+i הנקודה האחרונה שבה בצעתי עריכה במסמך : Ctrl+Shift+Backspace קיצורים מהירים : Ctrl+J מעבר בין טאבים : Alt+Left Arrow/Alt+Right Arrow סגירה ופתיחה של סוגריים : Ctrl+NumPad +/Ctrl+NumPad – ctrl + shift + – numpad …. Read More
הוספת קובץ JS למגנטו
1. יצירת תקיה בשם המודל ב design requirejs-config.js – יצירת הקובץ בתקייה הראשית,שם המודול ללא :: 2. הכנסת הקובץ הרצוי לתקיה Magento_Contact/web/js/select2.min.js 3.CSS Magento_Contactwebcssselect2.min.css – מיקום הקובץ בתקיה 4.XML Magento_Contactlayoutcontact_index_index.xml לשים לב שיש צורך ב:: בשם המודול
הוספת טאב בעמוד מוצר
xml lyaout – attribut לאחר בניה של אטריביוט במערכת הניהול ניתן לקרוא לו קח , הדגש זה על ה GROUP שתהיה בשם הגרופ הקיים.במקרה הזה , הקלאס שונה וישנו ארגומנט בשם add_attributeשמציין את האטריביוט שהוספתי במערכת הניהול xml lyaout – cms block יש לשנות לקלאס המתאים ולדייק את הBLOCKֹID
הוספת תמונה
נתיב תקיה PHTML CSS