Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 1.1.3.0
- * @ Author : DeZender
- * @ Release on : 17.05.2011
- * @ Official site : http://DeZender.Net
- *
- */
- class FavoredMinds_Vendor_Helper_Data extends Mage_Core_Helper_Abstract {
- private static $_domains = array(
- 0 => "demo.ezeck.com",
- 1 => "demo2.ezeck.com",
- 2 => "demo2.favoredminds.com",
- 3 => "www.web2.smartbuzz.net",
- 4 => "web2.smartbuzz.net",
- 5 => "magento.sunrisewebtech.com",
- 6 => "aetur.es",
- 7 => "www.aetur.es",
- 8 => "cosasperuanas.com",
- 9 => "www.cosasperuanas.com",
- 10 => "getkooky.com",
- 11 => "www.getkooky.com",
- 12 => "test.getkooky.com",
- 13 => "espaceventespro.fr",
- 14 => "www.espaceventespro.fr",
- 15 => "espaceventespro.com",
- 16 => "www.espaceventespro.com",
- 17 => "bigjewelers.com",
- 18 => "www.bigjewelers.com",
- 19 => "bigjewelers.gemfindwebdesign.com",
- 20 => "www.alibadeal.com",
- 21 => "alibadeal.com",
- 22 => "88.183.23.73",
- 23 => "196.217.45.53",
- 24 => "www.e-tic.magentodemo.dk",
- 25 => "e-tic.magentodemo.dk",
- 26 => "e-tic.dk",
- 27 => "www.e-tic.dk",
- 28 => "purplemenu.com",
- 29 => "www.purplemenu.com",
- 30 => "cpanel11.proisp.no",
- 31 => "www.xn--fetemoteklr-j9a.no",
- 32 => "xn--fetemoteklr-j9a.no",
- 33 => "www.fetemoteklær.no",
- 34 => "fetemoteklær.no",
- 35 => "www.exemplarsolutions.biz",
- 36 => "exemplarsolutions.biz",
- 37 => "www.lastseason.co.nz",
- 38 => "lastseason.co.nz",
- 39 => "test.lastseason.co.nz",
- 40 => "miratis.com",
- 41 => "www.miratis.com",
- 42 => "miratis.co.uk",
- 43 => "www.miratis.co.uk",
- 44 => "ezeck.webnicesoft.com",
- 45 => "bambanoo.com",
- 46 => "www.bambanoo.com",
- 47 => "stage.bambanoo.com",
- 48 => "dev.bambanoo.com",
- 49 => "dfavors.com",
- 50 => "www.dfavors.com",
- 51 => "boutique.urbansouq.com",
- 52 => "www.boutique.urbansouq.com",
- 53 => "fishynation.com",
- 54 => "www.fishynation.com",
- 55 => "local.softprodigy.com",
- 56 => "202.164.43.20",
- 57 => "174.123.41.228",
- 58 => "welivealive.com",
- 59 => "www.welivealive.com",
- 60 => "208.43.226.196",
- 61 => "www.futureonline.com.kw",
- 62 => "futureonline.com.kw",
- 63 => "dev.futureonline.com.kw",
- 64 => "www.phplans.com",
- 65 => "phplans.com",
- 66 => "174.123.40.168",
- 67 => "markita.nl",
- 68 => "www.markita.nl",
- 69 => "dev1.markita.nl",
- 70 => "dename.nl",
- 71 => "www.dename.nl",
- 72 => "dename.development.cream.nl",
- 73 => "dename.staging.web04.cream.nl",
- 74 => "www.woonfabriek-online.nl",
- 75 => "woonfabriek-online.nl",
- 76 => "woonfabriek.younifydev.net",
- 77 => "dev.woonfabriek-online.nl",
- 78 => "buycheaptiresandwheels.com",
- 79 => "www.buycheaptiresandwheels.com",
- 80 => "dev.buycheaptiresandwheels.com",
- 81 => "area254.co.ke",
- 82 => "www.area254.co.ke",
- 83 => "10.0.12.103",
- 84 => "10.0.12.104",
- 85 => "10.0.22.103",
- 86 => "10.0.22.104",
- 87 => "10.0.32.125",
- 88 => "72.44.219.248",
- 89 => "72.44.219.253",
- 90 => "172.19.110.74",
- 91 => "172.19.110.75",
- 92 => "marketplace.cloudcommons.com",
- 93 => "qa-marketplace.cloudcommons.com",
- 94 => "dev-marketplace.cloudcommons.com",
- 95 => "www.marketplace.cloudcommons.com",
- 96 => "www.qa-marketplace.cloudcommons.com",
- 97 => "www.dev-marketplace.cloudcommons.com",
- 98 => "test.rtspl.info",
- 99 => "fourseasonscollective.com",
- 100 => "www.fourseasonscollective.com",
- 101 => "goodkmall.com",
- 102 => "www.goodkmall.com",
- 103 => "173.254.19.243",
- 104 => "beta-marketplace.cloudcommons.com",
- 105 => "50.56.38.138",
- 106 => "50.56.38.74",
- 107 => "50.56.38.75",
- 108 => "10.131.5.170",
- 109 => "10.131.5.171",
- 110 => "172.19.110.74",
- 111 => "172.19.110.75",
- 112 => "www.edomtom.com",
- 113 => "edomtom.com",
- 114 => "magento6.01openhosting.com",
- 115 => "gulfplants.com",
- 116 => "www.gulfplants.com",
- 117 => "roaringforkflies.com",
- 118 => "www.roaringforkflies.com",
- 119 => "dev.roaringforkflies.com",
- 120 => "beta.roaringforkflies.com",
- 121 => "pngtradepost.com",
- 122 => "www.pngtradepost.com",
- 123 => "chelseaexchange.com",
- 124 => "www.chelseaexchange.com",
- 125 => "213.229.86.30",
- 126 => "184.168.92.52",
- 127 => "spektrade.com",
- 128 => "spektrade.com",
- 129 => "soundsonic.com",
- 130 => "www.soundsonic.com",
- 131 => "192.168.100.16",
- 132 => "deftsoft.org",
- 133 => "www.deftsoft.org",
- 134 => "wonderfan.com",
- 135 => "www.wonderfan.com",
- 136 => "eshop.aldr.cz",
- 137 => "www.eshop.aldr.cz",
- 138 => "caribzon.com",
- 139 => "www.caribzon.com",
- 140 => "www.invitecottage.com",
- 141 => "invitecottage.com",
- 142 => "invite.dev01.atlanticbt.net",
- 143 => "shoppingby.me",
- 144 => "www.shoppingby.me",
- 145 => "dev.shoppingby.me",
- 146 => "purehome.com",
- 147 => "www.purehome.com",
- 148 => "ec-cam.jp",
- 149 => "www.ec-cam.jp",
- 150 => "test.ec-cam.jp",
- 151 => "portero.com",
- 152 => "www.portero.com",
- 153 => "portero.spicedigitalmarketing.com",
- 154 => "re-dazzle.com",
- 155 => "www.re-dazzle.com",
- 156 => "dev.re-dazzle.com",
- 157 => "redazzle.com",
- 158 => "www.redazzle.com",
- 159 => "dev.redazzle.com",
- 160 => "183.purplecat.net",
- 161 => "1000knih.sk",
- 162 => "www.1000knih.sk",
- 163 => "shopeasy.ph",
- 164 => "www.shopeasy.ph",
- 165 => "192.168.204.130",
- 166 => "acosolar.com",
- 167 => "www.acosolar.com",
- 168 => "184.172.146.192",
- 169 => "mondofood.com",
- 170 => "www.mondofood.com",
- 171 => "secretaressewinkel.nl",
- 172 => "www.secretaressewinkel.nl",
- 173 => "wow.amcservices.it",
- 174 => "walkonwine.com",
- 175 => "www.walkonwine.com",
- 176 => "myshop24seven.com",
- 177 => "www.myshop24seven.com",
- 178 => "local.softprodigy.com",
- 179 => "www.fourseasonscollective.com",
- 180 => "fourseasonscollective.com",
- 181 => "test.rtspl.info",
- 182 => "purecitizen.com",
- 183 => "www.purecitizen.com",
- 184 => "staging.purecitizen.com",
- 185 => "onme.com",
- 186 => "www.onme.com",
- 187 => "shoppywood.com",
- 188 => "www.shoppywood.com",
- 189 => "ecom.greenkogroup.com",
- 190 => "www.ecom.greenkogroup.com",
- 191 => "priceking.phpdevelopment.co.in",
- 192 => "priceking.in",
- 193 => "www.priceking.in",
- 194 => "provendors.com",
- 195 => "www.provendors.com",
- 196 => "www.peradora.de",
- 197 => "peradora.de",
- 198 => "projekte-web.com",
- 199 => "www.projekte-web.com",
- 200 => "bvira.com",
- 201 => "www.bvira.com",
- 202 => "weddingplace.com.au",
- 203 => "www.weddingplace.com.au",
- 204 => "115.70.134.212",
- 205 => "dev2011v.bvira.com",
- 206 => "qa2011v.bvira.com",
- 207 => "staging2011v.bvira.com",
- 208 => "extrovart.com",
- 209 => "www.extrovart.com",
- 210 => "hans-dampf.net",
- 211 => "www.hans-dampf.net",
- 212 => "dev.hans-dampf.net",
- 213 => "plusalia.com",
- 214 => "www.plusalia.com",
- 215 => "pingnow.com",
- 216 => "www.pingnow.com",
- 217 => "dev.pingnow.com",
- 218 => "cleaningworld.co.uk",
- 219 => "www.cleaningworld.co.uk",
- 220 => "ovationmusic.com",
- 221 => "www.ovationmusic.com",
- 222 => "vicino.me",
- 223 => "www.vicino.me",
- 224 => "demo.vicino.me",
- 225 => "efficienttrade.co.nz",
- 226 => "www.efficienttrade.co.nz",
- 227 => "ingramswaterandair.com",
- 228 => "www.ingramswaterandair.com",
- 229 => "dev.ingramswaterandair.com",
- 230 => "myflipcharts.com",
- 231 => "www.myflipcharts.com",
- 232 => "46.23.68.75",
- 233 => "cleaningworld.co.uk",
- 234 => "www.cleaningworld.co.uk",
- 235 => "tiendascom.com",
- 236 => "www.tiendascom.com",
- 237 => "dev.tiendascom.com",
- 238 => "v8co.com",
- 239 => "www.v8co.com",
- 240 => "test.v8co.com",
- 241 => "exclusivogolden.com",
- 242 => "www.exclusivogolden.com",
- 243 => "66.147.244.205",
- 244 => "kanaim.com.ve",
- 245 => "www.kanaim.com.ve",
- 246 => "elmostradordeutopicus.com",
- 247 => "www.elmostradordeutopicus.com",
- 248 => "tienda.utopicus.consinergia.es",
- 249 => "lovenature.net.tw",
- 250 => "www.lovenature.net.tw",
- 251 => "114.32.7.102",
- 252 => "jolinjolan.com",
- 253 => "www.jolinjolan.com",
- 254 => "glasale.com",
- 255 => "www.glasale.com",
- 256 => "glasale.magentoeasy.net",
- 257 => "clikandget.com",
- 258 => "www.clikandget.com",
- 259 => "therealalecompany.co.uk",
- 260 => "www.therealalecompany.co.uk",
- 261 => "dev.therealalecompany.co.uk",
- 262 => "websites.websmart.com",
- 263 => "www.websites.websmart.com",
- 264 => "ecm-market.de",
- 265 => "www.ecm-market.de",
- 266 => "dev.ecm-market.de",
- 267 => "industry-of-cool.com",
- 268 => "www.industry-of-cool.com",
- 269 => "bikecraftonline.com",
- 270 => "www.bikecraftonline.com",
- 271 => "dev.bikecraftonline.com",
- 272 => "puloma.com",
- 273 => "dev.puloma.com",
- 274 => "devdev.puloma.com",
- 275 => "botane.net",
- 276 => "www.botane.net",
- 277 => "sandbox.botane.net",
- 278 => "iamfair.de",
- 279 => "www.iamfair.de",
- 280 => "beta.iamfair.de",
- 281 => "iamfair.aegro.de",
- 282 => "176.28.34.131",
- 283 => "wefashion.com.br",
- 284 => "www.wefashion.com.br"
- );
- private $_vendors = array( );
- function check() {
- if (!in_array( $_SERVER['HTTP_HOST'], self::$_domains )) {
- return false;
- }
- return true;
- }
- function getVendor($id) {
- FavoredMinds_Vendor_Model_Vendor;
- if ($id instanceof null) {
- if (empty( $this->_vendors[$id->getId( )] )) {
- $this->_vendors[$id->getId( )] = $id;
- }
- return $id;
- }
- if (empty( $this->_vendors[$id] )) {
- $this->_vendors[$id] = Mage::getmodel( 'vendor/vendor' )->load( $id );
- }
- return $this->_vendors[$id];
- }
- function sendVendorMail($vendor_id, $mail_data, &$order) {
- $helper = Mage::app( )->getHelper( 'vendor' );
- $vendor_data = $this->getVendorUserInfo( $vendor_id );
- $translate = Mage::getsingleton( 'core/translate' );
- $translate->setTranslateInline( false );
- $mailTemplate = Mage::getmodel( 'core/email_template' );
- $content = new Mage_Core_Block_Template( );
- $paymentBlock = Mage::helper( 'payment' )->getInfoBlock( $order->getPayment( ) )->setIsSecureMode( true );
- $paymentBlock->getMethod( )->setStore( $order->getStore( )->getId( ) );
- if (Mage::registry( 'vendor_data' )) {
- Mage::unregister( 'vendor_data' );
- }
- Mage::register( 'vendor_data', $vendor_data );
- if (Mage::registry( 'mail_data' )) {
- Mage::unregister( 'mail_data' );
- }
- Mage::register( 'mail_data', $mail_data );
- $mailTemplate->setDesignConfig( array( 'area' => 'frontend' ) )->sendTransactional( Mage::getstoreconfig( 'vendor/email/newordertemplate' ), array( 'name' => Mage::getstoreconfig( 'vendor/email/sendername' ), 'email' => Mage::getstoreconfig( 'vendor/email/senderaddress' ) ), $vendor_data['email'], $vendor_data['company_name'], array( 'vendorData' => $vendor_data, 'order' => $order, 'company_name' => $vendor_data['company_name'], 'mailData' => $mail_data, 'billing' => $order->getBillingAddress( ), 'payment_html' => $paymentBlock->toHtml( ) ) );
- return $mailTemplate->getSentSuccess( );
- }
- function isVendorRoleInstalled() {
- return (0 < $this->getVendorRoleId( ) * 1 ? true : false);
- }
- function getVendorRoleId() {
- $return = false;
- $write = Mage::getsingleton( 'core/resource' )->getConnection( 'core_write' );
- $table = $this->getTableName( 'admin_role' );
- $result = $write->query( '' . 'select * from `' . $table . '` where `role_name`=\'Vendor\';' );
- $line = $result->fetch( );
- if (( isset( $line['role_id'] ) && 0 < $line['role_id'] * 1 )) {
- $return = $line['role_id'];
- }
- return $return;
- }
- function vendorIsLogged() {
- $return = false;
- $vendor_id = $this->getVendorUserId( );
- if (!empty( $vendor_id )) {
- $return = ($this->isVendorCoreUser( $vendor_id ) == true ? true : false);
- }
- return $return;
- }
- function getVendorUserId() {
- $return = false;
- $write = Mage::getsingleton( 'core/resource' )->getConnection( 'core_write' );
- $user = Mage::getsingleton( 'admin/session' )->getUser( );
- if (!empty( $user )) {
- $userdata = $user->toArray( );
- $table = $this->getTableName( 'vendors' );
- $result = $write->query( '' . 'select * from `' . $table . '` where `username`=\'' . $userdata['username'] . '\';' );
- $line = $result->fetch( );
- $vendor_id = $line['vendor_id'];
- $return = $vendor_id;
- }
- return $return;
- }
- function getVendorByManufacturer($manufacturer) {
- $write = Mage::getsingleton( 'core/resource' )->getConnection( 'core_write' );
- $table = $this->getTableName( 'vendors' );
- $result = $write->query( '' . 'select * from `' . $table . '` where `company_name`=\'' . $manufacturer . '\';' );
- $line = $result->fetch( );
- if (( ( isset( $line['vendor_id'] ) && is_numeric( $line['vendor_id'] ) ) && 0 < $line['vendor_id'] * 1 )) {
- return $line['vendor_id'];
- }
- return false;
- }
- function getVendorProducts($vendor_id) {
- $manufacturer = $this->getManufacturerOption( $vendor_id );
- $collection = Mage::getresourcemodel( 'catalog/product_collection' )->load( );
- $products = array( );
- foreach ($collection->getItems( ) as $_product) {
- $_product = Mage::getmodel( 'catalog/product' )->load( $_product->getId( ) );
- if ($_product->getData( 'manufacturer' ) == $manufacturer['value']) {
- array_push( $products, $_product );
- continue;
- }
- }
- return $products;
- }
- function getManufacturers() {
- return $this->getAttributeOptions( 'manufacturer' );
- }
- ...........................................
- ...........................
- ..............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement