Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Mage_GiftMessage optional in templates #4266

Merged
merged 17 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 0 additions & 235 deletions .phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7705,11 +7705,6 @@ parameters:
count: 2
path: app/design/adminhtml/default/default/template/sales/order/address/form.phtml

-
message: "#^If condition is always true\\.$#"
count: 1
path: app/design/adminhtml/default/default/template/sales/order/create/giftmessage.phtml

-
message: "#^Method Mage_Adminhtml_Block_Sales_Order_Create_Abstract\\:\\:formatPrice\\(\\) invoked with 3 parameters, 1 required\\.$#"
count: 18
Expand Down Expand Up @@ -8175,51 +8170,6 @@ parameters:
count: 4
path: app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/options.phtml

-
message: "#^Variable \\$_item might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 22
path: app/design/frontend/base/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$_inc might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$_item might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 22
path: app/design/frontend/base/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 27
path: app/design/frontend/base/default/template/bundle/email/order/items/order/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 15
path: app/design/frontend/base/default/template/bundle/email/order/items/shipment/default.phtml

-
message: "#^Variable \\$_weeeTaxAttributes might not be defined\\.$#"
count: 8
Expand Down Expand Up @@ -8255,16 +8205,6 @@ parameters:
count: 173
path: app/design/frontend/base/default/template/bundle/sales/order/invoice/items/renderer.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 181
path: app/design/frontend/base/default/template/bundle/sales/order/items/renderer.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 20
path: app/design/frontend/base/default/template/bundle/sales/order/shipment/items/renderer.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 17
Expand Down Expand Up @@ -8780,11 +8720,6 @@ parameters:
count: 9
path: app/design/frontend/base/default/template/checkout/onepage/shipping_method.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 4
path: app/design/frontend/base/default/template/checkout/onepage/shipping_method/additional.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 15
Expand Down Expand Up @@ -9065,26 +9000,6 @@ parameters:
count: 18
path: app/design/frontend/base/default/template/downloadable/email/order/items/invoice/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 28
path: app/design/frontend/base/default/template/downloadable/email/order/items/order/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 170
path: app/design/frontend/base/default/template/downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 170
path: app/design/frontend/base/default/template/downloadable/sales/order/invoice/items/renderer/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 190
path: app/design/frontend/base/default/template/downloadable/sales/order/items/renderer/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 8
Expand All @@ -9095,11 +9010,6 @@ parameters:
count: 8
path: app/design/frontend/base/default/template/email/order/invoice/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 16
path: app/design/frontend/base/default/template/email/order/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 16
Expand All @@ -9110,11 +9020,6 @@ parameters:
count: 16
path: app/design/frontend/base/default/template/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 24
path: app/design/frontend/base/default/template/email/order/items/order/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 8
Expand Down Expand Up @@ -9410,31 +9315,16 @@ parameters:
count: 8
path: app/design/frontend/base/default/template/rss/list.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 27
path: app/design/frontend/base/default/template/rss/order/details.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 1
path: app/design/frontend/base/default/template/sales/guest/form.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 5
path: app/design/frontend/base/default/template/sales/order/creditmemo.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 17
path: app/design/frontend/base/default/template/sales/order/creditmemo/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 167
path: app/design/frontend/base/default/template/sales/order/creditmemo/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 21
Expand All @@ -9450,31 +9340,11 @@ parameters:
count: 10
path: app/design/frontend/base/default/template/sales/order/info/buttons.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 5
path: app/design/frontend/base/default/template/sales/order/invoice.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 15
path: app/design/frontend/base/default/template/sales/order/invoice/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 167
path: app/design/frontend/base/default/template/sales/order/invoice/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 18
path: app/design/frontend/base/default/template/sales/order/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 187
path: app/design/frontend/base/default/template/sales/order/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 18
Expand All @@ -9495,31 +9365,16 @@ parameters:
count: 17
path: app/design/frontend/base/default/template/sales/order/recent.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 5
path: app/design/frontend/base/default/template/sales/order/shipment.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 22
path: app/design/frontend/base/default/template/sales/order/shipment/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 15
path: app/design/frontend/base/default/template/sales/order/shipment/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 23
path: app/design/frontend/base/default/template/sales/order/trackinginfo.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 22
path: app/design/frontend/base/default/template/sales/order/view.phtml

-
message: "#^Call to method __\\(\\) on an unknown class Mage_Sale_Block_Reorder_Sidebar\\.$#"
count: 6
Expand Down Expand Up @@ -9650,56 +9505,6 @@ parameters:
count: 1
path: app/design/frontend/rwd/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml

-
message: "#^Variable \\$_item might not be defined\\.$#"
count: 1
path: app/design/frontend/rwd/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
count: 1
path: app/design/frontend/rwd/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 25
path: app/design/frontend/rwd/default/template/bundle/email/order/items/creditmemo/default.phtml

-
message: "#^Variable \\$_inc might not be defined\\.$#"
count: 1
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$_item might not be defined\\.$#"
count: 1
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$_showlastRow might not be defined\\.$#"
count: 1
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 25
path: app/design/frontend/rwd/default/template/bundle/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 29
path: app/design/frontend/rwd/default/template/bundle/email/order/items/order/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 16
path: app/design/frontend/rwd/default/template/bundle/email/order/items/shipment/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 181
path: app/design/frontend/rwd/default/template/bundle/sales/order/items/renderer.phtml

-
message: "#^Call to method escapeUrl\\(\\) on an unknown class Mage_Catalog_Block_Layer_Filter\\.$#"
count: 1
Expand Down Expand Up @@ -10125,16 +9930,6 @@ parameters:
count: 19
path: app/design/frontend/rwd/default/template/downloadable/email/order/items/invoice/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 29
path: app/design/frontend/rwd/default/template/downloadable/email/order/items/order/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 198
path: app/design/frontend/rwd/default/template/downloadable/sales/order/items/renderer/downloadable.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 10
Expand All @@ -10150,11 +9945,6 @@ parameters:
count: 8
path: app/design/frontend/rwd/default/template/email/order/invoice/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 16
path: app/design/frontend/rwd/default/template/email/order/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 17
Expand All @@ -10165,11 +9955,6 @@ parameters:
count: 17
path: app/design/frontend/rwd/default/template/email/order/items/invoice/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 25
path: app/design/frontend/rwd/default/template/email/order/items/order/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 8
Expand Down Expand Up @@ -10295,11 +10080,6 @@ parameters:
count: 22
path: app/design/frontend/rwd/default/template/sales/order/creditmemo/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 173
path: app/design/frontend/rwd/default/template/sales/order/creditmemo/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 19
Expand All @@ -10310,21 +10090,6 @@ parameters:
count: 18
path: app/design/frontend/rwd/default/template/sales/order/invoice/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 172
path: app/design/frontend/rwd/default/template/sales/order/invoice/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 18
path: app/design/frontend/rwd/default/template/sales/order/items.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 191
path: app/design/frontend/rwd/default/template/sales/order/items/renderer/default.phtml

-
message: "#^Variable \\$this might not be defined\\.$#"
count: 17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,14 @@ protected function _getGiftmessageSaveModel()
{
return Mage::getSingleton('adminhtml/giftmessage_save');
}

public function canDisplayGiftmessage(): bool
{
if (!Mage::helper('core')->isModuleOutputEnabled('Mage_GiftMessage')) {
return false;
}
/** @var Mage_GiftMessage_Helper_Message $helper */
$helper = $this->helper('giftmessage/message');
return $helper->getIsMessagesAvailable('order', $this->getEntity(), $this->getEntity()->getStoreId());
}
}
Loading
Loading