Esempio n. 1
0
    public function callbackColumnProductId($value, $row, $column, $isExport)
    {
        $productId = (int) $row->getData('entity_id');
        $storeId = (int) $this->listing->getData('store_id');
        $url = $this->getUrl('adminhtml/catalog_product/edit', array('id' => $productId));
        $htmlWithoutThumbnail = '<a href="' . $url . '" target="_blank">' . $productId . '</a>';
        $showProductsThumbnails = (bool) (int) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/view/', 'show_products_thumbnails');
        if (!$showProductsThumbnails) {
            return $htmlWithoutThumbnail;
        }
        /** @var $magentoProduct Ess_M2ePro_Model_Magento_Product */
        $magentoProduct = Mage::getModel('M2ePro/Magento_Product');
        $magentoProduct->setProductId($productId);
        $magentoProduct->setStoreId($storeId);
        $thumbnail = $magentoProduct->getThumbnailImageLink();
        if (is_null($thumbnail)) {
            return $htmlWithoutThumbnail;
        }
        return <<<HTML
<a href="{$url}" target="_blank">
    {$productId}
    <hr style="border: 1px solid silver; border-bottom: none;">
    <img src="{$thumbnail}" />
</a>
HTML;
    }
Esempio n. 2
0
 private function getCategoryAttributeLabel($attributeCode)
 {
     $attributeLabel = Mage::helper('M2ePro/Magento_Attribute')->getAttributeLabel($attributeCode, $this->listing->getData('store_id'));
     $result = Mage::helper('M2ePro')->__('Magento Attribute') . '&nbsp;->&nbsp;';
     $result .= Mage::helper('M2ePro')->escapeHtml($attributeLabel);
     return '<span style="padding-left: 10px; display: inline-block;">' . $result . '</span>';
 }
 private function addCategoriesPath(&$templateData, Ess_M2ePro_Model_Listing $listing)
 {
     $marketplaceId = $listing->getData('marketplace_id');
     $accountId = $listing->getAccountId();
     if (isset($templateData['category_main_mode'])) {
         if ($templateData['category_main_mode'] == Ess_M2ePro_Model_Ebay_Template_Category::CATEGORY_MODE_EBAY) {
             $templateData['category_main_path'] = Mage::helper('M2ePro/Component_Ebay_Category_Ebay')->getPath($templateData['category_main_id'], $marketplaceId);
         } else {
             $templateData['category_main_path'] = null;
         }
     }
     if (isset($templateData['category_secondary_mode'])) {
         if ($templateData['category_secondary_mode'] == Ess_M2ePro_Model_Ebay_Template_Category::CATEGORY_MODE_EBAY) {
             $templateData['category_secondary_path'] = Mage::helper('M2ePro/Component_Ebay_Category_Ebay')->getPath($templateData['category_secondary_id'], $marketplaceId);
         } else {
             $templateData['category_secondary_path'] = null;
         }
     }
     if (isset($templateData['store_category_main_mode'])) {
         if ($templateData['store_category_main_mode'] == Ess_M2ePro_Model_Ebay_Template_Category::CATEGORY_MODE_EBAY) {
             $templateData['store_category_main_path'] = Mage::helper('M2ePro/Component_Ebay_Category_Store')->getPath($templateData['store_category_main_id'], $accountId);
         } else {
             $templateData['store_category_main_path'] = null;
         }
     }
     if (isset($templateData['store_category_secondary_mode'])) {
         if ($templateData['store_category_secondary_mode'] == Ess_M2ePro_Model_Ebay_Template_Category::CATEGORY_MODE_EBAY) {
             $templateData['store_category_secondary_path'] = Mage::helper('M2ePro/Component_Ebay_Category_Store')->getPath($templateData['store_category_secondary_id'], $accountId);
         } else {
             $templateData['store_category_secondary_path'] = null;
         }
     }
 }