BxBaseModPaymentGridCarts.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. protected function _getActionDelete($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
  41. {
  42. if (bx_is_api()){
  43. $a['name'] = $sKey;
  44. $a['type'] = 'callback';
  45. return $a;
  46. }
  47. return $this->_getActionDefault($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
  48. }
  49. public function addQueryParam($sKey, $sValue)
  50. {
  51. if(empty($sKey) || !isset($sValue))
  52. return;
  53. $this->_aQueryAppend[$sKey] = $sValue;
  54. }
  55. }
  56. /** @} */