Data.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace WeltPixel\Quickview\Helper;
  3. /**
  4. * @SuppressWarnings(PHPMD.TooManyFields)
  5. * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
  6. */
  7. class Data extends \Magento\Framework\App\Helper\AbstractHelper
  8. {
  9. /**
  10. * @var array
  11. */
  12. protected $_quickviewOptions;
  13. /**
  14. * Data constructor.
  15. * @param \Magento\Framework\App\Helper\Context $context
  16. */
  17. public function __construct(
  18. \Magento\Framework\App\Helper\Context $context
  19. ) {
  20. parent::__construct($context);
  21. $this->_quickviewOptions = $this->scopeConfig->getValue('weltpixel_quickview', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
  22. }
  23. /**
  24. * @return string
  25. */
  26. public function getSkuTemplate() {
  27. $removeSku = $this->_quickviewOptions['general']['remove_sku'];
  28. if (!$removeSku) {
  29. return 'Magento_Catalog::product/view/attribute.phtml';
  30. }
  31. return '';
  32. }
  33. /**
  34. * @return string
  35. */
  36. public function getCustomCSS() {
  37. return trim($this->_quickviewOptions['general']['custom_css']);
  38. }
  39. /**
  40. * @return int
  41. */
  42. public function getCloseSeconds() {
  43. return trim($this->_quickviewOptions['general']['close_quickview']);
  44. }
  45. /**
  46. * @return boolean
  47. */
  48. public function getScrollAndOpenMiniCart() {
  49. return $this->_quickviewOptions['general']['scroll_to_top'];
  50. }
  51. /**
  52. * @return boolean
  53. */
  54. public function getShoppingCheckoutButtons() {
  55. return $this->_quickviewOptions['general']['enable_shopping_checkout_product_buttons'];
  56. }
  57. }