Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getTaxFields example
$this
->connection =
$connection
;
$this
->taxHydrator =
$taxHydrator
;
$this
->fieldHelper =
$fieldHelper
;
}
/** * {@inheritdoc} */
public
function
getRules
(
Group
$customerGroup
, ?Area
$area
= null, ?Country
$country
= null, ?State
$state
= null
)
{
$query
=
$this
->connection->
createQueryBuilder
(
)
;
$query
->
select
(
$this
->fieldHelper->
getTaxFields
(
)
)
->
from
(
's_core_tax', 'tax'
)
;
$statement
=
$query
->
execute
(
)
;
$data
=
$statement
->
fetchAll
(
PDO::FETCH_ASSOC
)
;
$rules
=
[
]
;
$query
=
$this
->
getAreaQuery
(
$customerGroup
,
$area
,
$country
,
public
function
getQuery
(
array
$numbers
, ShopContextInterface
$context
)
{
$esdQuery
=
$this
->
getEsdQuery
(
)
;
$customerGroupQuery
=
$this
->
getCustomerGroupQuery
(
)
;
$availableVariantQuery
=
$this
->
getHasAvailableVariantQuery
(
)
;
$fallbackPriceQuery
=
$this
->
getPriceCountQuery
(
':fallback'
)
;
$query
=
$this
->connection->
createQueryBuilder
(
)
;
$query
->
select
(
$this
->fieldHelper->
getArticleFields
(
)
)
->
addSelect
(
$this
->fieldHelper->
getTopSellerFields
(
)
)
->
addSelect
(
$this
->fieldHelper->
getVariantFields
(
)
)
->
addSelect
(
$this
->fieldHelper->
getUnitFields
(
)
)
->
addSelect
(
$this
->fieldHelper->
getTaxFields
(
)
)
->
addSelect
(
$this
->fieldHelper->
getPriceGroupFields
(
)
)
->
addSelect
(
$this
->fieldHelper->
getManufacturerFields
(
)
)
->
addSelect
(
$this
->fieldHelper->
getEsdFields
(
)
)
->
addSelect
(
'(' .
$esdQuery
->
getSQL
(
)
. ') as __product_has_esd'
)
->
addSelect
(
'(' .
$customerGroupQuery
->
getSQL
(
)
. ') as __product_blocked_customer_groups'
)
->
addSelect
(
'(' .
$availableVariantQuery
->
getSQL
(
)
. ') as __product_has_available_variants'
)
->
addSelect
(
'(' .
$fallbackPriceQuery
->
getSQL
(
)
. ') as __product_fallback_price_count'
)
->
addSelect
(
'manufacturerMedia.id as __manufacturer_img_id'
)
;
$query
->
setParameter
(
':fallback',
$context
->
getFallbackCustomerGroup
(
)
->
getKey
(
)
)
;
if
(
$context
->
getCurrentCustomerGroup
(
)
->
getId
(
)
!==
$context
->
getFallbackCustomerGroup
(
)
->
getId
(
)
)
{