Error while using code from docs
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- php
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu với phần “Step 3 “Create the carrier model”” trong tutorial Adobe Commerce được liên kết và so sánh các thuộc tính mẫu của phần này với Magento\Shipping\Model\Carrier\AbstractCarrier. Xác nhận lỗi PHP 8.3 và cập nhật các khai báo được ghi trong tài liệu để ví dụ khớp với lớp cha. Hoàn tất khi tutorial không còn tạo ra các lỗi typed-property đã được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is there an existing issue for this?
- I have searched the existing issues
Expected behavior
I have tried code from https://developer.adobe.com/commerce/php/tutorials/frontend/custom-checkout/add-shipping-carrier/#step-3-create-the-carrier-model
While testing with PHP 8.3.4 (cli) (built: Mar 16 2024 08:39:49) (NTS) it is throwing an error
"Fatal Error: 'Type of ---\Model\Carrier\Express::$_code must not be defined (as in class Magento\Shipping\Model\Carrier\AbstractCarrier)' in '.../Model/Carrier/Express.php' on line 18"
"Fatal Error: 'Type of ...\Model\Carrier\Express::$_isFixed must not be defined (as in class Magento\Shipping\Model\Carrier\AbstractCarrier)' in '.../Model/Carrier/Express.php' on line 18"
Should be fixed in docs.
Actual behavior
It should be corrected
protected string $_code = 'expressdelivery';
protected bool $_isFixed = true;
protected $_code = 'expressdelivery';
protected $_isFixed = true;
Steps to reproduce
Create custom module from https://developer.adobe.com/commerce/php/tutorials/frontend/custom-checkout/add-shipping-carrier/#step-3-create-the-carrier-model
Run coomands
Go to cart or checkout
Environment
- Browser:Chrome
- OS:Linux
Sample code
protected string $_code = 'expressdelivery';
protected bool $_isFixed = true;
protected $_code = 'expressdelivery';
protected $_isFixed = true;
Logs
"Fatal Error: 'Type of ---\Model\Carrier\Express::$_code must not be defined (as in class Magento\Shipping\Model\Carrier\AbstractCarrier)' in '.../Model/Carrier/Express.php' on line 18"
"Fatal Error: 'Type of ...\Model\Carrier\Express::$_isFixed must not be defined (as in class Magento\Shipping\Model\Carrier\AbstractCarrier)' in '.../Model/Carrier/Express.php' on line 18"
- Ngôn ngữ chính
- JavaScript
- Star
- 12
- Fork
- 178
- Merge trung bình
- 2 giờ 41 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AdobeDocs/commerce-php
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
AdobeDocs/commerce-php#457 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AdobeDocs/commerce-php#313 ·
-
What is the default value for a plugin's `sortOrder`?Có thể đã có người làm @jlnarvaez đã nhận 931 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
AdobeDocs/commerce-php#234 ·
-
🔗 Broken links found on developer.adobe.com (commerce-php)Có thể đã có người làm @dshevtsov đã nhận 43 ngày trước. Đang mởcontent-quality
AdobeDocs/commerce-php#460 · 1 bình luận · 2 người được giao ·
-
Issue in /src/pages/development/components/api-concepts.mdCó thể làm lại được @pawan đã nhận 240 ngày trước và không có pull request nào đang mở. Đang mở
AdobeDocs/commerce-php#432 · 5 bình luận · 1 người được giao ·
Tất cả issue của AdobeDocs/commerce-php
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
area:docs good first issue help wanted priority:medium type:chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
mahmutmft/courses-mcp#51 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue roadmap ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
AhmedNavaz/throughline#100 ·
-
good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
samiromer2/Ruby-Consent-Portal#26 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
django-helpdesk/django-helpdesk#1496 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày