Changeset View
Changeset View
Standalone View
Standalone View
modules/in-link/units/listings/listings_event_handler.php
Show First 20 Lines • Show All 278 Lines • ▼ Show 20 Line(s) | |||||
function OnRequestEnhancement($event) | function OnRequestEnhancement($event) | ||||
{ | { | ||||
if ( $this->Application->prefixRegistred('ord') ) { | if ( $this->Application->prefixRegistred('ord') ) { | ||||
$l_info = $this->Application->GetVar('l'); | $l_info = $this->Application->GetVar('l'); | ||||
if (!$l_info) { | if (!$l_info) { | ||||
return false; | return false; | ||||
} | } | ||||
list ($link_id, $link_info) = each($l_info); | $link_id = key($l_info); | ||||
$link_info = $l_info[$link_id]; | |||||
$listing_type_id = $link_info['ListingTypeId']; | $listing_type_id = $link_info['ListingTypeId']; | ||||
$listing_type = $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); | $listing_type = $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); | ||||
$listing_type->Load($listing_type_id); | $listing_type->Load($listing_type_id); | ||||
if ($listing_type->GetDBField('EnableBuying')) { | if ($listing_type->GetDBField('EnableBuying')) { | ||||
$add_to_cart_event = new kEvent('ord:OnAddVirtualProductToCart'); | $add_to_cart_event = new kEvent('ord:OnAddVirtualProductToCart'); | ||||
$this->Application->HandleEvent($add_to_cart_event); | $this->Application->HandleEvent($add_to_cart_event); | ||||
Show All 35 Lines | |||||
break; | break; | ||||
case 'OnListingCreate': | case 'OnListingCreate': | ||||
// when requesting enhancement from front (and not via in-commerce) | // when requesting enhancement from front (and not via in-commerce) | ||||
$links_info = $this->Application->GetVar('l'); | $links_info = $this->Application->GetVar('l'); | ||||
if (!$links_info) return false; | if (!$links_info) return false; | ||||
$event->redirect = false; | $event->redirect = false; | ||||
list($link_id, $link_info) = each($links_info); | $link_id = key($links_info); | ||||
$link_info = $links_info[$link_id]; | |||||
$listing_type_id = $link_info['ListingTypeId']; | $listing_type_id = $link_info['ListingTypeId']; | ||||
$new_processing = false; | $new_processing = false; | ||||
break; | break; | ||||
} | } | ||||
if (!$listing_type_id) { | if (!$listing_type_id) { | ||||
// free or invalid listing type selected | // free or invalid listing type selected | ||||
▲ Show 20 Lines • Show All 500 Lines • Show Last 20 Lines |