Skip to content

Commit

Permalink
Merge pull request #935 from vishal-singh-webkul/gli-1743
Browse files Browse the repository at this point in the history
Added New hooks in AdminProductsController, ObjectModel and in some template files.
  • Loading branch information
rohit053 authored Mar 15, 2024
2 parents 83604ff + e9bc804 commit 252da38
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
4 changes: 3 additions & 1 deletion classes/ObjectModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ public function __construct($id = null, $id_lang = null, $id_shop = null)
throw new PrestaShopException('Identifier or table format not valid for class '.$class_name);
}

ObjectModel::$loaded_classes[$class_name] = get_object_vars($this);
$objProperties = get_object_vars($this);
Hook::exec('actionObject'.$class_name.'PropertiesModifier', array('obj_properties' => &$objProperties));
ObjectModel::$loaded_classes[$class_name] = $objProperties;
} else {
foreach (ObjectModel::$loaded_classes[$class_name] as $key => $value) {
$this->{$key} = $value;
Expand Down
8 changes: 8 additions & 0 deletions controllers/admin/AdminProductsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3279,6 +3279,14 @@ public function processConfiguration()
$objHotelRoomDisableDates->reason = $disableDate['reason'];
$objHotelRoomDisableDates->add();
}

Hook::exec(
'actionRoomDisableDatesAddAfter',
array(
'room_info' => $roomInfo,
'disable_dates' => $disableDates
)
);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<a title="{$navigationLink['name']}" href="{$navigationLink['link']}">{$navigationLink['name']}</a>
</li>
{/foreach}
{hook h="displayFooterExploreSectionHook"}
</ul>
</div>
</section>
Expand Down
4 changes: 3 additions & 1 deletion themes/hotel-reservation-theme/order-confirmation.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@
</a>
</p>
</td>
<td>{$data_v['hotel_name']}</td>
<td>{$data_v['hotel_name']}
{hook h="displayOrderConfirmationHotelNameAfter" id_product=$data_v['id_product']}
</td>
<td class="text-center">
<p>
{if $rm_v['adults'] <= 9}0{$rm_v['adults']}{else}{$rm_v['adults']}{/if} {if $rm_v['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $rm_v['children']}, {if $rm_v['children'] <= 9}0{$rm_v['children']}{else} {$rm_v['children']}{/if} {if $rm_v['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}<br>{if $rm_v['num_rm'] <= 9}0{/if}{$rm_v['num_rm']} {if $rm_v['num_rm'] > 1}{l s='Rooms'}{else}{l s='Room'}{/if}
Expand Down
2 changes: 2 additions & 0 deletions themes/hotel-reservation-theme/product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@
{* Block for booking products *}
{if isset($id_hotel) && $id_hotel}&nbsp;-&nbsp;{$hotel_name}{/if}
</span>
{hook h='displayRoomTypeDetailRoomTypeNameBlock' id_product=$product->id}
</div>
{hook h='displayRoomTypeDetailRoomTypeNameAfter' id_product=$product->id}
</div>
{hook h='displayRoomTypeDetailRoomTypeImageBlockBefore' id_product=$product->id}
<!-- product img-->
<div class="row">

Expand Down
2 changes: 2 additions & 0 deletions themes/hotel-reservation-theme/shopping-cart.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,14 @@
{$data_v['name']}
</a>
<a class="btn btn-default pull-right product-xs-remove" href="{$rm_v['link']}"><i class="icon-trash"></i></a>
{hook h='displayCartRoomTypeNameAfter' id_product=$data_v['id_product']}
</p>
{if isset($data_v['hotel_info']['location'])}
<p class="hotel-location">
<i class="icon-map-marker"></i> &nbsp;{$data_v['hotel_info']['location']}
</p>
{/if}
{hook h='displayCartRoomTypeInfo' id_product=$data_v['id_product']}
</div>
</div>
{if isset($data_v['hotel_info']['room_features'])}
Expand Down

0 comments on commit 252da38

Please sign in to comment.