private function doParsing($sectID,$ibID){ $sect=new \CIblockSection; $sData=$sect->getList(array("SORT"=>"ASC"),array("ID"=>$sectID,"IBLOCK_ID"=>$ibID),false,array("ID","UF_PROV_LINK"))->fetch(); $html=ParserActions::getHTML('ANTips','251348',$sData['UF_PROV_LINK'][0],'enter=1'); PR(1); $data=ParserActions::getData($html); PR($data); }
protected function _buildPricing() { // We need SOAP for this. $this->psc = PR()->providerService(); $serviceCreds = PR()->serviceLogin(); // Collect guest information. $pricing = array(); $gtids = array(); foreach ($this->activities as $a) { $this->activityIds[] = $a->id; $result = $this->psc->getActivityGuestTypes(array('serviceLogin' => $serviceCreds, 'activityId' => $a->id, 'supplierId' => $a->supplierId, 'date' => new SoapVar(date('Y-m-d'), XSD_DATE))); $guestTypeList = $result->return; if (!is_array($result->return)) { $guestTypeList = array($result->return); } // Build guest pricing info. foreach ($guestTypeList as $guest) { $gtids[] = $guest->id; $pricing[$a->id][$guest->id] = sprintf("%.02f", $guest->price); } } $this->guestTypeIds = array_unique($gtids); $this->activityPrices = $pricing; }
$GLOBALS["arrFilterSectionSale"] = array( // ">=catalog_PRICE_1" => $_REQUEST["priceMin"], // "<=catalog_PRICE_1" => $_REQUEST["priceMax"], ">=catalog_QUANTITY" => 1, // "!PROPERTY_SALE" => 1 // "PROPERTY_ARTIKUL" => "ACH9000/6 PB" ); ?> <div class="outer-content-wrapper2"> <img src="skidki_banner2.png" style=""/> </div> <div class="outer-content-wrapper2"> <? PR($_GET); $SECTION_ID = "664"; // фильтр по свойству Тип светильника if( !empty($_GET["TIP_SV1"]) && isset($_GET["TIP_SV1"]) ) $GLOBALS["arrFilterSectionSale"]["PROPERTY_TIP_SVETILNIKA"][] = $_GET["TIP_SV1"]; if( !empty($_GET["TIP_SV2"]) && isset($_GET["TIP_SV2"]) ) $GLOBALS["arrFilterSectionSale"]["PROPERTY_TIP_SVETILNIKA"][] = $_GET["TIP_SV2"]; if( !empty($_GET["TIP_SV4"]) && isset($_GET["TIP_SV4"]) ) $GLOBALS["arrFilterSectionSale"]["PROPERTY_TIP_SVETILNIKA"][] = $_GET["TIP_SV4"]; if( !empty($_GET["TIP_SV3"]) && isset($_GET["TIP_SV3"]) ) foreach(explode(",", $_GET["TIP_SV3"]) as $val ) $GLOBALS["arrFilterSectionSale"]["PROPERTY_TIP_SVETILNIKA"][] = $val; // Фильтр по разделам
/** * Test the login information and store it. Return good information. */ public function ajaxStoreLogin() { // Submitted parameters $username = $_POST['pr_username']; $password = $_POST['pr_password']; $psc = PR()->providerService(); $testResult = $psc->testLogin(array('serviceLogin' => array('username' => $username, 'password' => $password))); // Return values kept here. $ajaxResult = array(); if (true == $testResult->return) { update_option('pr_username', $username); update_option('pr_password', $password); $ajaxResult['success'] = true; } else { $ajaxResult['success'] = false; $ajaxResult['message'] = $testResult->out_status; } header("Content-Type: application/json"); echo json_encode($ajaxResult); wp_die(); }
public function prGroupTransportation($atts = array(), $content = null, $tag) { $a = shortcode_atts(array('name' => null, 'message' => 'No transportation.', 'template' => $this->defaultTemplate), $atts); $rval = ''; // @TODO Turn this into JavaScript and incorporate it into prGroupShortcode? /* <div id="transportationRoutesContainer_a7748" style="display: none;">Select a Transportation Route:</p> <div><label><input name="transportationroute_a7748" type="radio" value="" />No Transportation; We will be Driving out to the Ranch.</label></div> <div id="transportationRouteContainer_a7748_355"><label><input name="transportationroute_a7748" type="radio" value="355" />Transporation (an additional $15.71 pp)</label></div> </div> */ $map = $this->_currentActivityGroup->transportationMap(); // Why so many substr() calls? Because everything has a # at the beginning. $rval = sprintf('<div id="%s" style="display:none;"><strong>Select a transportation route:</strong><br>', substr($map['routesContainerSelector'], 1)); $routeNameTag = sprintf('transportationroute_a%d', $this->_currentActivityGroup->activities[0]->id); $rval .= sprintf('<div><label><input name="%s" type="radio" value="" /> %s</label></div>', $routeNameTag, $a['message']); try { // We might need to use a SOAP call to import more data, such as route names. $serviceCreds = PR()->serviceLogin(); $service = PR()->providerService(); // @TODO These should be cached. foreach ($map['routeSelectorMap'] as $id => $route) { $result = $service->getTransportationRoute(array('serviceLogin' => $serviceCreds, 'supplierId' => $this->_currentActivityGroup->supplierId, 'transportationRouteId' => $id)); $tmp = sprintf('<div id="%s"><label><input name="%s" type="radio" value="%d" /> %s</label></div>', $route, $routeNameTag, $id, $result->return->name); $rval .= "\n" . $tmp; } } catch (Exception $e) { $rval = sprintf("<pre>%s\n</pre>\n", $e->getMessage()); } return $rval . "</div>"; }
/** * Shortcode to test login information. */ function pr_test_login_sc($atts = array(), $content = null, $tag) { $pr = PR(); $psc = $pr->providerService(); $sl = $pr->serviceLogin(); $result = $psc->testLogin(array('serviceLogin' => $pr->serviceLogin())); if (true == $result->return) { $rval = "<strong>Login succeeded.</strong>\n"; } else { $rval = "<strong>Login failed.</strong>\n"; $rval .= sprintf("<pre>\n%s</pre>\n", $result->out_status); } return $rval; }
<?php /** * Created by PhpStorm. * User: Abai Adelshin * www.orendev.ru */ if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } ?> <?php PR($arResult);
/** * Collect transportation information from PR SOAP service * * At the moment it doesn't catch SOAP exceptions, leaving that to * be done by a caller function. I do not know if that is the * best behavior. * * @TODO I can't get transportation options for the current day for some reason. * @TODO Catch SOAP exceptions? */ protected function _getTransportationOptionsSoap() { if (null !== $this->_transportationOptionsSoap) { return $this->_transportationOptionsSoap; } $serviceCreds = PR()->serviceLogin(); $service = PR()->providerService(); // Note that transportation routes aren't available in the Agency service for some reason. //$this->_transportationOptionsSoap $result = $service->getActivityTransportationOptions(array('serviceLogin' => $serviceCreds, 'supplierId' => $this->_supplierId, 'activityId' => $this->_activityId, 'date' => new SoapVar(date('Y-m-d', strtotime('+20 days')), XSD_DATE))); return $this->_transportationOptionsSoap = $result; }
<? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); CModule::IncludeModule("catalog"); CModule::IncludeModule("sale"); $xml = "<?xml version='1.0' encoding='UTF-8'?><items><item>10557</item></items>"; $xml_result = objectToArray( simplexml_load_string($xml) ); PR($_POST, true); ?> <form method="post" action=""> <input type="text" name="date" value=""> <input type="submit" name="sss" value="отправить"> </form>
// Выборка товаров со скидками $arFilter = array( "DISCOUNT_ID" => array(10, 11, 12, 13, 16, 18, 25, 27, 28, 29, 30, 33, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55) // "DISCOUNT_ID" => array(10, 11, 12, 13, 16, 18, 25, 27, 28, 29, 30, 33) ); $res = CCatalogDiscount::GetDiscountProductsList( array(), $arFilter, false, false, array() ); $str = "<?php \narray(\n"; while($item = $res->GetNext()){ PR($item); $str .= "'" . $item["PRODUCT_ID"] . "',\n"; } $str .= ");"; file_put_contents($_SERVER["DOCUMENT_ROOT"] . "/include/discount_ids2.php", $str); $arLogic = array( "CLASS_ID" => "CondGroup", "DATA" => array( "All" => "OR", "True" => "True", ), "CHILDREN" => array( array( "CLASS_ID" => "CondIBElement",
// PR($item); $dbProductDiscounts = CCatalogDiscount::GetList(array(), array("NOTES" => $item["discount_id"]), false, false, array())->Fetch(); if(empty($dbProductDiscounts)) { $arFields = array( "SITE_ID" => "s1", "NAME" => "Скидка из 1с " . $item["discount_name"], "CURRENCY" => "RUB", "PRIORITY" => 100, "VALUE_TYPE" => $item["discount_type"], "VALUE" => $item["discount_value"], "NOTES" => $item["discount_id"], "CONDITIONS" => serialize($arLogic), ); $Ids[] = CCatalogDiscount::Add($arFields); } else { $arFields2 = array( "NAME" => "Скидка из 1с " . $item["discount_name"], "VALUE_TYPE" => $item["discount_type"], "VALUE" => $item["discount_value"], "NOTES" => $item["discount_id"], "CONDITIONS" => serialize($arLogic), ); CCatalogDiscount::Update($dbProductDiscounts["ID"], $arFields2); } } PR($Ids); }
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?> <? // include($_SERVER["DOCUMENT_ROOT"]."/include/catalog_filter_bb.php"); // Фильтр отправляет данные на адресс /include/catalog_filter_bb.php PR($arResult["NAV_RESULT"]->NavRecordCount); /* BASE: Object CAN_ACCESS: "Y" CAN_BUY: "Y" CURRENCY: "RUB" DISCOUNT_DIFF: 3000 DISCOUNT_DIFF_PERCENT: 60 DISCOUNT_VALUE: 2000 DISCOUNT_VALUE_NOVAT: 2000 DISCOUNT_VALUE_VAT: 2000 DISCOUNT_VATRATE_VALUE: 0 ID: "23115" MIN_PRICE: "Y" PRICE_ID: 1 PRINT_DISCOUNT_DIFF: "3 000 руб." PRINT_DISCOUNT_VALUE: "2 000 руб." PRINT_DISCOUNT_VALUE_NOVAT: "2 000 руб." PRINT_DISCOUNT_VALUE_VAT: "2 000 руб." PRINT_DISCOUNT_VATRATE_VALUE: "0 руб." PRINT_VALUE: "5 000 руб." PRINT_VALUE_NOVAT: "5 000 руб." PRINT_VALUE_VAT: "5 000 руб." PRINT_VATRATE_VALUE: "0 руб." VALUE: 5000 VALUE_NOVAT: 5000 VALUE_VAT: 5000 VATRATE_VALUE: 0 */