CreateQuoteAbstract.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. abstract class Laybuy_Processes_CreateQuote_CreateQuoteAbstract extends Laybuy_Processes_AbstractProcess
  3. {
  4. abstract public function setCheckout($checkout);
  5. abstract public function getCheckout();
  6. /**
  7. * Checking if the Cart Item Details is a Custom Field or normal / default WooCommerce Product Line Item structure.
  8. *
  9. * @since 2.0.4
  10. * @param string $key The Key to be checked for Custom Field processing.
  11. * @return bool Whether or not the given key is a Custom Field (not WooCommerce Default structure).
  12. */
  13. protected function _isProductDetailCustom($key) {
  14. # Array of default values to exclude from the Custom Fields Handling
  15. $default_keys = array(
  16. 'key',
  17. 'variation_id',
  18. 'variation',
  19. 'quantity',
  20. 'data_hash',
  21. 'line_tax_data',
  22. 'line_subtotal',
  23. 'line_subtotal_tax',
  24. 'line_total',
  25. 'line_tax',
  26. 'data'
  27. );
  28. return !in_array($key, $default_keys);
  29. }
  30. }