BxBaseModPaymentGridCarts.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup BasePayment Base classes for Payment like modules
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxBaseModPaymentGridCarts extends BxTemplGrid
  12. {
  13. protected $MODULE;
  14. protected $_oModule;
  15. protected $_oCart;
  16. protected $_bSingleSeller;
  17. protected $_iSingleSeller;
  18. protected $_sCurrencySign;
  19. public function __construct ($aOptions, $oTemplate = false)
  20. {
  21. parent::__construct ($aOptions, $oTemplate);
  22. $this->_oModule = BxDolModule::getInstance($this->MODULE);
  23. $this->_oCart = $this->_oModule->getObjectCart();
  24. $this->_iSingleSeller = 0;
  25. if($this->_bSingleSeller)
  26. $this->_iSingleSeller = $this->_oModule->_oConfig->getSiteAdmin();
  27. $this->_sCurrencySign = $this->_oModule->_oConfig->getDefaultCurrencySign();
  28. $this->_sDefaultSortingOrder = 'DESC';
  29. $iClientId = bx_get('client_id');
  30. if($iClientId !== false)
  31. $this->_aQueryAppend['client_id'] = (int)$iClientId;
  32. $iSellerId = bx_get('seller_id');
  33. if($iSellerId !== false) {
  34. $iSellerId = (int)$iSellerId;
  35. $this->_aQueryAppend['seller_id'] = $iSellerId;
  36. if(!$this->_bSingleSeller)
  37. $this->_sCurrencySign = $this->_oModule->getVendorCurrencySign($iSellerId);
  38. }
  39. }
  40. public function addQueryParam($sKey, $sValue)
  41. {
  42. if(empty($sKey) || !isset($sValue))
  43. return;
  44. $this->_aQueryAppend[$sKey] = $sValue;
  45. }
  46. }
  47. /** @} */