PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wp-all-export-pro
/
src
/
App
/
Field
<?php namespace Wpae\App\Field; class Description extends Field { const SECTION = 'basicInformation'; private $basicInformationData = null; private $snippetData; public function getValue($snippetData) { $this->snippetData = $snippetData; $this->basicInformationData = $this->feed->getSectionFeedData(self::SECTION); if($this->entry->post_type === 'product') { return $this->getDescription($this->entry); } else if($this->entry->post_type === 'product_variation') { if($this->basicInformationData['useVariationDescriptionForVariableProducts']) { $variation_description = get_post_meta($this->entry->ID, '_variation_description'); if(!empty($variation_description[0])) { if(!empty($variation_description[0])) { if(empty($variation_description[0])) { $parentDescription = $this->getDescription(get_post($this->entry->post_parent)); return $parentDescription; } return $variation_description[0]; } else { $parentDescription = $this->getDescription(get_post($this->entry->post_parent)); return $parentDescription; } } else { $parentDescription = $this->getDescription(get_post($this->entry->post_parent)); return $parentDescription; } } else { return $this->getDescription(get_post($this->entry->post_parent)); } } else { throw new \Exception('Unknown export entity type'); } } public function getFieldName() { return 'description'; } /** * @param $product * @return mixed * @throws \Exception * @internal param $entry * @internal param $basicInformationData */ private function getDescription($product) { if ($this->basicInformationData['itemDescription'] == 'productDescription') { return $product->post_content; } else if ($this->basicInformationData['itemDescription'] == 'productShortDescription') { return $product->post_excerpt; } else if ($this->basicInformationData['itemDescription'] == self::CUSTOM_VALUE_TEXT) { return $this->replaceSnippetsInValue($this->basicInformationData['itemDescriptionCV'], $this->snippetData); } else { throw new \Exception('Unknown field value'); } } }
[+]
..
[-] Gender.php
[edit]
[-] Material.php
[edit]
[-] CustomLabel4.php
[edit]
[-] Price.php
[edit]
[-] CustomLabel3.php
[edit]
[-] Color.php
[edit]
[-] ExcludedDestination.php
[edit]
[-] Shipping.php
[edit]
[-] CustomLabel2.php
[edit]
[-] Multipack.php
[edit]
[-] AgeGroup.php
[edit]
[-] UnitPricingBaseMeasure.php
[edit]
[-] Adult.php
[edit]
[-] AdditionalImageLink.php
[edit]
[-] Link.php
[edit]
[-] Brand.php
[edit]
[-] ExpirationDate.php
[edit]
[-] Tax.php
[edit]
[-] AvailabilityDate.php
[edit]
[-] Condition.php
[edit]
[-] Mpn.php
[edit]
[-] Gtin.php
[edit]
[-] IsBundle.php
[edit]
[-] SizeType.php
[edit]
[-] Size.php
[edit]
[-] ShippingWeight.php
[edit]
[-] SalePriceEffectiveDate.php
[edit]
[-] ShippingWidth.php
[edit]
[-] CustomLabel1.php
[edit]
[-] Availability.php
[edit]
[-] AdwordsRedirect.php
[edit]
[-] SizeSystem.php
[edit]
[-] ShippingLabel.php
[edit]
[-] FieldFactory.php
[edit]
[-] MobileLink.php
[edit]
[-] GoogleProductCategory.php
[edit]
[-] Id.php
[edit]
[-] ShippingHeight.php
[edit]
[-] EnergyEfficiencyClass.php
[edit]
[-] Pattern.php
[edit]
[-] Description.php
[edit]
[-] UnitPricingMeasure.php
[edit]
[-] ItemGroupId.php
[edit]
[-] ShippingLength.php
[edit]
[-] Field.php
[edit]
[-] ImageLink.php
[edit]
[-] ProductType.php
[edit]
[-] ShippingDimensions.php
[edit]
[-] IdentifierExists.php
[edit]
[-] SalePrice.php
[edit]
[-] PromotionId.php
[edit]
[-] CustomLabel0.php
[edit]
[-] Title.php
[edit]