PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wp-all-export-pro
/
src
/
App
/
Field
<?php namespace Wpae\App\Field; class ImageLink extends Field { const SECTION = 'basicInformation'; public function getValue($snippetData) { $basicInformationData = $this->feed->getSectionFeedData(self::SECTION); if ($basicInformationData['itemImageLink'] == self::CUSTOM_VALUE_TEXT) { return $this->replaceSnippetsInValue($basicInformationData['itemImageLinkCV'], $snippetData); } else { if ($this->entry->post_type == 'product_variation') { if ($basicInformationData['useVariationImage']) { $variationImage = $this->getImage($this->entry); if (empty($variationImage)) { $variationImage = $this->getImage($this->entry->post_parent); } return $variationImage; } else { return $this->getImage($this->entry->post_parent); } } if (has_post_thumbnail($this->entry->ID)) { $image = $this->getImage($this->entry); return $image; } } return ''; } public function getFieldName() { return 'image_link'; } /** * @param $entry * @return mixed */ private function getImage($entry) { if (is_object($entry)) { if ($entry->post_type == 'product_variation') { $variation = new \WC_Product_Variation($entry->ID); if (is_object($variation)) { $imageId = $variation->get_image_id(); } else { $imageId = ''; } } else { $product = new \WC_Product($entry->ID); $imageId = $product->get_image_id(); } if ($imageId) { $imageUrl = wp_get_attachment_url($imageId); return $imageUrl; } else { return ''; } } else { return ''; } } }
[+]
..
[-] 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]