MerchantProductCommand
extends ContainerAwareCommand
in package
uses
LockableTrait
Class MerchantProductCommand
Tags
Table of Contents
Constants
- MERCHANT_PRODUCTS_SOURCE = [ '9525921' => ['Menzzo', 'AsirGroup', 'palimi', 'bigbuy', 'Notio'], '5530420986' => [ //FR 'Menzzo', 'AsirGroup', 'palimi', 'bigbuy', 'Notio', ], '125238729' => ['Menzzo', 'AsirGroup', 'palimi', 'bigbuy'], '273004042' => ['Menzzo', 'AsirGroup'], '5530421937' => [ //IT 'Menzzo', 'AsirGroup', ], '277404552' => ['Menzzo', 'AsirGroup'], '332050692' => ['Menzzo', 'AsirGroup'], '538719773' => [ 'Menzzo', 'AsirGroup', // 'palimi', 'bigbuy', 'Notio', ], '422482506' => ['Menzzo', 'AsirGroup'], '559212789' => ['Menzzo', 'AsirGroup'], '5530614025' => [ //DE 'Menzzo', 'AsirGroup', ], '5530614151' => [ //NL 'Menzzo', 'AsirGroup', ], '5530614595' => [ //PT 'Menzzo', 'AsirGroup', ], '5530614862' => [ //BE FR 'Menzzo', 'AsirGroup', ], '5530422732' => [ //AT 'Menzzo', 'AsirGroup', ], '143802359' => ['Menzzo', 'AsirGroup'], // '136911811' => [ // 'Menzzo', // ], '432983110' => ['Menzzo', 'AsirGroup'], '449869594' => ['Menzzo', 'AsirGroup'], '559160963' => ['Menzzo', 'AsirGroup'], '559161614' => ['Menzzo', 'AsirGroup'], '559212537' => ['Menzzo', 'AsirGroup'], '559212477' => ['Menzzo', 'AsirGroup'], '559161581' => ['Menzzo', 'AsirGroup'], '436985954' => ['Menzzo', 'AsirGroup'], '559160933' => ['Menzzo', 'AsirGroup'], '5530421676' => [ //ES 'Menzzo', 'AsirGroup', ], '8404649' => ['Menzzo', 'AsirGroup'], // '5064260817' => [ // 'AsirGroup', // 'Notio', // ], '5372907996' => ['Menzzo', 'AsirGroup'], ]
Properties
- $em : object
- $googleService : GoogleShoppingService
- $limit : int
- Query limit
- $merchantsProductsService : MerchantsProductsService
- $offset : int
- Query offset
- $sentProductIds : array<string|int, mixed>
- $expireToday : mixed
- $logger : mixed
- $merchantId : bool
- $noManufacturerSkus : array<string|int, mixed>
- $output : OutputInterface
- $productIds : mixed
- $sentFeedIds : array<string|int, mixed>
- $sentProducts : int
- $store : bool
- $storeId : int
Methods
- __construct() : mixed
- MerchantProductCommand constructor.
- updateSyncDate() : mixed
- Updating sync date for products
- writeToCSV() : mixed
- configure() : mixed
- Configure command
- execute() : int|void|null
- getEcoShippingPrice() : mixed
- getMonocolisShippingPrice() : mixed
- isEnergyEfficientClassProduct() : mixed
- roundDownToNearestFive() : float|int|string
- Rounds down a given percentage to the nearest multiple of 5.
- sendProductsToGoogle() : mixed
- sending products to google shopping
Constants
MERCHANT_PRODUCTS_SOURCE
public
mixed
MERCHANT_PRODUCTS_SOURCE
= [
'9525921' => ['Menzzo', 'AsirGroup', 'palimi', 'bigbuy', 'Notio'],
'5530420986' => [
//FR
'Menzzo',
'AsirGroup',
'palimi',
'bigbuy',
'Notio',
],
'125238729' => ['Menzzo', 'AsirGroup', 'palimi', 'bigbuy'],
'273004042' => ['Menzzo', 'AsirGroup'],
'5530421937' => [
//IT
'Menzzo',
'AsirGroup',
],
'277404552' => ['Menzzo', 'AsirGroup'],
'332050692' => ['Menzzo', 'AsirGroup'],
'538719773' => [
'Menzzo',
'AsirGroup',
// 'palimi',
'bigbuy',
'Notio',
],
'422482506' => ['Menzzo', 'AsirGroup'],
'559212789' => ['Menzzo', 'AsirGroup'],
'5530614025' => [
//DE
'Menzzo',
'AsirGroup',
],
'5530614151' => [
//NL
'Menzzo',
'AsirGroup',
],
'5530614595' => [
//PT
'Menzzo',
'AsirGroup',
],
'5530614862' => [
//BE FR
'Menzzo',
'AsirGroup',
],
'5530422732' => [
//AT
'Menzzo',
'AsirGroup',
],
'143802359' => ['Menzzo', 'AsirGroup'],
// '136911811' => [
// 'Menzzo',
// ],
'432983110' => ['Menzzo', 'AsirGroup'],
'449869594' => ['Menzzo', 'AsirGroup'],
'559160963' => ['Menzzo', 'AsirGroup'],
'559161614' => ['Menzzo', 'AsirGroup'],
'559212537' => ['Menzzo', 'AsirGroup'],
'559212477' => ['Menzzo', 'AsirGroup'],
'559161581' => ['Menzzo', 'AsirGroup'],
'436985954' => ['Menzzo', 'AsirGroup'],
'559160933' => ['Menzzo', 'AsirGroup'],
'5530421676' => [
//ES
'Menzzo',
'AsirGroup',
],
'8404649' => ['Menzzo', 'AsirGroup'],
// '5064260817' => [
// 'AsirGroup',
// 'Notio',
// ],
'5372907996' => ['Menzzo', 'AsirGroup'],
]
Properties
$em
protected
object
$em
$googleService
protected
GoogleShoppingService
$googleService
$limit
Query limit
protected
int
$limit
= 5000
$merchantsProductsService
protected
MerchantsProductsService
$merchantsProductsService
$offset
Query offset
protected
int
$offset
= 0
$sentProductIds
protected
array<string|int, mixed>
$sentProductIds
= []
$expireToday
private
mixed
$expireToday
$logger
private
mixed
$logger
Tags
$merchantId
private
bool
$merchantId
= false
$noManufacturerSkus
private
array<string|int, mixed>
$noManufacturerSkus
$output
private
OutputInterface
$output
$productIds
private
mixed
$productIds
$sentFeedIds
private
array<string|int, mixed>
$sentFeedIds
$sentProducts
private
int
$sentProducts
= 0
$store
private
bool
$store
= false
$storeId
private
int
$storeId
Methods
__construct()
MerchantProductCommand constructor.
public
__construct([null $name = null ][, MerchantsProductsService|null $merchantsProductsService = null ]) : mixed
Parameters
- $name : null = null
- $merchantsProductsService : MerchantsProductsService|null = null
updateSyncDate()
Updating sync date for products
public
updateSyncDate() : mixed
writeToCSV()
public
writeToCSV(mixed $googleProducts[, mixed $fileName = 'output.csv' ]) : mixed
Parameters
- $googleProducts : mixed
- $fileName : mixed = 'output.csv'
configure()
Configure command
protected
configure() : mixed
execute()
protected
execute(InputInterface $input, OutputInterface $output) : int|void|null
Parameters
- $input : InputInterface
- $output : OutputInterface
Tags
Return values
int|void|nullgetEcoShippingPrice()
private
getEcoShippingPrice(mixed $weight) : mixed
Parameters
- $weight : mixed
getMonocolisShippingPrice()
private
getMonocolisShippingPrice(mixed $weight[, mixed $qty = 1 ]) : mixed
Parameters
- $weight : mixed
- $qty : mixed = 1
isEnergyEfficientClassProduct()
private
isEnergyEfficientClassProduct(mixed $feedId) : mixed
Parameters
- $feedId : mixed
roundDownToNearestFive()
Rounds down a given percentage to the nearest multiple of 5.
private
roundDownToNearestFive(float|int $percentage) : float|int|string
This function checks if the input percentage is a valid number and non-negative. If the percentage is less than 5, it returns 5 as the minimum value. Otherwise, it rounds down the percentage to the nearest lower multiple of 5.
Parameters
- $percentage : float|int
-
The percentage to be rounded down.
Tags
Return values
float|int|string —Returns the rounded down percentage as an integer, or "Invalid percentage" if the input is invalid.
sendProductsToGoogle()
sending products to google shopping
private
sendProductsToGoogle() : mixed